code pal for ABAP > Documentation > Omit Optional EXPORTING
In functional calls of methods that only have importing parameters and a returning parameter, the keyword EXPORTING
in front of the parameter list at call sites is superfluous. This check searches for these superfluous instances of EXPORTING
.
Anti-Pattern:
update(
EXPORTING
node = /dirty/my_bo_c=>node-item
key = item->key
data = item
fields = changed_fields ).
Pattern:
update( node = /clean/my_bo_c=>node-item
key = item->key
data = item
fields = changed_fields ).
This check searches for the usage of EXPORTING
in functional method calls that have no CHANGING
, IMPORTING
, RECEIVING
or EXCEPTIONS
clauses.
Omit the optional keyword EXPORTING
.
In exceptional cases, you can suppress this finding by using the pseudo comment "#EC OPTL_EXP
which should be placed right at the end of the statement:
class->meth1( EXPORTING param1 = 'example' ). "#EC OPTL_EXP