Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (2024)

SAP ERP Central Component(SAP ECC) is usually implemented usingAdvanced Business Application Programming(ABAP) for business implementation. However, the way this implementation manages critical business information can be challenging and risky, even though the implementation itself is quite valuable.

Is it possible for the SAP ECC customers to build an extension application onSAP Business Technology Platform(SAP BTP)and leverage the benefit ofSAP HANAto make their business much faster? Yes, it is; by using the Side-by-Side Extensibilityfeature of SAP ECC. This extensibility offers a lot of new use cases without disturbing the core implementation, such as IoT scenarios, SAP and third party application integration, and integrating SAP ECC real time data with cloud applications.

This blog post primarily targets those who wish to try their hands on various technologies on SAP Cloud Platform, likeSAP Cloud Application Programming Model,SAP Enterprise Messaging,SAP Cloud SDK,SAP Integration Suite,andSAP Fiori Elements. This will also help to understand a few ABAP basics for creating a quick backend API in SAP ECC and Node.js for creating a business application on the SAP BTP.

We will see how to create a Business Partner oData Service in SAP ECC and then call this SAP ECC oData Service using the SAP Cloud Application Programming model locally, with basic authentication. However, the question arises as to why we should create this service in SAP ECC. Is it possible to get this API from theSAP API Business Hub?


Yes, this API is available in the SAP API Business Hub forSAP S/4HANA, unfortunately it’s not available for SAP ECC and the main blocker is the fact that this API works as a bridge between the backend and SAP Business Technology Platform. This API can, however, be created for SAP ECC as well and in this blog post we are going to replicate the SAP S/4HANA Standard Business Partner Service API_BUSINESS_PARTNER using it’s EDMX. This is, of course, accompanied by a lot of advantages, such as there will no longer be a requirement to change a business application to migrate from SAP ECC to SAP S/4HANA as the EDMX of SAP ECC will be similar to that of SAP S/4HANA.

You will soon see how one Cloud Business Application can pull both SAP ECC and SAP S/4HANA master data. So, let’s get started!

Create Business Partner oData Service



  1. Navigatehere to download the EDMX of Business Partner from API Business Hub.


Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (1)

2. Navigate to the transaction SEGW to create a Project.

Enter the data as shown below:

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (2)

3. Navigate to File → Data Model → Import → Data Model

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (3)

4. Import the EDMX file of the downloaded API_BUSINESS_PARTNER using Browse → Next.

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (4)

All the entities are automatically imported through the EDMX file. Click on Finish.

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (5)


Note: You might face an issue while importing the EDMX, due to an error in the conversion of data type. Please ignore the error for this scenario and continue for generation.

5. Click in Generate to enable DPC, MPC, Model, and Service successfully. You can save this either in the Local Package or in the Transport.

You will get a dialog box with a message “Do you still want to generate runtime artifacts (yes/no)”; select Yes.

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (6)

The following success messages will show all the registered Models and Services:

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (7)

6. Navigate to Service Runtime Artifacts.

Right click on the runtime artifact ZCL_ZAPI_BUSINESS_P_DPC_EXT Go to ABAP Workbench.


Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (8)

7. You will be navigated to the data provider class builder, where all the CRUD-related operations for the required entity set are implemented.

You can find all the required business entities at Expand Class -> Methods -> Inherited Methods. You must redefine each entity that has to be implemented.

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (9)

For example, find entityA_BUSINESSPARTNE_GET_ENTITYSETand redefine as shown below.

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (10)

Copy and paste the code below in the entity A_BUSINESSPARTNE_GET_ENTITYSET.

METHOD a_businesspartne_get_entityset.
* &--------------------------------------------------------------------------------------------*
* & Data Declaration
* &--------------------------------------------------------------------------------------------*
*Fetch the Business Partner Detail from Business Partner Master Table into local internal table.
SELECT partner,
name1_text,
bu_sort1
FROM but000 INTO TABLE @DATA(lt_partner)

*Pass the record of local internal table record to output entity of Business Partner API
LOOP AT lt_partner INTO DATA(ls_partner).
APPEND VALUE #( businesspartner = ls_partner-partner "Business lv_partner
businesspartnerfullname = ls_partner-name1_text "Business Full Name
searchterm1 = ls_partner-bu_sort1 "Search Term
) TO et_entityset.
ENDLOOP.
ENDMETHOD.


Note: This code snippet is written so that the select query to fetches all records. However, it is recommended to use BAPI, to select single record.

You must save the code after it is pasted. You can then check the code syntax. If there is no error, you can activate the object. Once the activation is successful, you will get the following message:

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (11)

Note: Never perform a forced activation, as it will dump the object. If activation is failing with errors, revisit the previous steps and ensure that every step is performed properly.

Register Your oData Service



  1. Navigate to the transaction /n/iwfnd/maint_service and click on Add Service to register the service.


Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (12)

2. Follow the steps below to register the newly created Business Partner in Gateway.

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (13)

3. The service will be visible in your gateway service catalog once it’s registered.

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (14)


Test Your Service



  1. Click on Registered Service SAP Gateway Client


Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (15)

2. Click on Execute and you should see the status code 200 in your response body.

Any status code other than 200 means there is an error in service activation.

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (16)

3. In the response, you might notice that all the entity sets belong to the standard service API_BUSINESS_PARTNER, such as A_BusinessPartner and A_BusinessPartnerAddress. In other words, it has inherited all the properties of the standard business partner.

4. You can see the metadata of this custom service by putting $metadata at the end of url; you will see the namespace API_BUSINESS_PARTNER.

Isn’t that cool!

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (17)

5. Change the requested URI and put A_BusinessPartner after the Service, as shown below.

6. Click on Execute and you should see the status code 200 in your response body.

Any status code other than 200 means there is an error in service activation.

7. Below, you can see all the backend data pulled by your service in response:

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (18)

Test From Postman

You need the IP to access your API from outside SAP ECC. It will be the same IP and you would need it while you configure the cloud connector. There are many ways to get it, such as the transaction SMICM and the Gateway.

Inside the Gateway, you can directly click on Call Browser and the service URL will pop up with the IP and PORT.

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (19)

Once you get the IP and PORT, you can access from POSTMAN easily.

If you select Authentication Basic Auth, your username will be your SAP logon user ID and the password will be your GUI password.

.

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (20)

Conclusion

Creating an oData service in SAP ECC from EDMX of standard services comes with a lot of advantages, such as getting rid of manual creation of complex entities. Since the Association and Navigation property remains the same, the way of calling these services, as compared to standard, remains unchanged.

What Next

In my blog post , we will see how we can consume this service fromSAP Cloud Application Programming Model, and use the same application for accessing SAP ECC and SAP S/4HANA master data.

In a later blog post, you will also be introduced toSAP Enterprise Messaging,SAP Cloud SDK,SAP Integration Suite,andSAP Fiori Elements,and also try to build an extension scenario based on these services.

SAP ERP Extension on SAP Discovery Centre

We have recently released a Mission for an event-driven extension scenario for SAP ERP 6.0, which is available onSAP Discovery Centre. You can watch the Mission Demo videohere. This will demonstrate how we can extend the SAP ECC without disrupting any core business processes. To get more insight about our extension scenario and steps involved, please refer to the sample reference applicationhere.

Bridging the World between SAP ECC and SAP Business Technology Platform through Event-Driven Architecture – Part 1 (2024)
Top Articles
Latest Posts
Article information

Author: Wyatt Volkman LLD

Last Updated:

Views: 5525

Rating: 4.6 / 5 (66 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Wyatt Volkman LLD

Birthday: 1992-02-16

Address: Suite 851 78549 Lubowitz Well, Wardside, TX 98080-8615

Phone: +67618977178100

Job: Manufacturing Director

Hobby: Running, Mountaineering, Inline skating, Writing, Baton twirling, Computer programming, Stone skipping

Introduction: My name is Wyatt Volkman LLD, I am a handsome, rich, comfortable, lively, zealous, graceful, gifted person who loves writing and wants to share my knowledge and understanding with you.