AS ABAP Release 758, ©Copyright 2024 SAP SE. All rights reserved.
ABAP - Keyword Documentation → ABAP - Rules for ABAP Cloud → Contract Rules for ABAP Released APIs → C0 Contract Rules → C0 Contract Rules for RAP Behavior Definitions →Example: C0 Released Projection BDEF, Design and Consumption
This topic provides an example for the design of a C0 released projection BDEF. It also shows an example for an extension to this released API from the restricted ABAP language version ABAP for Cloud Development.
Projection BDEF as C0 released API
The following projection BDEF 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 shows how to create a released API. It meets all the requirements for C0 release. However, it is not released under the C0 contract, extend, because it is not intended to be used as an 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
authorization (global)
{
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;
}