SAP STRING PROCESSING STRINGS



Get Example source ABAP code based on a different SAP table
  



Character Strings and Byte Chains
ITOC

Character Strings
Character-like data objects contain character strings. A character-like data object either has a character-like data type c, n, or string, a date/time type d or t, or it is a flat structure with exclusively character-like components.
ABAP supports the character format UCS-2 and a character always occupies two bytes. This ensures that all characters of the system code page UTF-16 are handled correctly, except those in the surrogate area. These occupy four bytes and hence are handled as two characters by ABAP, which can produce unexpected results if character strings are truncated or individual characters are compared in character sets.

Byte Chains
Byte-like data objects contain byte chains (or byte sequences). A byte-like data object always has the byte-like data type x or xstring.



Latest notes:

When working with dynamic data objects of type string and xstring, their maximum size must not be exceeded. If an operation with a string exceeds its maximum size, an exception of class CX_SY_STRING_SIZE_TOO_LARGE occurs and can be handled.
When accessing substrings of strings, it should always be checked if the specified substring lies within the current length of the string.
NON_V5_HINTS
ABAP_HINT_END

ABAP_EXAMPLE_VX5
A byte string of type xstring contains a byte chain, which is decoded in accordance with codepage UTF-8 into a text in a text string of type string.
ABEXA 01305
ABAP_EXAMPLE_END