Show TOC

 Data ElementsLocate this document in the navigation structure

Use

You use data elements to define the type of a table field, structure component or the row type of a table type. A data element can also be referenced in ABAP programs with TYPE. As a result, you can define in an ABAP program variables that take on the attributes of a data element.

Features

A data element describes either an elementary type or a reference type.

An elementary type is defined by the built-in data type, length and the number of decimal places. These type attributes can either be defined directly in the data element or copied from a domain .

A reference type defines the types of reference variables in ABAP programs.

You can assign to a data element information about the meaning of a table field or structure component and information about editing the corresponding screen field. This information is automatically available to all screen fields that refer to the data element. This information includes the display of the field in input templates using key word text, column headers for list output of the table contents (see Field Labels ), and output editing using parameter IDs.

This is also true for online field documentation. The text appearing in the field help (F1 help) in a field of an input template comes from the corresponding data element. For more information, see Documentation and Documentation Status .

Example

The field CONNID (flight class) of table SBOOK refers to the S_CONN_ID data element. This data element gets its technical attributes (data type NUMC, field length 4) from domain S_CONN_ID. Data element S_CONN_ID describes the technical attributes and meaning (with an assigned long text and an explanatory short text) of field CONNID (and all other fields that refer to this data element).

A variable with the type of data element S_CONN_ID can be defined in an ABAP program with the statement:

DATA CONNID TYPE S_CONN_ID

To get a clearer idea about this example, see the figure below.

See also:

Creating Data Elements