07-23-2008 9:28 AM
How to continue the execution of the program after a condition is being failed?
for eg. There are 8 employees, and they got hike.. after executing 4 employees the 5th one is getting stopped due to incorrect information. Now i want to continue the program execution from 6th employee onwards.. plz help to overcome this problem. Thanks in advance.
07-23-2008 9:31 AM
HI
Loop at ITAB.
-
if <condition-failed>.
continue.
endif.
-
endloop.
Aditya
07-23-2008 9:30 AM
IF you are processing the employee data inside a LOOP use CONTINUE statment.
07-23-2008 9:31 AM
loop at i_employee .
*say some condition failed ..
if i_employee-hike is initial. <-- say this is the condition ..
continue. <-- skip this employee ...
endif.
endif.
07-23-2008 9:31 AM
HI
Loop at ITAB.
-
if <condition-failed>.
continue.
endif.
-
endloop.
Aditya
07-23-2008 9:32 AM
i hope you are processing the employees in a loop. if this is the case u only need to use the CONTINUE statement to continue processing the next employee in case information is not valid for the employee in current loop pass..
07-23-2008 9:33 AM
Hi,
in the if condition write the statement continue on which it is going to fail.
07-23-2008 9:46 AM
Hi Rajasekaran,
Try this way :
Loop at ITAB into FS_ITAB.
if <condition fails>
continue.
else.
write 😕 FS_ITAB-empno,
FS_ITAB-empname,
FS_ITAB-dept...
endif.
endloop.
Regards,
Swapna.