Get Example source ABAP code based on a different SAP table
• LEAVE ABAP Statement
LEAVE> Short Reference >
ABAP_SYNTAX_OBS LEAVE.>
What does it do? The statement LEAVE> without additions is context-specific:
In list processing that is, when the list processor> is active, LEAVE> works like LEAVE LIST-PROCESSING>>. The list processor is either called using LEAVE TO LIST-PROCESSING>> or called implicitly when executable programs are processed>.
In all other situations, LEAVE> is executed only when the system field sy-calld> is not initial; if this field is initial, otherwise it is ignored.
LEAVE> exits a program called using CALL TRANSACTION>> or SUBMIT ... AND RETURN >>, and returns to after the calling position.
LEAVE> does not exit a program if it was started using LEAVE TO TRANSACTION>> or a transaction code from a dynpro>, or if the program is processed in batch input>.
If a program was called using SUBMIT> without the addition AND RETURN>, LEAVE> behaves in the same way as in the calling program.
Latest notes: The behavior of the statement LEAVE> without additions cannot be predicted statically, particularly if it is specified in callable units. Therefore, LEAVE> should only be used with additions that uniquely control the behavior: