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

which is not an exit command?

Former Member
0 Likes
1,363

exit,stop,cancel and back

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,243

<b>Cancel</b> is not an exit command.

Leaving Event Blocks Using STOP

If you use the STOP statement within an event block, the system stops processing the block

immediately. The ABAP runtime environment triggers the next event

Leaving Event Blocks Using EXIT

If you use the STOP statement within an event block but not in a loop, the system stops

processing the block immediately. The ABAP runtime environment triggers the next event. Before and during selection screen processing, the next event in the prescribed sequence is always called. From the START-OF-SELECTION event onwards, the system starts the list processor directly when the EXIT statement occurs, and displays the list.

If the EXIT statement occurs in a loop using DO, WHILE, or LOOP, it is the loop that terminates, not the processing block.

Leaving Event Blocks Using CHECK

If you use the CHECK <expr> statement within an event block but not within a loop, and the

condition <expr> is not fulfilled, the system exits the processing block immediately.

<expr> can be any logical expression or the name of a selection table. If you specify a selection

table and the contents of the corresponding table work are do not fulfill the condition in the

selection table, it is the same as a false logical expression.

<b>You can exit out of an event at any time using the following statements:</b>

exit

check

stop

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 (or action, such as display of the selection screen).

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 (or action, such as display of the output list).

check, exit, and stop do not set the value of sy-subrc. If you want to set it, you can assign a numeric value to it before leaving.

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers

exit,stop,cancel and back

10 REPLIES 10
Read only

Former Member
0 Likes
1,243

stop

Read only

naimesh_patel
Active Contributor
0 Likes
1,243

Hello,

BACK and STOP are not exit command.

CANCLE is not command.

Regards,

Naimesh

Read only

0 Likes
1,243

what is the diff btw stop and exit

Read only

0 Likes
1,243

i think exit is the exir command as name suggest

The behaviour of exit is diff in diff situations

if you use it in coditional loops like do..enddo, while..endwhile and loop and loop ....it will comeout of the conditional loop.

and it behaves diff in events...

if you use exit in your prog it won't leave the prog but it depends where you used exit.

for example if you use exit after start-of-selection then program goes to the list(report output) without processing further.

if you use in initialization then it will directly to the selection screen without processing further.

Read only

0 Likes
1,243

Hi,

you can define exit-commands with function type 'E' (for module exit AT EXIT-COMMAND)

in menu painter

A.

Read only

0 Likes
1,243

if u are talking abt module pool progamming

back, exit and cancel are exit commands.

if its report programming

back and cancel are not commands

Read only

0 Likes
1,243

To terminate an entire loop immediately and unconditionally, use the EXIT statement in the statement block of the loop.

EXIT.

After this statement, the loop is terminated, and processing resumes after the closing statement of the loop structure (ENDDO, ENDWHILE, ENDLOOP, ENDSELECT). In nested loops, only the current loop is terminated.

DO 4 TIMES.

IF sy-index = 3.

EXIT.

ENDIF.

WRITE sy-index.

ENDDO.

The list output is:

1 2

In the third loop pass, the loop is terminated before the WRITE statement is processed.

STOP: 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.

Read only

anversha_s
Active Contributor
0 Likes
1,243

hi,

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

<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 events that occur before start-of-selection

<b>exit and check</b> 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

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

<b>check</b> leaves the event and processing continues with the next event .

regards

Anver

<b><i>please mark points to all helpful answers</i></b>

Read only

Former Member
0 Likes
1,244

<b>Cancel</b> is not an exit command.

Leaving Event Blocks Using STOP

If you use the STOP statement within an event block, the system stops processing the block

immediately. The ABAP runtime environment triggers the next event

Leaving Event Blocks Using EXIT

If you use the STOP statement within an event block but not in a loop, the system stops

processing the block immediately. The ABAP runtime environment triggers the next event. Before and during selection screen processing, the next event in the prescribed sequence is always called. From the START-OF-SELECTION event onwards, the system starts the list processor directly when the EXIT statement occurs, and displays the list.

If the EXIT statement occurs in a loop using DO, WHILE, or LOOP, it is the loop that terminates, not the processing block.

Leaving Event Blocks Using CHECK

If you use the CHECK <expr> statement within an event block but not within a loop, and the

condition <expr> is not fulfilled, the system exits the processing block immediately.

<expr> can be any logical expression or the name of a selection table. If you specify a selection

table and the contents of the corresponding table work are do not fulfill the condition in the

selection table, it is the same as a false logical expression.

<b>You can exit out of an event at any time using the following statements:</b>

exit

check

stop

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 (or action, such as display of the selection screen).

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 (or action, such as display of the output list).

check, exit, and stop do not set the value of sy-subrc. If you want to set it, you can assign a numeric value to it before leaving.

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers

Read only

Former Member
0 Likes
1,243

Hi,

exit-> terminates current loop pass and control

stop -> terminates current program

cancel->

back -> used in interactive report

stop cancel back are not exit command

Regards

amole