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.

Source Code

REPORT demo_where_in_seltab .

DATA wa_carrid TYPE spfli-carrid.

SELECT-OPTIONS airline FOR wa_carrid.

SELECT carrid FROM spfli INTO wa_carrid WHERE carrid IN airline.
  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.