0% found this document useful (0 votes)
340 views

How To Create A Custom CDS View 1675795797

This document outlines the process for creating a custom CDS view in SAP S/4HANA Cloud. The steps include selecting a primary data source and associated data sources, defining the association between them, selecting which fields to display, and publishing the view. Custom CDS views can merge data from different sources and be used in applications like analytical queries.

Uploaded by

rajesh_popat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
340 views

How To Create A Custom CDS View 1675795797

This document outlines the process for creating a custom CDS view in SAP S/4HANA Cloud. The steps include selecting a primary data source and associated data sources, defining the association between them, selecting which fields to display, and publishing the view. Custom CDS views can merge data from different sources and be used in applications like analytical queries.

Uploaded by

rajesh_popat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

MICKAEL QUESNOT

How to Create a Custom CDS View

Get an overview of how to create a custom CDS view.

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. Create Custom CDS View with oData:

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.2 Click ‘Create’ to create a new Custom CDS View:

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

1.4 ‘Add Primary Data Source’:

Search for ‘Supplier and select ‘I_supplier’

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

and ‘I_supplierCompany’ CDS View as ‘Associated Data Source’

1.5 Click ‘Add’

MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 4 de 17
MICKAEL QUESNOT

and then click ‘Add Associated Data Source’:

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:

1.9 Here we will define the association condition.

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

1.12 Click ‘Close’ as we have finished defining our condition:

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

1.15 Click ‘Publish’ which will publish our CDS View:

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

You might also like