SAP® Documentation

Single view

ABAPEXIT_LOOP - EXIT LOOP

BAL Application Log Documentation   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

EXIT - loop

Short Reference



Syntax

EXIT.

Effect

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.

Note

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

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( ).






rdisp/max_wprun_time - Maximum work process run time   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.

Length: 1487 Date: 20200125 Time: 090855     sap01-206 ( 30 ms )

Our Service

Looking for Support? Questions?

The

Consolut

Callback-Service

Leave us your contact details and we will call you back. Panels marked with * are mandatory.