SAP NetWeaver AS ABAP Release 750, ©Copyright 2016 SAP AG. All rights reserved.
ABAP - Keyword Documentation → ABAP - Reference → Calling and leaving program units → Exiting Program Units → Exiting Processing Blocks →
RETURN
Syntax
RETURN.
Effect
This statement ends the current processing block immediately. It can appear at any point in a processing block and ends this block regardless of the statement block or control structure in which the block appears.
After the processing block is exited, the runtime environment responds in the same way as when the processing block is exited in a regular way (with the exception of LOAD-OF-PROGRAM and the reporting event blocks START-OF-SELECTION and GET). In particular, the output parameters of procedures are passed to the bound actual parameters.
Programming Guideline
Only use RETURN to exit procedures
Note
The statement RETURN is provided for exiting processing blocks early but correctly. However, since RETURN behaves differently in GET events than when the event block is exited as usual, the statement REJECT should be used here, which was designed especially for this purpose.
Example
Exits the method show_list using RETURN if one of the formal parameters required (structure or data_tab) is initial.