Skip to content

Files

Latest commit

lucasborinEugen Guenther
and
Sep 17, 2020
402bd06 · Sep 17, 2020

History

History
42 lines (26 loc) · 1.17 KB

boolean-input-parameter.md

File metadata and controls

42 lines (26 loc) · 1.17 KB

code pal for ABAP

code pal for ABAP > Documentation > Boolean Input Parameter

Boolean Input Parameter

What is the Intent of the Check?

Usage of boolean input parameters because they are often an indicator that a method does two things instead of one.
Ps: Setter methods using boolean variables are ok.

How to solve the issue?

Splitting the method may simplify the methods' code and describe the different intentions better.

What to do in case of exception?

You can suppress Code Inspector findings generated by this check using the pseudo comment "#EC BOOL_PARAM.
The pseudo comment has to be placed after the method declaration.

  METHODS update IMPORTING do_save TYPE abap_bool. "#EC BOOL_PARAM

Example

Before the check:

  METHODS update IMPORTING do_save TYPE abap_bool.

After the check:

  METHODS update_without_saving.
  METHODS update_and_save.

Further Readings & Knowledge