ABAP Keyword Documentation → ABAP - Reference → Calling and leaving program units → Exiting Program Units → Exiting Processing Blocks
CHECK - processing_block
Other versions: 7.31 | 7.40 | 7.54
Syntax
CHECK log_exp.
Effect
If the CHECK statement is located outside a
loop and log_exp is false, the statement terminates the current processing block. You can specify any
logical expression for log_exp.
After the processing block is exited, the runtime environment proceeds in the same way as when the
processing block is exited in the normal way
(with the exception of the event block LOAD-OF-PROGRAM and the
reporting event block
GET). In particular, the output parameters of procedures are passed on to the bound actual parameters.
-
You cannot exit the
LOAD-OF-PROGRAMevent block usingCHECK. -
After the reporting event block
GETis exited usingCHECK, subordinate nodes in the hierarchical structure of the linked logical database are no longer processed. The logical database reads the next line of the current node or next higher node, if it has reached the end of the hierarchy level.
Programming Guideline
Only use RETURN to exit procedures
Notes
-
In a procedure (method, function module, subroutine),
CHECK log_expfunctions outside a loop in the same way as:
IF NOT log_exp.
RETURN.
ENDIF.
-
A further variant of the statement
CHECKfor exiting processing blocks isCHECK SELECT-OPTIONSthat can only be used inGETevent blocks for logical databases.