Skip to content

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):

  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 STR_TMPL

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

Technical Details ​

Released under the MIT License.