When you setup a third-party warehouse management system(WMS) 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 create integration flow to connect SAP S/4HANA Cloud
⭐ How to setup SOAP request to call SAP S/4HANA Cloud API
⭐ How to verify message communication in SAP S/4HANA Cloud
Prerequisites
Environment
- SAP Cloud Platform Integration Suite tenant
You need have full control on your SAP Cloud Platform Integration Suite tenant. Highly suggest you read blog post Part 1 in prior to part 3 if you are new in SAP Cloud Platform Integration Suite, you can enable your own SAP Cloud Platform Integration Suite tenant step by step.Access your tenant, and navigate to design page
- Add user material
The SAP S/4HANA Cloud inbound call user could be saved in the security materials, the related credential saves in a parameter, Integration flow invoke the credential by consuming the parameter.
Navigate to Operations View, access Security Material
to Security Material page.
And then Create User Credentials
, define parameter name S4inboundusr
in field Name. Type the SAP S/4HANA Cloud inbound username and password.
Notes: The user CPI_INBOUND_USER has already created in blog post Part 2
Deploy Integration Flow shipping_advice in integration suite tenant
The example creates one integration flow to transform third-party WMS shipping advice back to SAP S/4HANA Cloud system. This blog post illustrates the integration flow design, SOAP request setup and message status verification in S/4 HANA Cloud system.
Step 1: Create integration flow
Select menu
Design, Create integration flow as following model. Some critical points will be noticed in this blog post.
This integration flow triggered by third-party WMS, when WMS operator complete picking and real shipping, third-party WMS trigger the integration flow. Integration flow call SAP S/4HANA Cloud SOAP API to complete shipping.
Step 2: Accomplish detailed setup for Sender request
The third-party WMS call out API defined as HTTPS protocol.
Edit integration flow, select HTTPS, switch to Connection tab to configure endpoint in
Address, it should be unique for identification. We define it as
/ShippingAdvice
here. User Role
ESBMessaging.send
is mandatory also.
Step 3: Add JSON to XML Converter
Add a new
JSON to XML converter
to convert data format.
Step 4: Add Message mapping
Add a new message mapping, create fields mapping here.
Step 5: Edit SOAP request header
This step is critical for the scenario. SAP S/4HANA Cloud inbound SOAP API call must include messageID which defined as UUID, but there is no place to define messageID in the integration flow design. So, we must add it in SOAP request header by manual scripting.
Add a
Groovy Script
, and then access the script develop view. This script will generate a random UUID, and then insert into SOAP request header. Create following script accordingly.
import com.sap.gateway.ip.core.customdev.util.Message;
import javax.xml.namespace.QName;
import com.sap.gateway.ip.core.customdev.util.SoapHeader;
def Message processData(Message message) {
def headers = new ArrayList();
def uuidCode = UUID.randomUUID().toString();
def xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><messageId xmlns=\"http://www.sap.com/webas/640/soap/features/messageId/\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">urn:uuid:" + uuidCode + "</messageId>";
def header = new SoapHeader(new QName("http://www.sap.com/webas/640/soap/features/messageId/", "messageId"), xml, false, "");
headers.add(header);
message.setSoapHeaders(headers);
return message;
}
Step 6: Add Request Reply
The integration flow almost done after SOAP header assembled. Add a new
Request Reply
.
Step 7: Setup Receiver
Add a new
Receiver
, select protocol
SOAP 1.X
from list.
- Upload WSDL file Click any blank area in integration flow, switch to
Resources
tab, Add
the file WAREHOUSESHIPPINGADVICE_IN.wsdl
- Define SAP S/4HANA Cloud inbound API endpoint in Address
Fetch the API URL from communication arrangement in SAP S/4HANA Cloud. regarding to the details, please refer to Step 3 of blog post Part 2.
- Select WSDL file
Click SOAP on Receiver to access SOAP configuration view, and then select the wsdl file from list.
- Setup credential for API call Input S4inboundusr in
Credential Name
. And keep None
in WS-Security.Notes:
The shipping advice related WSDL file could download in SAP S/4HANA Cloud communication arrangement. If you met policy errors after selecting the wsdl file, you can remove all policy chapters on your local disk manually and then re-upload wsdl file to integration flow. Delete and add the Receiver again to make sure change take effects. SAP S/4HANA Cloud doesn't validate policy during the SOAP API call.
Step 8: Deploy the integration flow shipping_advice
Click
Deploy to deploy integration flow, after deployment complete, navigate to
Operations view
. Click
All tile in Manage Integration Content section, check the integration content details view.
Test shipping_advice call back scenario
- Trigger integration flow call from third-party WMS
Trigger the integration flow call from third-party WMS, login integration suite tenant and then navigate to Operations view
, check new messages. There should be one new message received.
- Check message status in SAP S/4HANA Cloud
Login SAP S/4HANA Cloud by user administrator, open app Message Dashboard in group Message Monitoring.
Search out message result for today, check the namespace 3PLWSHPADV/1
Click the link to access message details. The message has already transformed successfully.
- Check outbound delivery document status
Login SAP S/4HANA Cloud by user shipping_specialist, open app Display Outbound Delivery, and then input document number 80000034, check the Document Flow
, Post goods issue has already created automatically.
Summary
This full blog post includes 3 parts, the first part introduces how to configure Integration Suite tenant and build up the integration flow shipping_order which receive SAP S/4HANA Cloud outbound delivery document. The second part explains how to setup communication in SAP S/4HANA Cloud side and create outbound delivery document to connecting the scenario. The third part illustrates how to call back shipping_advice to SAP S/4HANA Cloud. The third-party Warehouse Management System integration scenario works now.
Relational links:
Integrate SAP S/4HANA Cloud with third-party Warehouse Management System (WMS) by SAP Cloud Platform...
Integrate SAP S/4HANA Cloud with third-party Warehouse Management System(WMS) by SAP Cloud Platform ...