ABAP training: Data Dictionary: Domains

In the SAP data dictionary the lowest level re-usable element is the Domain. The Domain is used to build a Data Element in a database table.

Create a domain

To create a domain start transaction SE11, and choose the option Domain, enter your name and press Create:

In the next screen give the Domain a proper name and set the Date Type:

In this case we have chosen for a CHAR data type with length 50:

Note here that for text you can choose to make it case sensitive or not.

If you are happy, press the Save button and store the Domain in the proper package.

Then press the Check button to see if all is ok, and Activate button to activate the domain.

Possible data domains

The characteristics of a domain depend on the chosen Data Type.

For example a number will show different options:

There are domains for date, time, currency, quantity, etc…

Domain with own defined value set

The nicest feature of a domain is that you can define a value set. This value set can be used to restrict field choices to a limited set.

Example: first define a Domain;

Now go to the tab Value Range to set the restrictions:

In this case only the values FUTURE, PAST and PRESENT are allowed for this domain (and the Data Elements using it in tables).

Expert information

Be careful updating a domain later on (this includes adding a value in the value range). Any domain change will trigger a recompilation of:

  • The domain itself
  • Every Data Type using it (data type can be data element, structure and/or table type)
  • Every table using the data type
  • Every program using the table

This can be a lot!

Use the Where-Used button to see which tables are impacted. When it is a lot, check with your basis team when to import your transport in subsequent systems. Choose a time if possible where no users are working.

Domain Field length reduction and extension

Reducing domain field length can lead to data loss. Check and double check twice before executing a domain field length reduction.

Domain field length extensions are possible, but will trigger database table adjustments for the tables in which the data elements are using the impacted domain.

Use the Where-Used button to see which tables are impacted. Check with your basis team when to import your transport in subsequent systems. Choose a time if possible where no users are working.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.