Clean Core Concepts: Build CDS Views with SAP's Key User Extensibility Concept
As part of my journey with applying S/4HANA's clean core extensibility concepts, my next topic is building CDS views in S/4HANA with the Fiori app F1866A Custom CDS Views that is part of SAP's In-App Framework and Key User Extensibility concept.
If you're unsure about what clean core and In-App extensibility are check out my previous post on the topic.
This post contains a general introduction and some lessons learnt with my recent implementation experience.
You can use this app on both on-premise and cloud version of S/4HANA as part of Key User Extensibility.
Key features of Custom CDS Views
As per SAP Help Documentation:
You can use the app to create custom CDS views for different purposes:
- External APIs define a service that can be consumed externally via OData.
- Cube or Dimension views can be used in analytical scenarios.
- General custom CDS views can be reused for view building in various scenarios,
With the app, you can create or modify a custom CDS view by, for instance:
- adding fields from multiple data sources.
- creating your own calculated fields.
- refining the properties of the selected fields.
- creating and maintaining parameters for the usage within your view.
- adding filters in order to refine the result set.
❓Why should you use Custom CDS Views?
Using traditional methods like Eclipse and ABAP Development Tools is still very relevant in enhancing CDS Views however with the Fiori application F1866A Custom CDS you are leveraging is part of SAP's In-App Extensibility framework and Key User Extensibility concept which uses low-code/no-code approaches to enhance S/4HANA.
The reason for this is you start to transition your CDS view objects into SAP's In-App framework to leverage all the benefits of In-App extensibility like upgrade compatibility and object re-use.
If you're building a new data model consider:
- Building your data model as much as possible with Custom CDS Views first
- Then if you hit the limitations of the In-App framework fill the gap with Eclipse developed CDS Views
You might find that your data model maybe a mix of In-App and Traditional approaches however starting with In-App extensibility framework first builds some good habits up front.
Habits include:
- Learning how to start with Released CDS Views
- Building as many upgrade compatible CDS views up front with In-App extensibility
- Building your own knowledge of the strengths and limitations of the framework
✋ Custom CDS Views relies on "Released" CDS Views
One really big hurdle to using In-App extensibility is the availability of "Released" CDS Views in SAP's Virtual Data Model. As S/4HANA evolves over time SAP will naturally release more CDS views. As of writing of this blog post on S/4HANA 2022 only CDS views with Release contract of C1 are supported.
When building your data model it's important to check the release contract on your CDS view. There's already a lot of good quality documentation on SAP's help pages but search the following topics:
- Stability Contracts for CDS Views
- Stability Contract for Extensions (C0)
- Stability Contract for System-Internal Use (C1)
- Stability Contract for Remote API Use (C2)
- Deprecated and Decommissioned CDS Views
If the views in your data model are not in a released
🤔 Not all CDS annotations and features are available
There are still a number of limitations within the framework for example these are some scenarios my project team encountered but this list is not exhaustive and are examples only:
- "Group by" clause not supported
- Header annotations are not supported for example @Analytics.dataExtraction.enabled : true
- Union is not supported in Custom CDS views app
⚠️ Check the Framework before Project Implementation
If you're seriously considering using Custom CDS Views make sure to validate your entire framework before you start your project implementation. You could run into issues like security authorizations, random UI5 Fiori issues or just general stability overall. On my first rodeo with this tool I encountered a number of problems building our first data model.
Before your project implementation phase starts I do recommend you give the system a shake out by building a test/mock data model from start to finish to find these issues up front. You'll definitely need to work with your security, basis and SAP colleagues to address any issues that may pop up.
🖼 Impressions
If you have released CDS views of C1 contract that work for you and your use case doesn't require the header annotations that are not supported in Custom CDS Views this Key User Extensibility app is definitely a good starting point. I really hope SAP expands the features and compatibility over time and future versions of S/4HANA. I understand that to build these features into the product is not that straight forward due to the complexity of the framework but nonetheless it's a handy options to have in a developer's toolbox to build a cleaner analytics extension library.
📚 Reference Documentation
Take note that there's a few considerations you might want to review before getting started:
SAP Note 3201919 - Custom CDS Views - Frequently Asked Questions
Only applies to S/4HANA cloud as of writing of this blog post but you can search for released CDS views at SAP's API Business Hub online here:
Otherwise if you're using on-premise you'll need to use the view browser method. I might do another blog post specifically on view browser only.
🛠️ What's the best way to learn Custom Business Objects
I definitely suggest start off with the hands on tutorials ABAP developers - there's no substitue for actually getting hands on with the tool itself:
🙋🏻♂️ I might need additional help!
If your organization needs a helping hand on implementing clean core architecture with SAP S/4HANA, please feel free to reach out to me at ben@ben-kwong.com