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

Continue statement

Former Member
0 Likes
1,773

Please explain me what this continue statement do here.

IF lt_capreq[] IS INITIAL.

CONTINUE .

ENDIF.

LOOP AT lt_capreq ASSIGNING <lt_capreq> .

CHECK <lt_capreq>-act_status NE 6.

CHECK <lt_capreq>-acttype EQ 'P'.

MOVE <lt_capreq>-orderid TO wa_opr_key-orderid.

MOVE <lt_capreq>-oprcounter TO wa_opr_key-oprcounter.

APPEND wa_opr_key TO lt_opr_key_tab. "Has OrdID

ENDLOOP.

8 REPLIES 8
Read only

Former Member
0 Likes
1,165

Hi,

It continues to loop to next record.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,165

hi John,

CONTINUE terminates the current loop pass, returns the processing to the beginning of the loop and starts the next loop pass, if there is one.

Regards,

Santosh

Read only

venkata_ramisetti
Active Contributor
0 Likes
1,165

Hi,

If you use CONITINUE in the LOOP...ENDLOOP, it will skip the following code that exists till ENDLOOP. and control goes again to the starting of LOOP to process the subsequent record.

IF just want comeout from LOOP..ENDLOOP use EXIT

Thanks

Ramakrishna

Read only

Former Member
0 Likes
1,165

Hi Johnn,

If lt_capreq[] IS INITIAL.

CONTINUE . This will come out of this current loop processing and go to next loop process.

ENDIF.

Reward points if this helps.

Manish

Read only

Former Member
0 Likes
1,165

Normally we dont use continue statment whithout a loop.

like

DO 100 TIMES.

IF SY-INDEX >= 10 AND SY-INDEX <= 20.

CONTINUE.

ENDIF.

write:/ SY-INDEX.

ENDDO.

here write statement is not executed for SY-INDEX >= 10 AND SY-INDEX <= 20

for all other values it is executed.

continue statement without loop dont make any sense.

Read only

Former Member
0 Likes
1,165

lets the internal table lt_caprep is initial with no contents ,

it doesn't process the below code in the loop and goes for the next iteration .

this will make u clear.

ex..

data : a type i value 2,

b type i value 3,

c type i value 4,

d type i .

do 2 times.

d = d + 1.

continue.

d = d + 3.

enddo.

regards,

Vijay

Read only

Former Member
0 Likes
1,165

Are you using LDB in the below ABAP ?

If not the below statement does not have any impact.

Read only

Former Member
0 Likes
1,165

Johnn,

you are using the continue in if statement?

continue can use in loop statement only.

in loop it skips the lines after continue statement and go to next record of loop.

-Anu