abapOpenChecks - Installation - Checks - Utilities - Links

CHECK_01 - IF in IF

Improve this page
RFC enabled
CODE
IF condition1.
  IF condition2.
    ...
  ENDIF.
ENDIF.

Can be reduced to

IF ( condition1 ) AND ( condition2 ).
  ...
ENDIF.

or

ELSE.
  IF condition.
    ...
  ENDIF.
ENDIF.

Can be reduced to

ELSEIF condition.
  ...
ENDIF.

https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#keep-the-nesting-depth-low

Configuration

Configuration