Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing Internal Data →  Character String and Byte String Processing →  Character and Byte String Processing - Overview 

Character Strings and Byte Strings

Other versions: 7.31 | 7.40 | 7.54

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.


Note

In obsolete non-Unicode programs, any flat structures and byte-like data objects can also be handled like character strings.

Byte Chains

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