Background documentation  Data Types in the ABAP Dictionary Locate the document in its SAP Library structure

The data type in the ABAP Dictionary is the user’s view on the data, that is, the data format at the user interface. This data format depends on the database system used. When a table is defined in the ABAP Dictionary, the data types defined in the ABAP Dictionary are copied to the data types of the database system used.

If an ABAP Dictionary object (data element, structure, table type, table, view) is used in an ABAP program, the Dictionary data types of the object fields are converted to the corresponding ABAP data types.

This graphic is explained in the accompanying text

Note that some data types have a predefined length and set templates for output.

Existing Data Types

ACCP: Posting period. The length is set to 6 places for this data type. The format is YYYYMM. In input and output, a point is inserted between the year and month, so the template of this data type has the form ‘____.__’.

CHAR: Character string. Fields of type CHAR may have a maximum length of only 255 in tables. If longer character fields are to be used in tables, you must choose data type LCHR. There are no restrictions on the length of such fields in structures.

CLNT: Client. Client fields always have three places.

CUKY: Currency key. Fields of this type are referenced by fields of type CURR. The length is set to 5 places for this data type.

CURR: Currency field. Equivalent to an amount field DEC. A field of this type must refer to a field of type CUKY (reference field). The maximum length for this data type is 31 places.

DATS: Date. The length is set to 8 places for this data type. The output template can be defined with the user profile.

DEC: Counter or amount field with decimal point, sign, and commas separating thousands. A DEC field has a maximum length of 31 places.

FLTP: Floating point number. The length (including decimal places) is set to 16 places for this data type.

INT1: 1-byte integer between 0 and 255. The length is set to 3 places for this data type.

INT2: 2-byte integer between -32767 and 32767. Fields of this type should only be used for length fields. These long fields are positioned immediately in front of a long field (type LCHR, LRAW). With INSERT or UPDATE on the long field, the database interface enters the length which was actually used in the length field. The length is set to 5 places for this data type.

INT4: 4-byte integer between -2147483647 bis 2147483647. The length is set to 10 places for this data type.

LANG: Language key. Has its own field format for special functions. This data type always has length 1. The language key is displayed at the user interface with 2 places, but is only stored with 1 place in the database. The conversion exit ISOLA converts the display at the user interface for the database and vice versa. This conversion exit is automatically allocated to a domain with data type LANG at activation.

LCHR: Character string of any length, but has to be declared with a minimum of 256 characters. Fields of this type must be located at the end of transparent tables (in each table there can be only one such field) and must be preceded by a length field of type INT2. If there is an INSERT or UPDATE in ABAP programs, this length field must be filled with the length actually required. If the length field is not filled correctly, this may lead to a data loss in the LCHR field! A fields of this type cannot be used in the WHERE condition of a SELECT statement.

LRAW: Uninterpreted byte string of any length, but has to be declared with a minimum length of 256. Fields of this type must be located at the end of transparent tables (in each table there can be only one such field) and must be preceded by a length field of type INT2. If there is an INSERT or UPDATE in ABAP programs, this length field must be filled with the length actually required. If the length field is not filled correctly, this may lead to a data loss in the LRAW field! A fields of this type cannot be used in the WHERE condition of a SELECT statement.

NUMC: Long character field in which only numbers can be entered. The length of this field is limited to a maximum of 255 places.

PREC: Accuracy of a QUAN field. The length is set to 2 places for this data type.

QUAN: Quantity. Equivalent to an amount field DEC. A field of this type must always refer to a units field with UNIT format (reference field). The maximum length for this data type is 31 places.

RAW: Uninterpreted byte string. Fields of type RAW may have only a maximum length of 255 in tables. If longer raw fields are required in tables, you should select data type LRAW.

RAWSTRING: Uninterpreted byte string of variable length. In the Dictionary a length can be specified for this type (at least 256 characters). This data type can only be used in types (data elements, structures, table types) and domains. You can store binary data of type RAWSTRING in the database. However, there are restrictions; for a description of them, refer to the documentation of the ABAP statement 'STRING'. In ABAP, this type is implemented as a reference to a storage area of variable size. As default for the output length 132 characters are proposed. You cannot attach search helps to components of this type.

STRING: Character string with variable length This data type can only be used in types (data elements, structures, table types) and domains. In the Dictionary a length can be specified for this type (at least 256 characters). It may be used in database tables, however, only with restrictions. For a description of them refer to the documentation of the ABAP statement 'STRING' . In ABAP, this type is implemented as a reference to a storage area of variable size. As default for the output length 132 characters are proposed. You cannot attach search helps to components of this type.

SSTRING: Short character string with variable length. In the Dictionary the number of characters can be specified for this type (1-255). This data type can only be used in types (data elements, structures, table types) and domains. It may be used in database tables; however, to do so refer to the documentation of the ABAP statement 'STRING' . In ABAP, this type is implemented as a reference to a storage area of variable size. String fields of this type can be used in indexes and in the WHERE condition of a SELECT statement. You cannot use them in table keys.

TIMS: Time. The length is set to 6 places for this data type. The format is hhmmss. The template for input and output has the form ‘__.__.__’.

UNIT: Unit. Fields of this type are referenced by fields of type QUAN. The length of this data type is set to 2 or 3 places.

VARC: Character field of variable length. Creation of new fields of this data type is not supported as of Release 3.0. However, existing fields with this data type can still be used. A fields of this type cannot be used in the WHERE condition of a SELECT statement.

Note

When using the numeric data types CURR, DEC, FLPT, INT2, INT4 and QUAN, you can choose whether or not a sign should be output on screens.

With the data types CURR, DEC and QUAN, commas separating thousands and decimal points are set by the system. The output length (number of places plus the number of necessary editing characters such as commas separating thousands and decimal points) is therefore greater than the specified length.

The system omits editing characters if the output length specified in the domain maintenance is too small.

See also:

Mapping of the ABAP Data Types

 

 

Leaving content frame