ABAP Keyword Documentation → ABAP - Reference → Program Flow → Expressions and Functions for Logical Expressions → log_exp - Logical Expressions → log_exp - Predicates → log_exp - IN
Selection Tables in Logical Expressions
The example shows how to use logical expressions for selection tables.
Other versions: 7.31 | 7.40 | 7.54
Source Code
REPORT demo_logical_expr_seltab_1 .
DATA wa_carrid TYPE spfli-carrid.
SELECT-OPTIONS airline FOR wa_carrid.
WRITE: 'Innerhalb'(001), 'Ausserhalb'(002).
SELECT carrid FROM spfli INTO wa_carrid.
IF wa_carrid IN airline.
WRITE: / wa_carrid UNDER 'Innerhalb'(001).
ELSE.
WRITE: / wa_carrid UNDER 'Ausserhalb'(002).
ENDIF.
ENDSELECT.
Description
The SELECT
loop reads all rows from the database table SPFLI
and arranges them in a list, depending on their relation to the condition specified on the selection screen.