Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
AndreasRiehl
Advisor
Advisor

Frequently asked Questions
on the Custom CDS Views Key User app


This blog post will be continuously enhanced. Feel free to add comments when you think your question should be mentioned here as well.




Configuration



Product Information



Modeling Tipps & Tricks







The create button is not enabled


In a cloud system, the create button is only active in the new Custom CDS Views app. The old version cannot be used to create new Custom CDS Views any more.

You can only create custom CDS views in your development system. In the productive system (as well as in the test system in a 3 system landscape), the Custom CDS Views app is in a pure display mode.

In on premise (and private cloud) systems, the system has to be configured correctly as extensibility system. The most prominent configuration problems are
1) missing ATO setup - see ATO Configuration and SAP Note 2283716
2) missing authorisations - see Custom CDS Views authorisations

Back to top




Where can I find release news?


We try to publish blog posts for each new release of the Custom CDS Views app.
Here is the most recent one for SAP S/4HANA Cloud: 2302.

For SAP S/4HANA On Premise, there are no separate What's new blog posts, but the delta always consists of the respective cloud updates. For S/4HANA 2022, these are 2208, 2202 and 2111.

For older releases or to get an overview on all blog posts on the Custom CDS Views app, you may just want to search for the tag F1866A (and F1866). These are the Fiori IDs of the new (and the old) Custom CDS Views app.

Back to top




When will the deprecated Custom CDS Views App be removed?


As of 2308, the old app will finally be removed for all customers as announced in the 2202 release news as well as in SAP Note 2874206.

Back to top




I cannot see the old Custom CDS Views app any more. How can I get it back?


If you joined after 2202, you already started out with only having "the new" Custom CDS Views app. In this case, this question is not relevant for you.

For all others: The old app is included in a catalog that was deprecated. The catalog was therefore also removed from the template role. If you did not copy the template role, but used the template role directly for your business users, the old app will not be visible any longer. If you still need the old app e.g., to display your custom CDS views that you did not migrate yet, you can temporarily get it back by assigning the deprecated business catalog SAP_CORE_BC_EXT to your own business role.

With 2308, the old app was dismantled as announced in the 2202 release news.
With 2402, the deprecated business catalog SAP_CORE_BC_EXT will be removed as well.

Back to top




I cannot choose the data source XYZ as primary or associated data source


Data sources have to be explicitly released and marked as suitable for modelling so that they can be used in the Custom CDS Views app.

SAP Data sources that are not marked as modelling data sources, will initially be filtered out by the Custom CDS views app. You can remove the filter "suitable data source" in the data source selection dialog and still choose this data source at your own risk.

SAP Data sources that are not released at all by SAP cannot be chosen. If you are missing a data source or feel that a data source should be released by SAP, you can request this via ticket at the application component that provides the data sources. A good place to start investigations on data sources is the View Browser app, which also displays more details on unreleased data sources.

Data sources that you created with the ABAP Development Tools (ADT) e.g., via the Developer Extensibility in SAP S/4HANA Cloud, are only visible if you explicitly C1 released them for the usage in Key User Tools (via the context menu in ADT).
Additionally, you should add the annotation @ObjectModel.supportedCapabilities with the value CDS_MODELING_DATA_SOURCE to indicate that you recommend this data source for modelling with the Custom CDS Views app.

Some scenarios do also have stricter rules on the data sources that can be used or on how its data sources are allowed to be used. This will be specified in the documentation of the scenario. Prominent examples are:

  • Custom CDS Views with the OData scenario cannot be used as associated or primary data sources in other custom CDS views at all.

  • Custom CDS Views of the scenario Cube cannot have CDS views of type dimension as primary data source.


Back to top




Where is the preview for SAP data sources in the new Custom CDS Views app?


The old custom CDS views app had a preview not only for the custom CDS views, but also for released SAP views. This functionality is now covered in the Customer Data Browser app that is specialised in previewing data sources and provides advanced preview functionality like filtering or sorting.

The Customer Data Browser app is also integrated with the new Custom CDS Views app (and will be with the View Browser app soon), so you will not lose this functionality when the old Custom CDS Views app is removed with 2308.

Until then, previewing is still possible in the old Custom CDS Views app although it is deprecated.

Apart from that, all customers that do already have the three system landscape with developer extensibility can as well use the ABAP development tools (ADT) for previewing CDS views.

This is also covered in the blog post on the new Custom CDS Views app.

Back to top




What are the differences between CDS views in the developer extensibility and Custom CDS Views in the key user extensibility?


the Custom CDS Views app creates ABAP CDS Views as well. The main differences are the targeted personas (developer vs. key user) and therefore the different approaches:

The Custom CDS Views app is aimed at Key Users and typical, predefined, light-weighted business use-cases, the so called scenarios (e.g. building an External API, Cube, etc.). Therefore it takes a form based, guided and scenario centric approach. The app has advanced, scenario specific rules, checks and automatisms that ease the workflow, guide the user and finally generate ABAP CDS source code for him.

With the ADT based tools of the developer extensibility, a developer can freely write his own ABAP CDS source code (apart from other extensibility options) with all available freedom, that the CDS language provides. This is recommended, if the scenario is not supported in the key user tools and if the project is more of the nature of a development project (scope, complexity, requirements).

