SAP BUILTIN TYPES CHARACTER



Get Example source ABAP code based on a different SAP table
  


• c ABAP_TYPE
• n ABAP_TYPE
• string ABAP_TYPE

Built-In Character-Like Types
The data objects of the character-like data types are used to store character strings.

Properties TypeLengthStandard LengthMeaning Data Object ABAP_KEY c1 to 262,143 characters1 character Text field type Text field ABAP_KEY n1 to 262,143 characters1 character Numeric text field type Numeric text field ABAP_KEY stringVariable Text string type Text string

Value Ranges and Initial Values TypeValue RangeInitial Value cAny Unicode characters that can be encoded in UCS-2.Blank for every position nAny Unicode characters that can be encoded in UCS-2; valid characters are only the digits 0 to 90 for every position stringAs for type cEmpty string with length 0



Latest notes:

The character-like data types are mainly used for string processing.
For more about strings, see Strings.
The data types c and string are general character-like data types, whereas n has special properties. The data type n matches the special type NUMC in ABAP Dictionary.
Further character-like data types with special properties are the built-in date types and time types that match the corresponding types DATS and TIMS of the ABAP Dictionary. All other special character-like data types in ABAP Dictionary are assigned to the general ABAP types listed here.
The content of the data objects of character-like data types is stored in the memory according to the current system code page.
When specifying lengths for character-like types, note that the length of a character in bytes depends on the character representation used. For the character representation UCS-2 used by the ABAP programming language, the length of a character is two bytes.
The types c and n, for which a length interval is specified in the second column of the first table, are generic, which means that the length is not part of the type description. The entries in the column Standard Length specify the length that is used in declarations of data objects when using types with generic lengths, if no explicit length is specified in the corresponding statement.
The system class CL_ABAP_ELEMDESCR contains the constants TYPE_C_MAX_LENGTH and TYPE_N_MAX_LENGTH for the maximum length of the types c and n.
The valid values of the data type n are a subset of its value range. ABAP statements that work with data objects of this type are only guaranteed to function correctly for operands with valid values.
The maximum size of strings must be respected. If an operation with a string exceeds its maximum size, an exception of class CX_SY_STRING_SIZE_TOO_LARGE is raised and can be handled.
NON_V5_HINTS
ABAP_HINT_END

ABAP_EXAMPLE_VX5
Declaration of character-like data objects with built-in character-like data types. The flag flag is limited to one character and the set of characters in the string html is variable.
ABEXA 00838
ABAP_EXAMPLE_END