Omit RECEIVING in Method Invocations
WarningAnti-Patterns & Bad PracticesQuickFix Ready#EC NO_CALL_RECEIVINGRemote Enabled
Overview
Omit RECEIVING in Method Invocations.
ATC Finding Message:
Omit RECEIVING keyword; use functional call or omit parameter
Rationale
The RECEIVING clause in a method call is legacy syntax that forces a functional call into a statement format. In modern ABAP, capture the return value directly on the left-hand side of an assignment (e.g. result = obj->meth( )) to enable clean nesting and expression-oriented programming.
Non-Compliant
abap
lo_order->calculate_total( RECEIVING rv_total = lv_total ).Compliant
abap
lv_total = lo_order->calculate_total( ).Automated QuickFix
This rule provides an automated QuickFix directly in Eclipse ABAP Development Tools (ADT):
- Position the cursor on the flagged statement.
- Press Ctrl + 1 (Quick Assist).
- Select the automated refactoring to apply the clean syntax immediately.
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC NO_CALL_RECEIVING
" SAP CI_ prefix format:
... "#EC CI_NO_CALL_RECEIVINGRelated Rules
- Avoid Obsolete CALL METHOD —
#EC NO_CALL_METHOD - Omit Redundant EXPORTING in Method Calls —
#EC NO_CALL_EXPORTING - Prefer Functional RETURNING Parameters —
#EC PREF_RETURNING
Technical Details
- Native ATC Class:
ZCL_SKYLINT_NO_CALL_RECEIVING - Implementation File: zcl_skylint_no_call_receiving.clas.abap