Quick and easy way to create custom CDS view
Introduction- SAP Create Custom CDS View
SAP Create Custom CDS View can be used to generate the user’s own data access, in case they require access to data in the ERP system which is either not available in the standard apps or a report is needed to give more visibility to stakeholders or to create custom application that reads data from SAP.
Generally, the data of an application is spread across numerous database tables. SAP create custom CDS view that permits you to model the data access without altering underlying database tables. You can reorganize the table fields and define the metadata of the fields that fit into one object but then are set in different databases. Follow these steps when you are ready to create an app through the SAP create Custom CDS view.
Below is the summary of the steps we would be following
- Creating CDS View
- Specify Join condition
Create Custom CDS View
Custom CDS view to create an app. Go to Custom CDS view and click on create to add new
Specify the CDS view name, Label and scenario get automatically selected
However, I prefer to create an analytical dimension
Note the scenario once selected cannot be changed later.
After the CDS view is created click to add data sources
- Click on Add button
- Type the data source in the search
- Select the data source
Note that it would show you the data source based on the Analytics data category so if your CDS view was a standard CDS view the Analytics data category if dimension would not show up
This adds the primary data source. Now we add the associated data source to this
And now add the join condition between primary and associated data sources
Specify Join Condition
- Select cardinality
- Select how both primary and associated data sources are connected as seen below
And select the fields needed from both views by selecting the specific field.
So the fields shown on the Elements screen now which was selected
Also remember to select the entire I_product and add as its own reference as highlighted below
In the element Tab, you could specify the master data view. It is not mandatory but sometimes it does give errors. If it does not show the right view in the dropdown then use the previous step to add to the elements section where you could see _i_Product and then it would show up in the dropdown as below
Check the log there should not be any error and publishing should be successful. Click on preview
Check Preview and it opens up the next view where you would see the result of the CDS view created.
Conclusion – How To Create Custom CDS View
In this article, we talked about the steps used to create an app with the help of the Custom CDS View. Which in general, are intended to be consumed by a UI, analytics, or other systems.
Original Article was posted here: