Prefer INSERT ... INTO TABLE over APPEND
WarningClean ABAP & Modern SyntaxQuickFix Ready#EC INSERT_INTORemote Enabled
Overview
Prefer INSERT ... INTO TABLE over APPEND for table safety.
ATC Finding Message:
Prefer INSERT ... INTO TABLE over APPEND
Rationale
APPEND only works for index tables and implies sequential insertion, so changing the table type to sorted or hashed later breaks the code. INSERT ... INTO TABLE works with every table category and states the intent generically. Use INSERT for table handling that should remain independent of the concrete table kind.
Non-Compliant
abap
APPEND ls_order_item TO lt_order_items.Compliant
abap
INSERT ls_order_item INTO TABLE lt_order_items.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 INSERT_INTO
" SAP CI_ prefix format:
... "#EC CI_INSERT_INTOTechnical Details
- Native ATC Class:
ZCL_SKYLINT_PREF_INSERT - Implementation File: zcl_skylint_pref_insert.clas.abap