ABAP Keyword Documentation → ABAP − Reference → Processing Internal Data → Character String and Byte String Processing → Expressions and Functions for String Processing → String Functions → Processing Functions for Character-Like Arguments
concat_lines_of - Concatenation Function
Other versions: 7.31 | 7.40 | 7.54
Syntax
... concat_lines_of( [table =] itab [sep = sep] ) ...
Effect
This function concatenates all row contents of an internal table itab and returns the result as a character string. itab expects an
index table with character-like row type. itab is a
functional operand position.
sep can be used to specify a string as a separator, which is then inserted between the rows. sep is a
character-like expression
position. If sep is not specified, the row contents of the internal table
are appended to each other directly. If the row types or the argument sep have a fixed length, trailing blanks are ignored.
The formal parameter table must be specified explicitly only if sep is also specified.
The return code has the type string.
Note
The concatenation operator && can be used to concatenate elementary character strings.
Example
This function returns "ABAP Objects".
TYPES: c80 TYPE c LENGTH 80,
itab TYPE TABLE OF c80 WITH EMPTY KEY.
DATA(itab) = VALUE itab( ( 'ABAP' ) ( 'Objects' ) ).
cl_demo_output=>display(
concat_lines_of( table = itab sep = ` ` ) ).