Determining Field Properties
The class CL_ABAP_CHAR_UTILITIES provides attributes and methods that affect the properties of single characters. The components of this class are all static and public. The attributes are write-protected and are initialized in the class constructor method.
CHARSIZE TYPE I.
The CHARSIZE attribute declares the length of a C(1) field in bytes – that is, one byte in an NUS, and either two or four bytes in a US.
MINCHAR, MAXCHAR attributes
MINCHAR(1) TYPE C.
In an NUS, MINCHAR contains the Unicode character X’00’. In a US, it contains the Unicode character U+0000.
MINCHAR(1) TYPE C.
In an NUS, MAXCHAR contains the Unicode character X’FF’. In a US, it contains the Unicode character U+FFFD.
You can use these values only when performing binary comparisons in the following ABAP statements:
Bear in mind that the results of binary comparisons are platform-specific. For example, the character sequence in the ISO-8859-1 character set is 1 < A < Z < a < Ä < ü, whereas in EBCDIC it is Ä < a < A < ü < Z < 1.
You can use CLEAR feld WITH CL_ABAP_CHAR_UTILITIES=>MAXCHAR to fill a field with a value that is greater than or equal to all the strings. This also works in a multi-byte NUS.
MINCHAR and MAXCHAR are not usually valid characters in the current character set. In particular, you cannot useTRANSLATE f TO UPPER CASE in conjunction with these attributes, since the result would be undefined. The same constraint applies to all operations that implicitly convert characters to upper case – such as CS, NS, CP, NP or SEARCH. Moreover, you cannot perform character set conversions with the MINCHAR or MAXCHAR attribute.
In addition, MINCHAR may not always be displayed on screens as the number sign (#). In many cases, it is treated as the end of a text field.
Conversion classes, implemented with the file interface, are used to convert numeric data types and Unicode from little-endian to big-endian format and vice versa. The attributes described in this section are used to recognize and set byte order marks in X containers.
ENDIAN(1) TYPE C.
The value B indicates big-endian format, while L denotes little-endian, in either a US or an NUS (as in the class-based file interface).
BYTE_ORDER_MARK_LITTLE(2) TYPE X
BYTE_ORDER_MARK_BIG(2) TYPE X
BYTE_ORDER_MARK_UTF8(3) TYPE X
The values for these constants are X’FFFE’ for little-endian and X’FEFF’ for big-endian, in both Unicode and NUSs. BYTE_ORDER_MARK_UTF8 contains the UTF8 representation for U+FEFF.
The class-based file interface writes a byte order mark whenever a UTF16 or UCS2 text is opened to be written to. When a text file is opened to be read or appended, a byte order mark is used to specify the endian format. However, the byte order mark is not written to the target fields when the file is read.
NEWLINE, CR_LF and HORIZONTAL_TAB attributes
NEWLINE(1) TYPE C
CR_LF(2) TYPE C
These attributes contain the appropriate platform-specific control characters.