SAP Function STRING_CONCATENATE - Concatenates (links) two strings without multibyte handling

Parameter Reference Type Length Default Optional Text
STRING1 0 First String
STRING2 0 Second String

Parameter Reference Type Length Text
STRING 0 Concatenated String

Exception Text
TOO_SMALL Output field too short


Functionality
The function module puts two character strings together in onecharacter string. Blanks at the end of the first string are truncated,unless they are of the type STRING. Blanks at the beginning ofthe second character string are included. The behavior is the same aswith the ABAP command CONCATENATE .. INCHARACTER MODE. There are, however, some differences to theCONCATENATE command:
The parameter STRING must not be of the type STRING, butrather of the type C.
If the result is longer than the parameter STRING permits, theexception TOO_SMALL is thrown and the parameter STRINGremains unchanged.
If the system code page is a multibyte code page (for example, Chinese,Japanese, Korean), the CONCATENATE command checks whether theparameters STRING1 and STRING2 end with the first byte ofa double-byte character. If this is the case, this byte is replaced bya blank. In contrast to this, the function module always links theparameters STRING1 and STRING2 without performing a checkor making changes.
Examples:
STRING1 = 'abcde ' (4 blanks at the end)
STRING2 = 'fgh ' (0 blanks at the beginning)
STRING = 'abcdefgh ' (0 blanks in the middle)
STRING1 = 'abcde' (0 blanks at the end)
STRING2 = ' fgh ' (3 blanks at the beginning)
STRING = 'abcde fgh ' (3 blanks in the middle)
Sample call:
DATA: CONCATSTRING(20).
CALL FUNCTION 'STRING_CONCATENATE'
EXPORTING STRING1 = 'abcdefghij'
STRING2 = 'klmnopqrst'
IMPORTING STRING = CONCATSTRING
EXCEPTIONS TOO_SMALL = 1.
IF SY-SUBRC = 0.
* the composite character string is in STRING
ELSE.
* STRING too short
ENDIF.