ARTICLE
Character Strings and Byte Strings
Character Strings
Character-like data objects contain character strings. A character-like
data object either has a character-like data type ( c , d ,
n , t , or string ) or it is a
flat structure with exclusively
character-like components. The binary content of the characters of a
character string is determined by the current
environment code page .
In non-Unicode systems, one character occupies one byte in most code
pages; in double-byte code pages
, however, it can occupy two bytes.
In Unicode systems, ABAP supports the character format
UCS-2 and a character always occupies two
bytes. This ensures that all characters from the system code page
UTF-16 are handled correctly (except for
those in the surrogate area . These
characters occupy four bytes and hence are handled as two characters by
ABAP. This can produce unexpected results when cutting character strings
or comparing individual characters in character sets.
Outside of Unicode programs , it is
possible to handle any kind of flat
structure or byte-like data object as a character string.
Byte chains
Byte-like data objects contain byte strings. A byte-like data object
always has the byte-like data type x or xstring .
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved