Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to continue the execution of the program after a condition is failed?

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI

Loop at ITAB.

-


if <condition-failed>.

continue.

endif.

-


endloop.

Aditya

6 REPLIES 6

Former Member
0 Kudos

IF you are processing the employee data inside a LOOP use CONTINUE statment.

Former Member
0 Kudos

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.

Former Member
0 Kudos

HI

Loop at ITAB.

-


if <condition-failed>.

continue.

endif.

-


endloop.

Aditya

Former Member
0 Kudos

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..

Former Member
0 Kudos

Hi,

in the if condition write the statement continue on which it is going to fail.

Former Member
0 Kudos

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.