Ansicht
Dokumentation

ABENSQL_OPERANDS - SQL OPERANDS

ABENSQL_OPERANDS - SQL OPERANDS

BAL Application Log Documentation   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

- SQL Operands sql_elem

... col
  $| literal $| @dobj $| @( expr ) ...


Effect

Specifies a column col, a literal literal, a host variable @dobj, or a host expression @( expr ) as an elementary SQL operand in an operand position.

These elementary operands can have the following properties:

  • They can also occur in specific operand positions in which no SQL expressions or restricted SQL expressions are possible.

To operand positions in which host variables are handled as SQL expressions, the associated rules for the expressions apply. The rules of the respective position apply in operand positions in which no SQL expressions are possible.

While the value of a column col or a typed literal is determined on the database, the values of untyped literals, host variables, and host expressions are passed from ABAP to the database system before the SQL statement is executed or copied from the database system after it is executed. The operand position determines how the value of such an ABAP object is handled:

  • An ABAP object specified as an elementary SQL expression in a read position is mapped to a dictionary type as described there, passed to the database with this type, and handled accordingly. The database rules apply.

Note

Typed literals are always handled as elementary SQL expressions, while untyped literals can also be handled as host variables, depending on the operand position.

Example

SQL expressions are possible on the left side of the WHERE condition. The specified column carrid can be placed in parentheses as an elementary SQL expression. No general SQL expressions are possible on the right side of the condition. The literal CHAR`UA` as an elementary SQL expression can be used, but not be set in parentheses.

Example

In the first SELECT statement, the host variable @field is in an operand position in which it is not handled as an elementary SQL expression. Their content must comply with the rules for lossless assignments, which is not the case here. This is why an exception of the class CX_SY_OPEN_SQL_DATA_ERROR is raised. In the second SELECT statement, the same host variable is in an operand position in which it is evaluated as an elementary SQL expression and a mapping takes place to a dictionary type and the value is evaluated using this type on the database. No exception is raised in this case.






RFUMSV00 - Advance Return for Tax on Sales/Purchases   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 5527 Date: 20240426 Time: 182340     sap01-206 ( 91 ms )