Business Semantic Data Elements in ABAP CDS

25 min read

Why SAP Provides Business Semantic Data Elements

As someone working on SAP S/4HANA Public Cloud or ABAP Cloud, one of the biggest improvements you can make to your CDS models is choosing the correct data type.

While generic built-in types such as abap.char(), abap.numc() and abap.dec() are available, SAP also provides hundreds of business semantic data elements that already represent real-world business concepts.

Using these semantic data elements makes your CDS View Entities easier to understand, improves consistency across applications, and aligns your development with SAP standards.

Business Semantic Data Elements
SAP semantic data elements represent business concepts such as Material, Company Code, Currency, Plant, and Customer instead of generic character or numeric fields.
Click image to enlarge

Why Experienced SAP Architects Rarely Use Generic Types

One of the easiest ways to distinguish an experienced SAP architect from a beginner is by looking at the data types used inside CDS View Entities.

Beginners often define almost every field using generic built-in data types.

Generic Data Types
ABAP CDS
cast( Product as abap.char(40) )
cast( CompanyCode as abap.char(4) )
cast( Currency as abap.char(5) )

Although technically correct, these definitions do not communicate the business meaning of the data.

Experienced SAP developers instead prefer semantic data elements that already exist within the SAP data dictionary.

Business Semantic Data Elements
ABAP CDS
cast( Product as MATNR )
cast( CompanyCode as BUKRS )
cast( Currency as WAERS )

Architect Perspective

Architect Insight

Experienced SAP architects do not memorize thousands of SAP data elements.

Instead, they memorize the most commonly used business semantic data elements and reuse them consistently across CDS View Entities, RAP Business Objects, APIs, and Fiori applications.

This approach significantly improves readability, maintainability, and consistency across enterprise applications.

Why Not Simply Use abap.char() Everywhere?

Consider the following example.

Using Generic Types
ABAP CDS
cast( field1 as abap.char(4) )
cast( field2 as abap.char(4) )
cast( field3 as abap.char(4) )

Looking only at the code, there is no indication of what each field actually represents.

Each field could represent a Company Code, Plant, Currency, Sales Organization, Storage Location, or any other four-character business value.

Now compare the same code using SAP semantic data elements.

Using Business Semantic Types
ABAP CDS
cast( CompanyCode as BUKRS )
cast( Plant as WERKS_D )
cast( Currency as WAERS )

The business meaning is immediately obvious without requiring comments or additional documentation.

💡 SAP Best Practice

Whenever SAP already provides a released semantic data element for a business concept, prefer using it instead of a generic built-in data type.

This improves readability and keeps your CDS models aligned with SAP standard business semantics.

Advantages of Using Business Semantic Data Elements

Benefits

BenefitDescription
Improved ReadabilityBusiness meaning is immediately obvious.
ConsistencyUses the same semantic types across RAP, CDS, APIs, and Fiori.
Better MaintenanceDevelopers immediately understand the purpose of each field.
SAP StandardFollows SAP recommended development practices.
Reusable ModelsEncourages consistent data modeling across projects.

1. Organizational Data Elements

Organizational data elements represent the enterprise structure of an SAP system. They define how a business is organized into company codes, plants, purchasing organizations, sales organizations, and other operational units.

These are among the most frequently used semantic data elements in almost every SAP implementation and appear extensively in CDS View Entities, RAP Business Objects, and standard SAP APIs.

Common Organizational Data Elements

Data ElementLengthBusiness MeaningExample
BUKRSCHAR(4)Company Code1000
WERKS_DCHAR(4)Plant1100
LGORT_DCHAR(4)Storage Location0001
EKORGCHAR(4)Purchasing OrganizationP100
EKGRPCHAR(3)Purchasing Group001
VKORGCHAR(4)Sales Organization1000
VTWEGCHAR(2)Distribution Channel10
SPARTCHAR(2)Division01

If you work on Sales, Purchasing, Inventory, Manufacturing, or Finance projects, you will encounter these semantic data elements almost every day.

Using Organizational Data Elements in CDS

