ABAP - Keyword Documentation →  ABAP - Rules for Strict ABAP →  Contract Rules for Released APIs →  C0 Contract Rules →  C0 Contract Rules for CDS Behavior Definitions → 
Mail Feedback

Example: C0 Released Service Projection, Design and Consumption

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

Service projection as C0 released API

The following CDS projection behavior definition DEMO_RAP_PROJ_EXT_BEH is based on the CDS projection view DEMO_RAP_PROJ_EXT_BEH and it fulfills all requirements for C0 release:

Note: This projection BDEF 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.

projection;
strict(2);
extensible;

define behavior for demo_rap_proj_ext_beh alias Root
extensible
{
  use create;
  use update;
  use delete;
}

BDEF projection extension to a C0 released API

The following BDEF projection extension DEMO_RAP_PROJ_EXT_BEH_1 extends the projection BDEF displayed above and it obeys the naming rules.

extension for projection;

extend behavior for Root
{
  use association _child {create;}
  use action setValue;

  mapping for demo_rap_struc corresponding;
}

define behavior for DEMO_RAP_PROJ_EXT_BEH_CH alias Child
{
  use association _parent;
  use action ActionExt;
  field ( readonly ) int_field3;
}