Skip to Content
Technical Articles
Author's profile photo Jacky Liu

Extract and Integrate Data from SAP S/4HANA Cloud by using CPI Part I

In the  blog Extract and Integrate Data from SAP S/4HANA Cloud using CDI by Murthy, the method of data integraion with the tool CDI has been clearly explained .

But some customers haven’t purchased CDI , they only have purchased CPI and they also have the requirements to do data integration with S/4 hana cloud , Is it possible to do this with CPI . By this blog, I want to do some discovery with CPI .

Note:  For data integraion , I recommand SAP Data Intelligence or SDI or BW ETL .But comparing to the method of using business Odata API to do data integration with S/4 Hana Cloud, I recommend to use CDI Api(SAP_COM_0531) with CPI to do data integration.

In the blog Part I , I will show steps to  use postman to test CDI Api(SAP_COM_0531) in S/4 Hana Cloud and communication arrangement is SAP_COM_0531.

 

 

Prerequisite:

1, Customer has S/4 Hana Cloud gone alive

2, You have installed postman .

 

Procedure:

Step 1:  Create communication system, communication user, communication arrangement in S/4 Hana Cloud .

 

Step 2,  Query CDS provider to find the purchase order item provider ID .

 

 

Step 3 , Create  Subscription for purchase order item with following json data :

{"NamespaceID": "ABAP_CDS","ProviderID": "C_PURCHASEORDERITEMDEX","Description": "Data Extraction View for PO Item","Filter": "CompanyCode eq '1710'","Selection":"PurchaseOrder,PurchaseOrderItem,PurchaseOrderType,PurchasingGroup,PurchasingOrganization,Supplier,Material,PurchaseOrderItemText,CompanyCode,NetAmount,LocalCurrency","EntitySetName": "Facts"}

get  x-csrf-token

create  purchase order item subscription :

 

Step 4,  Use CurrentDeltaLink from subscription to do initial  data extract from S/4 Hana Cloud

In initial data extract, the data volumn maybe hug, the data can not be extracted with one extraction, we can use nextLink which include deltatoken and skipToken to do the next initial extraction untill all the data has been extracted .

Step 5,  After all the initial data extractions have been fully done, we can find both CurrentDeltaLink and PreviousDeltaLink in reading subscription, we can use CurrentDeltaLink to do delta data extraction from S/4 Hana Cloud  

The End!

 

In the next blog Part II, I will explain how to use CPI to realize  data initial extract and Delta extact from S/4 Hana Cloud .

Best Regards!

Jacky Liu

 

 

 

 

 

Assigned Tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Igor Zhilin
      Igor Zhilin

      Thanks Jacky

      Could you please explain what happens in step 1 where you "create communication system, communication user, communication arrangement in S/4 Hana Cloud"? What does this accomplish? Why do I need this?

      I mean, if you need to extract data with OData service, is it not enough to create a CDS view with annotation "ODATA.PUBLISH = true"?

      Author's profile photo Ahmed Zakaria
      Ahmed Zakaria

      Hello Igor, The communication arrangement / system step is needed to be able to use the SAP released communication scenario SAP_COM_0531 which is the scenario that enables the usage of the CDI protocol. BR, Ahmed

      Author's profile photo Jacky Liu
      Jacky Liu
      Blog Post Author

      Hi,Zakaria,

      Thanks for the comments!

      Hi, Igor,

      The 3 steps are used to expose an API in s/4 hana could for external calling!

       

      Best regards !

      Jacky Liu