How To Create A Custom CDS View 1675795797
How To Create A Custom CDS View 1675795797
Business Benefit
This process enables you to create custom CDS views that can be used to merge data from different data
sources. The custom CDS views can later be used in other applications, for example, in Custom Analytical
Queries.
Process Steps
1.1 Login to SAP S/4HANA Cloud, select ‘Extensibility’ and click ‘Custom CDS Views’ application:
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 1 de 17
MICKAEL QUESNOT
1.3 Provide a ‘Name’, ‘Label’ and check the ‘oData’ checkbox. The general naming convention for
Custom CDS Views starts with ‘YY1_’ which is prefixed automatically:
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 2 de 17
MICKAEL QUESNOT
Note: For our scenario, we will add ‘I_SUPPLIER’ CDS View as ‘Primary Data Source’
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 3 de 17
MICKAEL QUESNOT
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 4 de 17
MICKAEL QUESNOT
1.6 Search for supplier Company, select ‘I_supplierCompany’ and click ‘Add’:
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 5 de 17
MICKAEL QUESNOT
Note: We can have one CDS View as Primary Data Source and one or more related CDS Views as
Associated Data Sources based on our scenario.
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 6 de 17
MICKAEL QUESNOT
1.7 Click ‘Edit Association Properties’ to define the association between the selected CDS Views:
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 7 de 17
MICKAEL QUESNOT
Click ‘add data source’ for ‘Associated Data Source Fields’ and select ‘Supplier’:
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 8 de 17
MICKAEL QUESNOT
1.10 Select the ‘Operator’ as ‘=’ and click ‘Value help’ for ‘Value’:
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 9 de 17
MICKAEL QUESNOT
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 10 de 17
MICKAEL QUESNOT
1.11 Select ‘Supplier’:
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 11 de 17
MICKAEL QUESNOT
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 12 de 17
MICKAEL QUESNOT
1.13 Click ‘Elements’ through which we will select all those fields which we want to be displayed:
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 13 de 17
MICKAEL QUESNOT
1.14 Check the ‘Select’ checkbox for the fields which we want to be displayed in result:
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 14 de 17
MICKAEL QUESNOT
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 15 de 17
MICKAEL QUESNOT
Note: We would need at least 1 key field to be present in the “Selected Fields and Associations” and the
order for display (which field to be displayed first, second and so on) can be set by us. The fields are to
be selected based on the requirement we have for showing data.
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 16 de 17
MICKAEL QUESNOT
1.16 Click ‘Preview’ to see the display result of our published CDS View:
1.17 For example, here the result shows us some details about vendors
MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 17 de 17