2009 Mar 16 11:04 AM
hi
how to exit from loop after 3 time
loop at itab.
<exit after 3 time>
endloop.
thanks
hi
how to exit from loop after 3 time
loop at itab.
<exit after 3 time>
endloop.
thanks
2009 Mar 16 11:05 AM
loop at itab.
if sy-tabix >= 3.
exit.
endif.
endloop.
Edited by: Kalyan Chakravarthi on Mar 16, 2009 12:08 PM
2009 Mar 16 11:06 AM
Hi,
sy-index is a system filed
if sy-index = 3 then
exit from the loop
Thanks
Ramakrishna Pathi
2009 Mar 16 11:06 AM
Hi,
Use:
loop at itab.
if sy-tabix = 3.
exit. "to exit for loop
"continue. "to go to next loop pass
endif.
endloop.
Regards,
Tarun
2009 Mar 16 11:06 AM
try this...
data: count type i value 0.
loop at itab.
count = count + 1.
if count = 3.
exit. "to exit for loop
"continue. "to go to next loop pass
endif.
endloop.
Edited by: Arunima Rudra on Mar 16, 2009 4:39 PM
2009 Mar 16 11:07 AM
Hi Gupta,
loop at itab.
if sy-tabix EQ 3.
EXIT.
endloop.
I think this will workout check it once.
Thanks & Regards,
Kaza
2009 Mar 16 11:08 AM
Hi ,
caheck this code
Loop at t_itab.
if sy-tabix gt 3.
exit.
endif.
endloop.thanks and regrds
Durga.K
2009 Mar 16 11:16 AM
Hi,
You can check the value of SY_TABIX inside loop,
For Example:
Loop at itab.
if sy-tabix = 3.
Exit.
endif.
Endloop.
Hope it helps
Regrds
Mansi
2009 Mar 16 11:17 AM
Hi,
This is very simple...
data:counter type i value 0.
loop at itab.
counter = counter + 1.
if counter eq 3.
exit."this will take out of the loop at itab
endif.
endloop.OR
rather than taking and loacal variable simply use sy-tabix value as expalined above can be a solution.
Pooja
Edited by: Pooja Gupta on Mar 16, 2009 12:18 PM
2009 Mar 16 11:18 AM