Summary -
In this topic, we described about the below sections -
What is Data Element?
Data elements specifies the semantic information of table field. Data element gives the detailed information about fields.
Data element used to define the type of the field, structure or table row. Data element contains the information about editing the corresponding screen field and table field meaning or structure component.
The data element information is automatically available to all screen fields that refer to the data element. Data element defines either elementary type or reference type.
The elementary type is defined by built-in data type. The reference type is defined by using reference variables containing pointers to other objects or interfaces.
Below diagram explains the role of data element in the table definition -
Create Data Element -
Before creating a new data element, check if any existing data element have the same required specifications. If exists, then we must use the existing data element. If not exists, create a new element using the below steps -
Step-1: Go to SE11 transaction.
It opens "ABAP Dictionary: Initial Screen".
Step-2: Select "Data Type" radio button and enter the "Data Type" name. Click on "Create" button.
Next, the Create Type dialog box gets opened. Select "Data element" and click on "Continue" mark.
Next, the "Dictionary: Change Data Element screen" gets opened.
Step-3: Enter the "Short Description" and search the Domain details from the existing list. In this example, we are using the existing domain name "Z_CUST_GENDER".
Step-4: Once the domain selected, Open the "Field Label" tab to enter the Short, Medium, Long and Heading length and field labels.
Step-5: Next, open "Data Type" tab and press "(Ctrl + S)" to save the data element. System asks for the package. Enter existing package if any, or create new package.
Once the package information entered, click on "Local Object(If it is a local and non transportable object)" or "Save" icon to create the data element.
Step-6: Once the data element saved successfully, the "Z_CUST_GENDER saved" message displayed on status bar.
Step-7: Once the Data element successfully saved message displayed, click on Activate button or Ctrl +F3 to activate the data element.
If the data element activated successfully, the "Object activated" message displayed on status bar.
Data element now created and activated. If error messages or warnings occurred during the activation of the data element, the activation log gets displayed automatically. The same activation log can navigate through menu option Utilities(M) → Activation log.
Change Data Element -
If any information in the data element updated wrongly, Data element requires to be changed. Change data element option is used to change the data element properties and follow the below steps to change data element.
Step-1: Go to SE11 transaction.
It opens "ABAP Dictionary: Initial Screen".
Step-2: Enter the "Data Type" name and click on the "Change" button.
Step-3: Click on "Save" icon once the required information modified. Verify the below message gets displayed on status bar.
Step-4: Click on "Activate" button or "Ctrl +F3" to activate the new changes of the data element. Verify the below message gets displayed on status bar.
Delete Data Element -
If we want to delete the existing data element or a data element is wrongly created, follow the below steps to delete data element.
Step-1: Go to SE11 transaction.
It opens "ABAP Dictionary: Initial Screen".
Step-2: Enter the "Data Type" and click on the "Delete" icon.
Next, Delete data element popup gets opened for confirmation and click on "Yes" to delete the data element.
Once the data element successfully deleted, the below message displays on status bar.