C0 developer extensibility is a new extensibility option on ABAP Platform. It’s an attempt for upgrade-stable cloud extensibility with maximum flexibility. One use case for developer extensibility is the ABAP RESTful Application Programming Model (RAP). With C0 developer extensibility, you can extend your RAP application from the database to the service definition directly in ADT with custom ABAP code.

This blog post explains how to enable DDIC objects for C0 developer extensibility and how to extend a C0 released DDIC object.

How to prepare an ABAP Dictionary object for C0 release

DDIC structures and DDIC database tables can be released under the C0 stability contract for developer extensibility. All you need are the following six extensibility annotations:

  1. @AbapCatalog.enhancement.category must be set either to value #EXTENSIBLE_ANY or to value #EXTENSIBLE_CHARACTER_NUMERIC.
  2. @AbapCatalog.enhancement.fieldSuffix defines a 3-character element suffix to be used for extension fields. The purpose is to avoid field naming clashes.
  3. @AbapCatalog.enhancement.quotaMaximumFields reserves a field capacity for partner and customer extension fields. It must be set to an integer between 100 and 1000.
  4. @AbapCatalog.enhancement.quotaMaximumBytes reserves a byte capacity for partner and customer extension fields. It must be set to an integer between 1000 and 3500.
  5. @AbapCatalog.enhancement.quotaShareCustomer assigns a percentage of the reserved field and byte capacity to customer extensions. Currently, the only valid value is 50.
  6. @AbapCatalog.enhancement.quotaSharePartner assigns a percentage of the reserved field and byte capacity to partner extensions. Currently, the only valid value is 50.

Example

The following DDIC structure DEMO_RELEASED_API fulfills all requirements for C0 release and can be extended from cloud projects.

@EndUserText.label : 'Used for demo of C0 Released API'
@AbapCatalog.enhancement.category : #EXTENSIBLE_ANY
@AbapCatalog.enhancement.fieldSuffix : 'EMO'
@AbapCatalog.enhancement.quotaMaximumFields : 250
@AbapCatalog.enhancement.quotaMaximumBytes : 2500
@AbapCatalog.enhancement.quotaShareCustomer : 50
@AbapCatalog.enhancement.quotaSharePartner : 50
define structure demo_released_api {

  product_title   : abap.char(30);
  @Semantics.amount.currencyCode : 'demo_released_api.currency'
  amount          : abap.curr(7,2);
  currency        : abap.cuky;
  @AbapCatalog.anonymizedWhenDelivered : true
  created_by      : char12 not null;
  created_on      : abap.dats not null;
  created_at      : abap.tims not null;
  @AbapCatalog.anonymizedWhenDelivered : true
  last_changed_by : char12 not null;
  last_changed_on : abap.dats not null;
  last_changed_at : abap.tims not null;

}

This example is taken from the ABAP Keyword Documentation and it is part of the package SABAPDEMOS.

How to extend a C0 released ABAP Dictionary object

To extend a C0 released DDIC object, just obey the naming conventions and quota definitions of the extended object. Use the provided field suffix and don’t be greedy – stick to the field and byte limits.

Here’s an example:

@EndUserText.label : 'Demo of extension to C0 Released API'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
extend type demo_released_api with demo_structure_extend {
  @Semantics.quantity.unitOfMeasure : 'demo_structure_extend.zz_unit_emo'
  zz_quantity_emo : abap.quan(15,3);
  zz_unit_emo     : abap.unit(3);

}

This example is taken from the ABAP Keyword Documentation and it is part of the package SABAPDEMOS.

Release Info

C0 developer extensibility for DDIC objects has been available since release 2108, ABAP release 7.85, on premise 7.56.

Related Information

I’ve already published a blog post on developer extensibility for CDS data models: C0 Developer Extensibility for CDS Data Models | SAP Blogs

Further blog posts on developer extensibility for behavior definitions and service definitions are planned.

 

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x