Ansicht
Dokumentation

ABENC0_DEMO_1 - C0 DEMO 1

ABENC0_DEMO_1 - C0 DEMO 1

CL_GUI_FRONTEND_SERVICES - Frontend Services   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.
SAP E-Book

Example: C0 Released CDS Projection View, Design and Consumption

This topic provides an example for the design of a C0 released CDS projection view. It also shows an example for an extension to this released API from the restricted ABAP language version ABAP for Cloud Development.

CDS projection view as C0 released API

The following CDS projection view DEMO_CDS_PRODUCTTP_PV is based on the CDS view entity DEMO_CDS_PRODUCTTP and it fulfills all requirements for C0 release:

  • It defines the necessary extensibility annotations.
  • It is part of a transactional RAP application (indicated by the ROOT characteristic).
  • It defines the stable data source Product which fulfills all requirements necessary for C0 release.

This CDS projection view demonstrates the design of a released API, but it is not actually released for C0, since it is not intended to serve as released API.

CDS view entity extension to a C0 released API

The following CDS view entity extension DEMO_CDS_EXTEND_1 extends the CDS projection view shown above and it fulfills all requirements for consuming a C0 released API from the restricted ABAP language version ABAP for Cloud Development:

  • The extension fields are derived from the stable data source Product and use the alias name of the stable data source as prefix.
  • The newly added element II_UnitDescription_EMO uses the mandatory element suffix EMO.
The prefix ii is representative. It is meant as reminder to use the correct namespace prefix. In customer systems, the namespace prefix yy or zz must be used.
  • The newly added element II_UnitDescription_EMO is a path expression with a path length of 3. This traversing along an association path is only allowed because the annotation @AbapCatalog.extensibility.allowNewDatasources is set to true.

The program DEMO_CDS_RELEASED_API_PV provides type information of the enhanced CDS projection view. It also includes the view fields added by the extension.






Addresses (Business Address Services)   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 3422 Date: 20240511 Time: 145524     sap01-206 ( 43 ms )