SAP CDS CONDITIONAL EXPRESSION V1



Get Example source ABAP code based on a different SAP table
  


• NOT ABAP_CDS_DDL_OPERATOR
• AND ABAP_CDS_DDL_OPERATOR
• OR ABAP_CDS_DDL_OPERATOR
• ( ) ABAP_CDS_DDL_OPERATOR

ABAP_CDS_DDL - DDIC-Based View, cds_cond

ABAP_SYNTAX
... rel_expr
| $[NOT$] cds_cond $[AND$|OR cds_cond$] ...


What does it do?
Logical expression cds_cond for formulating a condition in ABAP CDS. A logical expression is either a single relational expression rel_exp, or an expression composed of the Boolean operators NOT, AND, OR and one or more logical expressions, in which parentheses are possible. An atomic component of a compound logical expression is always one relational expression.
Possible relational expressions rel_expr from which a condition cds_cond can be constructed:
Comparisons with comparison operators
Interval comparisons using BETWEEN
Pattern comparisons using LIKE
Checks on the null value using IS NULL
Checks on the initial value using IS INITIAL
The Boolean operators work as follows:
NOT negates the result of the following condition.
An AND combination is true if both combined conditions are true.
An OR combination is true if at least one of the combined conditions is true.
The operator NOT has a stronger binding than AND, which itself has a stronger binding than OR. This produces implicit parentheses, which can be overridden by explicit parentheses.
In SQL, the order in which two expressions are evaluated that are combined by AND is not defined. Results can be different on different database platforms.



Latest notes:

If multiple expressions are combined by AND, rules such as the following are not reliable: If one expression is false, then the following expressions are no longer evaluated. For example a condition col1 <> 0 AND col2 / col1 > 1 can raise an exception. To avoid such exceptions, CASE expressions can be used.
NON_V5_HINTS
ABAP_HINT_END