CONCATENATE (ABAP Keyword) introduction & details
CONCATENATE
Basic
form
CONCATENATE f1 ... fn INTO g.
Addition
... SEPARATED
BY h
Effect
Places the fields f1 to fn after g .
With the
fields fi (1 <= i <= n), trailing blanks are ignored, i.e. these fields
are considered only to have the length STRLEN ( fi ).
The return code
value is set as follows:
SY-SUBRC = 0 The result fits in g
.
SY_SUBRC = 4 The result was too long for g and was only copied to g in that
length.
Example
DATA: ONE(10) VALUE 'John',
TWO(3) VALUE '
F.',
THREE(10) VALUE ' Kennedy',
NAME(20).
CONCATENATE ONE TWO THREE
INTO NAME.
Then, NAME contains the value " John F. Kennedy
".
Addition
... SEPARATED BY h
Effect
Inserts the separator
h between the fields fi .
Here, h is used in its defined
length.
Examples
DATA: ONE(10) VALUE 'John',
TWO(3) VALUE
'F.',
THREE(10) VALUE 'Kennedy',
NAME(20).
CONCATENATE ONE TWO THREE
INTO NAME SEPARATED BY SPACE.
Then, NAME has the value " John F.
Kennedy ".
DATA SEPARATOR(4) VALUE 'USA'.
CONCATENATE SPACE ONE
TWO THREE INTO NAME
SEPARATED BY SEPARATOR.
Then, NAME has the
value " USA JohnUSA F.USA Ke ".
The return value of SY-SUBRC is set to
4.
Related
SPLIT, SHIFT, REPLACE, TRANSLATE,
CONDENSE
Note
Performance
You are recommended to use the key
word CONCATENATE rather than your own constructions because it is safer, more
efficient and clearer. The runtime required to append two 30-byte fields amounts
to approx. 14 msn (standardized microseconds).
Related 10 ABAP Syntax Tutorials
Most readed SAP Tutorials
- WRITE - Output to a list ( SAP ABAP Keyword)
WRITE ( Output to a list ) is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. - List of SAP HR TABLES and Infotypes tables
Detailed full list of tables and infotypes used in SAP HR module. - List of SAP MM Transaction codes
This documentation covers the details of SAP MM Transaction codes - SELECT-OPTIONS ( SAP ABAP Keyword)
SELECT-OPTIONS is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. - FI Accounts Receivable and Accounts Payable | SAP FI PDF manual
The following topics are an introduction to the Accounts Receivable and Accounts Payable application components. - SAP MM Process Flow
The typical procurement cycle for a service or material consists of the following phases: - SELECT clause ( SAP ABAP Keyword)
SELECT clause is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details.
Latest Added SAP documents
- 9KE9 Transaction code
Details about SAP transaction code 9KE9 - 9KE8 Transaction code
Details about SAP transaction code 9KE8 - 9KE7 Transaction code
Details about SAP transaction code 9KE7 - 9KE6 Transaction code
Details about SAP transaction code 9KE6 - 9KE5 Transaction code
Details about SAP transaction code 9KE5 - 9KE4 Transaction code
Details about SAP transaction code 9KE4 - 9KE3 Transaction code
Details about SAP transaction code 9KE3 - 9KE2 Transaction code
Details about SAP transaction code 9KE2 - 9KE1 Transaction code
Details about SAP transaction code 9KE1 - 9KE0 Transaction code
Details about SAP transaction code 9KE0