Contact Us 1-800-596-4880

SAP S4HANA Setup Guide

Overview

To configure and test an S/4HANA Cloud SOAP outbound service (Product replication: productmdmbulkreplicaterequest) and the SAP S/4HANA Cloud SOAP Connector as a Mule application deployed on CloudHub, see the [SAP S/4HANA Setup Guide] on Exchange.

Follow the steps in the S/4HANA Customization Guide section to set up your Salesforce OMS to ERP Integration.

Configure SAP S/4HANA

To make the necessary configurations in S/4HANA:

  1. Create a Communication System in the corresponding Fiori app. This communication system represents the external system that will consume the S/4HANA Cloud SOAP service. In this example, it’s named COM_0009_SOAP_OUT:

    retail-sap-s4hana-setup-guide-01.png

  2. For the 'Business System' name, use the same name of the System ID.

  3. In the 'Host Name' field, enter the hostname of the Mule application deployed on Cloudhub (if you don’t have it yet, you can enter a mock URL and then modify it later):

    retail-sap-s4hana-setup-guide-02.png

  4. Create a user that will be used to connect to the Cloud Hub app for sending product information in the outbound scenario (this is necessary even though the Mule application does not validate the user; we used any user for outbound):

    retail-sap-s4hana-setup-guide-03.png

  5. Use the Communication Arrangement Fiori app to create a new Communication Arrangement:

    retail-sap-s4hana-setup-guide-04.png

  6. Create a new Communication Arrangement, select the communication scenario "SAP_COM_0009", and then define a specific name for the arrangement, "SAP_COM_0009_SOAP".

  7. In the Communication System field, select the Communication System created in the previous step:

    retail-sap-s4hana-setup-guide-05.png

  8. For outbound communication, select the previously-created user and configure the Product Master - Replicate from SAP S/4HANA Cloud to Client and include the following settings. Make sure to note the Path (/sap/bc/srt/scs/sap/productmdmbulkreplicaterequest) because we will use this path to configure the Mule application SOAP endpoint:

    • Set the Service status to Active

    • Replication Model (any name)

    • Replication model = I (Initial)

    • The Output Mode = D (Direct)

      retail-sap-s4hana-setup-guide-06.png

      retail-sap-s4hana-setup-guide-07.png

      retail-sap-s4hana-setup-guide-08.png

  9. Save it. All configurations at S/4HANA Cloud side are finished and you will be able to download the WSDL that contains the metadata to import into the S/4HANA Cloud SOAP Connector into the Mule application.

Configurations in the Mule Application

The following example describes how to create a Mule application using the Outbound Message Listener operation of MuleSoft’s SAP S/4HANA SOAP Connector:

  1. Create a Mule project and add the appropriate connector from Exchange to the Mule Palette:

    retail-sap-s4hana-setup-guide-09.png

  2. Add and configure the Outbound Message Listener to the canvas:

    retail-sap-s4hana-setup-guide-10.png

  3. Add the corresponding WSDL path to the WSDL you downloaded from S/4HANA Cloud and create the HTTP listener configuration:

    retail-sap-s4hana-setup-guide-11.png

    retail-sap-s4hana-setup-guide-12.png

    Note: we are using no authentication on the Mule Application, so we used the Insecure option for the Trust Store Configuration. In the Keystore configuration, we used a test Keystore, which is mandatory for HTTPS communication:

    retail-sap-s4hana-setup-guide-13.png

  4. Select the Message type that the connector expects to receive from SAP (the connector reads the metadata from the WSDL we configured):

    retail-sap-s4hana-setup-guide-14.png

  5. On the Responses tab, use the status Code "202" and the Reason-Phrase "Accepted" because we want to send the same status that S/4HANA Cloud will send if the service invocation results OK. No payload will be returned as a response - just the Status code and Reason-phrase:

    retail-sap-s4hana-setup-guide-15.png

  6. Use a Logger component to log the inbound XML payload:

    retail-sap-s4hana-setup-guide-16.png

    The Mule flow should look like the following:

    retail-sap-s4hana-setup-guide-17.png

  7. Deploy the application to Cloudhub. You’re now ready to test the scenario.

Testing the Scenario

