Predefined Character-Like Types
The data objects of the character-like data types are used to handle character strings.
||1 to 262,143 characters||1 character||Text Field|
||1 to 262,143 characters||1 character||Numeric text field|
Value Ranges and Initial Values
|Type||Value Range||Initial Value|
||Any alphanumeric characters||" " for every position|
||Any alphanumeric characters; only valid values are the digits 0 to 9, however||"0" for every position|
||As for type
||Empty string with length 0|
- The character-like data types are mainly used for string processing.
- The data types
stringare general character-like data types, but
n, on the other hand, has special properties. The data type
ncorresponds to 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 in 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 saved in the memory in accordance with 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. The length of a character is two bytes for the character representation UCS-2 used by the ABAP programming language.
- The types
n, for which a length interval is specified in the second column in the first table, are generic, which means that the length is not part of the type description. The entries in the Standard Length column specify the length used in declarations of data objects when using types with generic lengths, if no explicit length is specified in the relevant statement.
- The system class CL_ABAP_ELEMDESCR contains constants TYPE_C_MAX_LENGTH
and TYPE_N_MAX_LENGTH for the maximum length of the types
- The valid values of the data type
nare 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.
Declares character-like data objects with built-in character-like data types. The flag
is limited to one character and the set of characters in the string
html is variable.
DATA: flag TYPE c LENGTH 1, html TYPE string.