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

EXIT , CHECK , CONTINUE

Former Member
0 Likes
5,399

Friendz,

could u plz explain me the exact diffrence between

<b>EXIT , CHECK , CONTINUE </b> statements in reports and where exactly we need to use these.

regards,

siri.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,674

Exit will leave a loop, form.

Check is used to check a field for a value

CHECK SY-SUBRC EQ 0.

....

....

....

If the value of SUBRC eq 4 then the code is not executed.

Continue is used within a loop.

Loop at .... into .....

if not field is initial.

continue. "This will then make the

"program goto the next

"occurance in the internal table

endif.

endloop.

SAP help is also a good trick.

8 REPLIES 8
Read only

Former Member
0 Likes
2,675

Exit will leave a loop, form.

Check is used to check a field for a value

CHECK SY-SUBRC EQ 0.

....

....

....

If the value of SUBRC eq 4 then the code is not executed.

Continue is used within a loop.

Loop at .... into .....

if not field is initial.

continue. "This will then make the

"program goto the next

"occurance in the internal table

endif.

endloop.

SAP help is also a good trick.

Read only

0 Likes
2,674

<b>EXIT</b> will take you out of the loops performs etc

<b>continue</b> takes you to the begening of the loops and check for the next loop value

<b>Check</b> works as a if statement where acording to the condition next statement is executed or skiped.

Read only

suresh_datti
Active Contributor
0 Likes
2,674

EXIT is used to come out of the current loop processing in DO,WHILE,LOOP & SELECT Blocks..

A WHILE.logexp block repeats the processing enclosed between the WHILE and ENDWHILE statements as long as the logical expression logexp is true.

CONTINUE terminates the current loop pass (suhc as DO,WHILE,LOOP & SELECT Blocks.. ), returns the processing to the beginning of the loop and starts the next loop pass, if there is one.

~Suresh

Read only

Former Member
0 Likes
2,674

Hi,

with in a loop

continue - go to the next without processing the current record.

exit - comes out of the loop.

check - works same as continue

with in a perform

exit - comes out of the form

check - comes out of the form

Madhavi

Read only

Former Member
0 Likes
2,674

HI Sireesha,

· - This is used when you want to continue the loop process on certain condition without coming out of the loop. (may be Do endo or loop endloop)

Reward points if this helps.

Manish

Message was edited by: Manish Kumar

Read only

Former Member
0 Likes
2,674

Hi ,

just understand this program .

data : a type i value 2,

b type i value 3,

c type i value 4,

d type i .

check a < b.

write:/ a.

if a > b.

write:/ a.

exit.

else .

write:/ b.

endif.

do 2 times.

d = d + 1.

continue.

d = d + 3.

enddo.

write:/ d.

regards,

VIjay

Read only

Former Member
0 Likes
2,674

Hi Sireesha,

all these statement works depends on the place you are using.

Exit: when ever you want to come out of the loop or perform of report you use this statement in that loop or perform or report(start-of-selection or end-of-selection).

Check: if you don't want to proceed further if and only if some condition satisfies, then you use this statement.

Continue: this statement you use in loop. control will go to the next loop from the point where you write this statement.

-Anu.

Read only

Former Member
0 Likes
2,674

Exit : transfers the control out of the loop.

Continue : skip the current loop pass and transfers the control to the loop for the next loop pass.

Check : if the condition is satisfied then it executes the next statement otherwise it behaves just like continue statement (ie, skip the current loop pass and transfers the control to the loop for the next loop pass.)