Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing External Data →  ABAP Database Accesses →  Native SQL →  EXEC SQL - Embedded Native SQL →  EXEC SQL 

EXEC SQL - Literals

Appropriate literals can be specified in ABAP syntax at suitable reader positions in embedded Native SQL statements.

The literal operator cannot be used in static Native SQL.

Other versions: 7.31 | 7.40 | 7.54


Example

Reads a row from the database table SPFLI using static Native SQL. The required row is specified using literals. The target range is specified as a host variable. If a row was found, sy-subrc is set to 0; if not, it is set to 4.

DATA: BEGIN OF wa, 
        cityfrom TYPE spfli-cityfrom, 
        cityto   TYPE spfli-cityto, 
      END OF wa. 

EXEC SQL. 
  SELECT cityfrom, cityto 
         INTO :wa 
         FROM spfli 
         WHERE mandt  = '100' AND 
               carrid = 'LH'  AND connid = '0400' 
ENDEXEC.