Skip to content

Avoid String Templates Without Embedded Expressions ​

WarningClean ABAP & Modern Syntax#EC NO_RAW_STR_TMPLRemote Enabled

Overview ​

Avoid string templates without embedded expressions.

ATC Finding Message: String template has no embedded expressions { }; use string literal or backticks

Rationale ​

Using string templates (|...|) without any embedded expressions { ... } creates unnecessary string template runtime evaluation overhead and clutters code readability. If a string has no dynamic variables or formatting expressions, a standard single-quote literal ('...') or backtick literal (`...`) should be used instead.

Best Practice: Only use |...| when interpolating expressions or formatting parameters.

Non-Compliant ​

abap
" Anti-pattern: String template with no dynamic expressions
DATA(lv_text) = |Hello World|.
DATA(lv_empty) = ||.

Compliant ​

abap
" Clean ABAP: Standard text literal or string backtick
DATA(lv_text) = 'Hello World'.
DATA(lv_str) = `Hello World`.

Configuration & Thresholds ​

This check can be fine-tuned directly in the ATC Check Variant Editor (CHKV) in Eclipse ADT:

Parameter NameData TypeDefault ValueDescription & Guidance
CHECK_EMPTY_TEMPLATEBooleantrueFlag empty string templates (||)
CHECK_STATIC_TEMPLATEBooleantrueFlag static string templates without expressions (|text|)

Suppression ​

To suppress findings for this rule, append the pseudo-comment to the statement:

abap
" Standard pseudo-comment:
... "#EC NO_RAW_STR_TMPL

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

Technical Details ​

Released under the MIT License.