Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member681427
Participant
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.


  • Setup Role & Role Collection
    New create a role collection such as "CPI", and then assign related Integration Suite roles to CPI.
    Click the link "CPI" to access role collection overview page, and then Edit it.
    Assign these roles to the role collection "CPI", the role MessagingSend is mandatory for subsequent integration process.
    AuthGroup_Administrator
    AuthGroup_BusinessExpert
    AuthGroup_ContentPublisher
    AuthGroup_IntegrationDeveloper
    MessagingSend

    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


Select menu Design, Create integration flow as following model. You could define your own flow as your real requirements. Some critical points will be noticed in this blog post.
This integration flow triggered by SAP S/4HANA Cloud system, when shipping_specialist created an outbound delivery order in SAP S/4HANA Cloud, SAP S/4HANA Cloud system will post out this document to the integration flow endpoint. Integration flow complete fields mapping and transform the data to acceptable format, and then post out to third-party warehouse management system. For this integration flow, SAP S/4HANA Cloud system is the Sender, and the third-party warehouse management system play the Receiver role.



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 Role ESBMessaging.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


Add a new message mapping, and then config related fields mapping relationship in the mapping. If some fields do not list out in source system, we could give a default value for the target system.



Step 5: Add XML to JSON converter


Add a Converter to convert acceptable format data for target system. Our target system identifies JSON format, so we add an XML to JSON converter.
If you need identify the items as array, please check the Streaming. And then assign correct path in XML Element.



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.


Setup correct Credential Name, and then save the integration flow as new version.



Step 7: Deploy the integration flow


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. SAP S/4HANA Cloud will consume the endpoint to trigger the integration flow in later chapter.



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:


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...


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
9 Comments