Purpose
With leave(), you can stop a process execution in a script.
The leave() command is actually a custom function, but behaves like a standard WS command. It is used to stop a process flow in a script. When a script execution stops, the process stops at the screen that is active at that instant.
Syntax
leave();
Options
The leave() command does not take any options.
Example
-
Open the VA01 script file and add the following code.
onscreen 'SAPMV45a.0101' enter(); leave(); onscreen 'SAPMV45A.4001' println("-=-----Inside SAPMV45A.4001----"); enter();
-
Press Enter to initiate the script.
The leave command stops the script before the VA01 screen appears. -
Verify that you do not see the VA01 Overview screen and also verify that the println statement does not display in the console.