Prefer String Templates over CONCATENATE
WarningClean ABAP & Modern SyntaxQuickFix Ready#EC STR_TMPLRemote Enabled
Overview
Prefer string templates over CONCATENATE.
ATC Finding Message:
Use string template |...| instead of CONCATENATE
Rationale
CONCATENATE with SEPARATED BY is a procedural statement that splits a message into literals and variables and cannot be nested in expressions. String templates interpolate values directly, preserve spaces, and support formatting options for numbers, dates, and alignment. Use a template for readable text composition and reserve CONCATENATE only for legacy downport code.
Non-Compliant
abap
CONCATENATE 'Order' lv_order_id 'created' INTO lv_message SEPARATED BY space.Compliant
abap
lv_message = |Order { lv_order_id } created|.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 STR_TMPL
" SAP CI_ prefix format:
... "#EC CI_STR_TMPLTechnical Details
- Native ATC Class:
ZCL_SKYLINT_PREF_STR_TMPL - Implementation File: zcl_skylint_pref_str_tmpl.clas.abap