This Blog is mainly on SAP Exam Questions and Selected "How-to" SAP processes

Friday, July 31, 2026

SAP HANA - VDM, CDS, and Database Tables


Core Data Services (CDS) and the standard Virtual Data Model (VDM) do not exist natively or fully in SAP ECC. SAP ECC reads data directly from physical database tables using ABAP Open SQL statements (like SELECT etc), rather than using Core Data Services (CDS) views.

Core Data Services (CDS) were introduced later by SAP with the advent of SAP S/4HANA and modern ABAP platforms to build a Virtual Data Model (VDM). Classic ECC architecture predates widespread CDS usage.

It is important to note that Core Data Services (CDS) and the Virtual Data Model (VDM) in SAP are strictly virtual definitions that fetch data dynamically at runtime rather than persisting or storing it physically. Physical records reside exclusively in underlying database tables. CDS and VDM do not store any data. 

A VDM is not a single file or a lone view; rather, it is a structured network or framework of multiple stacked and layered CDS views designed to work together, a single Virtual Data Model (VDM) in SAP S/4HANA always contains multiple Core Data Services (CDS) views. SAP builds the VDM using a hierarchical network of CDS views.

At the database runtime level, both VDM and non-VDM CDS views execute identical SQL statements against the actual database tables. The database engine does not change its reading behavior. Both Virtual Data Models (VDM) and Core Data Services (CDS) views ultimately rely on SQL to read data from underlying physical database tables. 

The SAP Virtual Data Model (VDM) is a structured architectural framework used to build reusable, high-performance data models using ABAP Core Data Services (CDS) views. It enforces a multi-layer design to separate raw database interaction from final application delivery.

The SAP Virtual Data Model (VDM) uses three primary user-facing and reuse layers built with Core Data Services (CDS) views: Basic/Interface, Composite, and Consumption.

1. Basic Views (@VDM.viewType: #BASIC)
• Basic views represent the foundation of the VDM stack. They are the only views allowed to interact directly with physical database tables.

2. Composite Views (@VDM.viewType: #COMPOSITE)
• Composite views live in the middle layer, serving as the reusability engine of the VDM. They cannot access the physical database directly.
• Virtual Data Model (VDM) consumption view can include aggregations and calculations, typically built on top of composite cube views to serve analytical queries and UI applications.

3. Consumption Views (@VDM.viewType: #CONSUMPTION)
• Consumption views act as the definitive top layer of the VDM stack, customized for specific business applications.
• In SAP ABAP Core Data Services (CDS), the Consumption View is the top-most layer designed specifically to interact with frontend applications and external programs.

In the SAP S/4HANA architecture, CDS (Core Data Services) views and the VDM (Virtual Data Model) represent a purely logical semantic layer and do not physically store or replicate data. They act as blueprints or definitions that read real-time data from actual, physical tables down in the database. 

(note: the above represents summary view of VDM and CDS in the S/4HANA system by a non-Technical person, the written notes are based on research material reading from SAP help.sap.com. Pleaes refer to the right technical expertise for precise information about the subject matter).

******************************************************************************************************************************************************************

References:
https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE/Virtual Data Model and CDS Views/
https://blog.sap-press.com/an-overview-of-the-sap-s4hana-vdm
https://help.sap.com/docs/SAP_S4HANA_CLOUD/Virtual Data Model and CDS Views in SAP S/4HANA Cloud Public Edition/
https://blog.sap-press.com/how-to-create-a-basic-interface-core-data-services-view-with-abap
https://www.cnblogs.com/虚拟数据模型/
 
Videos:

******************************************************************************************************************************************************************

The fundamental difference between VDM and CDS in SAP is that CDS (Core Data Services) is the underlying technology and language, while VDM (Virtual Data Model) is the architectural blueprint, semantic design, and rule book built using that technology.

Think of the difference between CDS and VDM as:
CDS are the BRICKs.
VDM are the WALLs.

  • CDS (Core Data Services) = The BRICKs
    • Definition: CDS is the foundational technology used to define and consume semantic data models. It is a technical infrastructure, DDL syntax, and data modeling framework.
    • Analogy: They are the individual, raw building blocks. A single brick (a basic CDS view) contains data but does not represent a complete structural feature on its own. You need many of them to build something meaningful.
    • Purpose: Pushes heavy data processing down to the HANA database layer (Code-to-Data paradigm).
    • Scope: Generic tool; anyone can build any arbitrary query or view using CDS.
  • VDM (Virtual Data Model) = The WALLs
    • Definition: VDM is the structured, layered framework built on top of database tables using CDS views. It organizes data into reusable, business-oriented layers (like Interface, Composite, and Consumption views). It is a structured semantic layer and architectural guidelines.
    • Analogy: The wall is the final structure. It is built by systematically arranging the bricks (CDS views) according to an architectural blueprint. The wall serves a specific purpose, like supporting a room or acting as a boundary.
    • Purpose: Abstracts raw, complex SAP database tables into understandable business entities.
    • Scope: Specific design standard used by SAP to model all standard business processes.

    ******************************************************************************************************************************************************************

    SAP GUI Transaction Codes:
    • SE11 (ABAP Dictionary): Enter the SQL view name of the CDS view to display its structure, then double-click the DDL name to open the data definition.
    • SDDLAR (CDS Repository): Used to display CDS view definitions and run consistency checks directly in the SAP GUI.
    • SE80 (Object Navigator): Select Repository Info System or edit object by entering the DDL (Data Definition Language) name to view the data definition.
    • RSRTS_ODP_DIS: Used to check and preview analytical or cube-based CDS views.
    Fiori and Developer Tools:
    • View Browser (Fiori App ID F2170): The official app to search, explore, and analyze CDS-based Virtual Data Models and their cross-references.
    • ABAP Development Tools (ADT): The Eclipse-based environment used by developers for advanced dependency analysis and viewing complete VDM hierarchies.

    ******************************************************************************************************************************************************************

    OData Service: An SAP OData service bridges raw database tables and front-end UIs by turning business data into a web-ready API. It acts as the delivery mechanism, while Core Data Services (CDS) structure the data, the Virtual Data Model (VDM) organizes it into meaningful business concepts, and the Database stores the physical records.


    How the Components Work Together:

    SAP Fiori application + SAP Business Object BI Tools + 3rd Party UI/Client + Cloud Reporting Tools
    ↑↑↑↑
    OData Service: The final communication protocol (REST-based API) generated on top of the VDM consumption views, allowing tools like SAP Fiori or external clients to query and modify the data.
    ↑↑↑↑
    VDM (Virtual Data Model): A structured, layered collection of CDS views (Basic, Composite, and Consumption) that translates technical database fields into clear business objects like SalesOrder or Product.
    ↑↑↑↑
    CDS (Core Data Services): SQL-like data definitions written in code that read from the database, add calculations, and define joins or associations.
    ↑↑↑↑
    Database: The foundation layer holding physical tables (like VBAK or VBAP) with technical column names

    ******************************************************************************************************************************************************************

    No comments:

    Post a Comment

    Note: Only a member of this blog may post a comment.