Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 1.89 KB

ReceivingKeywordRule.md

File metadata and controls

62 lines (43 loc) · 1.89 KB

<-- previous rule | overview | next rule -->

Omit RECEIVING

Transforms method calls that use the RECEIVING keyword into functional style.

This rule is part of the essential profile, as it is explicitly demanded by the Clean ABAP Styleguide.

References

Options

  • (no options available for this rule)

Examples

  METHOD omit_receiving.
    any_method(
      EXPORTING iv_param  = lv_param
      IMPORTING ev_param  = ev_param
      CHANGING  cv_param  = cv_param
      RECEIVING rv_result = lv_result ).

    cl_any_class=>get( )->any_method(
      IMPORTING
        ev_param  = ev_param
      CHANGING
        cv_param  = cv_param
      RECEIVING
        rv_result = DATA(lv_result2) ).
  ENDMETHOD.

Resulting code:

  METHOD omit_receiving.
    lv_result = any_method(
                  EXPORTING iv_param  = lv_param
                  IMPORTING ev_param  = ev_param
                  CHANGING  cv_param  = cv_param ).

    DATA(lv_result2) = cl_any_class=>get( )->any_method(
                         IMPORTING
                           ev_param  = ev_param
                         CHANGING
                           cv_param  = cv_param ).
  ENDMETHOD.

Related code