ABAP Keyword Documentation → ABAP - Reference → Obsolete Language Elements → Obsolete Processing of External Data → Logical Databases (Obsolete) → Logical Databases - Statements → Statements for Logical Databases
CHECK SELECT-OPTIONS
Other versions: 7.31 | 7.40 | 7.54
Obsolete Syntax
CHECK SELECT-OPTIONS.
Effect
This form of the statement CHECK for exiting processing blocks is only intended for use in executable programs that are associated using a
logical database, and then only in the event blocks for the
reporting events GET. It must not be used in methods.
The statement checks whether the content of the
interface work area that was filled for the current GET event by the logical database fulfills the conditions in all
selection tables that
are associated with the current node of the logical database. The name of the node is copied statically from the next highest GET statement in the program. The following restrictions apply:
-
The statement
CHECK SELECT-OPTIONScan only be used when the type of the current node of the logical database is a database table. -
If the node is to be used for dynamic selections, the statement evaluates only those selection criteria
that have been declared with the
NO DATABASE SELECTIONaddition of theSELECT-OPTIONSstatement.
If the conditions in one of the selection tables are not met, and the statement is not listed within
a loop, then the GET event block is exited and the runtime environment behaves
as with the other variant of CHECK
used for exiting processing blocks. If the statement is listed within a loop, then only the current loop pass is exited.
Notes
-
For performance reasons, the
CHECKstatement should only be used to check data selections duringGETevents if the selections provided by the logical database are not sufficient. -
The
CHECK SELECT-OPTIONSstatement should not be used within a loop since it otherwise only exits the current loop pass. -
If logical databases are no longer used, this variant of the statement
CHECKis also no longer necessary.
Example
Exiting a GET event block if the content of the components seatsmax
and seatsocc of the interface work area sflight
do not fulfill the conditions in the selection tables s_max or s_occ. Before the program can run, it must be associated with the logical database F1S.
NODES sflight.
SELECT-OPTIONS: s_max FOR sflight-seatsmax,
s_occ FOR sflight-seatsocc.
GET sflight.
cl_demo_output=>write( |{ sflight-carrid } {
sflight-connid }| ).
CHECK SELECT-OPTIONS.
cl_demo_output=>write( |{ sflight-seatsmax } {
sflight-seatsocc }| ).
END-OF-SELECTION.
cl_demo_output=>display( ).
Exceptions
Non-Catchable Exceptions
-
Cause: Incorrect
OPTIONin theSELECT-OPTIONStable or theRANGEStable
Runtime Error:CHECK_SELOPT_ILLEGAL_OPTION -
Cause: Incorrect
SIGNin theSELECT-OPTIONStable or theRANGEStable
Runtime Error:CHECK_SELOPT_ILLEGAL_SIGN -
Cause: Nonexistent memory area accessed
Runtime Error:CHECK_ADDR_NOT_ALLOC