Friday, 17 November 2017

ABAP – Continue Statement


            CONTINUE statement is used in a statement block of the loop to terminate a single loop pass immediately and unconditionally. As soon as the CONTINUE statement is executed, the execution of the remaining statements in the current processing block is stopped and the next loop pass is processed.

The syntax for continue statement is:

CONTINUE.

Block Diagram


Example :-


Report YH_SEP_15. 
DO 5 TIMES.
IF SY-INDEX = 3. 
CONTINUE. 
ENDIF.
Write / SY-INDEX. 
ENDDO.


The above code produces the following output:

1
2
4
5

The CONTINUE statement ignores all the statements in the current statement block and proceeds with the next loop pass.


No comments:

Post a Comment