Professional Documents
Culture Documents
CONCATENATE - Combines 2 or More Strings Into One String
CONCATENATE - Combines 2 or More Strings Into One String
CONCATENATE - Combines 2 or More Strings Into One String
Output
If the the concatenated string fits in the result string, then the system variable sy-subrc is set to 0.
If the result has to be truncated then sy-subrc is set to 4.
SPLIT Splits a string into 2 or more smaller strings.
DATA: s1(10), s2(10), s3(10),
source(20) VALUE 'abc-def-ghi'.
SPLIT source AT '-' INTO s1 s2 s3.
WRITE:/ 'S1 - ', s1.
WRITE:/ 'S2 - ', s2.
WRITE:/ 'S3 - ', s3.
Output
If all target fields are long enough and no target fields has to be truncated then sy-subrc is set to
0, else set to 4.
SEARCH Searches for a sub string in main string. If found then sy-subrc is set to 0, else set to
4.
DATA: string(30) VALUE 'SAP ABAP Development',
str(10) VALUE 'ABAP'.
Output
REPLACE Replaces the sub string with another sub string specified, in the main string. If
replaced successfully then sy-subrc is set to 0, else set to 4.
DATA: string(30) VALUE 'SAP ABAP Development',
str(10) VALUE 'World'.
REPLACE 'Development' WITH str INTO string.
WRITE:/ string.
Output