Skip to content

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

log_exp - ( )

Other versions: 7.31 | 7.40 | 7.54

Syntax


... ( log_exp ) ...

Effect

A full logical expression log_exp can be placed in parentheses. In the case of log_exp, this can be a join between multiple expressions using AND, OR, or EQUIV or a logical expression negated using NOT. A logical expression in parentheses is itself a logical expression.


Note

The smallest unit of a logical expression that can be placed in parentheses is a relational expression.


Example

A join of the logical expressions

NOT log_exp1 OR log_exp2 AND NOT log_exp3 AND log_exp4 EQUIV log_exp5

can be parenthesized explicitly as follows to stress the implicit parentheses:

  • Parentheses around the expressions with NOT
    ( NOT log_exp1 ) OR
    log_exp2 AND ( NOT log_exp3 ) AND log_exp4 EQUIV log_exp5
  • Parentheses around the expressions with AND
    ( NOT log_exp1 ) OR
    ( log_exp2 AND ( NOT log_exp3 ) AND log_exp4 ) EQUIV log_exp5
  • Parentheses around the expressions with OR
    ( ( NOT log_exp1 ) OR
    ( log_exp2 AND ( NOT log_exp3 ) AND log_exp4 ) ) EQUIV log_exp5
  • Parentheses around the expressions with EQUIV
    ( ( ( NOT log_exp1 ) OR
    ( log_exp2 AND ( NOT log_exp3 ) AND log_exp4 ) ) EQUIV log_exp5 )
  • Changing the parentheses explicitly changes the meaning of the expression. For example, if explicit parentheses are set as follows in the above expression:

    ( NOT log_exp1 OR log_exp2 ) AND
    NOT ( log_exp3 AND log_exp4 EQUIV log_exp5 )

    produces the following the result after implicit parentheses are set:

    ( ( ( NOT log_exp1 ) OR log_exp2 ) AND
    ( NOT ( ( log_exp3 AND log_exp4 ) EQUIV log_exp5 ) ) )