There are 3 types of Data Types:
- Data element
- Structure
- Table type
Data elements are used to be built tables with content. Structures are help structures with single data lines that can be used in ABAP programs. Table types are help tables with multiple lines that can be used in ABAP programs. Only tables store data in the database. Structures and table types not.
Date elements and types are mainly based on domains and are the building blocks for tables.
Creation of Data element
Start transaction SE11. Select Data type and enter the name of the data element you want to create:
On the next screen select Data element:
On the main screen enter the description:
For the types that the data element will use, you can choose from pointing it to a domain, or to a built in type. The data element will take over the characteristics from the domain or built in type.
The 3rd tab is for further characteristics:
Here a data element can be linked to a Search Help, a parameter ID can be set and the data element can be marked for functional Change Documents.
By default the SAP GUI will remember the user input. This normally helps the end user. If you select the No Input History tick box the GUI will not store the input history for those fields using this data element.
In the last tab, you set the field labels for the data element:
There are 3 labels with different length and a heading description.
Save the data element, check it and activate it.
Creation of a Structure
To create a Structure, start transaction SE11 and select Data type, enter your structure name and press create. In the popup screen now select Structure:
In the next screen give the Structure a name and fill out the fields of the structure:
The build up of the Structure is similar to building a table. Differences: structures are used in ABAP as helper structures and don’t store data in the database. Therefore also as structure will not have key fields as well.
For components you can use both your custom created data elements as well as standard SAP data elements. You can use the button “Built-In Type” to switch the entry to direct types.
If you are done, Save the Structure, check and activate it.
Creation of a Table Type
To create a Table Type, start transaction SE11 and select Data type, enter your structure name and press create. In the popup screen now select Table Type:
Enter the description of the table type:
The most used option is to refer the Table Type to a Structure.
In the initialization the table access can be set differently from Standard. In the Primary Key tab, you can define the keys for the table if wanted.
Re-use and transparency considerations
Both structures and table types can also be defined locally in ABAP programs. If a second program needs similar or the same structures and table types, it does already make sense to define these elements in SE11 data types. This will stimulate re-use and consistency. Also the where-used options of the data dictionary can be used to quickly find the uses of the data types.