‎2008 Mar 19 6:52 AM
Hi All,
I want to know which statment is used to break the loop after perticular situation is fullfilled.
‎2008 Mar 19 6:54 AM
‎2008 Mar 19 6:54 AM
‎2008 Mar 19 6:55 AM
Hi,
Use CONTINUE to skip that record.
Use EXIT to exit the loop.
Regards,
CS
‎2008 Mar 19 6:57 AM
‎2008 Mar 19 7:04 AM
Hi,
Use Exit statement.
loop at itab.
if itab-field1 = 'ABC'.
exit.
endif.
endloop.
Using exit statement once itab-field1 contains ABC then it will come out of the loop without processing the other records in the internal table.
Use continue.
loop at itab.
if itab-field1 = 'ABC'.
delete itab.
continue.
endif.
endloop.
Using continue statement it will process the other records also.
Thanks,
Sriram Ponna.
Edited by: Sriram Ponna on Mar 19, 2008 12:45 PM
‎2008 Mar 19 7:07 AM
Hi ,
Go through the below link u can clearly understand
http://help.sap.com/saphelp_46c/helpdata/en/fc/eb3564358411d1829f0000e829fbfe/frameset.htm
Thanks,
Ramya.R
Reward point if useful
‎2008 Mar 19 7:50 AM
HI,
use exit command
EXIT
If you use the EXIT statement within an event block but not in a loop, the system stops processing the block immediately.
Before and during selection screen processing, the next event in the prescribed sequence is always called. From the START-OF-SELECTION event onwards, the system starts the list
processor directly when the EXIT statement occurs, and displays the list.
If the EXIT statement occurs in a loop using DO, WHILE, or LOOP, it is the loop that terminates, not the processing block.
regards
mano
‎2008 Mar 19 8:02 AM
you should find the EXIT, CHECK and CONTINUE commands useful