Skip to Content
Technical Articles

SAP S/4HANA Cloud : Key Takeaways on CDS Views

In continuation to my last blog post “Key Options for Testing APIs: SAP S/4HANA Cloud” in which I talked about how to test APIs. In this I will share some of my findings while working with CDS View app in SAP S/4HANA Cloud 2002.Since I had S/4HANA On-Premise experience so obviously the first thing that we would tend to do is to compare both versions and then get familiar with what all S/4HANA Cloud offers.Key differences between CDS Views in Cloud and On Premise version have been very well covered by Rohit Khan in his blog  available here.

Now the blog is also updated for Cloud 2008 .

The first question that came to my mind was will I be able to develop my own logic in Custom CDS view app in Cloud ? How can I see what all standard CDS views are given by SAP ? How can I see the data of those CDS Views ? How can I find what all fields are part of standard CDS view ?How can I expose CDS view to be consumed and so on … So let’s start and try to find answers to these questions.

To start with you can only create custom CDS Views in SAP S/4HANA Cloud by using Fiori app CDS Views and with Cloud 2002 edition SAP has given new app and old app is shown as Custom CDS View (To be deprecated) and will be deprecated in future. So , of course no eclipse for CDS views in Cloud.

For what all has changed in new CDS View app ; you can refer blog  CDS View -2002 . Now you will wonder what will happen to my old CDS views created with old app ; they are not reflecting in the new app .When will the old app get deprecated ? Do I need to create them again ? Well in 2002 both CDS views co-exist the ones created by old app as well the ones created by new app . SAP recommends to start using new app to create any new Custom CDS Views going forward.
Good news is that with 2005 version, SAP brings the migration feature where CDS views created by old CDS app can be migrated to new CDS views app. So SAP has already addressed this worry with 2005 edition .Below is snippet of how this Migrate View option looks likeWe can create CDS View for any of the below scenarios using new Fiori app; new app is scenario driven where you can select the scenario when creating CDS view itself.

  1. Standard CDS View: can be reused for view building in various scenarios
  2. Analytical Cube: can be used in analytical scenarios
  3. Analytical Dimension: can be used in analytical scenarios
  4. External API: define a service that can be consumed externally via OData

While working with CDS views app ; you should take care of :

  • Use only released CDS Views.
  • You will only see custom CDS views created in the new app “CDS Views”; earlier you could see standard CDS view as well.
  • You can only use fields of CDS View that have release state as not equal to deprecated( you can check the same in View Browser Fiori App)
  • You can define your own Parameters to be used in filters /calculations
  • Fiori app “Replicate CDS View” is in maintenance mode and will be deprecated in future .It was used to replicate data from S/4HANA Cloud to SAP Cloud Platform .
  • For exposing CDS view as external API ; you need to create the communication arrangement and follow the steps listed here

Parameters Option with CDS View :

Parameters are usually used to give data input when your CDS view is executed. ( like selection screen field in On premise version )

Their allowed data types are listed here.

  • You can use them like variables in filter/ calculated fields/in join condition to other view.
  • When you define Parameter, you can choose either of 3 for Default Type and Value:
    Manual: You can manually define the value to be considered for filter but take care of the data type that you define parameter with.

   None: You can select None in case you don’t want to default any value
  System default: You can use System default if you want to define system information as default.

How to use Parameters :

You can use the parameter in the filter condition as shown below

Now when you preview the data; a popover is displayed where you can define the parameter value and click on apply. Data will be filtered based on the same.

In addition to Parameter in Filter option you can also use

  • Constant value: To check against constant value
  • Field: To use any field value to filter records
  • Session variable: to use System date /user/language
  • You can use parameter in JOIN condition

  • You can also use the parameter in calculation as well .

Display data of CDS View

  • For Custom CDS view created by Fiori app “Custom CDS Views”; you can use preview option to see the data.
  • For seeing data of standard CDS view you must use “View Browser” app, But with View Browser you can only see the data of Consumption views with data category = Query. Select the consumption view and on top select Show content.

  • Using show content, you can only see the data of Released analytical queries /custom created analytical query.
  • Using View definition tab; you can see the column names, data elements, relevant definitions, and other parameters of the selected view.
  • Other workaround could be to create Custom CDS view over standard CDS view and display its data ; that works well as well .

What’s not possible with CDS Views in Cloud version 

  • As mentioned that you cannot view CDS Views of SAP S/4HANA Cloud in Eclipse.
  • You cannot see the content of all CDS views in “View Browser” app.
  • It is not possible to add a custom parameter if the External API option has been checked for the custom CDS view. Add option is disabled in that case.
  • It is not possible to add custom parameters if a dependency (like a custom analytical query or another custom CDS view) is already built on top of this view

Recent additions Cloud 2008

  • With Cloud 2008 , now we have search function available while adding elements as shown below- earlier it was very painful to scroll down and find field manually in CDS view .

Summary : These were some of my discoveries while working with CDS views in SAP S/4HANA cloud 2002. So I thought to share the same with you ; since in case you are working on S/4HANA Cloud for the first time ; I am sure some of these questions will cross your mind as well :).

Also I have updated the same wrt Cloud 2008 ; SAP is improving and simplifying the CDS view app too.

I will keep updating the same based on if I discover anything else while working on them .

You can use these CDS views for reporting as well ; we will cover the Embedded Analytics in SAP S/4HANA Cloud in next blog  SAP S/4HANA Cloud: Shades of Embedded Analytics in Cloud and On-Premise version

 

Regards

Taranam

6 Comments
You must be Logged on to comment or reply to a post.