ABAP Keyword Documentation → ABAP − Reference → Processing Internal Data → Character String and Byte String Processing → Expressions and Functions for String Processing → string_exp - String Expressions → string_exp - String Templates
String Templates - literal_text
Other versions: 7.31 | 7.40 | 7.54
Syntax
c...c
Effect
Within a string template |...|, a literal text c...c
represents its exact character string. Literal text consists of all characters in c that
- are not enclosed in curly brackets
{ }
- are not control characters
- are not the special characters
|,{,}, or\.
Blanks in string templates in particular are always significant. To display a special character
|, {, }, or \ as a literal character, it can be prefixed with the escape character \.
Note
A standalone string template that contains nothing but literal text is not evaluated as an expression until runtime, even if it is not part of an expression. For such operands, a text string literal with backquotes should be used instead, for performance reasons.
Example
The following string template creates the character string shown below it.
DATA(txt) =
|Characters \|, \{, and \} have to be escaped by \\ in literal text.|.