08-14-2007 1:31 PM
08-14-2007 1:32 PM
Hi..
When we use EXIT in a Loop: It will Terminate the LOOP processing and continues the execution immediately after the Loop.
When we use STOP in a Loop: It will Terminate the LOOP processing and Triggers the Event END-OF-SELECTION.
<b>Reward if Helpful</b>
08-14-2007 1:34 PM
Hi Mayuri,
Exit Statement will terminate the loop and continue with the rest of the program.
Stop Statement will branch out to the end of Selection event if End of Selection Event is not present it behaves same as EXIT.
Award Points if helpful..
Thanks,
Imran
08-14-2007 1:37 PM
Hi,
Hi,
STOP :This statement terminates a processing block in an excutable
program.
The statement is only intended for use in the INITIALIZATION,
AT SELECTION-SCREEN, START-OF-SELECTION, and GET events. It
terminates the current processing block in an executable
program and triggers the END-OF-SELECTION event. In all other
processing blocks, or when you do not want to trigger the
END-OF-SELECTION event, you must use EXIT.
EXIT.
- 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.
Hope this helps you
reward if it helps..
Regards,
Omkar.