2007 Aug 08 7:07 PM
loop at itab.
IF <cond>.
Continue.
Endif.
Endloop.
If continue triggers what will happen, it comes out of loop and endloop for further loop pass or just comes out of IF and Endif.
hi,
continue statement is used to move to the starting of the loop i.e from the point it comes across continue statement it will go back to the loop statement.
and exit will get you out of the loop.
in your example
after the IF condition if it comes across <b>continue</b> it will move to the statement
<b>loop at itab</b>.
2007 Aug 08 7:13 PM
Continue will continue with the next iteration of the loop skipping any logic which may be after the if statement.
2007 Aug 08 7:16 PM
hi,
continue statement is used to move to the starting of the loop i.e from the point it comes across continue statement it will go back to the loop statement.
and exit will get you out of the loop.
in your example
after the IF condition if it comes across <b>continue</b> it will move to the statement
<b>loop at itab</b>.
2007 Aug 08 7:20 PM
Hi,
<b>EXIT</b>
- Within a loop structure:
Terminates looop processing (DO, WHILE, LOOP, SELECT).
- Within subroutines and other modularization units (but not
in a loop structure):
Leaves the subroutine or modularization unit (FORM, MODULE,
FUNCTION, TOP-OF-PAGE, END-OF-PAGE).
- Outside loop structures and modularization units (report
processing):
Terminates report processing and triggers list display.
DATA: SAP_COUNT TYPE I,
WA_T100 TYPE T100.
SELECT * FROM T100 INTO WA_T100 WHERE SPRSL = SY-LANGU AND
ARBGB = 'DS'.
WRITE / WA_T100-TEXT.
IF WA_T100-TEXT CS 'SAP'.
ADD 1 TO SAP_COUNT.
IF SAP_COUNT = 3.
EXIT.
ENDIF.
ENDIF.
ENDSELECT.
If you have a set of nested loops, EXIT only terminates the
current loop, and processing continues after the corresponding
END... statement in the next-highest loop.
<b>CONTINUE</b>
Within loop structures like
- DO ... ENDDO
- WHILE ... ENDWHILE
- LOOP ... ENDLOOP
- SELECT ... ENDSELECT
CONTINUE terminates the current loop pass, returns the
processing to the beginning of the loop and starts the next
loop pass, if there is one.
DO loop: Omit an area (10 ... 20)
DO 100 TIMES.
IF SY-INDEX >= 10 AND SY-INDEX <= 20.
CONTINUE.
ENDIF.
...
ENDDO.
Regards.
Marcelo Ramos
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |