Avoid Obsolete CALL METHOD
WarningAnti-Patterns & Bad PracticesQuickFix Ready#EC CALL_METHRemote Enabled
Overview
Avoid static CALL METHOD statements.
ATC Finding Message:
Avoid static CALL METHOD; use functional method call instead
Rationale
CALL METHOD is the procedural call syntax from early ABAP Objects and needs explicit EXPORTING and RECEIVING sections. Functional syntax is shorter, can be used inside expressions, and removes visual clutter around parameter lists. Use ref->method( ) or class=>method( ) for all method calls.
Non-Compliant
abap
CALL METHOD lo_service->calculate_tax
EXPORTING
iv_amount = lv_amount
RECEIVING
rv_tax = lv_tax.Compliant
abap
lv_tax = lo_service->calculate_tax( lv_amount ).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 CALL_METH
" SAP CI_ prefix format:
... "#EC CI_CALL_METHTechnical Details
- Native ATC Class:
ZCL_SKYLINT_NO_CALL_METHOD - Implementation File: zcl_skylint_no_call_method.clas.abap