Skip to content

ABAP Keyword Documentation →  ABAP - Dictionary →  Classic Objects in ABAP Dictionary →  Data Types →  Data Elements →  Domains 

Semantic Attributes of Domains

Domains can be given the following semantic attributes:

  • Short text
Each domain has a short description specified when it is created.
  • Documentation
A domain can be given (optional) documentation.
  • Output attributes
The output attributes determine how fields defined with reference to a data element (that itself references the domain) are displayed on dynpros or Web Dynpros or when formatted with the statements WRITE or WRITE TO. .
  • Output length

    The (optional) output length overrides the implicit output length as assigned to the built-in elementary data types. The potential output length is determined by the data type and is checked by ABAP Dictionary tools. If a format is assigned to the built-in data type in question, the output length should be long enough for all formatting characters.
  • Output style

    A domain with the type of a decimal floating point number must be assigned an output style.
  • Conversion routine

    If a domain is assigned to a conversion routine, the associated function module ..._INPUT (for each input in a dynpro field defined with reference to a data element that itself references the domain) is called. Similarly, the associated function module ..._OUTPUT (for each output using a dynpro field defined with reference to a data element that itself references the domain) is also called. The function module ..._OUTPUT is executed in the same way when a data object is formatted using WRITE or WRITE TO when the data object is declared with reference to a data element of this type.
  • Sign

    If a data type of a dynpro field defined in ABAP Dictionary is numeric, the "Sign" attribute must be set so that negative numbers can be displayed on the screen. This attribute can only be specified using a domain.
  • Lowercase letters

    If a data type of a dynpro field defined in ABAP Dictionary is character-like, the "Lowercase Letters" attribute can be set so that these letters are not transformed to uppercase. This attribute can only be specified using a domain.
  • Time format

    For the data type TIMS, a 24-hour or 12-hour format can be set for displaying dynpro fields in accordance with the ABAP time formats.
  • Value range
Value ranges for fields on user interfaces can be defined for domains of the built-in types CHAR, NUMC, DEC, INT1, INT2, INT4, and INT8. For domains of the types CHAR and NUMC, this range specifies the valid input values in dynpro fields defined with reference to a data element of the domain in question. The value range is evaluated for all types for the input help of dynpro fields if no input help with a higher priority exists. The value range is ignored for the content of data objects in ABAP programs or of database table fields that reference a data element with a domain of this type. A value range can be defined using the following:
  • Fixed values
  • Intervals
Fixed values and intervals can be combined here as required. The following can be specified as fixed values and interval boundaries:
  • Alphanumeric characters including blanks and special characters for the type CHAR. The length is restricted to 10.
  • Positive integers (including 0) for the types NUMC, INT1, INT2, INT4, INT8, and DEC within the value range defined by the technical attributes.
A short text can be specified for each fixed value or interval, which is then displayed when used in an input help. The fixed values of a domain can be specified as special literals in a CDS view. The fixed values provided by SAP can be enhanced by customers or partners using fixed value appends.
  • Value table
A value table can be a database table that is used as a default for the check table in cases where a table field of a database table that references a data element with this domain is included in a foreign key. Just specifying a value table does not trigger a check.

Other versions: 7.31 | 7.40 | 7.54


Example

The domain S_CLASS with the type CHAR describes the possible classes in a flight booking. The value range of the domain is defined by the fixed values "C" (Business Class), "F“ (First Class), and "Y“ (Economy Class). This means that only the values "C", "F", and "Y" can be entered for all dynpro fields that point to this domain.