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: 

difference between exit,stop,check

Former Member
0 Kudos

can anybody tell the difference between exit,stop,check in all events ?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

In all events

check immediately leaves the current event and processing continues with the next event (or action, such as displaying the selection screen or output list).

stop immediately leaves the current event and goes directly to the end-of-selection event. Executing stop within end-of-selection leaves the event. It doesn't cause an infinite loop.

In events that occur before start-of-selection

exit and check have the same behavior. They both leave the event immediately and processing continues with the next event .

In start-of-selection and events that occur after it

exit terminates the report and shows the output list. A single exception exists; within top-of-page, exit behaves like check.

check leaves the event and processing continues with the next event .

11 REPLIES 11

Former Member
0 Kudos

hi senthil,

Exit statement means coming out of program i.e, triggering END-OF-SELECTION and stop statement means coming out of block/loops.....

Hope this helps

Regards,

Santosh

vinod_gunaware2
Active Contributor
0 Kudos

exit statments is exit the current loop. and moving to next loop but stop statement move to end of selection. it's not check all other loops.

regards

vinod

hymavathi_oruganti
Active Contributor
0 Kudos

exit: if inside loop and endloop , comes out of it.

if outside loop then terminates the program

stop: triggers end_of_selection

check: if the statement with check is true goes to next else not (like if and endif)

Former Member
0 Kudos

Hi,

CHECK it will check your condition if it satisfies it go further. If not it will Continue to start of loop.

loop at bsid_it.

clear excel_it.

clear: duedt,

sbgrp_it,

output_it,

t024b_it,

bkunnr,

bname1,

btelf1,

xblnr,

adrnr,

addrnumber,

tel_ext.

duedt = bsid_it-zfbdt + bsid_it-zbd1t.

check duedt in sduedt.<<<<<<<<<-------

................

...................

.....................

Endloop.

Here if this condition satisfies only it will go down.If Not it will be back to loop for next record.

Exit will terminates the loop completely.

Thanks.

If this helps you reward with points.

Message was edited by: KDeepak

Former Member
0 Kudos

exit:

it exits from the inner loop in case of loop, select,try .

and if not inside loop. stops the program executation.

check:

contains a logical condition.

next line is only processed iff the condtion results in true.

stop.

it stops event dispatcher.

regards.

Former Member
0 Kudos

From the SAP F1 Help:

Basic form EXIT.

Effect - Within a loop structure:

Terminates looop processing (DO, WHILE, LOOP, SELECT).

- Within subroutines and other modularization units (but not

in a loop structure):

Leaves the subroutine or modularization unit (FORM, MODULE,

FUNCTION, TOP-OF-PAGE, END-OF-PAGE).

- Outside loop structures and modularization units (report

processing):

Terminates report processing and triggers list display.

STOP.

This statement is not allowed in an ABAP Objects context. Se

STOP not allowed.

This statement terminates a processing block in an excutable

program.

The statement is only intended for use in the INITIALIZATION,

AT SELECTION-SCREEN, START-OF-SELECTION, and GET events. It

terminates the current processing block in an executable

program and triggers the END-OF-SELECTION event. In all other

processing blocks, or when you do not want to trigger the

END-OF-SELECTION event, you must use EXIT.

Basic form CHECK logexp.

Effect CHECK evaluates the subsequent logical expression. If it is

true, the processing continues with the next statement.

In loop structures like

DO ... ENDDO

WHILE ... ENDWHILE

LOOP ... ENDLOOP

SELECT ... ENDSELECT

CHECK with a negative outcome terminates the current loop pass

and goes back to the beginning of the loop to start the next

pass, if there is one.

In structures like

FORM ... ENDFORM

FUNCTION ... ENDFUNCTION

MODULE ... ENDMODULE

AT events

GET events

CHECK with a negative outcome terminates the routine or

modularization unit.

If CHECK is neither in a loop nor a routine nor a

modularization unit, a negative logical expression terminates

the current event.

Sudha

Former Member
0 Kudos

hi Senthil,

In ALL Events..

1.<b>check</b> immediately leaves the current event and processing <b>continues with the next event</b> (or action, such as displaying the selection screen or output list).

2.<b>stop</b> immediately leaves the current event and goes directly to the end-of-selection event. Executing stop within end-of-selection leaves the event.

It doesn't cause an infinite loop...

In start-of-selection and events that occur after it

1.<b>exit</b> terminates the report and shows the output list. A single exception exists; within top-of-page, exit behaves like check...

2.<b>check</b> leaves the event and processing continues with the next event (or action, such as display of the output list)...

<b>check, exit, and stop do not set the value of sy-subrc</b>

regards

satesh

Former Member
0 Kudos

In all events

check immediately leaves the current event and processing continues with the next event (or action, such as displaying the selection screen or output list).

stop immediately leaves the current event and goes directly to the end-of-selection event. Executing stop within end-of-selection leaves the event. It doesn't cause an infinite loop.

In events that occur before start-of-selection

exit and check have the same behavior. They both leave the event immediately and processing continues with the next event .

In start-of-selection and events that occur after it

exit terminates the report and shows the output list. A single exception exists; within top-of-page, exit behaves like check.

check leaves the event and processing continues with the next event .

Former Member
0 Kudos

Hi senthil,

1. CHECK

It simply checks a condition.

If its true, then it continues further.

2. EXIT

Leaves/Exits the current processing block.

This block can be :

a) loop / endloop

b) if / endif

3. STOP

Simply leaves the event block.

regards,

amit m.

0 Kudos

Hi Senthil,

*)CONTINUE.

Terminates a loop pass immediately without any

condition, continues with the next loop pass.

*)EXIT.

Acts in following sequence:

-Terminates a loop entirely without any condition and continues the processing after the closing statement (ENDDO, ENDWHILE, ENDSELECT).

-Within nested loops, leaves the current loop;

*) CHECK <condition>.

Acts in following sequence:

-For a loop, if the condition is false, skips all the remaining statements in the current statement block and continues with the next loop pass.

-For processing block, if the condition is false, leaves the processing block and branches to the processing block of the next occurring event;

-For a subroutine, if the condition is false, terminates the subroutine.

Cheers

Sunny

Rewrd points , if helpful

Message was edited by: Sunny

Former Member
0 Kudos

Hi,

Exit : Exits from the inner most loop.

Stop : If this is encountered Control goes to the

End-of-selection.

check : If check fails control goes to the next loop

pass.(If inside a Loop.. endloop.

Else it goes to end-of-selection.)

Regards,

GSR.