ABAP Keyword Documentation → ABAP - Reference → Program Flow Logic → Expressions and Functions for Conditions → log_exp - Logical Expressions

# log_exp - Boolean Operators and Parentheses

The Boolean operators

join logical expressions; the operator

negates a logical expression.

Logical expressions can be parenthesized explicitly using

.

When combining multiple Boolean operators, the system implicitly parenthesizes all logical expressions that are not closed by explicit parentheses according to the following hierarchy (operator order, precedence). This expresses the strength of the connection between Boolean operators:

`NOT`

are combined with the adjacent logical expression to the right to a logical expression.
`AND`

are combined as one logical expression.
`OR`

are combined as one logical expression.
`EQUIV`

are combined as one logical expression.
The logical expressions of a parenthesis level are processed from the left to the right. If the value of a logical expression determines the total value of the parenthesis level, the remaining logical expressions are not evaluated. The dynamic parts of the expressions that are not evaluated, such as field symbols or reference variables, are not checked for validity in this case.

Other versions:
7.31 | **7.40** | 7.54

Notes

- If multiple logical expressions are joined, the explicit and implicit parentheses always produce exactly one logical expression that is either true or false.

- The smallest unit of a joined logical expression is always a relational expression.

- If functional methods are used as operands in the relational expressions in question, they are executed directly before the respective relational expression is evaluated. Any functional methods in a relational expression that does not need to be evaluated to get the result are not executed.