API Integration with SAP IBP via OData for SAP/ Non SAP Source Systems
www.valantic.com

API Integration with SAP IBP via OData for SAP/ Non SAP Source Systems

API Integration

SAP Integrated Business Planning for Supply Chain (SAP IBP) is powered by SAP HANA in-memory technology. This cloud-based intelligent solution combines sales and operations planning (S&OP), forecasting and demand, supply, demand-driven replenishment, and inventory planning. Few times, clients has the requirement to consume of data from third parties. Hence, SAP has provided provision of OData APIs to consume data from various data stores like Fiori, SAP Analytics Cloud, HANA cloud Platform mobile services etc. in a simple and standard way.

Why OData APIs are important?

From the business standpoint, there are a lot of advantages to leveraging this standard. it accelerates development, it saves money because we’re not coding, and it enables us to be connected to numerous tools that already support using data from an OData source – such as Excel, Tableau, and integration platforms etc. It Supports HTTP, Atom Pub, and JSON format as well and Retrieval of data can be done based on the URL.

Configuration of?OData service with SAP IBP for Supply Chain

Communication User and System

For any integration with external source , we need to establish the communication with IBP and the communication management apps helps to integrate IBP with other systems to enable data exchange. Below figure shows all required steps to establish connectivity for efficient data exchange.

No alt text provided for this image

The first step is to create and maintain communication user. This communication user is required to access the Odata query URL from any application using User ID/password. Authentication type can be a basic authentication (Plain username and password) or certificate-based communication (SSL Client certs).

Now navigate to IBP home screen and search for Communication system. ‘Enter the hostname and other required parameter details for consumer system. If the selected scenario contains inbound services, select the user for inbound communication that have been created earlier.

No alt text provided for this image

Communication Arrangements

Navigate to IBP home screen and search for communication arrangements tile to?create a new arrangement. Select the relevant communication scenario which needs to be used. In this case it will be?SAP_COM_0720 - IBP External Planning Data Integration.

Provide a relevant name for the communication arrangement?and assign the communication system and user created in earlier step. If the selected scenario contains outbound services, we have to enter the outbound user information.

No alt text provided for this image

After selecting scenario, in communication arrangement, we will be able to see inbound/outbound services of the scenario. The supported application protocol along with URL is provided.?This URL will be used as endpoint of IBP to exchange data services.

Global Configuration

In addition to above?setup, there are few parameters in IBP configuration which should be set with correct values. For that in IBP home page, Search for global configurations and for parameter group FLEXQUERY. Set the value for parameter?PLANNINGAREA?and RELEVANT_MDT_FOR_MD_API.

Value for Parameter PLANNINGAREA should be the name of planning area which should be used in IBP scenario. Also, RELEVANT_MDT_FOR_MD_API is used to set the name of master data table with which data should be integrated.

Once the initial communication setup is done, IBP APIs are ready to consume. Let’s start to make SOAP and OData calls to IBP APIs using the ‘API_User’ user Id and password.

Fetch CSRF Token

To establish the connectivity with IBP to import master/ key figure data, we need csrf-token value from IBP.?Here we will use POSTMAN tool for connectivity and integration testing. For fetching the token , Copy the “Service URL/Service Interface” from the communication arrangement app in IBP and?create a new request using GET method in postman for master/key figure data created in communication arrangement. Provide the credentials in Basic authentication method which we created earlier in IBP.

Now, in the header section, add a key to fetch the value of csrf-token and second one for content-type as JSON format as shown in below figure.?

No alt text provided for this image

Using Restful APIs, we can write different form of operations / queries on OData services while integrating data to IBP. Now click on the send button to send the request to IBP. In response we will receive the CSRF- token value. We will use this token value for further communication with IBP for each operation.

Insert / Create data in IBP

To insert/create records in IBP we will be using the POST method and service URL. Create a new POST request with the same credentials and CSRF- token value obtained in the previous steps.

In Body section, provide transaction ID value, requested attributes of table, planning area and version ID details. Also add the values of requested attributes which needs to be inserted in IBP. Add Master/ Transaction data table name at the end of service url with suffix as Trans (If wer table name is PRODUCT, then service url would be https://xxxx.xx.xx.ondemand.com/sap/opu/odata/IBP/MASTER_DATA_API_SRV/PRODUCTTrans )

No alt text provided for this image
No alt text provided for this image

In Requested Attribute section,?define all the attributes which are mandatory, and for which data will be send through API. Importing master and key figure data is possible in every version. If we wish to modify the attributes of a version-specific master data type, we can define the PlanningAreaID together with the VersionID in the request body.

Master data is permanently saved in SAP IBP system through sending a commit. If the value of Docommit is true then data will be permanently saved in IBP.

Data is disaggregated only to time periods. That is, using the service, we can import all key figure data either to the base planning level or to a time aggregated, but all values have to be on the same planning level, even if the request contains data of multiple key figures.

No alt text provided for this image

After sending the request, we will get response with status as 201 created.

For Key figure data,?we can track changes made by the service if we enable change history by selecting Data Import using /IBP/PLANNING_DATA_API_SRV OData service in the Settings for Change History app.

No alt text provided for this image

Need to know how valantic specializes in forecast to execute external custom algorithms by deploying API’s for Integration driving the end-to-end solution for the customers.

??write us at [email protected]

Hi Thanks for sharing your ideas and thoughts it would be helpful to all, I need your help for ODATA services basically I am Plant maintenance consultant recently I got one project, so from the SAP by using the BAPI to create the notification and create the ODATA services for the functional module and send the data to the another system for this do you have any documents please share with me it is very helpful for my project. [email protected]

回复

要查看或添加评论,请登录

valantic India的更多文章

社区洞察

其他会员也浏览了