‎2013 Feb 14 6:21 AM
Hello experts,
After a loop statement, there is a statement after LOOP. If the LOOP was executed successfully, the following statement would be executed. For example, if the loop are executed 5 times, I wanna the following statements execute 5 times correspondingly other than 6.
Thanx.
Best regards,
ts
‎2013 Feb 14 6:28 AM
‎2013 Feb 14 6:29 AM
Hello,
You can take a counter.
Data: lv_count type i.
lv_count = 0.
loop at gt_tab into gs_tab.
*---your code*..
lv_count = lv_count + 1.
endloop.
Now
do lv_count times.
enddo.
Thanks,
Abhijit
‎2013 Feb 14 6:49 AM
‎2013 Feb 14 6:54 AM
Hi ,
You can use a counter for this ....
like ... :-
Loop at i_tab into wa_tab.
your code .....
If sy-subrc = 0.
Add counter to one.
Endloop.
Then do counter times another loop which you want to execute.
Hope this will help ....
Regards,
AKS
‎2013 Feb 14 9:04 AM
Hi,
U can do it in 2 ways
1) Using nested LOOP , i.e
LOOP.
code block___________
____________________
LOOP.
*/your code here
ENDLOOP.
ENDLOOP.
2)v_counter = 0.
LOOP AT ITAB into WA.
*/your code here
v_counter = v_counter + 1.
ENDLOOP
DO v_counter times.
*/Your code here
ENDDO.