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

Data Elements

Data elements define the technical attributes of fields in SAP tables and structures. They specify properties such as data type, length, and field labels.

Understanding Data Elements

Data elements are ABAP Dictionary objects that:

  • Define the technical and semantic properties of fields
  • Provide field labels for different output lengths
  • Can be linked to domains for value range validation
  • Are used in table definitions, structure definitions, and parameter interfaces

Data Element Structure

A data element 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)

Semantic Attributes

  • Short Description: Brief description of the data element
  • Field Labels: Text for different output lengths (short, medium, long)
  • Search Help: Optional search help for value assistance
  • Documentation: Detailed description and usage information

Data Element vs. Domain

Data elements and domains serve different purposes:

AspectData ElementDomain
PurposeSemantic definitionTechnical definition
DefinesField labels, documentationData type, length, value range
ReuseMultiple fields with same meaningMultiple data elements with same technical properties
ExampleCustomer Number (semantic)10-character alphanumeric (technical)

Common Data Elements by Module

Financial Accounting (FI)

Data ElementDescriptionDomainUsed In
BUKRSCompany CodeBUKRSBKPF, BSEG, EKKO
BELNRAccounting Document NumberBELNRBKPF, BSEG
GJAHRFiscal YearGJAHRBKPF, BSEG
SAKNRG/L Account NumberSAKNRSKA1, BSEG

Materials Management (MM)

Data ElementDescriptionDomainUsed In
MATNRMaterial NumberMATNRMARA, MARC, MARD
WERKSPlantWERKSMARC, MARD, EKPO
LGORTStorage LocationLGORTMARD, MSEG
EBELNPurchase Order NumberEBELNEKKO, EKPO

Sales and Distribution (SD)

Data ElementDescriptionDomainUsed In
VBELNSales Document NumberVBELNVBAK, VBAP
KUNNRCustomer NumberKUNNRKNA1, VBAK
POSNRItem NumberPOSNRVBAP, LIPS
VKORGSales OrganizationVKORGVBAK, KNVV

Human Resources (HR)

Data ElementDescriptionDomainUsed In
PERNRPersonnel NumberPERNRPA0000, PA0001
PLANSPositionPLANSPA0001, HRP1000
ORGEHOrganizational UnitORGEHPA0001, HRP1000
PERSGEmployee GroupPERSGPA0001

Creating and Managing Data Elements

Transactions

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

Development Process

  1. Define the purpose and usage of the data element
  2. Determine the appropriate domain (or create a new one)
  3. Create the data element in Transaction SE11
  4. Define field labels and documentation
  5. Activate the data element

Best Practices

Naming Conventions

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

Design Considerations

  • Reuse existing data elements when appropriate
  • Create new data elements for fields with distinct semantic meanings
  • Link data elements to appropriate domains for value validation
  • Provide comprehensive field labels and documentation

Documentation

  • Document the purpose and usage of the data element
  • Describe the business context and meaning
  • Include examples of valid values
  • Document any dependencies or relationships with other objects

Finding Data Elements

Several methods exist to find data elements:

  • Transaction SE11: Search by name or description
  • Transaction SE80: Browse the ABAP Repository
  • Transaction SE16/SE16N: Query table DD04L (data element directory)
  • Field Information: Right-click on a field in SAP GUI and select "Technical Information"

Data Element Usage Examples

Table Definition

TABLES: KNA1.  " Customer Master: General Data

DATA: gv_customer TYPE kunnr,  " Using data element KUNNR
      gv_name     TYPE name1,  " Using data element NAME1
      gv_city     TYPE ort01.  " Using data element ORT01

Structure Definition

TYPES: BEGIN OF ty_customer,
         kunnr TYPE kunnr,  " Customer Number
         name1 TYPE name1,  " Customer Name
         ort01 TYPE ort01,  " City
         land1 TYPE land1,  " Country
       END OF ty_customer.

DATA: gs_customer TYPE ty_customer,
      gt_customers TYPE TABLE OF ty_customer.

Function Module Interface

FUNCTION Z_GET_CUSTOMER_DATA.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(IV_CUSTOMER_ID) TYPE  KUNNR
*"  EXPORTING
*"     VALUE(ES_CUSTOMER_DATA) TYPE  TY_CUSTOMER
*"  EXCEPTIONS
*"      CUSTOMER_NOT_FOUND
*"----------------------------------------------------------------------

Custom Data Elements

Organizations often create custom data elements for:

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

Custom data elements typically:

  • Start with 'Z' or 'Y' (following SAP naming conventions)
  • Reference either standard or custom domains
  • Include comprehensive documentation for future reference

Data Element Relationships

Data elements are related to other ABAP Dictionary objects:

  • Domains: Define technical properties and value ranges
  • Tables: Use data elements to define fields
  • Structures: Use data elements to define components
  • Search Helps: Provide value assistance for fields
  • Lock Objects: Use data elements for key fields

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

Edit this page
Last Updated:: 4/12/25, 1:49 AM
Contributors: Taylor Brazelton
Prev
Function Modules
Next
Domains