Clear EXPORTING parameters

 home styleguide  example  edit

clear_exporting_parameters

Description

Checks that EXPORTING parameters passed by reference are cleared or assigned before they are read

Extended Information

An EXPORTING parameter passed by reference behaves like a CHANGING parameter: it is not
initialized when the method is called, so it can still contain a value supplied by the caller. Clear or overwrite it
before reading it, so a leftover value is not accidentally used.

https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#clear-or-overwrite-exporting-reference-parameters

https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abenref_transf_output_param_guidl.html

Note: EXPORTING parameters passed by VALUE are always initialized and are therefore not reported.
Reading and writing the parameter in the same statement (e.g. "ev_result = ev_result + 1") is reported,
as the source is evaluated before the parameter is assigned.
Objects containing parser or syntax errors are not reported.
"IS SUPPLIED"/"IS REQUESTED" checks are not considered reads, and "GET REFERENCE OF" plus
"ASSIGN ... TO " are considered writes, as the value can be written via the reference.

Class and interface method implementations and function modules are checked.

Default Configuration

Hover to see descriptions, Ctrl+Space for suggestions

Examples