SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Calling and leaving program units → Exiting Program Units → Exiting Processing Blocks →Syntax
STOP.
Effect
The STOP statement is only to be used in executable programs and in the following event blocks:
These event blocks are exited using STOP and the runtime environment triggers the event END-OF-SELECTION.
Note
The STOP statement cannot be used in methods and raises a non-handleable exception when processing
dynpros called with
CALL SCREEN, during a
LOAD-OF-PROGRAM event, and in programs not called with SUBMIT.
Example
Ending the event block GET sbook of the logical database F1S, 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.
cl_demo_output=>next_section( |{ sflight-carrid } | &&
|{ sflight-connid } | &&
|{ sflight-fldate }| ).
GET sbook.
bookings = bookings + 1.
cl_demo_output=>write( |{ sbook-bookid } | &&
|{ sbook-customid }| ).
IF bookings = max.
STOP.
ENDIF.
END-OF-SELECTION.
cl_demo_output=>line( ).
cl_demo_output=>display( |First { bookings } bookings| ).
Non-Catchable Exceptions