Skip to Content
Technical Articles
Author's profile photo Subrahmanyam Potturi

Implementation of CDS Extensibility for S/4 HANA

Extensibility

Extensibility allows customers to adopt standard business software to their business requirement and it offers more convenience for customers in their end to end scenarios.

To achieve this we need to prepare suitable extension points by defining corresponding DDIC artefacts, registering extension options and preparing application code for dealing with the extended structures at runtime. It is applicable for both on-premise and cloud customers.

The following entities can be extended.

  1. CDS Views
  2. Screens
  3. Reports
  4. Email and form templates
  5. BAdi Implementations

In this blog, we will see how to implement CDS Extensibilty.

Advantages of CDS Extensibility

  • Custom fields can be extended along with SAP standard fields.
  • Enables to add the association of custom field extend CDS view with standard extensible CDS view.
  • Possible to extend unions and views with aggregations.

Scenario: For On-Premise customers, they can extend any standard CDS views by using backend tools like ADT(ABAP Development Tools) or HANA Studio. Whereas cloud customers, cannot add their custom fields to any standard CDS views as they don’t have access to backend tools. In order to overcome this, we will create CDS extensibility where they can do the same by using “Custom Fields and Logic” App.

Required Steps for Extensibility Enablement of the CDS Model:

  1. Create two Extension Include DDIC Structures.
  2. Include Persistent Extension Include DDIC Structure into DB Table.
  3. Create Extension Include CDS View.
  4. Create Associations from the Extensible CDS views to the Extension Include CDS View.
  5. Create Business Context in Extensibility Registry.
  6. Define Extensible CDS Views in Extensibility Registry.

Step 1: Create two Extension Include DDIC Structures.

Creation of Persistent Structure and Transient Structure and their naming conventions as shown below.

Extension Include DDIC Structure for Persistent Extension Fields.

 

Extension Include DDIC Structure for Transient Extension Fields(This will be used for OData Extensibility)

 

Step 2: Include Persistent Extension Include DDIC Structure into DB Table.

 

Step 3: Create Extension Include CDS View

Step 4: Create Associations from the Extensible CDS views to the Extension Include CDS View.

Step 5: Create Business Context in Extensibility Registry.

T-code : SCFD_REGISTRY

Create Business Context in T-code “SCFD_REGISTRY” and provide Persistence Include, Transient Include which has been created in Step 1.

Field Suffix: All the custom fields which will be created by “Custom Fields and Logic” App will be suffixed with the name ‘XX1’ given in “Business Context”.

 

Step 6: Define Extensible CDS Views in Extensibility Registry.

T-code:  SCFD_REGISTRY

In  “Extensibility Registry” Navigate to “Extensible CDS View” tab and create Extensible CDS view by providing the details which has been created in previous steps as shown below.

 

Creation of custom fields to Extensible view using “Custom Fields and Logic” App.

  1. Login to Fiori Launchpad.
  2. Search for “Custom Fields and Logic” App.
  3. Navigate to “Custom Fields and Logic” App.
  4. Click on “Custom Fields” tab.
  5. Click on Add New Field( ‘+’ ).
  6. Select “Business Context” Description from the drop-down list and provide the custom field details.
  7. Click on the “Create” button.

 

Enable Usage and Publish Enablement

  1. Click on “UIs and Reports” tab and click on “Enable Usage” for extensible CDS view.
  2. Publish the custom field by click on “Publish” button.

 

DDIC Artifacts after Publishing a Custom Field:

After publishing the custom field the following DDIC objects Domain, Data Element, Append Structure will be generated in Backend. The append structure will be included in Persistent Structure and Custom field will be inserted in the DDIC table.

Extension of Extensible CDS views with the custom field.

A spiral symbol will appear at Extensible CDS view with the Extended custom field and added custom field will be displayed in the result set of CDS view along with standard fields.

In this way, we will implement CDS Extensiblity so that the customers can create their custom fields along with standard fields by using “Custom Fields and Logic” App.

Assigned Tags

      8 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Michelle Crapo
      Michelle Crapo

      Nice!   I created my own ABAP CDS.  (First time)  I'm now wondering if I could have just used an extension.  I know I will be looking at libraries from this point forward.

      Thank you,

      Michelle

      Author's profile photo Diwakar Matham
      Diwakar Matham

      Interesting!! Thanks for your lucid explanation 🙂

      Author's profile photo Markus Hapke
      Markus Hapke

      Hello Potturi, pretty comprehensive illustration .

       

      Question Does this only work for a S4/HANA or a regular on-premise Installation ( provided the release level is sufficient ) ?

      Thank you in advance,

      Markus

      Author's profile photo Alessandro Spadoni
      Alessandro Spadoni

      Hi, this is an interesting option,

      but how you created a custom business context?

      If I try to create from SCFD_REGISTRY it seems can't be created if the system is not an internal SAP System

      check%20in%20SCFD_REGISTRY

      Thanks

      Author's profile photo Paul McFarling
      Paul McFarling

      Same here. We've reached out to SAP, will let you know what they say. I assume customers/partners aren't supposed to be doing this. The internal check checks for the existence of a packagee that is not on our systems.

      Author's profile photo Markus Hapke
      Markus Hapke

      Hello Mr McFarling,

      did you receive any answers from SAP to this issue?

      Regards, M.Hapke

      Author's profile photo Paul McFarling
      Paul McFarling

      Here is the email I received: 

      <Name Omitted> is right, it’s SAP only. Neither partner nor customer apps are supported in key user extensibility. It’s on the roadmap, but not yet there.

       

      However, there are always some buts:

      Customers can extend partner apps or their own using classic extensibility (ABAP Workbench in OnPremise) or Developer Extensibility (“Embedded Steampunk”).
      The blog https://blogs.sap.com/2018/10/03/implementation-of-cds-extensibility-for-s4-hana/ is exactly about this part (=non key user, but similar technical approach).
      Also the new paper https://www.sap.com/documents/2022/10/52e0cd9b-497e-0010-bca6-c68f7e60039b.html is about developer extensibility in that aspect.

       

      “Key user extensibility” and “App” are not quite well defined.

      For UI5 folks an app is something that can be added to the Fiori Launchpad. For other, it’s ABAP code in the backend.

      I think Jocelyn’s blog SAP Fiori for SAP S/4HANA – What is Key User Extensibility and Who are your Key Users | SAP Blogs is about the Fiori/UI5 part only.
      Extending the Fiori App of a partner by means of UI5 key user tools is possible – but not the backend (custom fields, custom logic)

      Author's profile photo Markus Hapke
      Markus Hapke

      Cheers Paul for that reply to my answer.  Nice, when such blogs leave a way out, if one gets stucked at a certain point. M.