Application Development and Automation 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: 
Read only

INTRUPT THE LOOP.

Former Member
0 Likes
1,124

Hi Experts,

I have one doubt. I m working loop inside rhe loop.

Loop at itab.

loop at jtab.

IF<CONDITION>

i wanna know when IF condition would not be satisify the control should go to outer loop. What statement would be suitable for exit loop which i can write inside the else.

Regards,

Swapnika

STOP : is giving dump error .

Edited by: Swapnika Panse on Mar 13, 2009 10:56 AM

11 REPLIES 11
Read only

Former Member
0 Likes
1,096

Use the statement EXIT.

CONTINUE is used if you want to continue processing for the next record.

Regards,

George

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,096

Hi,

Refer:


loop at itab.  
  if <condition>.
    exit.  "<--control moves out of loop (next line to endloop)
    continue.  "<--control moves to next loop pass
  endif.
endloop.

Hope this helps you.

Regards,

Tarun

Read only

Former Member
0 Likes
1,096

HI,

Use EXIT statement.

Thankx,

Dharmishta

Read only

Former Member
0 Likes
1,096

Hi There,

data: lv_rc type sy-subrc

I will do this if i were you

loop at itab

clear lv_rc.<<<<<<<<<<<<<<<<<

loop at jtab

if lv_rc = 4.

exit.

endif.

if <cond>

......

....

endif

lv_rc = sy-subrc

endloop.

endloop.

regards

Edited by: BrightSide on Mar 13, 2009 10:07 AM

Edited by: BrightSide on Mar 13, 2009 10:20 AM

Read only

Former Member
0 Likes
1,096

hi,


Loop at itab.
   loop at jtab.
     IF<CONDITION>
      *EXIT.*
    endif.
   endloop.
Endloop.

here Exit will go to outer loop.

Read only

0 Likes
1,096

hi ,

i did Exit. But problem is it again take value from outerloop and should comparision inside the loop if condition. But we r using exit statement it is not going again inside the second loop.

Regards,

Read only

0 Likes
1,096

HI,

Here use parallel cusror preocess. it will work, just try.

Thanks

Sri

Read only

0 Likes
1,096

Have u tried mine? that should work

Edited by: BrightSide on Mar 13, 2009 10:18 AM

Read only

0 Likes
1,096

Hi,

Could you please explain more clearly what you want???

regards,

Neha

Read only

0 Likes
1,096

Hi friend ,

Use like below.

Data c type i value 0.

Loop at itab.

loop at jtab.

if c ne 1.

IF<CONDITION>

c = 1.

continue.

endif.

endif.

endloop.

c = 0.

Endloop.

Hope it helps.

Thanks..

Edited by: Sap Fan on Mar 13, 2009 11:31 AM

Read only

0 Likes
1,096

HI ,

Yes it will work, performance point of also very good.

Thanks

Sri