Business Semantic Organizational Types
ABAP CDS
cast( CompanyCode          as BUKRS   ) as CompanyCode,
cast( Plant                as WERKS_D ) as Plant,
cast( StorageLocation      as LGORT_D ) as StorageLocation,
cast( PurchasingOrg        as EKORG   ) as PurchasingOrganization,
cast( SalesOrganization    as VKORG   ) as SalesOrganization

Notice how the CDS immediately communicates the business meaning of every field without requiring comments or additional documentation.

2. Master Data Elements

Master data represents the core business entities of an organization. These identifiers are reused throughout SAP business processes and are among the most important semantic data elements to remember.

Common Master Data Elements

Data ElementBusiness MeaningExample
MATNRMaterial NumberMAT-10001
KUNNRCustomer Number1000001
LIFNRSupplier Number2000001
Business PartnerBusiness Partner Number1000123

Whether you build Procurement, Sales, Manufacturing, Finance, or RAP applications, these semantic types appear repeatedly across SAP business objects.

Using Master Data Elements

Master Data Semantic Types
ABAP CDS
cast( Product          as MATNR ) as Material,
cast( Customer         as KUNNR ) as Customer,
cast( Supplier         as LIFNR ) as Supplier

Real Project Example: Purchase Order Application

A Purchase Order application may display Supplier, Material, Plant, Company Code, Currency, and Quantity within a single CDS View Entity.

Using SAP semantic data elements immediately tells every developer what each field represents without inspecting the underlying database structure.

3. Financial Data Elements

Financial applications require standardized semantic types for currencies, amounts, and exchange rates. SAP provides dedicated data elements for these concepts instead of relying on generic decimal fields.

Common Financial Data Elements

Data ElementBusiness MeaningExample
WAERSCurrencyINR
WRBTRAmount in Document Currency12,500.50
DMBTRAmount in Local Currency10,000.00
KURSFExchange Rate89.2354

These semantic types become especially important when working with currency conversion functions, analytical CDS Views, and financial reporting.

Using Financial Data Elements

Financial Semantic Types
ABAP CDS
cast( TransactionCurrency as WAERS ) as Currency,
cast( NetAmount            as WRBTR ) as NetAmount,
cast( ExchangeRate         as KURSF ) as ExchangeRate

💡 SAP Best Practice

Remember that semantic data elements do not perform currency or unit conversion.

Currency conversion should always be implemented using the CDS CURRENCY_CONVERSION() function, while unit conversion should use UNIT_CONVERSION().

4. Quantity and Unit Data Elements

Quantity fields are almost always associated with a Unit of Measure. SAP provides dedicated semantic data elements for both quantities and units to ensure consistency across logistics, manufacturing, inventory, and procurement applications.

Common Quantity and Unit Data Elements

Data ElementBusiness MeaningExample
MEINSBase UnitKG
VRKMESales UnitPCS
BSTMEPurchase Order UnitBOX
MENGE_DQuantity250.500
Quantity Semantic Types
ABAP CDS
cast( BaseUnit        as MEINS   ) as BaseUnit,
cast( SalesUnit       as VRKME   ) as SalesUnit,
cast( PurchaseUnit    as BSTME   ) as PurchaseUnit,
cast( Quantity        as MENGE_D ) as Quantity

These semantic data elements are frequently used together with UNIT_CONVERSION() and quantity semantics in CDS View Entities.

5. Date and Time Data Elements

Almost every business application stores dates, times, or timestamps. SAP provides dedicated semantic types that clearly indicate the type of temporal information being stored.

Common Date and Time Data Elements

Data ElementBusiness MeaningExample
DATSDate20260702
TIMSTime143015
TZNTSTMPSUTC Timestamp20260702143015
Date and Time Types
ABAP CDS
cast( CreationDate      as DATS ) as CreationDate,
cast( CreationTime      as TIMS ) as CreationTime,
cast( LastChangedUTC    as TZNTSTMPS ) as LastChangedTimestamp

These semantic types become particularly useful when working with CDS date functions, timestamp calculations, and RAP audit fields.

