Concatenation of String in SAP ABAP
Concatenation of strings in SAP ABAP involves combining multiple strings into a single string. The CONCATENATE statement is commonly used for this purpose.
Example 1:
DATA(s1) TYPE string VALUE 'HELLO',
(s2) TYPE string VALUE 'WORLD' ,
(s3) TYPE string .
CONCATENATE s1 s2 INTO s3.
Output:
HELLOWORLD
In this example, s3 will hold the value “HELLO WORLD“
Example 2:
DATA: s1(10) VALUE 'John',
s2(10) VALUE 'USA',
s3(10) VALUE 30,
s4(30)
CONCATENATE s1 s2 s3 INTO s4
WRITE: / 'Full Information:', s4.
Output:
JohnUSA30
In this example, s4 will contain a string with concatenated information about a person, including their name, country, and age.
SAP ABAP | Mastering String Manipulation
String manipulation is a fundamental skill in SAP ABAP programming language, and it’s crucial for dealing with various types of data processing, text formatting, and building dynamic content. This article aims to guide you through mastering string manipulation in SAP ABAP, providing insights, best practices, and code examples.
Table of Content
- Introduction to String Manipulation in SAP ABAP
- Basic String Operations in SAP ABAP
- 1. Concatenation of String in SAP ABAP:
- 2. Substrings of String in SAP ABAP:
- 3. Searching and Replacing of String in SAP ABAP:
- 4. Formatting Strings of String in SAP ABAP
- 5. Advanced Operations of String in SAP ABAP
- Conclusion