Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Diff btw stop and Continue

Former Member
0 Likes
422

What is the diff between Stop and Continue?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
382

Hi

CONTINUE will skip that Loop pass.

STOP will go to the end of selection.

Reward points if useful

Regards

Anji

2 REPLIES 2
Read only

Former Member
0 Likes
383

Hi

CONTINUE will skip that Loop pass.

STOP will go to the end of selection.

Reward points if useful

Regards

Anji

Read only

Former Member
0 Likes
382

<b>STOP</b>

Effect

The statement STOP is only to be used in executable programs and in the following event blocks:

AT SELECTION-SCREEN (without additions)

START-OF-SELECTION

GET

You leave these event blocks via STOP, and the runtime environment triggers the event END-OF-SELECTION.

Note

The statement STOP is forbidden in methods and, since Release 6.10, leads to an uncatchable exception during the processing of screens called with CALL SCREEN and in programs not called with SUBMIT.

Example

Ending the event blocks GET sbook after max postings have been issued, and branching to END-OF-SELECTION.

<b>CONTINUE</b>

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. 
  WRITE / sy-index. 
ENDDO.