For developers, these CDS views are an important resource:
- A lot of these standard CDS views are exposed via OData services and available for lookup via the SAP API Business Hub. This makes them a great resource for Front-end (UI5/Fiori) developers.
- ABAP developers can re-use the existing CDS logic in a powerful and modular way. Finding the right CDS view can be dead easy or a challenge...
CDS View Types
In SAP S/4HANA the VDM (virtual data model) forms the basis for data access and consists of CDS views. These views follow consistent modeling and naming rules, for example you'll recognize following prefixes during your search:
SAP API Business Hub
Your first resource should be the SAP API Business Hub, which can be used to find CDS views:
The only thing you need is a good search term. For example when looking for (product) characteristics:
The result of the search will be a number of available CDS views. When clicking on a tile, more details are displayed:
- ID: The name of the development object. Notice that the prefix is I_, meaning that is an interface view.
- Supported Capabilities: These are the uses SAP supports for this view.
- Fields: The fields the CDS view returns.
Remark: all CDS views found on the SAP API Business Hub are all listed in the SAP S/4HANA Cloud solutions only. At this point in time, it is not clear if the usage is also supported on SAP S/4HANA on-premise systems. But when searching for some samples on an on-premise SAP S/4HANA system, they will exists depending on the installed product:
Transaction SDDLAR
If you can't find what you are looking for on the SAP API Business Hub, this is a final option: transaction SDDLAR. This transaction allows you to search in the DDL (Data Definition Language) of the CDS views:
After pressing Analyse, following input form is shown:
Warning: the search may take a while, depending on the performance of the system and your search terms. If all goes well, you'll end up with a list of DDL sources that have the given pattern in their definition.
The output contains:
- The SAP object definition in the Dictionary, together with the complete CDS view DDL:
- And at the bottom of each DDL source, the ABAP Catalog View Name and in what other DDL sources this CDS view is used:
Summary
In search for the correct CDS view, always start on the SAP API Business Hub. These are publicly shared and supported by SAP. When building a future/upgrade prove solution, this should be your starting point.
If that is not enough, it can be useful to dive deeper in the system by searching for a CDS view with transaction SDDLAR. But be warned:
- Don't get lost in the CDS view spaghetti.
- There is no guarantee at future upgrades.
- Sometimes the search will feel like looking for a needle in a haystack.