Skip to content

ABAP Keyword Documentation →  ABAP Dictionary →  ABAP CDS in ABAP Dictionary →  ABAP CDS - Views →  ABAP CDS - DDL Statements →  ABAP CDS - DEFINE VIEW →  ABAP CDS - SELECT →  ABAP CDS - SELECT, Operands and Expressions 

ABAP CDS - cond_expr

Other versions: 7.31 | 7.40 | 7.54

Syntax


... rel_expr 
  | [NOT] cond_expr [AND|OR cond_expr] ...

Effect

Formulates a condition in a CDS view in ABAP CDS whose result is true or false. A condition is either a single relational expression, rel_expr, or an expression constructed from the Boolean operators NOT, AND, and OR in which parenthesized full conditions cond_expr using the parentheses ( ... ) are possible. The Boolean operators work as follows:

  • NOT negates the result of the following condition.
  • An AND join is true if both joined conditions are true.
  • An OR join is true if at least one of the joined conditions is true.

The operator NOT is a stronger binding than AND, which itself is a strong binding than OR. This produces implicit parenthesizing, which can be overridden by explicit parenthesizing. The following table shows the relational expressions from which a condition cond_expr can be constructed:

rel_expr True if
lhs = rhs Value of lhs is equal to the value of rhs
lhs <> rhs Value of lhs is not equal to the value of rhs
lhs < rhs Value of lhs is less than the value of rhs
lhs > rhs Value of lhs is greater than the value of rhs
lhs <= rhs Value of lhs is less than or equal to the value of rhs
lhs >= rhs Value of lhs is greater than or equal to the value of rhs
lhs BETWEEN rhs1 AND rhs2 Value of lhs is between the values of rhs1 and rhs2
lhs LIKE rhs Value of character-like lhs matches the pattern in rhs(wildcard character in rhs: % for any character string and _ for any character); only character-likeliterals are allowed for rhs
lhs IS [NOT] NULL Value of lhs is (not) the null value

The following rules apply when the operands lhs and rhs are specified:

  • General Rules
  • Numeric literals that represent a value outside the value range of INT4 must be specified as floating point literals with a decimal point.
  • Rules for use in a WHERE condition
  • Rules for use in a HAVING condition
  • Rules for use in an ON condition of a join expression
  • Rules for use in an ON condition of an association
  • Rules for use in a filter condition of a path expression
  • Rules for use in a complex case distinction.

Continue

ABAP CDS - cond_expr, WHERE

ABAP CDS - cond_expr, HAVING

ABAP CDS - cond_expr, ON, Join

ABAP CDS - cond_expr, ON, Association

ABAP CDS - cond_expr, Filter

ABAP CDS - cond_expr, CASE