AS ABAP Release 757, ©Copyright 2023 SAP SE. All rights reserved.
ABAP - Keyword Documentation → ABAP - Rules for Strict ABAP → Contract Rules for Released APIs → C0 Contract Rules → C0 Contract Rules for CDS Behavior Definitions →Example: C0 Released RAP BO, Design and Consumption
This topic provides an example for the design of a C0 released RAP BO. It also shows an example for an extension to this released API from the restricted ABAP language version ABAP for Cloud Development.
CDS behavior definition of type managed as C0 released API
The following CDS behavior definition DEMO_RAP_BASE_DET_VAL is based on the CDS view entity DEMO_RAP_BASE_DET_VAL and it fulfills all requirements for C0 release:
Note: This CDS behavior definition 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.
managed implementation in class bp_demo_rap_base_det_val unique;
strict(2);
extensible
{ with determinations on modify;
with determinations on save;
with validations on save; }
define behavior for DEMO_RAP_BASE_DET_VAL
persistent table DEMO_DBTAB_ROOT
lock master
authorization master ( instance )
extensible
{
create;
update;
delete;
}
BDEF extension to a C0 released API
The following BDEF extension DEMO_RAP_EXT_DET_VAL extends the RAP BO displayed above and it obeys the naming rules.
extension implementation in class bp_demo_rap_ext_det_val unique;
extend behavior for DEMO_RAP_BASE_DET_VAL
{
determination setStatus on save { create; }
}