sapdev logo background
sapdev logo sapdev logo
Comments

ABAP CHECK LOOP Statement syntax, information and example SAP source code



Return to Statement index



CHECK - loop

Short Reference

ABAP Syntax CHECK log_exp .

What does it do? If the statement CHECK is executed in a loop and log_exp is incorrect, the statement CHECK immediately terminates the current loop pass and the program continues with the next loop pass. Any logical expression can be specified for log_exp .
Latest notes: Inside a loop, CHECK log_exp functions just like
IF NOT log_exp.
CONTINUE.
ENDIF.
Outside a loop, the statement CHECK exits the current processing block (see CHECK ), however we recommend using CHECK only inside loops.
Example ABAP Coding A loop pass is exited using CHECK if the loop index sy-index is an odd number.
DATA remainder TYPE i.
DO 20 TIMES.
remainder = sy-index MOD 2.
CHECK remainder = 0.
cl_demo_output=>write_text( |{ sy-index }| ).
ENDDO.
cl_demo_output=>display( ).
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




CHECK
CHECK_PROCESSING_BLOCKS




comments powered by Disqus