Summary -
In this topic, we described about the below sections -
What is Domain?
Specifies the technical characteristics of a table field. Domain assigned to a data element and defines a value range.
Any value of the table field that linked to a data element range also defines by a domain. Fields or components that assigned to a same domain gets changed if domain changed.
Domain ensures that the value ranges are data consistent. The domain value range is defined by specifying a data type and length. The domain value range can be restricted by defining fixed values.
Create Domain -
Before creating a new domain, check if any existing domain have the same required specifications. If exists, then we must use the existing domain. If not exists, create a new domain using the below steps -
Step-1: Go to SE11 transaction.
It opens "ABAP Dictionary: Initial Screen".
Step-2: Select the Domain radio button and enter the Domain name (For this example, it is Z_CUST_GENDER) and click on "Create" button. Domains under the customer namespaces always starts with 'Z' or 'Y'.
It opens "Dictionary: Change Domain Screen".
Step-3: Enter the Short Description, Data Type and No. characters. Short description, No. characters can be entered manually.
To get the list of Data Types, place the cursor in data type field and press F4. It opens the Data Type in ABAP Dictionary popup.
Double click on the desired data type to select and enter No. characters. For this example, the No. characters is 1.
Step-4: Open the tab "Value Range" if required to enter the fixed values or the lower/higher limits if the domain is a range. For this domain, we are entering fixed values and the description.
Step-5: Once range entered, open definition tab and press (Ctrl + S) to save the domain. It asks for the package. Enter existing package if you have any or create new package.
Once the package information entered, click on "Local Object" (non transportable object) to save the domain.
Step-6: Once the domain saved successfully, the "Z_CUST_GENDER saved" message displayed on status bar as shown below.
Step-7: Once the domain is saved successfully, click on Activate button or Ctrl +F3 to activate or create the domain.
If the domain activated successfully, the "Object activated" message displayed on status bar like below.
Domain now created and activated. If any error messages or warnings occurred during the activation of the domain, the activation log is displayed automatically. The same activation log can navigate through menu option Utilities(M) → Activation log.
Change Domain -
Domain needs to be modified if any information in the domain updated wrongly. Change Domain option is used to change the domain properties. Follow the below steps for change domain.
Step-1: Go to SE11 transaction.
It opens "ABAP Dictionary: Initial Screen" with a domain information in change mode.
Step-2: Enter the "Domain Name" and click on the "Change" button.
Step-3: Click on Save button once the required information modified.
Step-4: click on Activate button or Ctrl +F3 to activate the new changes of the domain.
Delete Domain -
If a domain is wrongly created and to delete the domain existing domain, follow the below steps to delete domain -
Step-1: Go to SE11 transaction.
It opens "ABAP Dictionary: Initial Screen".
Step-2: Enter the "Domain Name" and click on the "Delete" icon.
It displays a popup for confirmation, click on "Yes" to delete the domain.
Once the domain successfully deleted, the below message displays on status bar.