Fonction SAP TRUNCATE_MULTIPLE_BYTE_STRING - Multiple byte string: Position where to truncate

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
STRING C C 0 String to be truncated
TARGET_LENGTH I I 4 Desired length of STRING

Paramètre Reférence Type Long. Description
USE_LENGTH I I 4 Position where to truncate STRING

Functionality
The function module determines the position where a string consistingof multiple byte characters can be truncated without cutting onecharacter in the middle.
The string and the desired length of the string is handed over to thefunction module. The function module returns the position where thestring can be cut.

Example
Assume that a pair of two adjacent identical characters represent onedouble byte character (for example 'AA' is repreenting one double bytecharacter).
DATA: USE_LENGTH TYPE I.
CALL FUNCTION 'TRUNCATE_MULTIPLE_BYTE_STRING'
EXPORTING
STRING = 'AABBCCDDEE'
TARGET_LENGTH = 7
IMPORTING
USE_LENGTH = USE_LENGTH.
After this function call, USE_LENGTH has value 6.

Notes
It is assumed that the function module is running in proper languageenvironment (locale language).