Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Program Flow Logic →  Expressions and Functions for Conditions →  log_exp - Logical Expressions →  rel_exp - Comparison Expressions →  rel_exp - Relational Operators →  rel_exp - Relational Operators for All Data Types →  rel_exp - Tabular Relational Operator IN 

Comparison with Selection Table

This example demonstrates how selection tables are evaluated in a comparison expression.

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: 'Inside', 'Outside'.
SKIP.

SELECT carrid FROM spfli INTO @wa_carrid.
  IF wa_carrid IN airline.
    WRITE: / wa_carrid UNDER 'Inside'.
  ELSE.
    WRITE: / wa_carrid UNDER 'Outside'.
  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.