[SAP S/4HANA CLOUD] – DEVELOPER EXTENSIBILITY IN S/4 HANA CLOUD

Hi guys, when I am working on SAP BTP from Integration Suite, Low code and No code , RAP model, CAP model I focused into terms like ABAP Environment and Side by Side Extensibility

When I worked on SAP S/4 HANA public edition I also explore more detail for SAP S/4 HANA Cloud public edition.

For short

  • I will write S4HC for SAP S/4 HANA cloud public edition

One more time, when explore in S4HC, I saw terms like ABAP Environment, Developer Extensibility, Key user extensibility etc.

Oh, what is this ? When should I use this ? How do I implement this ?

After two weeks explore about extensibity, today I want to share my understand about this and share one simple scenario about Developer Extensibity in S4HC.

Let’s start

EXTENSIBILITY – WHAT IS THIS ?

Today, business requirements around the globe are so diverse, complex, and unique that the standard scope of any ERP cannot hope to cover them all.

To adopt business requirement , before, with ON-PREMISE SAP (ECC, S/4 HANA OP) we often modify SAP object by writting custom code (Enhancement). But when SAP upgrade to cloud, If we still keep way write custom code or modify SAP object but no rules for this, our custom code will by crash. So, how to adopt Cloud-readiness and stable ?

Yes, my answer is by using extensibility options in S4HC.

First, we need to understand What is ABAP cloud development ? Rules for ABAP developement in extensibility.

I am not ABAP developer, so I just share simplest as my understand

ABAP Cloud development

  • Use public SAP APIs (local or remote) released by SAP to access SAP functionality and SAP data.
  • Use public SAP extension points released by SAP to extend SAP objects. Modifications to SAP objects are not supported.
  • Use ADT (ABAP Development Tools) as your ABAP IDE
  • Use RAP (ABAP RESTful Application Programming Model) to build Fiori apps and services. SAP technologies like Dynpro or Web Dynpro are not released for ABAP cloud development.

RULES for ensure cloud-readiness & stable

Rule 1 – Extensions can only use released remote or local SAP APIs. SAP keeps these APIs stable.

Rule 2 – SAP objects can only be extended via predefined extension points. SAP keeps these extension points stable. Modifications of SAP objects as in on-premise systems are no longer supported

Rule 3 – Extensions can only use cloud-enabled and released technologies

Because of Business requirements around the globe are so diverse, complex and unique that the standard scope of any ERP cannot hope to cover them all, SAP S/4 HANA public edition offers powerful, rich, and flexible extensibility options that allow to

  • Add scope to the standard solution by covering specific customer business requirements, as well as creating additional checks and additional process steps
  • Optimize existing processes according to specific business scenarios, harnessing the full power of SAP S/4HANA Cloud, public edition
  • Increase and bring new innovations with a multitude of diverse extensibility tools and available integration services to strengthen your business process
  • Increase the user base as a result of all these activities

Extensibility covers many topics that enable customers and partners to adapt standard business software to their business requirements. This includes changes to software behavior that go beyond the capabilities of business configuration, data model extensions, data exposure, layout changes to user interfaces (UIs) or forms and reports, and creation of new UIs or your own applications.

SAP help document

Overview extensibility model

The following diagram shows the individual extensibility options

EXTENSIBILY – SCENARIO, USE CASE AND BENEFIT

EXTENSIBILITY – EXAMPLES

Ok, after get take a look for extensibility in S4HC I think that I should be do some example for more clearly about this.

Prerequisites

ABAP Development Tool – Eclipse

POSTMAN tool

S4HC developer tenant with role SAP_BR_DEVELOPER

Entity Manipulation Language (EML) fundamental.

RESTful Application Programming (RAP) model

EXAMPLE – CREATE BUSINESS PARTNER

Business Scenario

External system will be create master data for customer or supplier with a less information. After that call API which published by S4HC.

This API will be collect data and insert into ZTABLE.

Every 5 minustes, One job will be schedule to read this table and create business partner in S4HC

Solution Approach
  • Create custom table and CDS view on top of the table
  • Create behavior with manage code with method create, edit, delete
  • Expose projection view for external call with API ODATA V4
  • Create an Application Job template using the Custom Development object. This development object facilitates the business logic (Code developer extensibility with EML in here) within the template.
  • Use the above template to schedule a regularly running job to create a Business Partner that can be viewed in CDS view I_BUSINESSPARTNERTP_3
Solution Details Step by Step

