SAP Bit
Home
Get Started
  • Overview
  • Transaction Codes
  • Tables
  • Function Modules
  • Data Elements
  • Domains
  • IMG Activities
  • Overview
  • Standard RFCs
  • Custom RFCs
  • Overview
  • OData URLs
  • OData Services
GitHub
Home
Get Started
  • Overview
  • Transaction Codes
  • Tables
  • Function Modules
  • Data Elements
  • Domains
  • IMG Activities
  • Overview
  • Standard RFCs
  • Custom RFCs
  • Overview
  • OData URLs
  • OData Services
GitHub
  • SAP Objects

    • SAP Objects
    • Transaction Codes (T-Codes)
    • SAP Tables
    • Function Modules
    • Data Elements
    • Domains
    • IMG Activities

Domains

Domains define the value range for data elements. They specify the technical properties of a field, such as data type and length, and can include value tables for validation.

Understanding Domains

Domains are ABAP Dictionary objects that:

  • Define the technical attributes of fields
  • Specify valid value ranges
  • Can include fixed values or value tables
  • Are linked to data elements
  • Provide a foundation for data consistency

Domain Structure

A domain consists of:

Technical Attributes

  • Data Type: The technical data type (CHAR, NUMC, DEC, etc.)
  • Length: The field length in characters or digits
  • Decimals: The number of decimal places (for decimal types)
  • Output Characteristics: Output length, conversion routine, etc.

Value Range

  • Fixed Values: Predefined list of valid values
  • Value Table: Reference to a table containing valid values
  • Value Range: Minimum and maximum values

Domain vs. Data Element

Domains and data elements serve different purposes:

AspectDomainData Element
PurposeTechnical definitionSemantic definition
DefinesData type, length, value rangeField labels, documentation
ReuseMultiple data elements with same technical propertiesMultiple fields with same meaning
Example10-character alphanumeric (technical)Customer Number (semantic)

Common Domains by Module

Financial Accounting (FI)

DomainDescriptionData TypeLengthUsed By Data Elements
BUKRSCompany CodeCHAR4BUKRS
BELNRAccounting Document NumberCHAR10BELNR, XBELNR
GJAHRFiscal YearNUMC4GJAHR
SAKNRG/L Account NumberCHAR10SAKNR, RACCT

Materials Management (MM)

DomainDescriptionData TypeLengthUsed By Data Elements
MATNRMaterial NumberCHAR18MATNR
WERKSPlantCHAR4WERKS
LGORTStorage LocationCHAR4LGORT
EBELNPurchase Order NumberCHAR10EBELN

Sales and Distribution (SD)

DomainDescriptionData TypeLengthUsed By Data Elements
VBELNSales Document NumberCHAR10VBELN, AUBEL
KUNNRCustomer NumberCHAR10KUNNR
POSNRItem NumberNUMC6POSNR
VKORGSales OrganizationCHAR4VKORG

Human Resources (HR)

DomainDescriptionData TypeLengthUsed By Data Elements
PERNRPersonnel NumberNUMC8PERNR
PLANSPositionNUMC8PLANS
ORGEHOrganizational UnitNUMC8ORGEH
PERSGEmployee GroupCHAR1PERSG

Value Range Types

Domains can define value ranges in several ways:

Fixed Values

Fixed values define a list of valid values directly in the domain:

Value  | Description
-------------------------------
01     | Domestic Customer
02     | International Customer
03     | Internal Customer

Value Table

Value tables reference a database table containing valid values:

Table: T001
Field: BUKRS (Company Code)

Value Range

Value ranges define minimum and maximum values:

Minimum: 1000
Maximum: 9999

Creating and Managing Domains

Transactions

  • SE11: ABAP Dictionary Maintenance
  • SE80: Object Navigator (access domains in the ABAP Repository)

Development Process

  1. Define the purpose and usage of the domain
  2. Determine the appropriate data type and length
  3. Create the domain in Transaction SE11
  4. Define value range (fixed values, value table, or min/max)
  5. Activate the domain

Best Practices

Naming Conventions

  • Use descriptive names that indicate the purpose of the domain
  • Follow SAP naming conventions for custom domains (Z or Y prefix)
  • Use consistent naming patterns within your organization

Design Considerations

  • Reuse existing domains when appropriate
  • Create new domains for fields with distinct technical requirements
  • Define value ranges to ensure data consistency
  • Consider performance implications of value table validations

Documentation

  • Document the purpose and usage of the domain
  • Describe the valid value range
  • Include examples of valid values
  • Document any dependencies or relationships with other objects

Finding Domains

Several methods exist to find domains:

  • Transaction SE11: Search by name or description
  • Transaction SE80: Browse the ABAP Repository
  • Transaction SE16/SE16N: Query table DD01L (domain directory)
  • Data Element Information: View the domain linked to a data element

Domain Usage Examples

Creating a Domain with Fixed Values

DOMAIN Z_CUSTOMER_TYPE
  TYPE CHAR
  LENGTH 2
  VALUE TABLE
    VALUE '01' TEXT 'Domestic Customer'
    VALUE '02' TEXT 'International Customer'
    VALUE '03' TEXT 'Internal Customer'

Creating a Domain with Value Table

DOMAIN Z_COMPANY_CODE
  TYPE CHAR
  LENGTH 4
  VALUE TABLE T001
  FIELD BUKRS

Creating a Domain with Value Range

DOMAIN Z_QUANTITY
  TYPE DEC
  LENGTH 13
  DECIMALS 3
  VALUE RANGE
    MINIMUM 0.000
    MAXIMUM 999999999.999

Custom Domains

Organizations often create custom domains for:

  • Business-specific fields not covered by standard SAP
  • Extensions to standard functionality
  • Custom applications and reports

Custom domains typically:

  • Start with 'Z' or 'Y' (following SAP naming conventions)
  • Define technical properties specific to the organization's needs
  • Include value ranges appropriate for the business context

Domain Relationships

Domains are related to other ABAP Dictionary objects:

  • Data Elements: Use domains to define technical properties
  • Tables: Use data elements (linked to domains) to define fields
  • Structures: Use data elements (linked to domains) to define components
  • Search Helps: May use domains for value restriction

Understanding these relationships is crucial for effective data modeling and development.

Domain Conversion Routines

Domains can include conversion routines that transform values between internal and external formats:

Conversion RoutinePurposeExample
ALPHAConvert numeric values to alphanumeric'1' → '0000000001'
CUNITConvert unit of measure'KG' → 'KGM'
DATFMFormat date based on user settings'20220101' → '01/01/2022'
TZONEConvert time zone'UTC' → 'GMT'

Conversion routines ensure consistent data representation across the system.

Domain Validation

Domains provide several levels of validation:

  1. Technical Validation: Ensures data matches the defined data type and length
  2. Value Range Validation: Ensures data falls within defined minimum and maximum values
  3. Fixed Value Validation: Ensures data matches one of the predefined fixed values
  4. Value Table Validation: Ensures data exists in the referenced value table

These validations help maintain data integrity throughout the SAP system.

Edit this page
Last Updated:: 4/12/25, 1:49 AM
Contributors: Taylor Brazelton
Prev
Data Elements
Next
IMG Activities