Prefer String Templates over CONCATENATE
WarningClean ABAP & Modern SyntaxQuickFix Ready#EC PREF_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 PREF_STR_TMPL
" SAP CI_ prefix format:
... "#EC CI_PREF_STR_TMPLRelated Rules
- Prefer Built-in String Functions over SEARCH/SHIFT —
#EC PREF_STR_FUNC - Avoid Concatenating Adjacent String Literals —
#EC NO_USELESS_CONCAT - Avoid Obsolete String and POSIX Regex Statements —
#EC NO_OBS_STRINGS
Technical Details
- Native ATC Class:
ZCL_SKYLINT_PREF_STR_TMPL - Implementation File: zcl_skylint_pref_str_tmpl.clas.abap