Documentation View

We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!



ROGBILLS - Synchronize billing plans   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.
SAP E-Book

- SQL Expressions sql_exp

... sql_elem
  $| sql_func
  $| sql_arith
  $| sql_cast
  $| sql_string
  $| sql_case
  $| sql_agg
  $| sql_win...


SQL expressions are expressions that generally can be specified in the following positions of statements:

  • As a grouping criterion after GROUP BY

Some expressions, such as CAST expressions, can also be specified at other positions and built-in functions can be specified on the right side of SQL conditions for statements. This is documented for the respective positions.

SQL expressions are passed to the database system, executed there, and the result is passed to the AS ABAP if requested.

In general, the operands of SQL expressions can also be SQL expressions whose result must have a suitable data type. There are restrictions to individual operand positions, which are described for these.

The following SQL expressions exist:

Every expression can be enclosed in parentheses. The result of an expression is used in the statement in accordance with the operand position, with the data type in nested expressions based on the outermost expression.


  • No alias names defined using AS can be used as operands of SQL expressions. This also means that none of the expressions used in a SELECT list can be specified as operands using their alias names.
  • SQL expressions cannot currently be used together with the addition FOR ALL ENTRIES. An exception to this rule are individual columns and an individually specified aggregate expression COUNT( * ).
  • When SQL expressions are used other than for individually specified columns or individually specified aggregate expressions, the syntax check is performed in a strict mode as of Release , which handles the statement more strictly than the regular syntax check. If other SQL expressions are specified along with aggregate expressions or the addition GROUP BY, the syntax check is performed in strict mode as of Release . Using aggregate expressions as operands of SQL expressions results in the strict mode as of Release .


Syntax example for specifying SQL expressions in different operand positions in a SELECT statement

ROGBILLS - Synchronize billing plans   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 6107 Date: 20230207 Time: 091644     sap01-206 ( 50 ms )