Ansicht
Dokumentation
ABENABAP_SQL_EXPR_LOGEXP - ABAP SQL EXPR LOGEXP
CPI1466 during Backup BAL Application Log DocumentationThis documentation is copyright by SAP AG.
- rel_exp for Expressions
... ${ ${operand1 ${=$|EQ$|<>$|NE$|>$|GT$|<$|LT$|>=$|GE$|=$|LE$} operand2 $}
$| ${operand $[NOT$] BETWEEN operand1 AND operand2$}
$| ${operand1 $[NOT$] LIKE operand2 $[ESCAPE esc$]$}
$| ${operand IS $[NOT$] NULL$}
$| ${operand IS $[NOT$] INITIAL$} $} ...
Effect
Relational expression in a condition of an expression in an statement. Logical expressions sql_cond can be formed from the relational expressions shown here for the following conditions:
- ON condition in the definition of a CTE association.
- WHEN condition of a complex case distinction
- Start condition of the table function HIERARCHY.
- WHERE, ON, and START WHERE condition in a hierarchy aggregate navigator.
The relational expressions that can be used in expressions are a subset of the relational expressions for statements, but also allow SQL expressions as operands on the right side.
- operand1 =$|<>$|>$|$|>=$|= operand2
- Comparison of the operand operand1 on the left side with the operand operand2 on the right side. The same applies to comparison operators as in a condition for statements. The operands of size comparisons can have the following data types here:
- Numeric data types: All except the replacement types for decimal floating point numbers
- Character-like data types: CHAR, CLNT, LANG, CUKY, UNIT, and NUMC
- Date types, time types, and time stamp types: DATN, DATS, TIMN, TIMS, and UTCLONG
- The operand operand2 on the right-hand side can be any SQL expression except aggregate expressions and window expressions. If an operand of the comparison has the null value, the result of this comparison is unknown.
- operand $[NOT$] BETWEEN operand1 AND operand2
- Checks the assignment to an interval. The relational expression has the same effect as the corresponding condition for statements. The addition NOT is not possible. The operands can have the same data types as for size comparisons. For operand1 and operand2, any SQL expressions except aggregate expressions and window expressions can be specified. If one of the operands has the null value, the result of the check is unknown.
- operand1 $[NOT$] LIKE operand2 $[ESCAPE esc$]
- Pattern comparison. The relational expression has the same effect as the corresponding condition for statements. The addition NOT is not possible. The same applies to the operands as in the condition for statements. The operands must be character-like and only literals and host variables can be specified on the right-hand side.
- operand IS $[NOT$] NULL
- Checks for the null value. The relational expression has the same effect as the corresponding condition for statements.
- operand IS $[NOT$] INITIAL
- Checks for the initial value of the assigned elementary ABAP type. The relational expression has the same effect as the corresponding condition for statements.
The operands on the left side can be any SQL expressions except aggregate expressions and window expressions. All columns and expressions, except for LIKE, can have any dictionary type except ACCP, DF16_SCL (obsolete), DF34_SCL (obsolete), LCHR, LRAW, PREC, RAWSTRING, STRING, and GEOM_EWKB. Individually specified literals, host variables, and host expressions are handled as elementary SQL expressions and can be of any ABAP type.
It must be possible to compare the data types of the operands of a relational expression. If this is not the case, a statically specified type raises a syntax error and a dynamically specified type raises an exception of the class CX_SY_DYNAMIC_OSQL_SEMANTICS. Unlike in conditions for statements, operands of the types DATS and TIMS are handled like regular flat character-like operands.
If an expression is used for a selection, the client column of a client-dependent data source of a query or the target of a write statement in an SQL condition of this expression cannot be used as an operand due to implicit client handling.
Notes
- Because an expression is passed to the database essentially unchanged, the possible relational expressions and their operands represent only a subset of the relational expressions for statements. In some constructs, however, a WHERE, HAVING, or ON condition of a statement is processed by the ABAP runtime framework before the pass, to achieve platform-independent behavior.
- When specifying literals, host variables, and host expressions, it should be noted that these are used as elementary SQL expressions in expressions and that their ABAP type is mapped to a dictionary type according to the corresponding tables. This type must fulfill the comparability rules. This differs from relational expressions for statements, for which the ABAP type is generally converted to the appropriate dictionary type.
- The addition NOT cannot currently be specified in front of BETWEEN and LIKE. Instead, the operator NOT can be used in front of the entire expression.
- A client column can be used as an operand only if implicit client handling is disabled using the addition CLIENT SPECIFIED for the query or the write. This is not possible for filter conditions.
Vendor Master (General Section) SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up
This documentation is copyright by SAP AG.
Length: 10605 Date: 20240425 Time: 012115 sap01-206 ( 147 ms )