‎2006 Dec 22 10:46 AM
Hello experts!
What is the LCHR data type and when do we use it?
Regards,
Pavel
‎2006 Dec 22 10:50 AM
Hi pavel,
The data type LCHR should be used for character strings of arbitrary length, but with at least 256 characters.
Unlike binary data (LRAW), character data (LCHR) is converted automatically in heterogeneous environments, providing the database system used supports ASCII-EBCDIC or code page conversion in heterogeneous networks. Type LCHR is therefore suitable for long texts that are to be stored. Fields of type LCHR can occur in structures and tables. Fields of this type must be placed at the end in tables and have a preceding length field of the type INT2. When using INSERT or UPDATE in ABAP/4 programs, the preceding length field must be filled with the length actually required. LCHR fields cannot be used in WHERE conditions.
<b> Difference between LCHR and CHAR or between LRAW and RAW</b>
Fields of the type CHAR or RAW can have any length in structures. In tables, however, the maximum length is only 255. If longer character fields or raw fields are to be used in tables, then the data types LCHR or LRAW must be used.
‎2006 Dec 22 10:50 AM
Hi pavel,
The data type LCHR should be used for character strings of arbitrary length, but with at least 256 characters.
Unlike binary data (LRAW), character data (LCHR) is converted automatically in heterogeneous environments, providing the database system used supports ASCII-EBCDIC or code page conversion in heterogeneous networks. Type LCHR is therefore suitable for long texts that are to be stored. Fields of type LCHR can occur in structures and tables. Fields of this type must be placed at the end in tables and have a preceding length field of the type INT2. When using INSERT or UPDATE in ABAP/4 programs, the preceding length field must be filled with the length actually required. LCHR fields cannot be used in WHERE conditions.
<b> Difference between LCHR and CHAR or between LRAW and RAW</b>
Fields of the type CHAR or RAW can have any length in structures. In tables, however, the maximum length is only 255. If longer character fields or raw fields are to be used in tables, then the data types LCHR or LRAW must be used.
‎2006 Dec 22 11:03 AM