ABAP Keyword Documentation → ABAP - Reference → Calling and leaving program units → Exiting Program Units → Exiting Processing Blocks
REJECT
Other versions: 7.31 | 7.40 | 7.54
Syntax
REJECT [node].
Addition
Effect
The statement END-OF-SELECTION is only intended for use in
executable programs that are associated with a
logical database.
It exits the current GET event block
of an executable program. If you do not specify node, any nodes that are
at a lower level in the hierarchical structure of the associated logical database are no longer processed.
The logical database reads the next line of the current node or next higher node, if it has reached the end of the hierarchy level.
The REJECT statement always refers to the current GET event, not to the location where it is specified. If you call a
procedure in a GET
event block, and the REJECT statement is executed there, the calling event block is affected.
Notes
-
You cannot use
REJECTin methods. Also, we do not recommend usingREJECTin processing blocks other than inGETevent blocks. Runtime errors can occur if the processing blocks are not executed in the correct context. -
If logical databases are no longer used, then you no longer need to use the statement
REJECTeither.
Addition
... node
Effect
You can specify node as
flat,
character-like data object. When the statement is executed, the object must contain the name of a node that lies above the current node in the
logical database
hierarchy. If you specify node, the logical database reads the next data record of the corresponding node.
Example
Exits the event block GET sbook and branches to
the event GET sflight after the interface work area sbook is output for the first time.
NODES: sflight, sbook.
GET sflight.
SKIP.
WRITE: / 'Carrid:', sflight-carrid,
'Connid:', sflight-connid,
'Fldate:', sflight-fldate.
ULINE.
GET sbook.
WRITE: / 'Bookid:', sbook-bookid.
REJECT 'SFLIGHT'.
Exceptions
Non-Catchable Exceptions
-
Cause: The table whose name is in the field
dbtabis not active. This means that the table does not lie above the current table in the database hierarchy. Therefore, the processing cannot continue with the next data record of this table.
Runtime Error:REJECT_TABLE_NOT_FOUND