Creating Data Elements
Procedure
In the initial screen of the ABAP Dictionary, select object type Data type, enter the data element name and choose
Create.
A dialog box appears.
Select the data element and choose
.
The maintenance screen for data elements appears.
Enter an explanatory short text in the field Short text.
The short text appears as title in the F1 help for all the screen fields referring to this data element.
On the Data type tab page, define the
data type, number of places and possibly the number of decimal places of the data element. You can define these attributes by specifying a domain or by direct type entry.
If the data element should have the type attributes of a domain, you only have to select Domain and enter the domain name in the corresponding field. You can also define a new domain and create it by navigating to the domain maintenance screen by double-clicking (see
Creating Domains).If you want to enter the type attributes directly, select Direct type entry. Entries are now possible in the fields Data type, Number of places and Decimal places.
If the data element should describe a
reference type, choose Reference type and then Referenced type. Enter the name of the referenced type. This can be the name of a class or of an interface, a generic reference to ANY, OBJECT or DATA or a reference to a type defined in the Dictionary. If you want the reference type to be a predefined Dictionary type, select Reference to a predefined type. Enter the type, the number of places and possibly the decimal places.On the
Field label tab page you can maintain text information (short, medium, and long field labels and the title) for the data element.
You can use this text information in input templates to represent fields that refer to this data element.
Save the data element.
You are asked to assign the data element a development class.
Choose
.
Result
The data element is activated. You can find information about the activation flow in the activation log, which you can display with Utilities
®
Activation log. If errors occurred when activating the data element, the activation log is automatically displayed.
Other Options
Create documentation: With Documentation, create a text that describes the contents of the data element. This text is displayed for the F1 help in all screen fields that refer to this data element. You should therefore only leave out this step if the data element does not appear on a screen. In this case you should set the
documentation status appropriately.
Assign a search help: You can assign the data element a
search help. This search help is offered on all the screen fields referring to this data element when the input help (F4 help) is called (see
Attaching Search Helps to Data Elements). To assign the search help, you must specify its Name in the data element maintenance screen and an export parameter of the search help in the Parameter field.
Assign a parameter ID: A field can be filled with default values from SAP memory using a parameter ID. A screen field is only filled automatically with the value stored under the parameter ID of the data element if this was explicitly permitted in the Screen Painter.
![Example](../../images/beispiel.gif)
For example, if a user only has authorization for company code 001, this company code can be stored in memory under the corresponding parameter ID at the beginning of a transaction. Fields referring to the data element for the company code are then automatically filled with the value 001 in all subsequent screen templates. In this case, the corresponding parameter ID must be only entered in the data element for the company code.
- Assign a default component name:
You can store a proposal for the name of the table fields or structure components that refer to a data element. If possible, use an English-language default name. Always use this default name for components in BAPI structures (structures with a fixed interface). This results in a more unified assignment of field and component names.
- Mark data element as relevant for change documents:
The data of a business-oriented object is often distributed on several tables. To be able to trace changes to this business object, these tables can be combined in a Change document object. Function modules that can be integrated in the corresponding application programs and that log the changes are generated from such a change document object. Changed field contents are only logged if the Change document flag is set for the data element of the field.