STOP
Short Reference
ABAP Syntax STOP.
What does it do? The STOP statement is only to be used in
executable programs and in the
following event blocks:
AT SELECTION-SCREEN (without
additions)
START-OF-SELECTION
GET
These event blocks are exited using STOP and the runtime
environment triggers the event END-OF-SELECTION .
Latest notes: 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 ABAP Coding 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| ).
Runtime Exceptions Non-catchable Exceptions
Reason for error: The STOP statement was executed outside the
process for an executable program.
Runtime error: STOP_NO_REPORT
Reason for error: The STOP statement was executed during the
process for a screen and therefore outside the permitted events.
Runtime error: STOP_WITHIN_CALLED_DYNPRO
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved