Ansicht
Dokumentation
ABENC0_PROVIDER_RULES_CDS - C0 PROVIDER RULES CDS
Fill RESBD Structure from EBP Component Structure BAL Application Log DocumentationThis documentation is copyright by SAP AG.
C0 Contract Rules for Providers of CDS Entities
Generally, a repository object that is classified with the C0 contract must not be deleted after being released as an API but can become deprecated.
The following sections show the most important rules that a C0 contract imposes on different kinds of repository objects.
Prerequisites for C0 Release
- The CDS entity must be marked as extensible. That means that the annotation @AbapCatalog.extensibility.extensible must be set to true.
- In CDS view entities and CDS projection views, the annotation @AbapCatalog.viewEnhancementCategory can be used instead, or both annotations can be used at the same time. Their values must fit to each other, that means, they must both allow extensions.
- The CDS entity must define a 3-character long element suffix using the annotation @AbapCatalog.extensibility.elementSuffix.
- The CDS entity must define a quota that preserves capacity for extension content. Both annotations @AbapCatalog.extensibility.quota.maximumFields and @AbapCatalog.extensibility.quota.maximumBytes are mandatory. The maximum number of fields must be an integer between 0 and 1000, the maximum number of bytes must be an integer between 0 and 10.000.
- If the entity to be released is a CDS view entity or a CDS projection view, stable alias names for data sources and associations that can be used by extensions are mandatory. The annotation @AbapCatalog.extensibility.dataSources must be set and define at least one stable data source. The data sources and associations which are allowlisted in this way must themselves be released, either under the C0 contract, or under the C1 contract.
- The stable data sources defined in the annotation @AbapCatalog.extensibility.dataSources must fulfill at least one of the following conditions:
- be a data source specified as part of the SELECT clause (CDS view entity)
- be specified as data source after DEFINE VIEW ENTITY AS PROJECTION ON (CDS projection view)
- be a locally defined or redefined association whose association target has exactly one data source defined after FROM, which is a DDIC database table. An association can only be defined as stable data source if is has a maximum cardinality of maximum 1.
- Release is possible only if all elements use the correct namespace prefix. For repository objects developed in an SAP system, this means that the element names must not start with YY or ZZ. /namespace_prefix is only allowed if the enclosing object has the same prefix.
- If the entity to be released is a CDS view entity or a CDS projection view, it must fulfill at least one of the following conditions for C0 release:
- be part of a transactional RAP application. This implies that it must either be a root view entity, or have a to-parent association.
- have exactly one DDIC database table as data source after FROM and do not define any associations.
- The CDS entity must not have any fields of data type LCHR or LRAW.
- The annotation @AbapCatalog.extensibility.allowNewDatasources is optional. It can be set to true or false, but true is allowed only in CDS projection views. When set to true, consumers of the released API are allowed to use new data sources. This means that a consumer can use a newly defined association in a path expression to include a field from a new data source in the extension.
General Rules for Released APIs
- Currently, CDS view entities, CDS projection views, CDS abstract entities, and CDS custom entities can be released with a C0 contract.
- Client-dependent views must not be changed into client-independent views after C0 release.
- The provider contract must not be changed after C0 release.
- The CDS object type must not be changed after C0 release.
- The DDL source type must not be changed after C0 release.
- The extensibility annotations must not be removed after C0 release. Changes are allowed within strict limits:
- @AbapCatalog.extensibility.extensible must not be removed and its value must not be changed.
- The released stable alias names specified in AbapCatalog.extensibility.dataSources must not be changed. The target object name a released alias refers to must not be changed. If the released alias name refers to an association, this association must not change its maximum cardinality. New stable data sources can be added.
- The quota definition defined in @AbapCatalog.extensibility.quota.maximumFields and @AbapCatalog.extensibility.quota.maximumBytes must not be reduced.
- The element suffix defined with @AbapCatalog.extensibility.elementSuffix must not be changed.
- @AbapCatalog.extensibility.allowNewDatasources must not be removed and its value must not be changed from true to false. The reverse, from false to true, is possible though.
- Union views must not be released under the C0 contract.
- Entities with a GROUP BY clause are not supported.
- The annotation AbapCatalog.viewEnhancementCategory must not be set to #UNION or #GROUP BY.
- A maximum of 64 joins is supported (ATC error). A maximum of 32 joins is recommended (ATC warning).
- Buffering is not supported. The annotation @AbapCatalog.entityBuffer must not be set to true.
- Client-independent CDS views must not be released under the C0 contract.
Example Topics
Example for a C0 released CDS view entity which is extended from a restricted ABAP language version
CL_GUI_FRONTEND_SERVICES - Frontend Services Fill RESBD Structure from EBP Component Structure
This documentation is copyright by SAP AG.
Length: 12102 Date: 20240511 Time: 062956 sap01-206 ( 123 ms )