ABAP - Keyword Documentation →  ABAP - Rules for ABAP Cloud →  Contract Rules for ABAP Released APIs →  C0 Contract Rules →  C0 Contract Rules for RAP Behavior Definitions → 
Mail Feedback

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.

Managed BDEF as C0 released API

The following BDEF DEMO_RAP_BASE_DET_VAL is based on the CDS view entity DEMO_RAP_BASE_DET_VAL and it fulfills all requirements for a C0 release:

Note: This BDEF shows how to create a released API. It meets all the requirements for a C0 release. However, it is not released under the C0 contract, extend, because it is not intended to be used as an 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;
  field(readonly:update) key_field;
}

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 using interface DEMO_RAP_INT_DET_VAL
implementation in class bp_demo_rap_ext_det_val unique;

extend behavior for RootInterface
{
  determination setStatus on save { create; }
}