Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Calling and leaving program units →  Exiting Program Units →  Exiting Loops 

CONTINUE

Short Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


CONTINUE. 

Effect

The CONTINUE statement can only be used in loops. If it is used, the current loop pass is ended immediately and the program flow is continued with the next loop pass.


Example

A loop pass is exited using CONTINUE if the loop index sy-index is an odd number.

DATA remainder TYPE i. 
DO 20 TIMES. 
  remainder = sy-index MOD 2. 
  IF remainder <> 0. 
    CONTINUE. 
  ENDIF. 
  cl_demo_output=>write_text( |{ sy-index }| ). 
ENDDO. 
cl_demo_output=>display( ).