Technical Articles
Integrate SAP S/4HANA Cloud with third-party Warehouse Management System (WMS) by SAP Cloud Platform Integration Suite – Part 1
When you setup a third-party warehouse management system outside of SAP S/4HANA Cloud system, and you need implement shipping order, storage change advice or data exchanging between two systems. This communication works base on SAP Application Interface Framework and Integration Flow.
What You will learn
⭐ How to connect SAP S/4HANA Cloud system with third-party WMS by SAP Cloud Platform Integration Suite
⭐ How to implement data exchange and message transport in integration flow
⭐ How to transform SAP S/4HANA Cloud shipping order to third-party warehouse management system
Prerequisites
Environment
- Entitlements requirement
For the SAP Cloud Platform Integration Suite. You need to have the following available quotas in the space to which you will log on (see Add a New Entitlement to Your Subaccount):Entitlements Plan Comments Integration Suite standard_edition After entitlements assignment, subscribe Integration Suite in Subscription page.
-
Add your user into Users table
- Create integration suite service instance
Choose Process Integration Runtime from Service Marketplace which located in your space. Click Create Instance button to open wizard.
Add following json as parameter, this json is mandatory for entire solution. You could add it manually or download it from Integration Suite tenant security storage.
{"roles":["ESBMessaging.send"]}
Finish the new service key creation, memorize the clientid and clientsecret for subsequent steps. The clientid and clientsecret will be used for outbound service call which should be configured in SAP S/4HANA Cloud communication system.
- Activate SAP Cloud Platform Integration tenant
Navigate to Subscription page, click Go to Application on Integration Suite tile. Activate your CPI tenant, access your CPI tenant after initialization complete. Please refer to this blog post to setup your CPI tenant accordingly. Set Up Integration Suite tenant
Deploy Integration Flow shipping_order in integration suite tenant
The integration flow named as “shipping_order”. SAP S/4HANA Cloud posts out outbound delivery automatically when new document created, the integration flow shipping_order accepts the request and transform to third-party WMS.
Step 1: Create integration flow
Step 2: Accomplish detailed setup for Sender’s SOAP request
- Design Sender
SAP S/4HANA Cloud call out API defined as SOAP protocol, so select SOAP request here.
Edit integration flow, click SOAP, switch to Connection tab. Config endpoint for the integration flow. Setup current integration flow endpoint in Address, it should be unique for identification. We setup/ShippingOrder
here. User RoleESBMessaging.send
is mandatory also.
Step 3: Add Groovy script to capture request payload
Integration flow write logs by Groovy scripts, it helps developer debug data processing and payload details. We can trace the request payload from log info. Add this script to capture the payload.
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message)
{
def body = message.getBody(java.lang.String) as String;
def messageLog = messageLogFactory.getMessageLog(message);
if(messageLog != null)
{
messageLog.addAttachmentAsString("Log incoming request payload:", body, "text/plain");
}
return message;
}
Step 4: Add message mapping for the target third-party WMS
Step 5: Add XML to JSON converter
Step 6: Add receiver to connecting target system
Add a Request Reply after the XML to JSON converter, setup correct connection method to the Receiver. Select correct Authentication from the drop-down list. We use Basic method here. The credential name could be prepared in Manage Security material, CPI save the user & password in parameter wmsuser
, developer just only need invoke the key in the integration flow.
Step 7: Deploy the integration flow
Summary
This blog post complete all configurations and shipping_order integration flow design on SAP Cloud Platform side. The shipping_order integration flow is monitoring incoming message which sent out from SAP S/4HANA Cloud message now. It will be revealed how to make message communication in blog post Part 2.
Relational links:
Great! this is what I am doing now~! study from the note
Dear Arvin,
Does the URL in step6 is the address of host+port+path which given by external warehouse?
Exactly, this URL provided by third-party WMS.
Dear Avrin,
I just test it , but occurred a issue: java.net.ConnectException: General SSLEngine problem,
cause: java.security.cert.CertificateException: No subject alternative names present
I have already add the certificate in the monitoring of the SAP CPI,
Do we need to do something in CPI side? the certificate provided from external warehouse works without CPI.
Thanks!
Hi,
Are you configuring the receiver in the i-flow? If you are using client certificate authentication to connect third-party WMS, you have to upload the certificate into Overview/Manage Keystore firstly, and then consume the certificate alias name in the i-flow.
Arvin
Hi Arvin
does is related with my outbound user in the communication system? or do you have any advice? thanks!
Hi,
This credential is used for the third-party WMS, you can verify it if the connectivity works fine when connecting WMS. I mean you can verify it by any other method not only limited in the i-flow.
The certificate credential is not related with the outbound user in communication system, it’s only for i-flow call third-party WMS.
Regards,
Arvin
Hi Arvin,
Great blog, thanks. Does Integration IFlow can also trigger BTP Workflow service? If yes, do you have any example or links about it? Thanks.
BR,
Frank
Arvin,
Your tips on UUID script and manual Policy removing helped a lot with a similar SOAP scenario.
Wonderful blog series, very detailed! Thanks a lot for sharing