sapdev logo background
sapdev logo sapdev logo
Comments

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



Return to Statement index



EXIT - loop

Short Reference

ABAP Syntax EXIT.

What does it do? If the EXIT statement is specified within a loop , it exits the loop by ending the current loop pass. The program flow resumes after the closing statement in the loop.
Latest notes: Outside of a loop, the statement EXIT exits the current processing block (see EXIT - Processing Block ).
EXIT , however, should only be used within loops.
Example ABAP Coding Exits a loop using EXIT if the loop index
sy-index is greater than a number limit .
DATA limit TYPE i VALUE 10.
DO.
IF sy-index > limit.
EXIT.
ENDIF.
cl_demo_output=>write( |{ sy-index } | ).
ENDDO.
cl_demo_output=>display( ).
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




EXIT-
EXIT_PROCESSING_BLOCKS




comments powered by Disqus