While creating a table in data dictionary each table field is assigned to a data element. Each data element is in turn assigned to a domain.
- Domain describes the technical attributes such as data type and length of a table field.
- Data Element gives the field labels and documentation for the table field.
Consider the following code. PARAMETERS is the keyword to create input fields.
PARAMETERS: p_matnr TYPE matnr.
In order to get the field labels use the menu in the ABAP editor GOTO->Text Elements->Selection Texts.
All the input fields will be displayed in a table.
Just check the Dictionary Ref checkbox and press enter.
The Text ( Field Label ) will be automatically read from the Data Element. Now save, activate, go back and run the program again.
Now place the cursor on the input field and press F1 key to get the documentation from the data element.
Actually this field label and documentation are maintained in the Data Element MATNR.
So if we want to create a table with two fields as “FirstName” and “SecondName”, then only one domain is sufficient with data type as “CHAR” and length say 20. But we need two different data elements in order to display different field labels and documentation for both the fields.