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 - NOT
Other versions: 7.31 | 7.40 | 7.54
Syntax
... NOT log_exp ...
Effect
The negation of a logical expression log_exp
using NOT creates a new logical expression that is false if the logical expression log_exp is true and vice versa.
Notes
- The operator
NOTis a stronger join thanAND,OR, andEQUIV.
- The Boolean operator
NOTmust not be confused with the additionNOTof the relational operatorsBETWEEN,IN, and the predicate operatorIS. The following syntax is one possible example:
... NOT operand NOT IN range_tab ...
NOT is a Boolean operator that negates a comparison expression.
The second NOT is a part of the comparison expression with the relational operator IN. This is made clear using parentheses around the comparison expression:
... NOT ( operand NOT IN range_tab ) ...
Example
Exit the current processing block if sy-subrc does not have the value 0.
IF NOT sy-subrc = 0.
RETURN.
ENDIF.