Skip to content

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

log_exp- ( )

Other versions: 7.31 | 7.40 | 7.54

Syntax


... ( log_exp ) ...

Effect

A complete logical expression log_exp can be put in round brackets. log_exp can be a link of multiple expressions with AND, OR or EQUIV or a logical expression which was negated with NOT. A bracketed logical expression constitutes again a logical expression.


Example

Linking of logical expressions

NOT log_exp1 OR log_exp2 AND NOT log_exp3 AND log_exp4 EQUIV log_exp5

Can be bracketed explicitly as follows to clarify implicit bracketing:

  • Bracketing the expressions with NOT
    ( NOT log_exp1 ) OR
    log_exp2 AND ( NOT log_exp3 ) AND log_exp4 EQUIV log_exp5
  • Bracketing the expressions with AND
    ( NOT log_exp1 ) OR
    ( log_exp2 AND ( NOT log_exp3 ) AND log_exp4 ) EQUIV log_exp5
  • Bracketing the expressions with OR
    ( ( NOT log_exp1 ) OR
    ( log_exp2 AND ( NOT log_exp3 ) AND log_exp4 ) ) EQUIV log_exp5
  • Bracketing the expressions with EQUIV
    ( ( ( NOT log_exp1 ) OR
    ( log_exp2 AND ( NOT log_exp3 ) AND log_exp4 ) ) EQUIV log_exp5 )
  • A different explicit bracketing changes the meaning of the expression. If you set explicit brackets as follows in the above expression:

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

    the result after implicit bracketing is:

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