SAP ABAP SQL EXPR LOGEXP Get Example source ABAP code based on a different SAP table
SAP Help
• NOT ABAP_OSQL_EXP_COND
• AND ABAP_OSQL_EXP_COND
• OR ABAP_OSQL_EXP_COND
• BETWEEN ABAP_OSQL_EXP_COND
• NOT LIKE ABAP_OSQL_EXP_COND
• LIKE ABAP_OSQL_EXP_COND
• NOT BETWEEN ABAP_OSQL_EXP_COND
• IS NULL ABAP_OSQL_EXP_COND
• IS NOT NULL ABAP_OSQL_EXP_COND
• = ABAP_OSQL_EXP_COND
• <> ABAP_OSQL_EXP_COND
• < ABAP_OSQL_EXP_COND
• > ABAP_OSQL_EXP_COND
• <= ABAP_OSQL_EXP_COND
• >= ABAP_OSQL_EXP_COND
ABAP_SQLCOND > - rel_exp> for Expressions ABAP_SYNTAX ... ${ ${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$} $} ...> What does it do? Relational expression in a condition of an expression in an AB-SQL statement. From the relational expressions shown here, logical expressions sql_cond> can be formed for the following conditions: ON> condition> in the definition of a CTE association>. Filter condition> of a path expression>. 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>. Here, the operands of size comparisons can have the following data types: 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 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 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>, BEGIN_SECTION VERSION 5 OUT DF16_SCL> (obsolete), DF34_SCL> (obsolete), END_SECTION VERSION 5 OUT 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>. Latest 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. NON_V5_HINTS 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>. That the result of a check is unknown if one of the operands has the null value>, is especially true for the null expression NULL>> that contains the null value by definition. ABAP_HINT_END