6. Purchasing Data Elements

SAP Purchasing applications use standardized semantic data elements for Purchase Orders and Purchase Requisitions.

Common Purchasing Data Elements

Data ElementBusiness MeaningExample
EBELNPurchase Order4500001234
EBELPPurchase Order Item00010
BANFNPurchase Requisition1000000123
BNFPOPurchase Requisition Item00010
Purchasing Types
ABAP CDS
cast( PurchaseOrder      as EBELN ) as PurchaseOrder,
cast( PurchaseOrderItem  as EBELP ) as PurchaseOrderItem,
cast( PurchaseReq        as BANFN ) as PurchaseRequisition,
cast( PurchaseReqItem    as BNFPO ) as PurchaseRequisitionItem

7. Sales Data Elements

Sales and Distribution applications rely on semantic data elements representing Sales Orders, Billing Documents, and related business objects.

Common Sales Data Elements

Data ElementBusiness MeaningExample
VBELN_VASales Order5000001234
POSNR_VASales Order Item000010
VBELN_VFBilling Document9000001234
Sales Semantic Types
ABAP CDS
cast( SalesOrder       as VBELN_VA ) as SalesOrder,
cast( SalesOrderItem   as POSNR_VA ) as SalesOrderItem,
cast( BillingDocument  as VBELN_VF ) as BillingDocument

Why Semantic Data Elements Improve CDS Models

Semantic data elements communicate business meaning immediately. Developers reading the CDS View Entity can understand the purpose of a field without referring to technical documentation.

Generic Types vs Business Semantic Types

Generic TypeSemantic TypeBusiness Meaning
abap.char(4)BUKRSCompany Code
abap.char(4)WERKS_DPlant
abap.char(5)WAERSCurrency
abap.char(18)MATNRMaterial
abap.char(10)KUNNRCustomer
abap.char(10)LIFNRSupplier

💡 SAP Best Practice

Before defining a generic built-in type, check whether SAP already provides a semantic data element representing the same business concept.

Using standard semantic types produces cleaner CDS models and makes collaboration across development teams much easier.

8. Material Management Data Elements

Material Management applications frequently use semantic data elements representing batches, valuation areas, and valuation types. These fields are commonly found in Inventory Management, Material Ledger, and Warehouse Management scenarios.

Common Material Management Data Elements

Data ElementBusiness MeaningExample
CHARG_DBatchBATCH001
BWKEYValuation Area1000
BWTAR_DValuation TypeRETAIL
Material Management Semantic Types
ABAP CDS
cast( Batch           as CHARG_D ) as Batch,
cast( ValuationArea   as BWKEY   ) as ValuationArea,
cast( ValuationType   as BWTAR_D ) as ValuationType

9. User Information Data Elements

SAP also provides semantic types representing user-related information. These appear frequently in audit fields, workflow, approvals, and administrative applications.

Common User Information Data Elements

Data ElementBusiness MeaningExample
SYUNAMEUser NameSHADAB
MANDTClient100
User Information Types
ABAP CDS
cast( CreatedBy as SYUNAME ) as CreatedBy,
cast( Client    as MANDT   ) as Client

10. Generic SAP Semantic Types

Besides business-specific data elements, SAP provides several generic semantic types that are reused throughout almost every SAP application.

Common Generic SAP Types

Data ElementBusiness Meaning
BOOLEANTrue / False
XUBNAMESAP User Name
LAND1Country
SPRASLanguage
ADRNRAddress Number

These semantic data elements are not tied to a specific business module but are shared across Finance, Sales, Purchasing, Logistics, and many other SAP applications.

Using Semantic Data Elements with CAST

One of the most common use cases for business semantic data elements is within CAST expressions.

Instead of casting to a generic built-in type, developers often cast directly to the corresponding SAP semantic type.

Using CAST with Semantic Data Elements
ABAP CDS
cast( Product              as MATNR   ) as Material,
cast( CompanyCode          as BUKRS   ) as CompanyCode,
cast( Plant                as WERKS_D ) as Plant,
cast( Customer             as KUNNR   ) as Customer,
cast( Supplier             as LIFNR   ) as Supplier,
cast( Currency             as WAERS   ) as Currency,
cast( BaseUnit             as MEINS   ) as BaseUnit

