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

stop

Former Member
0 Likes
812

difference between stop and exit.

1 ACCEPTED SOLUTION
Read only

rainer_hbenthal
Active Contributor
0 Likes
788

stop starts with s and exit starts with e. Why didnt you just read the online help by pressing F1?

5 REPLIES 5
Read only

rainer_hbenthal
Active Contributor
0 Likes
789

stop starts with s and exit starts with e. Why didnt you just read the online help by pressing F1?

Read only

Former Member
0 Likes
788

<b>STOP</b>

The statement is only intended for use in the INITIALIZATION, AT SELECTION-SCREEN, START-OF-SELECTION, and GET events. During the execution of type 1 programs, it terminates the processing of the associated event blocks and triggers the sending of the selection screen during the event INITIALIZATION, and - in all other cases - triggers the event END-OF-SELECTION of the runtime environment.

<b>EXIT</b>

terminate the loop pass or select..endselect statements

taken fron SAP HELP

Read only

varma_narayana
Active Contributor
0 Likes
788

Hi..

STOP.

This statement terminates the Current processing block and Triggers the END-of-SELECTION event.

EXIT.

This statement terminates the Current processing block and continue the execution after the Processing block (Loop etc...).

<b>

reward if Helpful.</b>

Read only

Former Member
0 Likes
788

Hi

STOP is Absolete in ECC 6.0

Regards

Shiva

Read only

Former Member
0 Likes
788

Hi,

See the full help:

<b>STOP</b>

Syntax

STOP.

Effect

The statement STOP is only to be used in executable programs and in the following event blocks:

• AT SELECTION-SCREEN (without additions)

• START-OF-SELECTION

• GET

You leave these event blocks via STOP, and the runtime environment triggers the event END-OF-SELECTION.

Note

The statement STOP is forbidden in methods and, since Release 6.10, leads to an uncatchable exception during the processing of screens called with CALL SCREEN and in programs not called with SUBMIT.

Example

Ending the event blocks GET sbook after max postings have been issued, and branching to END-OF-SELECTION.

NODES: sflight, sbook.

DATA: bookings TYPE i,

max TYPE i VALUE 100.

GET sflight.

WRITE: / sflight-carrid, sflight-connid, sflight-fldate.

GET sbook.

bookings = bookings + 1.

WRITE: / sbook-bookid, sbook-customid.

IF bookings = max.

STOP.

ENDIF.

END-OF-SELECTION.

ULINE.

WRITE: / 'First', bookings, 'bookings'.

<b>EXIT - processing_block</b>

Syntax

EXIT.

Effect

If the EXIT statement is executed outside of a loop, it will immediately terminate the current processing block.

After the processing block has been executed, the runtime environment behaves in such a way that it follows with the exception Reporting Event Blocks START-OF-SELECTION and GET the schema from Leave Processing Blocks.

After the Reporting Processing Blocks START-OF-SELECTION and GET have been exited using EXIT, the runtime environment does not trigger any further reporting events. Instead, it directly calls the list processor for displaying the basic list.

Note

We recommend using EXIT only within loops (see EXIT - loops ). Instead, use RETURN to leave processing blocks.

<b>EXIT - loop</b>

Syntax

EXIT.

Effect

If the EXIT statement is listed within a loop, it leaves the loop by ending the current loop process. Program execution is continued after the closing statement in the loop.

Note

Outside of a loop, the EXIT statement leaves the current processing block (see EXIT - Processing block). We recommend that you use EXIT within loops only.

Example

Leaving a loop with EXIT if the loop index sy-index is greater than a number limit.

DATA limit TYPE i VALUE 10.

DO.

IF sy-index > limit.

EXIT.

ENDIF.

WRITE / sy-index.

ENDDO.

<b>EXIT FROM SQL</b>

Syntax

EXIT FROM SQL.

Effect

This statement, which is forbidden in classes, is only executed during processing of subroutines that were called using the PERFORMING addition EXEC SQL. Otherwise it is ignored.

The statement has the effect that implicit cursor processing is terminated after the current subroutine has finished. Processing of the called ABAP program is continued after ENDEXEC, whereby sy-dbcnt contains the number of rows read up until that point and sy-subrc is set to the value 4.

<b>EXIT FROM STEP-LOOP</b>

Syntax

EXIT FROM STEP-LOOP.

Effect

During the processing of Table Controls or Steploops with the statement LOOP in the Dynpro-flow logic, this statement effects the immediate termination of the loop. The current ABAP- processing block is instantly left and the dynpro flow logic continues after the statement ENDLOOP. During the PBO-processing, the statement effects that the current and the following table-control-rows resp. steploop-groups are not displayed on the screen. If the statement is not processed during execution of a LOOP-loop in the dynpro flow logic, then the program terminates with a termination message.

Regards,

Rama.