abapOpenChecks - Installation - Checks - Utilities - Links

CHECK_59 - Logical expression structure

Improve this page
RFC enabled
CODE
* Bad, too many parentheses
IF ( ( foo = bar ) AND ( moo = boo ) ).
IF ( foo = bar AND moo = boo ).
IF ( foo = bar ) AND ( moo = boo ).
IF foo = bar AND ( moo = boo ).
* Good
IF foo = bar AND moo = boo.


* Bad, too few parentheses
IF foo = bar AND moo = boo OR laa = baa.
* Good
IF ( foo = bar AND moo = boo ) OR laa = baa.
IF foo = bar AND ( moo = boo OR laa = baa ).

Check does not work if variables are named as keywords, eg. AND IF OR

Configuration

Configuration