<-- previous rule | overview | next rule -->
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.
- Clean ABAP Styleguide: Omit the optional keyword EXPORTING
- Code Pal for ABAP: Omit Optional EXPORTING
- (no options available for this rule)
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.