STEP 01Create custom business object (ZTABLE)

STEP 02Create root CDS view for entity

STEP 03 – Create behavior with manage code

Step 04 – Publish API for external system ( Side by Side Extensibility implement)

Create Projection View

Create behavior for projection view

Create Service Definition

Create Service Binding with OData V4

Create Custom Scenario

Add Service Binding into Custom Scenario

Configuration communication system, communication arrangement in S4HC

Test Create with POSTMAN

Step 05 – Write business logic get data from custom table and create business partner (Developer extensibility implement)

Explore Business Object interface of Business partner at SAP API hub

Create class implement business logic

Next step, we will create class implement business logic. This class will be implement two interfaces

if_apj_dt_exec_object

if_apj_rt_exec_object

Create job catalog entry

Create job template base on job catalog entry

Configuration JOB in S4HC reference to JOB Template to trigger create business partner

Test with Job

SUMMARY

In this article, I shared my understand about Extensibility in SAP S/4 HANA Cloud and one very simplest example to desmontrate this. This is steps which did on realtime and code ABAP I will put it in comment below. Thanks for your reading, because of I am not ABAP developer so I appriciatewhen receiver any advise from you. So, any advise kindly leave your comment on this.

Thanks.

Joseph.

One comment

  1. *********************************Code ABAP for implement business logic**********************************

    CLASS zcl_create_businesspartner DEFINITION
    PUBLIC
    FINAL
    CREATE PUBLIC .

    PUBLIC SECTION.

    INTERFACES if_apj_dt_exec_object .
    INTERFACES if_apj_rt_exec_object .
    PROTECTED SECTION.
    PRIVATE SECTION.
    ENDCLASS.

    CLASS zcl_create_businesspartner IMPLEMENTATION.

    METHOD if_apj_dt_exec_object~get_parameters.
    ENDMETHOD.

    METHOD if_apj_rt_exec_object~execute.

    ***********Implement business logic create business partner here******
    ***********By copy code developer extensibility paste here************
    **********************************************************************

    DATA: lt_bp TYPE STANDARD TABLE OF zdmo_i_bp,
    fullname TYPE string,
    ls_bp TYPE zdmo_i_bp.
    ********* Read all entities of custom table
    SELECT bp~student_id,bp~firstname,bp~lastname,bp~country,bp~cityname
    FROM zdmo_i_bp AS bp INTO TABLE @lt_bp.

    IF sy-subrc = 0.
    ” Code here
    LOOP AT lt_bp INTO ls_bp.
    DATA create_partner TYPE TABLE FOR CREATE i_businesspartnertp_3.
    create_partner = VALUE #( (
    %cid = ‘bp1’
    businesspartner = ls_bp-student_id
    firstname = ls_bp-firstname
    lastname = ls_bp-lastname
    businesspartnercategory = ‘1’ ” data example
    “Open filed for insert/update
    %control-businesspartner = if_abap_behv=>mk-on
    %control-businesspartnercategory = if_abap_behv=>mk-on
    %control-lastname = if_abap_behv=>mk-on
    %control-firstname = if_abap_behv=>mk-on
    ) ).
    MODIFY ENTITIES OF i_businesspartnertp_3
    ENTITY businesspartner
    CREATE FROM create_partner
    CREATE BY \_businesspartneraddress
    FIELDS ( country cityname ) WITH VALUE #( (
    %cid_ref = ‘bp1’
    %target = VALUE #(
    (
    %cid = ‘bp1_1’
    country = ‘VN’
    cityname = ‘HCM’

    )
    )
    ) )
    MAPPED DATA(mapped)
    REPORTED DATA(reported)
    FAILED DATA(failed).
    COMMIT ENTITIES
    RESPONSE OF i_businesspartnertp_3
    FAILED DATA(failed_commit)
    REPORTED DATA(reported_commit).
    if mapped is NOT INITIAL.
    “Call delete entity in custom table
    MODIFY ENTITIES OF zdmo_i_bp
    ENTITY zdmo_i_bp
    DELETE FROM
    VALUE #( ( Student_Id = ls_bp-student_id ) )
    FAILED data(failed_delete)
    REPORTED data(reported_delete).
    COMMIT ENTITIES
    RESPONSE OF zdmo_i_bp
    FAILED data(failedDeleted_commit)
    REPORTED data(reportedDeleted_commit).

    endif.

    ENDLOOP.
    ENDIF.

    ENDMETHOD.
    ENDCLASS.

    Like

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.