Skip to Content

SAP ABAP CDS @VDM.viewType usage.

Hello Experts,

I have below query regarding SAP ABAP CDS (core data services) VDM (virtual data models) types:

I read the article "https://blogs.sap.com/2017/10/09/abap-core-data-services-part-2virtual-data-model-types/" where the types of VDM views are explained.

We know that Basic views are built on top of DB tables, composite views are on top of basic view and consumption views are on top of composite views. But there are no error/warning messages pop's up when we don't follow these rules.

For example: I created below ABAP CDS view with @VDM.viewType: #CONSUMPTION where I am directly fetching from DB table 'DFKKINVBILL_I' & CDS view is getting activated.

Above I am directly hitting DB table for data access & it is activated(that means it can be used in Fiori application for data access). So, how come VDM view type matter's in the development? It is working for @VDM.viewType: #CONSUMPTION.

Is it like VDM types are just design patterns? that we should always develop ABAP CDS views in this way-> DB table-> Basic views->composite views->consumption views?

Also, I have seen a ABAP CDS view which was developed without using any VDMtypes annotation and only used annotation was "@OData.publish: true". Using this CDS view the Fiori app(Fiori List view) was accessible on Fiori launchpad. So, here also how come VDM types actually making difference?

Or is it just that we wanted to keep our DB table access separated from external sources (Fiori or BI tools) and other reason?

Regards,
Prince

vdm-query.png (33.3 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    Posted on May 04 at 09:59 PM

    It is only a classification of your CDS-Views. At the moment, it has no impact on your runtime.

    According to the documentation it is only interpreted internally by SAP. But of course it is also good for your own structuring

    https://help.sap.com/viewer/cc0c305d2fab47bd808adcad3ca7ee9d/7.5.9/en-US/efe9c80fc6ba4db692e08340c9151a17.html

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 20 at 02:17 PM

    Hi Horst Keller,

    Could you please put some light on the above query.

    Regards,
    Prince

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 10 at 11:35 AM

    Hi Prince Joshi,

    That's a valid question,

    @VDM.viewType:

    This annotation has absolutely NO impact on the behavior or output of the CDS view rather.

    However its Best Practices to mark @VDM annotation for CDS views. Looking at this annotations, one can figure out everything about the CDS view. it just show below features;

    1.What kind of data CDS view expose or What's the category of CDS view.

    @VDM annotation is further broken down into the type of views. There are 4 type of CDS views can be developed;

    -BASIC

    Basic CDS views are developed to expose the Master Data like Customer Master, Material MAster, Business Partner etc. They consume the physical SAP tables to read data. They are also called INTERFACE views and for naming standards SAP use ‘I’ in between of the view name : *_I_*

    -COMPOSITE:

    These views are configures as an Association of Master data sets OR Master data and Transactional data. They can consume Basic Views or other Composite views to read data. For naming standards, SAP use ‘CO’ in between of the view name: *_CO_*

    -CONSUMPTION

    These views are created as the last layer of CDS analytical Model. These are the final views ready for consumption by the UI tools – Bex, Lumira, Webi, Analysis for Office etc. to be accessed by business users in the from of a report. These views can consume all other Basic or Composite Views to read data and create a final data set to be fed into the UI tools for reports based on business requirements. For naming standards, SAP start the view name with ‘C’: C_*

    -PRIVATE

    These views are private to SAP and must not be Used or Created by anyone other than SAP. SAP can change their configuration without any notice to the customers. For naming standards, SAP start the view name with ‘P’: P_*


    Thanks

    Pavan Golesar

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 10 at 08:39 PM

    There are no syntax errors or warnings for not following the rules, but there are static code checks reported (in SAP Code Insperctor for example).

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.