Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing External Data →  ABAP Database Accesses →  Open SQL →  Open SQL - Read Accesses →  SELECT →  SELECT - WHERE →  WHERE - sql_cond →  sql_cond - IN seltab 

Selection Tables in the WHERE Clause

The example demonstrates how to use the WHERE clause with selection tables.

Other versions: 7.31 | 7.40 | 7.54

Source Code

REPORT demo_where_in_seltab .

DATA wa_carrid TYPE spfli-carrid.

SELECT-OPTIONS airline FOR wa_carrid.

SELECT carrid
       FROM spfli
       WHERE carrid IN @airline
       INTO @wa_carrid.
  WRITE / wa_carrid.
ENDSELECT.

Description

Selection table airline is connected to column CARRID of database table SPFLI. The WHERE clause of the SELECT statement checks whether the content of column CARRID corresponds to the conditions stored in airline.