Skip to content

Latest commit

 

History

History
38 lines (22 loc) · 1.17 KB

prefer-returning-to-exporting.md

File metadata and controls

38 lines (22 loc) · 1.17 KB

code pal for ABAP > Documentation > Prefer RETURNING to EXPORTING

Prefer RETURNING to EXPORTING

What is the intent of the check?

This check searches for methods in ABAP objects that have only a single exporting parameter.

How to solve the issue?

Change the exporting parameter to a returning parameter, if possible. This may not be possible when the exporting parameter is not fully typed (i.e. at least partly generic) as returning parameters must be fully typed.

What to do in case of exception?

In exceptional cases, you can suppress this finding by using the pseudo comment "#EC PREFER_RET which has to be placed after the method declaration:

  METHODS get_name EXPORTING result TYPE string. "#EC PREFER_RET

Example

Before the check:

  METHODS get_name EXPORTING result TYPE string.

After the check:

  METHODS get_name RETURNING VALUE(result) TYPE string.

Further Readings & Knowledge