Clean Core Concepts: Be Aware of Release Contracts in S/4HANA
When applying S/4HANA's clean core extensibility concepts within SAP's Key User Extensibility concept one of the biggest lessons learnt is that this framework is heavily reliant on availability of released CDS views. Even if a CDS view is in a Released state it may not necessarily be available to use due to it's release contract.
What are release contracts?
A release contract is a set of rules and policies that define the process for releasing CDS views from development to production environments.
Release contracts help to ensure that CDS views are:
- Tested and approved before they are released to production environments
- Ensure that CDS views are released in a consistent manner, reducing the risk of errors and inconsistencies.
What type of release contracts are there?
As per SAP help:
In order to ensure that CDS views fulfill a variety of tasks reliably, SAP has introduced three stability contracts. Each contract applies to different consumption scenarios of CDS views, depending on the functions that they are expected to perform. The stability contracts cover the following three use cases:
- Contract for key user field extension (C0)
- Contract for system-internal use (C1)
- Contract for remote API use (C2)
It's important to note that each release contract determines how the CDS view can be used within SAP's Key User Extensibility Framework!
Stability Contract for Key User Field Extensibility (C0)
Key users can add their own custom fields or SAP standard fields using the Custom Fields and Logic app to CDS views.
As per SAP help:
As a general rule, the number of elements in a CDS view that remain stable according to this stability contract is smaller than in the contracts for system-internal use or for remote-API use. The main elements that are kept stable for key user field extensibility are the anchors of the extensions.
Relevant apps:
- Custom Fields
- Custom Logic
It's also important to note (pun intended) : https://launchpad.support.sap.com/#/notes/3136810
Stability Contract for System-Internal Use (C1)
This release contract is the one that basically allows you to extend CDS views within the key user framework.
SAP can release CDS views either for system-internal use (contract C1) or for remote API use (contract C2). The majority of released CDS views follow the stability contract for system-internal use. This contract provides sufficient stability to allow smooth operation of the system across updates.
This release contract is granted by SAP because as per SAP help:
...the elements accessing the CDS views use the same data types, for example, ABAP domains, and follow the same lifecycle. The contract C1 affects fewer view elements than the contract C2 because there is more compatibility across system-internal objects compared to remote, external objects. For example, neither of the contracts allows field length reductions. However, field length extensions are possible in C1, but not in C2.
If a CDS view is released for system-internal use, it becomes available in the key user tools such as:
App Name | Available View Types |
---|---|
Custom Analytical Queries | Query and cube |
Custom CDS Views | All except query |
Custom Fields and Logic | All |
Custom Business Objects | All |
Custom Reusable Elements | All |
Stability Contract for Remote API Use (C2)
As per SAP help:
In some cases, CDS views need to be accessed by remote application programming interfaces (APIs). This remote access is made possible through external services, such as OData. In these cases, the affected CDS views must be released for remote API use (contract C2).
The contract C2 needs to keep more elements stable than the one for system internal use (contract C1). The main use case of remote API views is that they perform basic database functions, such as updating, retrieving, and deleting, in scenarios in which applications interact with an external client.
Little is known about the properties of external consumers compared to SAP-internal objects. To ensure that external consumers of the API view continue to work after an upgrade, SAP ensures far-reaching stability rules, which exclude not only the reduction, but also the elongation of fields.
Why does this matter?
The release contract C0, C1 and C2 in the context of your use may be the difference between using key user extensiblity versus traditional methods but at the same time understanding these nuances gives you an appreciation of why SAP put these contracts in place to keep the system stable amongst upgrades and key user extensibility.
If you have the requirement to use traditional extensiblity methods beyond the release contracts you should be cautious with your approach or make a note of your extension to closely monitor as S/4HANA evolves so you can develop a path back to standard.
Where do I see Release contracts?
Here's an example of Released CDS View I_MaintOrderTechObjCube:
Important Links
I recommend searching help.sap.com for "Stability Contracts for CDS Views"
🙋🏻♂️ I might need additional help!
If your organization needs a helping hand on implementing clean core architecture and governance with SAP S/4HANA, please feel free to reach out to me at ben@ben-kwong.com