This approach improves readability while ensuring the CDS model uses SAP's standard business semantics.

When Should You Use Semantic Data Elements?

Recommended Approach

ScenarioRecommendation
SAP already provides a semantic data elementUse the semantic data element
Business-specific SAP identifierPrefer semantic type over generic type
No suitable SAP semantic type existsUse an appropriate ABAP built-in type
Custom business fieldUse built-in type or custom data element

💡 SAP Best Practice

Treat semantic data elements as the default choice whenever SAP already provides one for the business concept you are modeling.

Reserve generic built-in types such as abap.char() or abap.dec() for technical or custom fields where no suitable SAP semantic type exists.

Real Project Example: Building a Purchase Order CDS View

Consider a Purchase Order CDS View Entity containing the following fields:

  • Purchase Order
  • Company Code
  • Plant
  • Supplier
  • Material
  • Currency
  • Quantity
  • Base Unit

Instead of declaring these using generic character and decimal types, an experienced developer immediately recognizes the appropriate SAP semantic data elements:

Professional CDS Modeling
ABAP CDS
EBELN
BUKRS
WERKS_D
LIFNR
MATNR
WAERS
MENGE_D
MEINS

This is the modeling approach commonly used in SAP standard VDM views, released APIs, RAP Business Objects, and enterprise-grade CDS applications.

Common Mistakes

  • Using generic abap.char() for every business field instead of SAP semantic data elements.
  • Using MATNR, KUNNR, or WAERS without understanding their business meaning.
  • Assuming semantic data elements automatically perform formatting or conversion.
  • Confusing business semantic data elements with built-in ABAP CDS data types.
  • Ignoring SAP standard semantic types and creating unnecessary custom definitions.

Architect Perspective

Architect Insight

One of the easiest ways to recognize an experienced SAP architect is by looking at the data types used inside CDS View Entities.

Experienced developers rarely model business fields using generic abap.char() or abap.dec() unless absolutely necessary.

Instead, they reuse SAP's standard semantic data elements because they clearly communicate business meaning, improve consistency across applications, and align CDS models with SAP's standard Virtual Data Model (VDM).

This approach makes RAP Business Objects, Fiori applications, APIs, and CDS View Entities much easier to understand and maintain.

Interview Questions

BeginnerInterview Question

What is a business semantic data element?

Answer: A business semantic data element is a predefined SAP data element that represents a specific business concept such as Company Code, Material, Customer, Currency, or Plant instead of using a generic built-in data type.

ExperiencedInterview Question

Why should you prefer MATNR over abap.char(18)?

Answer: MATNR immediately communicates that the field represents a Material Number. Using semantic data elements improves readability, consistency, and aligns the CDS model with SAP standard business semantics.

ArchitectInterview Question

When should generic built-in types be used instead of SAP semantic data elements?

Answer: Generic built-in types should be used only when SAP does not provide an appropriate semantic data element or when modeling purely technical or custom application fields. Business concepts should normally use SAP semantic data elements.

Watch the Complete ADT Walkthrough

Prefer learning by watching?

This lesson is accompanied by a complete step-by-step implementation in Eclipse ADT. The video uses the same examples, naming conventions, and CDS code demonstrated throughout this tutorial.

💡 Key Takeaway

SAP provides hundreds of predefined semantic data elements that represent real business concepts such as Material, Company Code, Customer, Supplier, Currency, Plant, and Quantity.

Instead of relying exclusively on generic built-in types like abap.char() or abap.dec(), experienced SAP developers choose semantic data elements whenever they model standard business information.

This improves readability, promotes consistency across RAP applications, CDS View Entities, Fiori apps, and APIs, and aligns your development with SAP's standard business semantics.

In the next lesson, we will explore ABAP CDS Built-in Data Types and understand how they form the foundation for expressions, calculations, and CAST operations.