LEAVE PROGRAM
Short Reference
Syntax
LEAVE PROGRAM.
Effect
This statement immediately ends the current main program and deletes its internal session - including all loaded programs, instances, and their data .
The LEAVE PROGRAM statement can appear anywhere within any processing blocks. It ends the program regardless of the program/object or the
program group of the internal session in which it is executed.
The runtime environment responds to the LEAVE PROGRAM statement depending on how the main program was called in the internal session:
-
If the main program was called usingCALL TRANSACTION,
SUBMIT AND RETURN, or
CALL DIALOG, the runtime environment returns to the calling program
after the call position. If the main program was called with CALL DIALOG, the output parameters of the
dialog module are passed to the calling program., ,
-
If the main program was called using LEAVE TO TRANSACTION or using a transaction code from within a
dynpro, the runtime environment returns to the position at which the first program in the current
call sequence was called.
-
If the main program was called using SUBMIT without the addition
AND RETURN, the runtime environment returns to the position at which the calling program was started.
Note
The statement LEAVE without additions is obsolete.