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: 

Exiting a Loop.

Former Member
0 Kudos

Experts,

I am in a loop, say the third record out of ten, I have a scenario where I neeed to exit that third instance of the loop so no subsequent processing occurs within that instance of the loop. I say exit. However, I want to loop to the fourth record and let it process thru the loop.

When I say exit it exits the loop all together. Is there a syntax I can use to only quit out of that third record out of ten and then loop at the fourth record? Otherwise it looks like the old reliable set a flag so it does not continue processing within the rest of that occurence of the loop. I have too many nested IFS already within this loop and am trying to avoid another one.

Thank-You.

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Say CONTINUE.

loop at itab.

if condition = false.
continue.
endif.


endloop.

Regards,

Rich Heilman

7 REPLIES 7

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Say CONTINUE.

loop at itab.

if condition = false.
continue.
endif.


endloop.

Regards,

Rich Heilman

0 Kudos

Thanks again!

sridhar_k1
Active Contributor
0 Kudos

Use continue statement in IF condition or CHECK <condition> statement in the loop.

Regards

Sridhar

Former Member
0 Kudos

hi Tom,

Use <b>Case Endcase</b> statements else use <b>Continue</b> statement

Manohar2u
Active Contributor
0 Kudos

Try with <b>continue</b>, it will continue processing from the next recrod.

Regds

Manohar

Former Member
0 Kudos

Hi,

can use 'Continue' for that.

regs

Rakesh

0 Kudos

or replace the IF condition with a CHECK statement.

CHECK condition = true.

*-- these lines will be processed only if the condition is true

Message was edited by: Srinivas Adavi