To test the scenario:

  1. Create the following. You only need to create a material in the corresponding Fiori app of S/4HANA Cloud:

    retail-sap-s4hana-setup-guide-18.png

    retail-sap-s4hana-setup-guide-19.png

    retail-sap-s4hana-setup-guide-20.png

    retail-sap-s4hana-setup-guide-21.png

    After you save the new material, you should see the following confirmation in S/4HANA Cloud:

    retail-sap-s4hana-setup-guide-22.png

    The following shows the XML message received at the Mule application at the Runtime Manager on Cloudhub:

    retail-sap-s4hana-setup-guide-23.png

  2. See the sent message in the Message Dashboard Fiori Application:

    retail-sap-s4hana-setup-guide-24.png

  3. Select the date:

    retail-sap-s4hana-setup-guide-25.png

  4. Search under CMD:Product Integration - /CMDPR → Product Replication to Client via Service - PRDREQ_OUT/00001 namespace:

    retail-sap-s4hana-setup-guide-26.png

    retail-sap-s4hana-setup-guide-27.png

S/4HANA Customization Guide

Create the following custom fields in the corresponding objects in Salesforce OMS to enable the customer, product, and orders sync use cases to function end-to-end.

Salesforce Object Field Name Data Type Length Unique ExternalId

BusinessPartner

YY1_SME_MPARTYROLEID_bus

Text

36

Y

Y

SalesOrder

YY1_SME_MORDERID_SDH

Text

36

Y

Y

Product

YY1_SME_UnvProductId_PRD

Text

36

Y

Y

Configure SAP S/4HANA Order Management

Follow the steps in these sections to configure your Salesforce OMS to ERP Integration.

Configure the Communication Arrangement

Use the settings in the table to configure the communication arrangements.

Communication Arrangement ID Service Name Protocol

SAP_COM_0109

Sales Order (A2X)

OData V2

SAP_COM_0223

Outbound Delivery - Notify (B2B)

OData V2

SAP_COM_0905

Transportation Management - Freight Order Integration

OData V4

SAP_COM_0120

Billing Document - Create with SD Document Reference

SOAP

SAP_COM_0120

Billing Document - Read, Cancel, GetPDF

OData V2

Add the Required Entry for Outbound Delivery - Notify (B2B) Communication Arrangement

Use the Fiori app Output Parameter Determination to add the following entry under the rule for Outbound delivery and Determination Step Output Relevance.

Output Type Goods movement status Document Category Picking status

DELIVERY_NOTE

A

J

C

After configuring the communication arrangements, add the customer by using the rule Outbound Delivery and the Determination Step Channel.

Output Type Recipient Channel Rolee

DELIVERY_NOTE

<Customer Number>

EDI

WE

Next, add the customer in the Business Partner section of the communication system, which is used to configure this communication arrangement.

Custom CDS View

  • Name

    YY1_SDDocumentFlow

  • Representative Key

    SalesDocument

  • Scenario

    External API

  • Data Sources

    Field name Type Cardinality Join Condition

    I_SalesDocument

    Primary Datasource

    N/A

    N/A

    I_SDDocumentMultiLevelProcFlow

    Associated Datasource

    Zero or More [0..*]

    PrecedingDocument = SalesDocument

    I_SDDocumentCategory

    Associated Datasource

    Zero or More [0..*]

    SDDocumentCategory = SubsequentDocumentCategory

  • Elements

    Alias Path Type Key

    SalesDocument

    I_SalesDocument.SalesDocument

    CHAR (10)

    Yes

    PrecedingDocumentCategory

    _I_SDDocumentMultiLevelProcFlo.PrecedingDocumentCategory

    CHAR (4)

    No

    SubsequentDocument

    _I_SDDocumentMultiLevelProcFlo.SubsequentDocument

    CHAR (10)

    No

    SubsequentDocumentCategory

    _I_SDDocumentMultiLevelProcFlo.SubsequentDocumentCategory

    CHAR (10)

    No

    ProcessFlowLevel

    _I_SDDocumentMultiLevelProcFlo.ProcessFlowLevel

    NUMC(2)

    No

    CreationDate

    _I_SDDocumentMultiLevelProcFlo.CreationDate

    DATS (8)

    No

    CreationTime

    _I_SDDocumentMultiLevelProcFlo.CreationTime

    TIMS (6)

    No

Create a Custom Communication Scenario

You must create a custom communication scenario by adding the CDS view as an inbound service.

Publish the communication scenario, and then create a communication arrangement using the custom communication scenario you just created. The communication arrangement includes the service URL that is used to retrieve the SD Document Flow.

SAP Field Name Label Data Type Length SAP Business Context

YY1_SME_Tracking_Nmb

Tracking Number

Text

20

Transportation Orders (TM_TRANSPORTATION_ORDER)

See Also