---
schema_version: "1"
id: 0178bd88922056e28e6d37610752d63a2f9042ed6cd8f96bb3324d4f04b9319a
title: SAP S4HANA Setup Guide
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/salesforce-oms/latest/sap-s4hana-setup-guide.md
canonical_url: https://docs.mulesoft.com/salesforce-oms/latest/sap-s4hana-setup-guide
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 83f5008ac587f328d1d6c61d117ebaba3cb687d642634356de9d7054eb45a224
description: MuleSoft Documentation Site
release: "1.1"
latest: true
---
---
product: Salesforce OMS
version: 1.1
is-latest-version: true
---

# SAP S4HANA Setup Guide

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## 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](#s4hana-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`:

    ![SAP S/4HANA Create Communication System](/mulesoft/current/en-us/retail/latest/_images/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):

    ![SAP S/4HANA Communication System with Host Name field](/mulesoft/current/en-us/retail/latest/_images/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):

    ![SAP S/4HANA user creation](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-03.png)

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

    ![SAP S/4HANA Create Communication Arrangement](/mulesoft/current/en-us/retail/latest/_images/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:

    ![SAP S/4HANA Communication Arrangement with Communication System selected](/mulesoft/current/en-us/retail/latest/_images/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)`

      ![SAP S/4HANA outbound service with Service Status set to Active](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-06.png)

      ![SAP S/4HANA outbound service Replication Model settings](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-07.png)

      ![SAP S/4HANA outbound service Output Mode settings](/mulesoft/current/en-us/retail/latest/_images/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:

    ![Anypoint Studio Mule Palette with SAP S/4HANA SOAP Connector](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-09.png)

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

    ![Anypoint Studio Outbound Message Listener configuration](/mulesoft/current/en-us/retail/latest/_images/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:

    ![Anypoint Studio SAP S/4HANA SOAP Connector WSDL configuration](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-11.png)

    ![Anypoint Studio HTTP Listener configuration](/mulesoft/current/en-us/retail/latest/_images/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:_

    ![Anypoint Studio TLS configuration with insecure trust store](/mulesoft/current/en-us/retail/latest/_images/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):

    ![Anypoint Studio SAP S/4HANA SOAP message type selection](/mulesoft/current/en-us/retail/latest/_images/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`:

    ![Anypoint Studio response configuration with HTTP status 202 Accepted](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-15.png)

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

    ![Anypoint Studio Logger component configuration](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-16.png)

    _The Mule flow should look like the following:_

    ![Anypoint Studio flow for receiving SAP S/4HANA product replication messages](/mulesoft/current/en-us/retail/latest/_images/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:

    ![SAP S/4HANA material creation](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-18.png)

    ![SAP S/4HANA material data entry](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-19.png)

    ![SAP S/4HANA material configuration](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-20.png)

    ![SAP S/4HANA material save](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-21.png)

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

    ![SAP S/4HANA confirmation that the material was saved](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-22.png)

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

    ![Anypoint Runtime Manager log with the received product replication message](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-23.png)

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

    ![SAP S/4HANA Message Dashboard with sent product replication message](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-24.png)

3.  Select the date:

    ![SAP S/4HANA Message Dashboard date selection](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-25.png)

4.  Search under **CMD:Product Integration - /CMDPR → Product Replication to Client via Service -
    PRDREQ\_OUT/00001 namespace**:

    ![SAP S/4HANA Message Dashboard search for product replication messages](/mulesoft/current/en-us/retail/latest/_images/retail-sap-s4hana-setup-guide-26.png)

    ![SAP S/4HANA product replication message details](/mulesoft/current/en-us/retail/latest/_images/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.

<table><colgroup><col> <col> <col> <col> <col> <col></colgroup><thead><tr><th>Salesforce Object</th><th>Field Name</th><th>Data Type</th><th>Length</th><th>Unique</th><th>ExternalId</th></tr></thead><tbody><tr><td><p>BusinessPartner</p></td><td><p>YY1_SME_MPARTYROLEID_bus</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>SalesOrder</p></td><td><p>YY1_SME_MORDERID_SDH</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Product</p></td><td><p>YY1_SME_UnvProductId_PRD</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr></tbody></table>

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

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Communication Arrangement ID</th><th>Service Name</th><th>Protocol</th></tr></thead><tbody><tr><td><p>SAP_COM_0109</p></td><td><p>Sales Order (A2X)</p></td><td><p>OData V2</p></td></tr><tr><td><p>SAP_COM_0223</p></td><td><p>Outbound Delivery - Notify (B2B)</p></td><td><p>OData V2</p></td></tr><tr><td><p>SAP_COM_0905</p></td><td><p>Transportation Management - Freight Order Integration</p></td><td><p>OData V4</p></td></tr><tr><td><p>SAP_COM_0120</p></td><td><p>Billing Document - Create with SD Document Reference</p></td><td><p>SOAP</p></td></tr><tr><td><p>SAP_COM_0120</p></td><td><p>Billing Document - Read, Cancel, GetPDF</p></td><td><p>OData V2</p></td></tr></tbody></table>

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

<table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th>Output Type</th><th>Goods movement status</th><th>Document Category</th><th>Picking status</th></tr></thead><tbody><tr><td><p>DELIVERY_NOTE</p></td><td><p>A</p></td><td><p>J</p></td><td><p>C</p></td></tr></tbody></table>

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

<table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th>Output Type</th><th>Recipient</th><th>Channel</th><th>Rolee</th></tr></thead><tbody><tr><td><p>DELIVERY_NOTE</p></td><td><p>&lt;Customer Number&gt;</p></td><td><p>EDI</p></td><td><p>WE</p></td></tr></tbody></table>

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

  <table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th>Field name</th><th>Type</th><th>Cardinality</th><th>Join Condition</th></tr></thead><tbody><tr><td><p>I_SalesDocument</p></td><td><p>Primary Datasource</p></td><td><p>N/A</p></td><td><p>N/A</p></td></tr><tr><td><p>I_SDDocumentMultiLevelProcFlow</p></td><td><p>Associated Datasource</p></td><td><p>Zero or More [0..*]</p></td><td><p>PrecedingDocument = SalesDocument</p></td></tr><tr><td><p>I_SDDocumentCategory</p></td><td><p>Associated Datasource</p></td><td><p>Zero or More [0..*]</p></td><td><p>SDDocumentCategory = SubsequentDocumentCategory</p></td></tr></tbody></table>

- **Elements**

  <table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th>Alias</th><th>Path</th><th>Type</th><th>Key</th></tr></thead><tbody><tr><td><p>SalesDocument</p></td><td><p>I_SalesDocument.SalesDocument</p></td><td><p>CHAR (10)</p></td><td><p>Yes</p></td></tr><tr><td><p>PrecedingDocumentCategory</p></td><td><p>_I_SDDocumentMultiLevelProcFlo.PrecedingDocumentCategory</p></td><td><p>CHAR (4)</p></td><td><p>No</p></td></tr><tr><td><p>SubsequentDocument</p></td><td><p>_I_SDDocumentMultiLevelProcFlo.SubsequentDocument</p></td><td><p>CHAR (10)</p></td><td><p>No</p></td></tr><tr><td><p>SubsequentDocumentCategory</p></td><td><p>_I_SDDocumentMultiLevelProcFlo.SubsequentDocumentCategory</p></td><td><p>CHAR (10)</p></td><td><p>No</p></td></tr><tr><td><p>ProcessFlowLevel</p></td><td><p>_I_SDDocumentMultiLevelProcFlo.ProcessFlowLevel</p></td><td><p>NUMC(2)</p></td><td><p>No</p></td></tr><tr><td><p>CreationDate</p></td><td><p>_I_SDDocumentMultiLevelProcFlo.CreationDate</p></td><td><p>DATS (8)</p></td><td><p>No</p></td></tr><tr><td><p>CreationTime</p></td><td><p>_I_SDDocumentMultiLevelProcFlo.CreationTime</p></td><td><p>TIMS (6)</p></td><td><p>No</p></td></tr></tbody></table>

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

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>SAP Field Name</th><th>Label</th><th>Data Type</th><th>Length</th><th>SAP Business Context</th></tr></thead><tbody><tr><td><p>YY1_SME_Tracking_Nmb</p></td><td><p>Tracking Number</p></td><td><p>Text</p></td><td><p>20</p></td><td><p>Transportation Orders (TM_TRANSPORTATION_ORDER)</p></td></tr></tbody></table>

## See Also

- [Prerequisites](https://docs.mulesoft.com/salesforce-oms/latest/prerequisites)
