Skip to content

Avoid Boolean Flag Importing Parameters ​

WarningClean ABAP & Modern Syntax#EC NO_BOOL_BLINDNESSRemote Enabled

Overview ​

Avoid boolean flag importing parameters.

ATC Finding Message: Boolean importing parameters hide intent; use dedicated methods or a typed flag

Rationale ​

A boolean importing parameter turns a method call into a positional switch: callers write do_work( abap_true ) and readers cannot tell what true means without opening the signature. Boolean blindness also pushes every new variation into the same method instead of a dedicated, well-named API. Expose the alternatives as separate methods or as a meaningful typed flag, and keep abap_bool flags out of method interfaces.

Non-Compliant ​

abap
METHODS save_order
  IMPORTING iv_send_mail TYPE abap_bool.

Compliant ​

abap
METHODS save_order.
METHODS save_and_send_order.

Suppression ​

To suppress findings for this rule, append the pseudo-comment to the statement:

abap
" Standard pseudo-comment:
... "#EC NO_BOOL_BLINDNESS

" SAP CI_ prefix format:
... "#EC CI_NO_BOOL_BLINDNESS

Technical Details ​

Released under the MIT License.