Integrate SAP S/4HANA Cloud with SAP Cloud Platform Integration using SOAP APIs – Part 1
SAP Cloud Platform Integration (SAP CPI) simplifies the custom-driven integration with SAP S/4HANA Cloud by using a wide variety of SAP S/4HANA Cloud APIs. These APIs play the major role in exchanging data with other systems. Offering OData and SOAP protocol based APIs SAP S/4HANA Cloud is perfectly equipped to meet this requirement now and in the future. The central tool to explore all available SAP S/4HANA Cloud APIs is the SAP API Business Hub.
This blog series consists of two Blog posts. In this series the integration possibilities between SAP S/4HANA Cloud and the SAP CPI will be outlined by using a SOAP API of SAP S/4HANA Cloud to replicate business data to the SAP CPI. As SOAP APIs are best suited for a asynchronous exchange of have weight data and is mostly used in the Business-to-Business and Application-to-Application context this blog series uses SOAP APIs.
Deploy the integration flow on the SAP Cloud Platform Integration
The following steps describe how to deploy your integration flow (iFlow):
- Logon to the SAP CPI with the appropriate user roles assigned. The four appropriate user roles are as follows (for more details visit the SAP CPI help page):
- Switch to the Design menu option in the main menu on the left.
- Create a Package.
- Open the Package by clicking on it and create an Integration Flow in the ARTIFACTS tab.
- Connect the Sender with the Start event by drawing a message flow between them.
- Select SOAP as adapter type and SOAP 1.X.
- Open the message flow settings by clicking on it and open the Connection tab. Enter a desired Address for your endpoint on the SAP CPI.
- Finally deploy the iFlow on the SAP CPI.
Important Remark: No WSRM policies allowed!
The SOAP 1.x adapter does not support WSRM. Make sure the used WSDL does not contain such policies or use the adapter without WSDL. In future a check will be introduced raising an error in case WSRM is defined in the WSDL.
Retrieve the endpoint of the iFlow
This step describes where to find the endpoint url of your recently deployed integration flow. Both information will be needed during the setup of the Communication Arrangement in the SAP S/4HANA Cloud system.
- Switch to the Monitor menu option in the main menu on the left.
- Navigate to the Manage Integration Content section.
- Select the iFlow in the Integration Content navigation pane.
- Copy the complete URL displayed in the Endpoints tab and save it for later. The URL consist of the host name and the specific path of the iFlow.
- Continue with the SAP S/4HANA Cloud setup which is described in this blog.
Setup the Certificate-to-User-Mapping
To enable the communication between the SAP S/4HANA Cloud system and the SAP CPI system you have to upload your authentication certificate of the SAP S/4HANA Cloud system into the SAP CPI. To do so:
- Switch to the Monitor menu option in the main menu on the left.
- Open the Certificate-to-User Mapping App in the Monitor Dashboard.
- Enter the SAP CPI user name and choose the certificate of the S/4HANA Cloud system downloaded during the setup of the Communication Arrangement.
Monitor replicated data
After replicating the data in the SAP S/4HANA Cloud system (described in this blog) the data was sent to the endpoint configured in the iFlow on the SAP CPI. Proceed as follows to Monitor the data replication:
- Open the Message Processing Monitor.
- Select the iFlow in the left navigation pane.
The detailed communication log of the data exchange between the S/4HANA Cloud system and the SAP CPI are shown in the message processing logs which can be found on the right side of the screen.
Thanks for the Blog.This is very helpful for S/4 HANA beginners like me. We have some integration requirement with S/4 HANA and external system using CPI. Can you please suggest which would be the best methodology( SOAP API/ IDOC/ODATA SERVCES) from S/4 HANA back end point of view. We have master data interface like Customer master /Material Master and also few transnational data interface like Sales Order /Purchase Order Etc.
Connection to HCI from S4 Hana Cloud is established using Communication Scenario, Communication Scenario is a package of Communication provisions ( might be based on SOAP , IDOC, REST etc.) particular for a Business Integration Scenario like Customer Integration , Material/Product Integration , Sale Order etc.
So SAP has provided Communication Scenario and inside those you can Select option you want to .
For SAP Sales Order Inbound : Comm Scenario = SAP_COM_0109
For Customer/Business Partner Creation Outbound : Comm Scenario = SAP_COM_0008
For Material/Product Integration : Comm Scenario = SAP_COM_0009
For Sale Documents Outbound : Comm Scenario = SAP_COM_0223
For Reading Organizational Data from SAP S4 : Comm Scenario = SAP_COM_0087.
Create Communication Arrangements using these to explore the options ( SOAP/REST/IDOC ) each and every individual Comm Scenario offers for integration.
Thanks Srijin for your reply,
I have another query regarding CPI integration. Do we need to do any configuration in S/4 HANA back end system as part of ABAP developments or all the configuration steps needs to done in CPI integrator.
the SAP S/4HANA Cloud system setup is described in this blog:
Am quite new into this and I have minimal idea regarding ABAP related developments to be carried out in S4 Hana Cloud.
you can explore all available APIs on the API Business Hub on api.sap.com. There you find the necessary communication scenario number for each API which are SOAP and OData services.
Authentication method for Outbound Communication in our scenario is based on "User-id and Password" , do we still need to upload Authentication Certificate to be uploaded for establishing the connection between S4 Hana Cloud and CPI ?
no you can use both independently.
I am trying to Implement Sale Order replication to HCI and as mentioned by you ( in another blog) once am using Communication Scenario SAP_COM_0223.
But as contradictory from the Part 2 of this blog in which we are giving "Replication Model" in Additional Properties of the Outbound setting , there is no such Additional Properties with "Replication Model" in case of Sale Order Integration ( SAP_COM_0223). Please find the screenshot.
So how to establish connection in this scenario ?
Even the "Check Connection" button is not showing activated ( you can see in screenshot).
As in Part 2 of this blog we are activating the Replication Scenario using Replication Model , can you please suggest what to do in this case as there is no Replication Model being asked here.
Your suggestion would be very helpful for many here who need to replicate transactional data to HCI like Sale Order, Purchase Order. There is no blog explaining this kind of scenario that's the reason finding it difficult to get it done.
the "replication model" is not always there. It depends on the use case of the APIs. For master data there is usually the DRF framework used which then requires a "replication model". For transactional data there is no need to replicate data as it would be for master data. And as the SAP_COM_0223 is for transactional data there is no possibility to maintain a "replication model". The sales order confirmation gets distribute by the system every time the sales order is created.
This setup is described in detail in the setup guide of scope item 2EL:
I have gone through this document , so it shows a "Process flow" where they have outlined a S4 Hana Cloud Sale Integration with a Buyer Side Client, but its nowhere mentioned what are the Technical and Configuration setups to be done to achieve this.
I am looking for the "Send Order Confirmation" part only, if you could provide a document which explains what EDI related setup need to be done for this it would be very helpful.
I was finally able to download 2EL document from a "Integration Package" using CPI System ( used Discover option of CPI ).
We are following the same and setting up the EDI configs and getting the below error message.
It says "No active outbound service could be found.) , but we have already setup a Communication Arrangement using Scenario SAP_COM_0223 with correct endpoint URL of CPI/HCI side in the Outbound side. Could you please guide where we would be missing.
We have assigned the Recipients as well:
But still the Output message for EDI persists and we are not able to push data to HCI.
did you maintain the setting in the BRF+ properly as well ?
First very thanks for your prompt response.
Will check with Functionals and paste the screenshots of BRF+ done in our S4 System asap.
One question while maintaining Recipients what should we provide under Alias ?
In our case we have provided here the S userid of the CPI Credential ( User Id ) which we have defined for Outbound Communication in Communication Arrangement. Is this fine ?
Please find the below details on BRF+ details maintained for carrying out Output determination:
We are creating Sale Orders which satisfies above rules and still we are getting below error message :
Please tell where we could be missing ?
could you please open a customer incident on this as the settings as such seems to be right from my point of view.
Will proceed as you suggested.
Thanks for your efforts and time.
I have a question regarding our ERP to S/4 Hana Cloud project:
We have the FI module in the S/4 Hana Cloud, and we have the HCM module in the ERP ABAP System On Premise.
We have to transfer HCM masterdata from that HCM system to the S/4 Hana Cloud, and we have to transfer FI data (like cost centers) from the S/4 Hana Cloud to the HCM System.
Our plan is to use the SAP Cloud Connector and the Cloud Platform Integration between these systems.
Do you know, exists there any predefined Szenario for that data transfer.
If I discover the predefined Szenarios within the CPI, I can find about 130 of them, but nearly all of them are for connections to SuccessFactors.
If I check the Communnication Arrangements within the S/4 Hana Cloud I can find the following, interesting ones:
.) GEM Service Cost Level Export OData V2 https://myxxxxxx-api.s4hana.ondemand.com/sap/opu/odata/sap/YY1_GEM_SCL_EXP_CDS
.) WorkforcePersonMasterDataReplicationRequestResponse_In SOAP https://myxxxxxx-api.s4hana.ondemand.com/sap/bc/srt/scs/sap/workforcepersonmasterdatarepli
It seems the dataflow between S/4 Hana Cloud and the On Premise ERP system can work via the follwing protocols: SOAP, OData V2, RFC and Idoc
Do you know, exists there any guide that describes how to establish the connections by using these Aplication Protocols?
Are there different guides for the configuraton of all theses Aplication Protocols available?
Is there a cloud connector for the connection with the ERP system required? Is that Cloud Connector required for all these aplication protocols?
Thanks a lot for your help!
Great blog and I wish we had this when we originally setup our EDI.
Currently the connection from our S4Hana Cloud to CPI uses a user name and password, however I wish to change this to use an SSL certificate as detailed in section 'Setup the Certificate-to-User-Mapping' and in part 2 of the blog.
I have set the user for outbound communication to use SSL Client Certificate - Default Client Certificate, I have then downloaded the certificate from the communication arrangement and uploaded to CPI.
But when we create outbound messages in S4HC the messages are showing up in error with HTTP Code: 403 (Forbidden)
Have I missed something? Change it back to User name and password and it works again.
Resolved - the user for the SSL certificate was missing authorisation on CPI
I have configured the same as above for business partner outbound , in S/4HANA the replication status is successful but no response in CPI. Please help me to overcome this issue.
please check your configured endpoint in the communication arrangement and the certificate or user. And check if you have the required roles to execute a iFlow on the CPI.
Thank you for your Response. I solved that problem ,resolution is I didn't add my CPI credentials as outbound User in Communication Arrangement.
Marcel I have one more doubt . I have Configured a scenario for IDOC inbound to S/4HANA. I am getting the below error.
org.apache.cxf.binding.soap.SoapFault: A/EA/706 (No authorization to send IDocs with message type
The error shows that its a type of authorization based error. So,can you please tell me what is the authorization role to be added to overcome this issue.
I'm going to integrate sap s4Hana cloud to Success factor via CPI. This is my first integration with cpi earlier i worked on SAP PI. Could you please guied me and tell me the needful configuration for SAP s4 hana cloud. And also how can I replicate the query from S4hana cloud to CPI.
I'm going with JB1 document provided by sap, But the integration not working.
Can we use EDI to integrate with S/4 HANA cloud from Non SAP system? Lets say i want to use some custom IDOC"s.Note 2653671 says only limited support after applying request.
Its a nice blog. I have followed almost everything but only the difference i have with me is we are having CPI cloud foundry env. Could you please help us with how we need add the certificate user mapping step completed in CPI CF env.
unfortunately I am to able to assist here. I would highly recommend to check the Integration Suite docu on SAP Help.