Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 1.1 KB

empty-if-branches.md

File metadata and controls

45 lines (28 loc) · 1.1 KB

code pal for ABAP > Documentation > Empty IF Branches Check

Empty IF-Branch Check

What is the Intent of the Check?

This check searches for empty IF statements or branches.

How to solve the issue?

Fill the empty IF structure with code or remove it by refactoring the condition.

What to do in case of exception?

In exceptional cases, you can suppress this finding by using the pseudo comment "#EC EMPTY_IF_BRANCH which should be placed after the opening statement of the empty IF branch; or, in case of nested IFstatements, in the deepest structure within the branch:

IF name = ''.
  IF address = ''. "#EC EMPTY_IF_BRANCH

  ENDIF.
ENDIF.

IF name = ''. "#EC EMPTY_IF_BRANCH

ENDIF.

IF name = ''.
  " Source Code.
ELSEIF name = ''. "#EC EMPTY_IF_BRANCH

ELSE.
  " Source Code.
ENDIF.

IF name = ''.
  " Source Code.
ELSE. "#EC EMPTY_IF_BRANCH

ENDIF.

Further Readings & Knowledge