Skip to content

Files

Latest commit

 

History

History
63 lines (42 loc) · 2.31 KB

ExportingKeywordRule.md

File metadata and controls

63 lines (42 loc) · 2.31 KB

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

Omit optional EXPORTING

Removes the optional EXPORTING keyword from method calls that do not use any other keyword (IMPORTING, CHANGING, RECEIVING, or EXCEPTIONS).

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_optional_exporting.
    lo_any_object->any_method(
      EXPORTING iv_par1 = iv_par1
                iv_par2 = iv_par2 ).

    lv_value = get_value( EXPORTING iv_value1 = lv_value
                                    iv_value2 = 'abc'
                                    iv_value3 = get_inner_value( EXPORTING a = 5
                                                                           b = 7 ) ).

    " calls with other keywords such as IMPORTING and RECEIVING must NOT be changed:
    calculate( EXPORTING iv_value  = lv_value
               IMPORTING ev_result = lv_result ).
  ENDMETHOD.

Resulting code:

  METHOD omit_optional_exporting.
    lo_any_object->any_method(
        iv_par1 = iv_par1
        iv_par2 = iv_par2 ).

    lv_value = get_value( iv_value1 = lv_value
                          iv_value2 = 'abc'
                          iv_value3 = get_inner_value( a = 5
                                                       b = 7 ) ).

    " calls with other keywords such as IMPORTING and RECEIVING must NOT be changed:
    calculate( EXPORTING iv_value  = lv_value
               IMPORTING ev_result = lv_result ).
  ENDMETHOD.

Related code