ARTICLE TABLE OF CONTENTS
These are 3 ways to find SAP ABAP CDS views examples and demos by SAP.
SAP’s implementations are a great orientation for how they do things and what they want them to look like in terms of best practices.
But it’s not so easy to find meaningful SAP ABAP CDS view demos or examples in an SAP R/3, SAP ECC, or SAP S/4HANA system.
So if you want to know how to find SAP ABAP CDS views in your SAP system, then this article is for you.
Let’s dive right in!
3 Ways to Find SAP ABAP CDS Views Implemented by SAP to Orient Towards Them
First, besides SAP ABAP CDS views, there are also SAP HANA CDS views. This article is about SAP ABAP CDS views. You can find SAP HANA CDS views in the SAP HANA XSA (Extended Application Services Advanced).
Let’s kick things-off with way #1:
#1 SAP ABAP CDS Views Demo Package in an SAP R/3, SAP ECC, or SAP S/4HANA System
Good news, everyone:
SAP provides an SAP ABAP CDS views demo package full of tasty SAP ABAP CDS demo files.
The demo package is called SABAPDEMOS and you can find it either in the transaction SE80 or in Eclipse. It’s available in every system that runs at least ABAP 7.40 SP05.
Depending on your ABAP version there might be more or less demo files in the SABAPDEMOS package because SAP keeps adding new files.
Whenever ABAP was updated and CDS views got new features, the package grew.
Anyway, here’s how to get the demo package:
In Eclipse open the ABAP Development Object Dialog by pressing CTRL + SHIFT + A (CMD + SHIFT + A) or through the menu:
Navigate > Open ABAP Development Object.
Once the dialog is open enter in the search field SAPABAPDEMOS. Now you should see the SABAPDEMOS package. Just doube click it to open it.
But be careful with the naming conventions of these files:
The naming conventions of many files in the demo package don’t match SAP’s naming conventions for CDS views such as:
- Starting basic and composite views with an I_
- Starting a consumption views with a C_.
Who knows why—do you? (leave a comment)
Anyway, depending on the ABAP version you have (remember you need at least 7.40 SP05), you might find these files.
- ABAP CDS views with different types of joins, union, and associations
- ABAP CDS view with currency and unit conversion
- ABAP CDS views with parameters
- ABAP CDS views with SQL functions
- ABAP CDS views with different annotations
- ABAP CDS views with extensions
- ABAP CDS views with table functions
- ABAP CDS views with authorization checks
- Table functions
- Access Controls (Authorization checks)
Pretty nice, isn’t it?
By the way, see here for the difference between SAP ABAP CDS views and SAP ABAP dictionary views.
#2 Fiori Standard Application OData Services in an SAP S/4HANA System
In an SAP S/4HANA system are pre-installed SAP Fiori standard applications and their OData services. CDS views generate those OData services. Therefore, these CDS views must exist somewhere in the SAP S/4HANA system.
Here is how you find them:
- Go to the SAP Fiori Apps Library.
- Navigate in the left menu: All apps for SAP S/4HANA > All apps.
- Select one of the applications in the list on the left—for example, the application Change Process Analysis for Business Partner.
- On the detail view of the application, select IMPLEMENTATION INFORMATIONS in the tab bar.
- Expand the Configuration panel.
- Get the name of the OData service under OData Service(s). For example, the OData service of the application Change Process Analysis for Business Partner is called MDC_PROC_BP_ALP_SRV.
- Copy the name of the OData service without the _SRV at the end. For example, from MDC_PROC_BP_ALP_SRV copy just MDC_PROC_BP_ALP.
- Go to the transaction SEGW in your S/4HANA system.
- Click on Open Project.
- Paste the OData service name without the _SRV of the Fiori standard application.
- Select the project and open it.
- Open the project in the SEGW navigator on the left.
- Open in the project the folders Data Model > Data Source References > CDS-Entity Exposures > Entity Types.
- Here you see the names of the ABAP CDS views associated with this OData service. For example, an entity of the OData service MDC_PROC_BP_ALP of the application Change Process Analysis for Business Partner is C_MDBusPartChangeProcessType.
- Copy an entity, and therefore ABAP CDS view name and go to Eclipse.
- Press CTRL + SHIFT + A or go to Navigate > Open ABAP Development Object… in the top menu of Eclipse.
- Paste the entity name into the input field of the Open ABAP Development Object dialog. For example, C_MDBusPartChangeProcessType.
- Remove the Type from the entity name to get the ABAP CDS view name. For example, change C_MDBusPartChangeProcessType to C_MDBusPartChangeProcess.
- Open the ABAP CDS view. Voila!
#3 Eclipse ABAP Development Object Type Search in an SAP R/3, SAP ECC, or SAP S/4HANA System
SAP S/4HANA has pre-installed SAP Fiori standard applications and their OData services. CDS views generate those OData services. Therefore, these CDS views must exist somewhere in the SAP S/4HANA system.
Here’s how to find them:
- Open Eclipse.
- Press CTRL + SHIFT + A (CMD + SHIFT + A) or navigate in the top menu to Navigate > Open ABAP Development Object…
- Enter in the Open ABAP Development Object input field any string and type:ddls. For example, I* type:ddls. Use type:dcls for access controls.
- Now you see all ABAP CDS views which names are starting with an I in the result list. You can use in good old SAP manner the * in the search query. For those who don’t know the * yet: the * is a wildcard character.
- Go through the result list and open an ABAP CDS views which sounds interesting.
- Bonus tip: SAP does not continuously stick to it with their implementations, but the naming conventions for ABAP CDS views are that BASIC and COMPOSITE views start with an I_ and that CONSUMPTION views start with a C_. Therefore, a search for I_* type:ddls results in a search for basic and composite views and a search for C_* type:ddls results in a search for consumption views.