Technical Articles
CDS View for Functional
Introduction
Hello everyone!
When transitioning to the SAP S4 HANA Cloud system, functional consultants encounter a significant change: we can no longer access tables directly. This shift can feel like losing a vital tool in our toolkit. However, fear not! In this blog, I’ll show you the alternative that SAP has provided in the SAP S4 HANA Cloud system for accessing data similarly to tables. I’ll explain how to use it and how to find the views with the required fields.
Understanding SAP S4 HANA Cloud’s Virtual Data Model (VDM)
In SAP S4 HANA Cloud, the Virtual Data Model (VDM) forms the foundation for data access. It aims to expose all business data in a way that’s easy to understand and consume. VDM is called a virtual model because it abstracts data from database tables, providing access to the corresponding data at runtime. The VDM is implemented using Core Data Services (CDS).
Types of CDS Views
CDS views in SAP S4 HANA Cloud come in various types, including:
- Basic Interface Views: These directly access database tables and are used to make table fields more understandable by renaming them with business-friendly names.
- Composite Interface Views: Built on basic interface views, these can link to different composite views or combine multiple basic interface views, creating new semantic views for analyzing and using data. They don’t access the database directly but rely on basic views.
- Restricted Basic and Composite Views: Similar to basic and composite views, but reserved for SAP’s use and not accessible to customers or partners.
- Consumption Views: These sit at the top layer of VDM CDS views and access the database indirectly through the reuse layers. They are designed for specific transactional or analytical applications and are used for creating analytical queries.
Naming Conventions in VDM CDS Views
CDS view names consist of up to four elements:
- Prefix (Mandatory): Indicates the view type, such as “C_” for consumption views or “I_” for composite and basic views.
- Semantic Name (Mandatory): Describes what the CDS view is about based on the business process.
- Suffix (Optional): Specifies the purpose of the CDS, such as “Query,” “Cube,” or “TP” (for Transactional data processing).
- Version Number (Optional): Used when there are multiple versions of the CDS view.
Example:
C_GoodsMovementQuery_2
CDS View Name element | Mandatory or Optional | Example | Reason |
Prefix | Mandatory | C_ | Indicates the view type |
Semantic name | Mandatory | Goodsmovement | Based on the business process, Indicates what the CDS View is about |
Suffix | Optional | Query | Indicates the purpose of the CDS such as Query, transactional etc |
version number | Optional | _2 | If there are more than one version, the versions are noted here |
Finding CDS Views in SAP S4 HANA Cloud
You can easily find CDS views using the Fiori app “View Browser.” It allows you to search for available CDS views in your system, including their release status.
We can use only the CDS View with status as “Released” to fetch the data in the ABAP program and only those can be used in the Custom analytical queries.
You can search CDS views in two ways:
- By using business context (e.g., purchase order, sales order)
- By using required table names or column names in the alternative search. For accessing the alternative search click the “Alternative Search” button on the view browser app.
Additionally, you can search for CDS views on the SAP Help Portal using the below link:
Viewing Data in SAP S4 HANA Cloud
In SAP S4 HANA Cloud, accessing database tables directly is no longer an option. Instead, you must use CDS views.
For example, to view all sales orders, you should use the “View Browser Fiori app” to find the relevant CDS view (e.g., “I_SALESORDER”). Then, use the “Customer Data Browser” Fiori app to access the data, similar to SE16 for tables.
In the customer Data Browser select the required CDS view to view the data, if needed we can enter selection criteria.
You can export data or create filters as needed, providing flexibility in working with your data.
What if CDS Views Aren’t Available?
While most database tables can be accessed through released CDS views, not every business objects may be available. SAP regularly releases new CDS views with quarterly updates to cover all business objects. If a CDS view isn’t available for a specific business object, you can still access the data through tables in the “Customer Data Browser.”
Please note that SAP removes tables related to a business object if a CDS view is released for that object.
Conclusion
In this blog, we’ve explored the world of CDS views in SAP S4 HANA Cloud. As a functional consultant, understanding and effectively using these views will be essential for your work in the system. Embrace this shift in data access, and you’ll unlock the full potential of SAP S4 HANA Cloud for your business processes.
Thank you for reading, and feel free to reach out if you have any questions or need further guidance. Happy data exploring!
This is the most useful post I've seen so far about S4HANA Cloud.
Thanks for sharing!
Correct spelling is S/4HANA and I believe the product you're writing about is S/4HANA Public Cloud. (Thank SAP for all the name confusion. 🙂 )
To clarify, except for viewing data part, this information is not specific to Public Cloud version. CDS views also exist in on-premise systems. Here is Help article for on-premise describing VDM structure.
"SAP removes tables related to a business object if a CDS view is released for that object." - Can you please provide source of information for this statement? I don't believe this is possible. Virtual data model cannot replace actual DB tables. You cannot have a CDS view without the actual DB table somewhere. I believe something is misstated here.
Thank you.
Hi Jelena Perfiljeva,
Thanks for your Insights and I appreciate your feedback.
Yes, You are absolutely right, the CDS View also exists in the S/4 HANA but regarding the viewing the data in S/4 HANA there is the easy way to access the database table directly using the SE16N or SE16H, that's why i didn't mention SAP S4 HANA.
And regarding
I didn't mention the DB tables there, I mentioned the "Tables" which are available to access or display the Data in the "Customer Data browser app", sorry for the confusion.
Please find the source of information regarding this, here
C1 stability contract
Thank you again for your valuable input.
Thanks and Regards,
Suryaprakash.
If this was the source then it's completely misquoted. "Remove" and "disable" are two different things. Also, this document applies to S/4HANA public cloud edition. (Again, SAP really made a mess with the names but if you follow the breadcrumbs in Help document, eventually you'll see that "S/4HANA Cloud" really translates to S/4HANA public cloud edition.
Note that in most cases we can't just say "S/4HANA" because it's the name of 3 different products. 2 of them are not very different but 1 (public cloud) is.
You might want to update the blog post to quote Help accurately, at least.
Thank you.