2008 Aug 09 11:10 AM
hi
i have developed a report in that there is a loop and inside loop there are many read statements and messages.
my querry is, whenever any message pop up i.e. when that condition fails, the loop should go to next iteration i.e. if the condition has failed in 2nd sy-tabix then immediately the loop should start and it should start from 3rd iteration.
tabix = 0.
loop at itab.
read statement
read statement
message
what should i write here stop or exit or var = x
read statement
message
what should i write here stop or exit or var = x
read statement
endloop.
from message it should go to next iteration of the loop.
thanx in adv
manoj
hi
i have developed a report in that there is a loop and inside loop there are many read statements and messages.
my querry is, whenever any message pop up i.e. when that condition fails, the loop should go to next iteration i.e. if the condition has failed in 2nd sy-tabix then immediately the loop should start and it should start from 3rd iteration.
tabix = 0.
loop at itab.
read statement
read statement
message
what should i write here stop or exit or var = x
read statement
message
what should i write here stop or exit or var = x
read statement
endloop.
from message it should go to next iteration of the loop.
thanx in adv
manoj
2008 Aug 09 11:15 AM
Dear,
Use CONTINUE.
loop at itab.
read statement
read statement
message
CONTINUE.
read statement
message
CONTINUE.
read statement
endloop.
Regards,
2008 Aug 09 11:15 AM
tabix = 0.
loop at itab.
read statement
read statement
message
continue.
"use continue
"what should i write here stop or exit or var = x
read statement
message
"continue.
what should i write here stop or exit or var = x
read statement
endloop.
2008 Aug 09 11:29 AM
hi
actually these messages are inside perform statements, so inside perform there is no loop and therefore 'continue' will not work there.
manoj
2008 Aug 09 11:42 AM
If it is inside perform then you can use EXIT and a flag.
loop at itab.
perform check_something.
if v_flag = 'X'.
continue.
endif.
endloop.
form check_something.
clear v_flag.
read ....
read....
message.
v_flag = 'X'.
exit.
endform.Regards
Vijay Babu Dudla
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |