Skip to content

Prefer CORRESPONDING #( ) Operator ​

WarningClean ABAP & Modern SyntaxQuickFix Ready#EC CORRESPRemote Enabled

Overview ​

Prefer CORRESPONDING Expression over MOVE-CORRESPONDING.

ATC Finding Message: Prefer functional CORRESPONDING #( ... ) over MOVE-CORRESPONDING

Rationale ​

MOVE-CORRESPONDING is a procedural statement that copies same-named fields implicitly and cannot be nested in expressions. CORRESPONDING #( ) is expression-capable and supports EXCEPT, MAPPING, and DISCARDING to control the mapping explicitly. Use it to make structure transfers visible and type-safe.

Non-Compliant ​

abap
MOVE-CORRESPONDING ls_customer_api TO ls_customer_db.

Compliant ​

abap
ls_customer_db = CORRESPONDING #( ls_customer_api ).

Automated QuickFix ​

This rule provides an automated QuickFix directly in Eclipse ABAP Development Tools (ADT):

  1. Position the cursor on the flagged statement.
  2. Press Ctrl + 1 (Quick Assist).
  3. 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 CORRESP

" SAP CI_ prefix format:
... "#EC CI_CORRESP

Technical Details ​

Released under the MIT License.