Unlocking Data: How to Retrieve SAP S/4HANA On-Premises Data with SAP Cloud SDK

Mr.Bhoopeshkumar, SAP Integration Consultant, Smartsoft.
Introduction
SAP S/4HANA is a next-generation, integrated enterprise resource planning (ERP) system that leverages the power of SAP HANA, a high-performance in-memory database. With the growing demand for flexibility and efficiency, SAP offers two deployment options: On-Premise and Cloud. To facilitate seamless integration and customization, SAP provides Software Development Kits (SDKs) for both environments.
In this blog, we will explore how to use the SAP S/4HANA SDK to access and manipulate data from both On-Premise and Cloud deployments. We will focus on the Business Partner API as an example to demonstrate these capabilities.
Understanding the SAP S/4HANA SDK
The SAP S/4HANA SDK is a comprehensive toolkit designed to enable developers to build, extend, and integrate applications with SAP S/4HANA systems. The SDK provides a consistent set of APIs and tools to interact with the core functionalities of SAP S/4HANA, regardless of the deployment model.
- On-Premise SDK: This SDK is tailored for on-premise deployments, offering robust tools for deep integration with existing infrastructure.
- Cloud SDK: Designed for cloud deployments, this SDK focuses on scalability and ease of integration with cloud-native services.
Both SDKs provide similar functionalities but are optimised for their respective environments.
Setting Up the SDK
Prerequisites
- SAP S/4HANA system (On-Premise or Cloud)
- Developer account with appropriate permissions
- Development environment (e.g., Eclipse, IntelliJ)
Installation Steps for On-Premise and Cloud SDK
- Access the SAP Accelerator Hub.
- Navigate to either Cloud Edition or S4HANA (On-Premise).
- Select API from the main tab, then All in the secondary tab.
- Search for Business Partners.
- Choose Business Partner (A2X) (V2).
- Click and open the service.
- On the Business Partner Service page, locate the section titled API Resources at the bottom.
- Select the API Specification option.
- Download the EDMX file in JSON, YAML, or EDMX format.
- SAP Accelerator hub
- Navigate to this
- Search
- Business partner
- Navigate Down and download the EDMX file
Utilising the EDMX File
On the Business Partner Service page, navigate to the API consumption tab.
For Java
- Set up a plugin in the xml file.
- When the Java application is triggered, it will build the required files to use the SDK.
- Java SDK Documentation
For JavaScript
- In JS it is really easy there will be cmd that needs to run.
- Run a command in the terminal
- JavaScript SDK Documentation
Note: For both Java and JavaScript, ensure the EDMX file is placed in the appropriate project folder. For Java, place it inside the resource folder; for JavaScript, place it in the root folder.
How to Use the SDK
Documentation :
- JAVA : JAVA SDK Doc
- JAVASCRIPT : JAVASCRIPT SDK Doc
How to GET Business Partner
- Step 1 : You Need to Setup Destination in ENV.
- Step 2 : Access the Destination by using the Destination Accessor.
- Step 3 : Initialise “ BusinessPartnerService ” this will have the url endpoint of the required API Service in your on-premise or cloud.
- Step 4 : Make the Request by using the Destination.
- Step 5 : Almost All the On-premise system and cloud system is private, so you will need to step up header to have authentication credentials.
- Eg : getBusinessPartnerById(“BP_ID”)
Follow the SAP Provided Documentation to find out how to do Create, Updata, Delete, Filter etc…
Conclusion
In this blog, we have covered how to use the SAP S/4HANA SDK to access and manipulate data from both On-Premise and Cloud deployments, using the Business Partner API as an example. By following the steps and best practices outlined, you can effectively integrate and extend your SAP S/4HANA system to meet your business needs.