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 - Character String Operator
One string operator is currently available for string expressions.
Other versions: 7.31 | 7.40 | 7.54
Syntax
... operand1 && operand2 ...
Effect
The chaining operator &&
concatenates two operands in a string expression as a character string.
The operand positions operand
are
character-like expression positions, which means that
character-like data objects,
string expressions, and
predefined functions, or
functional methods and
method chainings whose return code has a
character-like data type, can be specified. In particular, this means that you can also specify
string templates.
In operands with a fixed length, trailing blanks are ignored.
Notes
- We recommend string functions with character-like return codes when you specify predefined functions as operands.
- Do not confuse the chaining operator
&&
with the literal operator&
, which concatenates two character literals as a literal. The literal operator is generally used if you want to define a literal string template across multiple program lines. The operator is executed only once, when the program is compiled and trailing blanks of character literals are always respected. A character string expression with a chaining operator, on the other hand, is recalculated each time (like all expressions) and can be used to concatenate any number of character-like operands.
Example
Concatenation of four operands as the character string "Hello world!". The last operand is a string template that has only literal content.
DATA text TYPE string VALUE `Hello`.
text = text && ` ` && 'world' && |!|.