Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing External Data →  ABAP Database Accesses →  Open SQL →  Open SQL - Read Accesses →  SELECT →  SELECT - result →  SELECT - select_list →  SELECT - col_spec →  SELECT - sql_exp 

sql_exp - sql_elem

Other versions: 7.31 | 7.40 | 7.54

Syntax


... col | dobj ...

Effect

Elementary expression in Open SQL. An elementary expression is either a column col of a database table or view or a host variable or literal dobj.

  • The column col can have any data type from ABAP Dictionary and the same rules apply as when specifying columns directly, particularly for columns of the type LRAW or LCHR.
  • The host variable dobj or literal can have any non-generic ABAP data type except string or xstring and the name of a host variable must be flagged with the escape character @. Empty text field literals cannot be specified.

The result is the value of the column, the host variable, or the literal. When a column is specified, the result has the data type of the column. When a host variable or literal is specified, the ABAP type is mapped to a dictionary type as follows:

Numeric ABAP Type Dictionary Type
b, s, i INT1, INT2, INT4
p DEC with appropriate length and decimal places
decfloat16, decfloat34 DF16_RAW, DF34_RAW
f FLTP
Character-Like ABAP Type Dictionary Type
c CHAR with appropriate length
n NUMC with appropriate length
d DATS
t TIMS
Byte-Like ABAP Type Dictionary Type
x RAW with appropriate length


Notes

  • A column specified as an elementary expression can be flagged using parentheses. In this case, the statement can only have lists separated by commas and host variables must be indicated by the escape character @.

  • It is a good idea to specify a host variable or a literal as an elementary expression whenever a defined value is assigned to a column of a results set that is not read from the database.

  • Specifying a constant or a literal as the only element of a SINGLE list is one way of defining whether data in a selection exists without having to transport data from the database.