ABAP CDS is a data modelling language that is extended with semantic parts in the form of annotations. Therefore it is not possible in the scope of this FAQ, to name all the options it has. Nevertheless, here are some prominent examples of the possibilities that will only work in developer extensibility, not in the Custom CDS views app:

  • Freely define own access protections (DCLs)

  • Freely define unions or explicit joins

  • Defining group by & aggregations or hierarchies

  • Doing incompatible changes (e.g. for refactoring purposes)


 

Back to top




My custom CDS view with the scenario External API has poor performance


You may have used a very complex or large CDS view as a data source that is not suitable or not intended to be used as an API. Check if you can find a more basic CDS view as a data source instead. You should only use data sources that are marked as modelling data source. Apart from that, advanced criteria can be checked in the View Browser app. Good indicators are

  • the View Type ("Basic" is ideal)

  • the complexity (ObjectModel.usageType.serviceQuality #A or #B are fine)

  • additionally, you can also check the size (ObjectModel.usageType.sizeCategory)


If you need to use a large data source, you should use filtering to improve the performance. Be aware that you do not filter on calculated fields though as this might have a negative impact on the performance again.

Filtering can be done in the custom CDS views app itself on the filter tab or in the consumption of your OData service using $top and $skip.

Please also note in this context, that the external API scenario is not intended for data extraction.

For further information, see the External API documentation.

Back to top




Multiple Views appear to be transported even only one was changed.


The behaviour is expected whenever SAP did changes to the access protection of the underlying SAP view of that you have used in your Custom CDS View.

When a new Custom CDFS View is published for the first time, it inherits its access protection from its primary data source. When the access protection of the underlying view is updated later on, the access protection of the Custom CDS View may need to be refreshed as well. This results in a rework task for the Custom CDS View.

When you now publish this view, the access protection gets updated and the rework task will be resolved. If you built several views on top, all of the depending views will be refreshed (and therefore published) as well for consistency reasons.

All changed views will appear in the log of the Custom CDS View that you changed (and where you started the publishing process).

You can find more details in the corresponding What's new in 2105 blog post.

Back to top




I have parameters in my external API Custom CDS view. How can I fill them?


When calling the OData service, make sure to enter the parameters in the URL using the following schema:
https://[base url]/sap/opu/odata/sap/[custom CDS view name]_CDS/[custom CDS view name]([parameter name 1]='[parameter value]',[timestamp based parameter name]=datetime'[YYYY]-[MM]-[DD]T[hh]:[mm]:[ss]')/Results

Back to top




How can I find suitable data sources for my purpose?


With SAP S/4HANA Cloud, the tools of choice for getting information on CDS views and data sources are the View Browser app inside your system as well as the API Business Hub that is externally available on the web.

The View Browser app lists CDS views in your system with structural details like their elements, labels and annotations as well as relationships to other CDS views.

The view browser can also be navigated to from the Custom CDS Views app and gives you additional valuable details like the type, size as well as complexity information.

Indicators for suitable data sources are

  • the View Type ("Basic" is ideal)

  • ObjectModel.usageType.serviceQuality for the complexity (#A or #B are fine)

  • additionally, you can also check the expected size (ObjectModel.usageType.sizeCategory)


The API Business Hub helps you to explore integration or extension possibilities of SAP solutions and also has the option to list released SAP CDS views with details on the capabilities and a field search.

Back to top




I get wrong or duplicate results in my CDS view. How can I avoid this?


Usually, an unexpected result set is based on modelling mistakes when using multiple data sources. To find out where the duplicate data comes from, check all the fields of your custom CDS view, that do not originate directly from your primary data source. Either you have chosen a field from an association that is not of cardinality *..1 or you selected a field from a data source that you defined an association to and did not map all the key fields of the target data source in the association definition.

There is also a blog post about how to deal with multiple data sources and another one that helps you identifying the root cause in case of such a problem.

Back to top




I want to introduce a counter. How can I do this?


If you want to introduce a counter that shall be aggregated as a sum in the runtime of an analytical query or in an external API, you need to:
First add a calculated field (on the elements tab) with the value "cast(1 as ABAP.INT4)",
Then give it an according aggregation "sum" (element properties tab).
The cast function makes sure that the data type INT4 is enforced. When you use a plain "1" instead, the data type would be the smallest possible ending up with a byte. As a result you will not be able to count beyond 255. Even worse, if the numbers become larger you might end up with errors or even dumps. So make sure you use a cast function and pick a data type that is large enough.

Back to top




How to expose an External API in On-Premise or Private Cloud?


The documentation of Custom CDS Views for the Cloud Edition mentions the Custom Communication Scenario & Communication Arrangement Apps, that are not available in S/4HANA On-Premise and Private Cloud.
In these cases, you will have to use transaction /IWFND/MAINT_SERVICE in SAP Gui. Please refer to the On-Premise documentation for more details how an OData connection can be activated in your case.
Please be aware, that the step "Generate Service Artifacts" (via OData.publish) has already been done by the Custom CDS Views app when publishing a Custom CDS View with the "External API" scenario.

Back to top
8 Comments