Skip to content

Don't clear VALUE parameters

Parameters that work by VALUE are handed over as new, separate memory areas that are empty by definition. Don’t clear them again:

METHODS square
  EXPORTING
    VALUE(result) TYPE i.

METHOD square.
  " no need to CLEAR result
ENDMETHOD.

RETURNING parameters are always VALUE parameters, so you never have to clear them:

METHODS square
  RETURNING
    VALUE(result) TYPE i.

METHOD square.
  " no need to CLEAR result
ENDMETHOD.
From SAP/styleguides under CC BY 3.0 — more details
Last updated on