0% found this document useful (0 votes)
267 views63 pages

S4HANA Integration With Salesforce Configuration Guide

This document provides a guide for configuring integration between SAP S/4HANA and Salesforce using SAP Cloud Platform Integration. It covers prerequisites, adapter installation, plugin installation, and configuration steps for SAP S/4HANA, Salesforce, and SAP Cloud Platform Integration. The configuration enables synchronization of master data between the systems and automation of some business processes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
267 views63 pages

S4HANA Integration With Salesforce Configuration Guide

This document provides a guide for configuring integration between SAP S/4HANA and Salesforce using SAP Cloud Platform Integration. It covers prerequisites, adapter installation, plugin installation, and configuration steps for SAP S/4HANA, Salesforce, and SAP Cloud Platform Integration. The configuration enables synchronization of master data between the systems and automation of some business processes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

SAP S/4HANA

Integration with
Salesforce
Configuration Guide
For SAP Cloud Platform Integration

Version 1.0 – December 2020


SAP S/4HANA Integration with Salesforce Configuration Guide

Contents
1 Introduction .............................................................................................................. 2
1.1 Coding Samples .............................................................................................................. 2
1.2 Internet Hyperlinks ......................................................................................................... 2
2 Business Scenario ...................................................................................................... 2
3 Preparing the Systems for Integration ........................................................................ 3
3.1 Prerequisites .................................................................................................................. 3
3.2 Adapter Installation ........................................................................................................ 3
3.3 Plug-in Installation.......................................................................................................... 3
4 Configuration ............................................................................................................ 3
4.1 Configuration in SAP S/4HANA ........................................................................................ 4
4.1.1 Create Technical Communication User ............................................................................................4
4.1.2 Activating SAP Gateway ...................................................................................................................4
4.1.3 Activate OData API in Gateway ........................................................................................................5
4.2 Configuration in Salesforce.com ...................................................................................... 5
4.2.1 Configuration of Security Token and OAuth Credentials .................................................................6
4.2.2 Activate Entitlement Management in Salesforce ............................................................................7
4.2.3 Activate Quotes in Salesforce ..........................................................................................................8
4.2.4 Activate Multiple Currencies ............................................................................................................8
4.2.5 Adding SAP S/4HANA References ....................................................................................................9
4.2.6 Adding a Released Custom Field ................................................................................................... 10
4.2.7 Configuration for Order Process Flow........................................................................................... 10
4.3 Configuration in SAP Cloud Platform Integration ........................................................... 11
4.3.1 Replicate Account from SAP S/4HANA to Salesforce ................................................................... 11
4.3.2 Replicate Product from SAP S/4HANA to Salesforce .................................................................... 17
4.3.3 Replicate Sales Prices from S/4HANA to Salesforce ..................................................................... 22
4.3.4 Replicate Sales Order from Salesforce to SAP S/4HANA .............................................................. 28
4.3.5 Replicate Sales Contract from Salesforce to SAP S/4HANA .......................................................... 34
4.3.6 Receive Product Availability from SAP S/4HANA .......................................................................... 40
4.3.7 Update Account from Salesforce to SAP S/4HANA ....................................................................... 44
4.3.8 Replicate Sales Order from SAP S/4HANA to Salesforce .............................................................. 50
4.3.9 Receive Sales Order History from SAP S/4HANA .......................................................................... 57

5 Appendix ..................................................................................................................61
5.1 Generating Schema from Eclipse Plug-in and Replacing Standard Schema Used in
Integration Flow ..................................................................................................................... 61
5.2 Deploying Salesforce User Credentials, Token, and OAuth in SAP Cloud Platform Interface
61
5.2.1 Deploying User Credentials ........................................................................................................... 62
5.2.2 Deploying Token............................................................................................................................ 62
5.2.3 Deploying OAuth ........................................................................................................................... 62

1
SAP S/4HANA Integration with Salesforce Configuration Guide

1 Introduction
This is the official guide for the configuration of SAP S/4HANA Integration with Salesforce
for SAP Cloud Platform Integration (SAP CPI). This guide covers relevant information for
integration developers to configure and deploy the Integration content.

Read this guide carefully before configuring the integration content.

1.1 Coding Samples

Any software coding and/or code lines/strings ("Code") included in this documentation are
only examples and are not intended to be used in a productive system environment. The
Code is only intended to better explain and visualize the syntax and phrasing rules of
certain coding. We do not warrant the correctness and completeness of the Code given
herein.

1.2 Internet Hyperlinks

The documentation may contain hyperlinks to the Internet. These hyperlinks are intended
to serve as a hint about where to find related information. We do not warrant the
availability and the correctness of this related information or the ability of this information
to serve a particular purpose.

2 Business Scenario
SAP S/4HANA is the ERP business suite based on the SAP HANA in-memory database. It
is an on-premise based system that customers can use to manages various business
processes.

Salesforce is a cloud computing service as a software (SaaS) company that specializes in


customer relationship management (CRM) and helps your automation of Sales and
marketing process in an Enterprise.

The Integration content in SAP Cloud Integration for SAP S/4HANA Integration with
Salesforce enables the synchronization of master data like Product, Customer, Pricing, etc.

This integration content helps with the automation of some business processes by
integrating SAP S/4HANA to Salesforce through SAP Cloud Platform Integration.
Information is retrieved from SAP S/4HANA with the OData adapter. Data retrieved from
SAP S/4Hana is then mapped and transformed to a structure that fits SObjects in
Salesforce. Lastly, the data is sent to Salesforce using the Salesforce Adapter. Some
integration flows also retrieve data from the Salesforce. In which case the data is
transformed and mapped in SAP CPI and later sent to SAP S/4HANA using the OData
adapter.

2
SAP S/4HANA Integration with Salesforce Configuration Guide

3 Preparing the Systems for Integration

3.1 Prerequisites

To configure the integration content using this guide, you would need to have access and
authorizations to the systems listed below.

Access required:

• SAP S/4HANA Tenant Details


• SAP Cloud Platform Integration Tenant Details.
• Salesforce Tenant Details

Authorization required:

• SAP S/4HANA Tenant Details


o Access to SAP Gateway
o Access to create a user and assign roles
o Access to Master Data Product Master
o Access to Sales Master Data
o Access to Sales Order

• SAP Cloud Platform Integration (CPI) Tenant Details.


o AuthGroup.IntegrationDeveloper

• Salesforce Tenant
o Appropriate authorizations for the use of Tenant Salesforce too, among
other things, configure Custom Fields for certain objects that we will detail.

3.2 Adapter Installation

For the adapter installation refer to the Salesforce Adapter and Plug-in Installation Guide
that is included as part of the Salesforce adapter package.

3.3 Plug-in Installation

For the plug-in installation refer to the Salesforce Adapter and Plug-in Installation
Guide that is included as part of the Salesforce adapter package.

4 Configuration
SAP S/4HANA, Salesforce, and SAP Cloud Platform Integration need to be configured and
prepared before the integration content package can be configured and deployed. Follow
the steps mentioned in the next sections.

3
SAP S/4HANA Integration with Salesforce Configuration Guide

4.1 Configuration in SAP S/4HANA

This section describes the mandatory configurations which need to be performed in the
SAP S/4HANA system before you can start implementing the configuration for Salesforce
or configuring the Integration content in SAP Cloud Platform Integration. Follow the steps
mentioned in the following sub-sections.

4.1.1 Create Technical Communication User

A Technical Communication User is needed to call OData services in SAP S/4HANA from
Cloud Platform Integration. Communication Users in SAP S/4HANA are used for inbound
communication and for processing messages in the system. Follow the steps below to
create a communication user in SAPS/4HANA.

Procedure

1. Access the Transaction Code: SU01


2. On the User Maintenance: Initial screen, enter the <User ID>
3. Choose to Create.
4. On the Maintain User screen, maintain the following values, and choose Save.

<Last Name>
Logon data tab page
User Type: Communication Data
Password: <password>

Note: Ensure the user is assigned relevant authorizations to execute ODATA API Calls.

5. Click Save.

4.1.2 Activating SAP Gateway

Before you can use the SAP Gateway functionality, it needs to be globally activated in your
system.

If SAP Gateway is not activated, OData services will not run, consumer servers cannot
communicate with it, and an error message will be sent to any system that calls the
services.

You can perform configuration activities via: SAP Reference IMG (transaction SPRO) SAP
NetWeaver > SAP Gateway > OData Channel > Configuration User Settings and
Connection Settings. After you have completed these configuration activities, you must
activate SAP Gateway using the steps below:

1. In the transaction SPRO, open the SAP Reference IMG and navigate to SAP
NetWeaver > SAP Gateway > OData Channel > Configuration > Activate or
Deactivate SAP Gateway and click on the Activity icon. A message will display.
2. Choose Activate. A message will inform you of the current status.

4
SAP S/4HANA Integration with Salesforce Configuration Guide

4.1.3 Activate OData API in Gateway

The integration between Salesforce and SAPS/4HANA is based on ODATA APIs of


SAPS/4HANA.

Follow the steps below to activate the ODATA APIs used by the Integration Content.

Procedure

1. Access the Transaction Code: “/IWFND/MAINT_SERVICE”.


The entry screen of the transaction displays in the target system all activated
Gateway services in the Service Catalog and allows you to add new services.
2. Click the Add Service button in the toolbar.
3. Enter the System Alias of your front-end server.
4. Enter the External Service Name: “API_BUSINESS_PARTNER”.
5. Click the Get Services button in the toolbar to request the services available. As a
result, the service is displayed for selection.
6. Select the service created as a result of the last procedure and then choose Add
Selected Services or click the object link for further selection.
7. The Add Service dialog that appears and suggests already the name
“ZAPI_BUSINESS_PARTNER” for the Technical Service, and the Technical Model.
The dialog that now appears informs you that the model metadata for the Gateway
service is going to be created.
8. Specify the package for service activation.
9. Leave the other details on the dialog screen unchanged and choose Continue. The
dialog that now appears informs you that the model metadata for the Gateway
service has been created successfully in the Gateway.
10. In the information dialog, complete the procedure with .

Repeat the above process for the below APIs:

1. API_SALES_CONTRACT_SRV
2. API_SALES_ORDER_SRV

4.2 Configuration in Salesforce.com

This section describes the mandatory configurations which need to be performed in


Salesforce. It includes the configurations of Security Token and OAuth Credentials and the
creation of customfields (external id) in Salesforce to store the SAP S/4HANA ID.

These activities need to be performed before you can start with the implementation and
configuration of the Integration content in SAP Cloud Platform Integration.

5
SAP S/4HANA Integration with Salesforce Configuration Guide

4.2.1 Configuration of Security Token and OAuth Credentials

Security Token and OAuth Credentials are needed for a secure connection to
Salesforce, to access them an app needs to be created in the Salesforce tenant. To retrieve
the Security Token and OAuth Credentials follow the below procedure.

Procedure

1. Login to your Salesforce console and select Setup.


2. On the left panel in the Build overview, select Create > Apps, then New for the
Connected Apps section as shown in Figure 4.1.

Figure 4.1 Create Salesforce App

3. In the next screen select fill in basic details such as App Name, API Name ,
and Contact Email. In the API (Enable OAuth Settings) select Enable OAuth
Settings, see Figure 4.2.

Figure 4.2 New Connected App

4. In the API section (see Figure 4.3) perform the following actions:

6
SAP S/4HANA Integration with Salesforce Configuration Guide

• Disable Enable for Device Flow.


• Fill in a Callback URL.
• Disable Use digital signatures.
• Set Selected OAuth Scopes to Full access (full).
• Enable Require Secret for Web Server Flow.
• Disable Include ID Token.
• Disable Enable Asset Tokens. Select Save to complete the creation of the
app as shown in Figure 4.3.

Figure 4.3 API

5. In the next overview, when you select the specific connect app, you can find the
Client ID and Client Secret in the respective Consumer Key and Consumer
Secret fields, see Figure 4.4.

Figure 4.4 Consumer Key and Secret

4.2.2 Activate Entitlement Management in Salesforce

Entitlement management is a collection of Salesforce features that help you provide the
correct service levels to your customer. Its features let you define, enforce, and track
service levels as part of your support management process.

7
SAP S/4HANA Integration with Salesforce Configuration Guide

Follow the Salesforce guide below to enable entitlement management modules in


your Salesforce instance:

https://help.salesforce.com/articleView?id=entitlements_enabling.htm&type=5

Procedure

1. From Setup, enter Entitlement Settings in the Quick Find box, then select
Entitlement Settings.
2. Select Enable Entitlement Management.
3. Click Save. This takes you to a page where you can customize Entitlement
Management settings. You will come back to those settings later on in the
Entitlement Management Setup process.

4.2.3 Activate Quotes in Salesforce

Quotes in Salesforce represent the proposed prices of your company’s products and
services. You create a quote from an opportunity and its products. Each opportunity can
have multiple associated quotes, and any one of them can be synced with the opportunity.

Follow the Salesforce guide below to enable quotes modules in your Salesforce instance:

https://help.salesforce.com/articleView?id=quotes_enable.htm&type=5

Procedure

1. From Setup, enter Quote in the Quick Find box, then select Quote Settings
(Lightning Experience) or Quotes Settings (Salesforce Classic).
2. Select the option for enabling quotes.
3. To display the Quotes related list on the standard opportunity page layout,
select Opportunity Layout.
4. To add the Quotes related list to all opportunity page layouts that users have
customized, select Append to users' personal related list customization.
5. Save your changes.

4.2.4 Activate Multiple Currencies

In case support for multiple currencies is required for your scenario, this section gives an
overview of how this can be achieved. Before your organization can use multiple
currencies, the feature must be activated in Salesforce. Multiple currencies activation
enables selecting multiple currencies throughout Salesforce.

Note: Enabling multiple currencies introduces permanent changes in your Salesforce.


Before proceeding, be aware of the implications in the link below:

8
SAP S/4HANA Integration with Salesforce Configuration Guide

https://help.salesforce.com/articleView?id=admin_enable_multicurrency_implications.ht
m&type=5

Follow the Salesforce guide to activate multiple currencies in your Salesforce instance:

https://help.salesforce.com/articleView?id=admin_enable_multicurrency.htm&type=0

Procedure

1. In Setup, enter Company Information in the Quick Find box.


2. Select Company Information and click Edit.
3. Ensure that your selected currency locale is the default currency that you want to
use for current and future records.
4. Enable Activate Multiple Currencies, and then save your changes.

4.2.5 Adding SAP S/4HANA References

The Integration content synchronizes data between SAP S/4HANA Cloud and Salesforce.
For this purpose, an SAP S/4HANA Cloud unique identifier needs to be added in Salesforce
which will hold SAP S/4HANA Cloud key value. To achieve that, follow the steps below.

Procedure

1. Enter the Setup screen.


2. In the Quick Find box type Accounts* and click on Fields.
3. Scroll down and click New.
4. Choose Text as field type and click on Next.
5. Enter field name: SAP_BusinessPartner_Ref**, enter a Length of 30, and select
the External ID checkbox.
6. Press next and next and then save.
7. Do the same for the below object types and field names.

The above steps need to be repeated for more Objects. The table below contains a list of
fields per object that needs to be added. Perform the above steps for all fields listed in the
table below.

Object* Field Name**

Products SAP_Material_Ref

Accounts SAP_BusinessPartner_Ref

Orders SAP_SalesOrder_Ref

9
SAP S/4HANA Integration with Salesforce Configuration Guide

Order Products SAP_OrderItem_Ref

Service Contracts SAP_SalesContract_Ref

Contract Line Items SAP_SalesContractItem_Ref

Price Book Entries SAP_PriceBookEntry_Ref

Table 1 SAP S/4HANA References for Salesforce

4.2.6 Adding a Released Custom Field

To have control over the Service Contracts that need to be replicated to SAP S/4HANA, a
custom field needs to be created in Salesforce. Follow the below steps below.

Procedure

1. Enter the Setup screen.


2. Type Service Contracts in the Quick Find box and click on Fields.
3. Scroll down and click New.
4. Choose Checkbox as field data type and click Next.
5. Enter field name Released and choose Unchecked as the default value.
6. Press next and next and then save.
7. Repeat the steps for Orders.

4.2.7 Configuration for Order Process Flow

In Salesforce we need to create a record type corresponding to the partner function in SAP
S/4HANA Cloud. Record types determine the business processes, page layouts, and picklist
values users have access to.

Procedure

1. Go to Setup.
2. Type Record Types in the Quick Find box and select Record Types in Accounts.
3. Click on New and create two new Records:
• SAP Ship-To
• SAP SoldTo

Note: These names are for reference, adapt as necessary for your organization.

4. Check Active and click on Next.


5. Select a layout (e.g.: Account Layout) and click on Save.
6. Repeat for the other Record.
7. Type Page Layouts in the Quick Find box and select Page Layouts in Accounts.
8. Edit Account Layout (or according to your organization).

10
SAP S/4HANA Integration with Salesforce Configuration Guide

9. Select components and drag and drop Orders and Contracts to the layout and click
on save.
10. Type Page Layouts in the Quick Find box and select Page Layouts in
Opportunities.
11. Edit Opportunity Layout.
12. Select Related Lists and drag and drop Orders to the layout.
13. Save.

4.3 Configuration in SAP Cloud Platform Integration

In this section, the settings of the Integration Flows are discussed, including the
prerequisites, parameters of the Sender and Receiver systems, as well as others specific
to each iFlow.

4.3.1 Replicate Account from SAP S/4HANA to Salesforce

4.3.1.1 Business Scenario

This integration flow allows replication of the customer data by replicating the Customer
master data from SAP S/4HANA to Salesforce as Accounts. Whenever a Customer in SAP
S/4HANA is created or modified, it gets replicated to SAP S/4HANA in the next run of the
integration flow (if scheduled to recur). Figure 4.5 depicts the business process to be
implemented.

Figure 4.5 Process Diagram

The SAP CPI implementation of the process in Figure 4.5 is shown in Figure 4.6.

11
SAP S/4HANA Integration with Salesforce Configuration Guide

Figure 4.6 Integration Flow

4.3.1.2 Prerequisites

The following steps need to be taken as a prerequisite:

• Deploy the security artifacts that will be required during the configuration of
integration content.
• Users need to define the time zone in configuration and the first time run date and
hour from when to start replicating.

4.3.1.3 Scope

Note that this integration flow will only replicate the Business Partners of the
category Customers.

4.3.1.4 Configuration

Follow the below steps to configure the integration flow:

1. Open the integration flow “Replicate Account from SAP S/4HANA to Salesforce”.
2. Click on Configure.
3. Configure “Timer”. You can choose between:
Run Once: iFlow will be executed only once, can be used for the initial load.
Schedule on Day: iFlow will be executed on a specific date/time.
Schedule to Recur: iFlow will be executed at a regular interval and will replicate
the changes from the source system to the target system (suggested mode).

12
SAP S/4HANA Integration with Salesforce Configuration Guide

Figure 4.7 Configure Timer SAP S/4HANA

Note: Replace the default values of the parameters in the configurations based on your
scenario and landscape.

4. Go to Receiver.
5. Configure the “Receiver” connector named “S4HANA” to fit your specific landscape.
See Figure 4.8.

Figure 4.8 Configure Receiver S/4HANA

The description of each of the fields in Figure 4.8 is presented in the table below.

Parameter Description

Hostname Enter the API hostname of your SAP S/4HANA system. The hostname is
part of the Address.

(https://hostname:port/sap/opu/odata/sap/API_BUSINESS_PARTNER)

Port Enter the API port of your SAP S/4HANA system. The port is part of the
Address.

(https://hostname:port/sap/opu/odata/sap/API_BUSINESS_PARTNER)

13
SAP S/4HANA Integration with Salesforce Configuration Guide

Location Enter the Location identifier for your SAP S/4HANA tenant.
ID

Credential Enter the name of the credential you have deployed for/4HANA. See
Name below about deploying credential artifacts.

Table 2 Configure Receiver S/4HANA

6. Configure the “Receiver” connector named “Salesforce”. See Figure 4.9.

Figure 4.9 Configure Receiver Salesforce

The description of each of the fields in Figure 4.9 is presented in the table below.

Parameter Description

Address The data store URL for Salesforce.

E.g.: https://login.salesforce.com

Basic Credential Name Name of a deployed User Credentials artifact that holds
Username and Password used to authenticate with
Salesforce.

Security Token Alias Name of a deployed Secure Parameter artifact that holds
the real Security Token. The security token is required to
log in to Salesforce from an untrusted network.

OAuth Credential Name of deployed OAuth credential name.


Name

Table 3 Configure Receiver Salesforce

14
SAP S/4HANA Integration with Salesforce Configuration Guide

7. Configure “More” as shown in Figure 4.10.

Figure 4.10 Configure More options

The description of each of the fields in Figure 4.10 are presented in the table below.

Parameter Description

ExceptionLogging Possible values “YES” / “NO”.

Specify “YES” to log the exception if any.

Specify “NO” or leave blank otherwise.

InitialDate Date from when the integration flow will replicate for the
first time. Correct format: YYYY-MM-DD’T’hh:mm:ss.sss’Z’

(E.g.: 1970-01-01T00:00:00.000Z).

InitialHour Time from when the integration flow will replicate for the
first time.

Correct format: ‘PT’hh’H’mm’M’ss’S’

(E.g.: PT00H00M00S).

LogMessageBody Possible values “YES” / “NO”.

Specify “YES” to log the Message Body (Not recommended


in a live environment).

Specify “NO” or leave blank otherwise.

LogMessageHeader Possible values “YES” / “NO”.

15
SAP S/4HANA Integration with Salesforce Configuration Guide

Specify “YES” to log the Message Header.

Specify “NO” or leave blank otherwise.

LogMessageProperty Possible values “YES” / “NO”.

Specify “YES” to log the Message Properties .

Specify “NO” or leave blank otherwise.

Figure 4.11 Configure More options

8. Save and Deploy.

4.3.1.5 Integration Message Mapping

In case your organization uses custom fields in Salesforce, you might need to customize
the provided integration flow and adapt it to your needs. Users should update the existing
solution by creating a new XSD using the Eclipse Salesforce Plug-in, change this schema
in the message mapping, and add custom connections as needed.

4.3.1.6 Value Mapping

Value mapping facilitates the customization of Account Group for Customers in SAP
S/4HANA to “RecordType” in Salesforce. In the current version of the content
package, there are two records – see Figure 4.12.

Note: Users should rename these Record Types according to their organization.

Figure 4.12 Value Mapping for Account Group

16
SAP S/4HANA Integration with Salesforce Configuration Guide

4.3.2 Replicate Product from SAP S/4HANA to Salesforce

4.3.2.1 Business Scenario

This integration flow enables the synchronization of the Materials data by replicating the
Product master data from SAP S/4HANA to Salesforce as Products. Whenever a Material
in SAP S/4HANA is created, it will be replicated to Salesforce in the next run of the
integration flow (If scheduled).

Figure 4.13 depicts the business process to be implemented.

Figure 4.13 Process Diagram

The SAP CPI implementation of the process in Figure 4.13 is shown in Figure 4.14.

17
SAP S/4HANA Integration with Salesforce Configuration Guide

Figure 4.14 Integration Flow

4.3.2.2 Prerequisites

The following steps need to be taken as a prerequisite:

• Deploy the security artifacts that will be required during the configuration of
integration content.
• Users need to define the initial time run date from when the data should be
replicated.

4.3.2.3 Scope

SAP S/4HANA does not save the modification or creation times, it only saves the date. As
a result, only the date is taken into consideration for defining intervals for the replications.

4.3.2.4 Configuration

Follow the below steps to configure the integration flow:

1. Open the integration flow “Replicate Product from SAP S4HANA to Salesforce”.
2. Click on Configure.
3. Configure “Timer”. You can choose between:
Run Once: iFlow will be executed only once, can be used for the initial load.
Schedule on Day: iFlow will be executed on a specific date/time.
Schedule to Recur: iFlow will be executed at a regular interval and will replicate
the changes from the source system to the target system (suggested mode).

18
SAP S/4HANA Integration with Salesforce Configuration Guide

Figure 4.15 Configure Timer

Note: Replace the default values of the parameters in the configurations based on your
scenario and landscape.

4. Configure the “Receiver” connector named “S4HANA” to fit your specific landscape.
See Figure 4.16.

Figure 4.16 Configure Receiver S/4HANA

The description of each of the fields in Figure 4.16 is presented in the table below.

Parameter Description

Hostname Enter the API hostname of your SAP S/4HANA system. The
hostname is part of the Address.

(https://hostname:port/sap/opu/odata/sap/API_PRODUCT_SRV)

Port Enter the API port of your SAP S/4HANA system. The port is part of
the Address.

(https://hostname:port/sap/opu/odata/sap/API_PRODUCT_SRV)

19
SAP S/4HANA Integration with Salesforce Configuration Guide

Location ID Enter the Location identifier for your SAP S/4HANA tenant.

Credential Enter the name of the credential you have deployed for S/4HANA.
Name See below about deploying credential artifacts.

Table 4 Configure Receiver S/4HANA

5. Configure the “Receiver” connector named “Salesforce”. See Figure 4.17.

Figure 4.17 Configure Receiver Salesforce

The description of each of the fields in Figure 4.17 is presented in the table below.

Parameter Description

Login URL The data store URL for Salesforce.

E.g.: https://login.salesforce.com

Basic Credential Name Name of a deployed User Credentials artifact that holds
Username and Password used to authenticate with
Salesforce.

Security Token Name of a deployed Secure Parameter artifact that holds


the real Security Token. The security token is required to
log in to Salesforce from an untrusted network.

OAuth Credential Name Name of deployed OAuth credential name.

Table 5 Configure Receiver Salesforce

20
SAP S/4HANA Integration with Salesforce Configuration Guide

6. Configure “More” as shown in Figure 4.18.

Figure 4.18 Configure More options

The description of each of the fields in Figure 4.18 is presented in the table below.

Parameter Description

ExceptionLogging Possible values “YES” / “NO”.

Specify “YES” to log the exception if any.

Specify “NO” or leave blank otherwise.

InitialDate Date from when the integration flow will replicate for the
first time. Correct format: YYYY-MM-DD’T’hh:mm:ss.sss’Z’

(E.g.: 1970-01-01T00:00:00.000Z).

LogMessageBody Possible values “YES” / “NO”.

Specify “YES” to log the Message Body (Not recommended


in a live environment).

Specify “NO” or leave blank otherwise.

LogMessageHeader Possible values “YES” / “NO”.

Specify “YES” to log the Message Header.

Specify “NO” or leave blank otherwise.

LogMessageProperty Possible values “YES” / “NO”.

Specify “YES” to log the Message Properties.

21
SAP S/4HANA Integration with Salesforce Configuration Guide

Specify “NO” or leave blank otherwise.

Table 6 Configure More options

4.3.3 Replicate Sales Prices from S/4HANA to Salesforce

4.3.3.1 Business Scenario

This integration flow allows the replication of Pricing by replicating the sales pricing data
from SAP S/4HANA to Salesforce as pricebook entry. Whenever a new condition in SAP
S/4HANA is created, it gets replicated to SAP S/4HANA in the next run of the integration
flow (if scheduled to recur).

Figure 4.19 depicts the business process to be implemented.

Figure 4.19 Process Diagram

22
SAP S/4HANA Integration with Salesforce Configuration Guide

The SAP CPI implementation of the process in Figure 4.19 is shown in Figure 4.20.

Figure 4.20 Integration Flow

4.3.3.2 Prerequisites

The following steps are prerequisites for this integration scenario:

• Deploy security artifacts that will be required during the configuration of Integration
content.
• Products should have been replicated from SAP S/4HANA to Salesforce.
• Condition Type, Distribution Channel, Pricebook Name, and Sales Organization
must be configured before replicating the pricing condition.

4.3.3.3 Scope

• This integration flow only covers new sales pricing, update is not covered in this
version.
• Salesforce allows only one entry of each material per Price Book.
• The iFlow should be scheduled to recur once a day.

23
SAP S/4HANA Integration with Salesforce Configuration Guide

4.3.3.4 Configuration

Follow the below steps to configure the integration flow:

1. Open the integration flow “Replicate Sales Prices from SAP S4HANA to Salesforce”.
2. Click on Configure.
3. Configure “Timer”. You can choose between:
Run Once: iFlow will be executed only once, can be used for the initial load.
Schedule on Day: iFlow will be executed on a specific date/time.
Schedule to Recur: iFlow will be executed at a regular interval and will replicate the
changes from the source system to the target system (suggested mode).

Figure 4.21 Configure Timer

Note: Replace the default values of the parameters in the configurations based on your
scenario and landscape.

4. Go to Receiver.
5. Configure the “Receiver” connector named “S4HANA” to fit your specific landscape.
See Figure 4.22.

Figure 4.22 Configure Receiver S/4HANA

24
SAP S/4HANA Integration with Salesforce Configuration Guide

The description of each of the fields in Figure 4.22 is presented in the table below.

Parameter Description

Hostname Enter the API hostname of your S/4HANA system. The hostname is part
of the Address.

(https://hostname:port/sap/opu/odata/sap/API_SLSPRICINGCONDITI
ONRECORD_SRV).

Port Enter the API port of your S/4HANA system. The port is part of the
Address.

(https://hostname:port/sap/opu/odata/sap/API_SLSPRICINGCONDITIO
NRECORD_SRV).

Authenticati Select “Basic” authentication Type.


on

Credential Enter the name of the credential you have deployed for S/4HANA. See
Name below about deploying credential artifacts.

Table 7 Configure Receiver S/4HANA

6. Configure the “Receiver” connector named “Salesforce”. See Figure 4.23.

Figure 4.23 Configure Receiver Salesforce

Parameter Description

Address The data store URL for Salesforce.

25
SAP S/4HANA Integration with Salesforce Configuration Guide

E.g.: https://login.salesforce.com

Credential Name Name of a deployed User Credentials artifact that holds


Username and Password used to authenticate with
Salesforce.

Security Token Name of a deployed Secure Parameter artifact that holds


the real Security Token. The security token is required to
log in to Salesforce from an untrusted network. Salesforce
automatically generates this key.

OAuth Credential OAuth credential name.


Name

Table 8 Configure Receiver Salesforce

7. Configure “More” as shown in Figure 4.24.

Figure 4.24 Configure More options

The description of each of the fields in Figure 4.24 is presented in the table below.

26
SAP S/4HANA Integration with Salesforce Configuration Guide

Parameter Description

DistributionChannel Specify the distribution channel to be used in the iFlow.

The default value is “10”.

SalesOrganization Specify the sales organization to be used in the iFlow.

The default value is “1710”.

PricebookName Pricebook name in Salesforce.

The default value is “Standard Price Book”

ExceptionLogging Possible values “YES” / “NO”.

Specify “YES” to log the exception if any.

Specify “NO” or leave blank otherwise.

LogMessageBody Possible values “YES” / “NO”.

Specify “YES” to log the Message Body (Not recommended


in a live environment).

Specify “NO” or leave blank otherwise.

LogMessageHeader Possible values “YES” / “NO”.

Specify “YES” to log the Message Header.

Specify “NO” or leave blank otherwise.

LogMessageProperty Possible values “YES” / “NO”.

Specify “YES” to log the Message Properties

Specify “NO” or leave blank otherwise.

Table 9 Configure More options

27
SAP S/4HANA Integration with Salesforce Configuration Guide

4.3.4 Replicate Sales Order from Salesforce to SAP S/4HANA

4.3.4.1 Business Scenario

This integration flow allows the replication of sales orders data by replicating the Orders
data Salesforce to SAP S/4HANA as Sales Orders. Whenever an Order in Salesforce is
created or modified, it will be replicated to SAP S/4HANA in the next run of the integration
flow (if scheduled to recur), as long as it has the custom field Released, created in Section
4.2.6, checked.

Figure 4.25 depicts the business process to be implemented.

Figure 4.25 Process Diagram

The SAP CPI implementation of the process in Figure 4.25 is shown in Figure 4.26.

Figure 4.26 Integration Flow

28
SAP S/4HANA Integration with Salesforce Configuration Guide

4.3.4.2 Prerequisites

The following steps are the prerequisites for this Integration Scenario:

• Deploy security artifacts that will be required during the configuration of integration
content.
• Customers/Accounts should have been replicated from SAP S/4HANA to Salesforce.
• Materials/Products should have been replicated from SAP S/4HANA to Salesforce.
• Orders were created with replicated Accounts and Products from SAP S/4HANA.
• Users need to define the first run date-time from when to start replicating.
• Customer Payment Terms, Distribution Channel, Organization Division, Sales Order
Type, Sales Organization, and Shipping Conditions are externalized in iFlow and
should be configured to correctly replicate to SAP S/4HANA.

4.3.4.3 Scope

• Sales orders cannot be replicated until extending customers/accounts to the


respective sales area.
• This integration flow only covers new orders, update is not covered in this version.

4.3.4.4 Configuration

Follow the steps below to configure the integration flow:

1. Open the integration flow “Replicate Sales Order from Salesforce to SAP S4HANA”.
2. Click on Configure.
3. Configure “Timer”. You can choose between:
Run Once: iFlow will be executed only once, can be used for the initial load.
Schedule on Day: iFlow will be executed on a specific date/time.
Schedule to Recur: iFlow will be executed at a regular interval and will replicate
the changes from the source system to the target system(Suggested mode).

Figure 4.27 Configure Timer

Note: Replace the default values of the parameters in the configurations based on your
scenario and landscape.

29
SAP S/4HANA Integration with Salesforce Configuration Guide

4. Configure the “Receiver” connector named “S4HANA” to fit your specific landscape.
See Figure 4.28.

Figure 4.28 Configure Receiver S/4HANA

The description of each of the fields in Figure 4.28 is presented in the table below.

Parameter Description

Hostname Enter the API hostname of your SAP S/4HANA system. The hostname is
part of the Address.

(https://hostname:port/sap/opu/odata/sap/API_SALES_ORDER_SRV).

Port Enter the API port of your SAP S/4HANA system. The port is part of the
Address.

(https://hostname:port/sap/opu/odata/sap/API_SALES_ORDER_SRV).

Location ID Enter the Location identifier for your SAP S/4HANA tenant.

Credential Enter the name of the credential you have deployed for S/4HANA. See
Name below about deploying credential artifacts.

Table 10 Configure Receiver S/4HANA

5. Configure the “Receiver” connector named “Salesforce”. See Figure 4.29.

30
SAP S/4HANA Integration with Salesforce Configuration Guide

Figure 4.29 Configure Receiver Salesforce

The description of each of the fields in Figure 4.29 is presented in the table below.

Parameter Description

Address The data store URL for Salesforce.

E.g.: https://login.salesforce.com

Basic Credential Name Name of a deployed User Credentials artifact that holds
Username and Password used to authenticate with
Salesforce.

Security Token Name of a deployed Secure Parameter artifact that holds


the real Security Token. The security token is required to
log in to Salesforce from an untrusted network

OAuth Credential Name of deployed OAuth credential name.


Name

Table 11 Configure Receiver Salesforce

6. Configure “More” as shown in Figure 4.30.

31
SAP S/4HANA Integration with Salesforce Configuration Guide

Figure 4.30 Configure More options

The description of each of the fields in Figure 4.30 is presented in the table below.

Parameter Description

Condition Type Specify the Condition Type to be used in the iFlow.

The default value is “PMP0”.

Customer Payment Specify the Customer Payment Terms to be used in


Terms the iFlow.

The default value is “0004”.

Distribution Channel Specify the distribution channel to be used in the iFlow.

The default value is “10”.

Organization Division Specify the Organization Division to be used in the iFlow.

The default value is “00”.

Sales Order Type Specify the document type to be used in the iFlow.

The default value is “OR”.

32
SAP S/4HANA Integration with Salesforce Configuration Guide

Sales Organization Specify the sales organization to be used in the iFlow.

The default value is “1710”.

Shipping Condition Specify Shipping Condition to be used in the iFlow.

The default value is “01”.

InitialDate Date from when the integration flow will replicate for the
first time. Correct format: YYYY-MM-DD’T’hh:mm:ss.sss’Z’

(E.g.: 1970-01-01T00:00:00.000Z)

ExceptionLogging Possible values “YES” / “NO”.

Specify “YES” to log the exception if any.

Specify “NO” or leave blank otherwise.

LogMessageBody Possible values “YES” / “NO”.

Specify “YES” to log the Message Body (Not recommended


in a live environment).

Specify “NO” or leave blank otherwise.

LogMessageHeader Possible values “YES” / “NO”.

Specify “YES” to log the Message Header.

Specify “NO” or leave blank otherwise.

LogMessageProperty Possible values “YES” / “NO”.

Specify “YES” to log the Message Properties

Specify “NO” or leave blank otherwise.

Table 12 Configure More options

33
SAP S/4HANA Integration with Salesforce Configuration Guide

4.3.5 Replicate Sales Contract from Salesforce to SAP S/4HANA

4.3.5.1 Business Scenario

This integration flow allows the synchronization of Contracts by replicating the Service
Contracts from Salesforce to SAP S/4HANA as Sales Contracts, and by updating it with a
reference from SAP S/4HANA.

Figure 4.31 depicts the business process to be implemented.

Figure 4.31 Process Diagram

The SAP CPI implementation of the process in Figure 4.31 is shown in Figure 4.32.

34
SAP S/4HANA Integration with Salesforce Configuration Guide

Figure 4.32 Integration Flow

4.3.5.2 Prerequisites

The following steps are the prerequisites for this integration scenario:

• Deploy the security artifacts that will be required during the configuration of
integration content.
• Salesforce Entitlement Management feature should be enabled in the user’s
Salesforce instance.
• Customers/Accounts should have been replicated from SAP S/4HANA to Salesforce.
• Materials/Products should have been replicated from SAP S/4HANA to Salesforce
• Service Contracts were created with replicated Customer/Accounts and
Materials/Products from SAP S/4HANA.
• The custom field ‘Released’ must be checked for the replication to occur.
• Condition Type, Customer Payment Terms, Distribution Channel, Organization
Division, Sales Contract Type, and Sales Organization are externalized and should
be configured in iFlow before the replication.

4.3.5.3 Scope

• Users cannot create sales contracts until extending the master data to the
respective sales area.
• Users need to define the first run date-time from when to start replicating
• This integration flow only covers new service contracts, update is not covered in
this version.

4.3.5.4 Configuration

Follow the below steps to configure the integration flow:

1. Open the Integration flow “Replicate Sales Contract from Salesforce to SAP
S4HANA”
2. Click on Configure.
3. Configure “Timer”. You can choose between:

35
SAP S/4HANA Integration with Salesforce Configuration Guide

Run Once: iFlow will be executed only once, can be used for the initial load.
Schedule on Day: iFlow will be executed on a specific date/time.
Schedule to Recur: iFlow will be executed at a regular interval and will replicate
the changes from the source system to the target system (suggested mode).

Figure 4.33 Configure Timer

Note: Replace the default values of the parameters in the configurations based on your
scenario and landscape.

4. Configure the “Receiver” connector named “S4HANA” to fit your specific landscape.
See Figure 4.34.

Figure 4.34 Configure Receiver S/4HANA

The description of each of the fields in Figure 4.34 is presented in the table below.

Parameter Description

Hostname Enter the API hostname of your SAP S/4HANA system. The hostname is
part of the Address.

36
SAP S/4HANA Integration with Salesforce Configuration Guide

https://hostname:port/sap/opu/odata/sap/API_SALES_CONTRACT_SRV

Port Enter the API port of your SAP S/4HANA system. The port is part of the
Address

https://hostname:port/sap/opu/odata/sap/API_SALES_CONTRACT_SRV

Location ID Enter the Location identifier for your SAP S/4HANA tenant.

Credential Enter the name of the credential you have deployed for S/4HANA. See
Name below about deploying credential artifacts.

Table 13 Configure Receiver S/4HANA

5. Configure the “Receiver” connector named “Salesforce”. See Figure 4.35.

Figure 4.35 Configure Receiver Salesforce

The description of each of the fields in Figure 4.35 is presented in the table below.

Parameter Description

Address The data store URL for Salesforce.

E.g.: https://login.salesforce.com

Basic Credential Name Name of a deployed User Credentials artifact that holds
Username and Password used to authenticate with
Salesforce.

37
SAP S/4HANA Integration with Salesforce Configuration Guide

Security Token Name of a deployed Secure Parameter artifact that holds


the real Security Token. The security token is required to
log in to Salesforce from an untrusted network.

OAuth Credential Name of deployed OAuth credential name.


Name

Table 14 Configure Receiver Salesforce

6. Configure “More” as shown in Figure 4.36.

Figure 4.36 Configure More options

The description of each of the fields in Figure 4.36 is presented in the table below.

Parameter Description

Condition Type Specify the Condition Type to be used in the iFlow.

The default value is “PPR0”.

Customer Payment Specify the Customer Payment Terms to be used in


Terms the iflow.

The default value is “0004”.

38
SAP S/4HANA Integration with Salesforce Configuration Guide

Distribution Channel Specify the distribution channel to be used in the iFlow.

The default value is “10”.

Organization Division Specify the Organization Division to be used in the iFlow.

The default value is “0”.

Sales Contract Type Specify the document type to be used in the iFlow.

The default value is “CQ”.

Sales Organization Specify the sales organization to be used in the iFlow.

The default value is “1710”.

InitialDate Date from when the integration flow will replicate for the
first time.

Correct format: YYYY-MM-DD’T’hh:mm:ss.sss’Z’

(E.g.: 1970-01-01T00:00:00.000Z)

ExceptionLogging Possible values “YES” / “NO”.

Specify “YES” to log the exception if any.

Specify “NO” or leave blank otherwise.

LogMessageBody Possible values “YES” / “NO”.

Specify “YES” to log the Message Body (Not recommended


in a live environment).

Specify “NO” or leave blank otherwise.

LogMessageHeader Possible values “YES” / “NO”.

Specify “YES” to log the Message Header.

Specify “NO” or leave blank otherwise.

LogMessageProperty Possible values “YES” / “NO”.

39
SAP S/4HANA Integration with Salesforce Configuration Guide

Specify “YES” to log the Message Properties.

Specify “NO” or leave blank otherwise.

Table 15 Configure More options

4.3.6 Receive Product Availability from SAP S/4HANA

4.3.6.1 Business Scenario

This integration flow allows users to obtain the availability of materials in a specified plant,
as delivered by your SAP S/4HANA through the SOAP protocol. This SOAP protocol can be
configured in other platforms to extract current stock or check the availability of a
requested quantity.

Figure 4.37 depicts the business process to be implemented.

Figure 4.37 Process Diagram

The SAP CPI implementation of the process in Figure 4.37 is shown in Figure 4.38.

40
SAP S/4HANA Integration with Salesforce Configuration Guide

Figure 4.38 Integration Flow

4.3.6.2 Prerequisites

The following steps are the prerequisites for this integration scenario:

• Deploy the security artifacts that will be required during the configuration of
Integration content.
• Users need to implement classes to consume this web service with APEX (for
reference, see Invoking Callouts Using Apex).

4.3.6.3 Scope

The value of quantity returned in response is always the maximum quantity available of
the product in SAP S/4HANA.

4.3.6.4 Configuration

Follow the below steps to configure the integration flow:

1. Open the integration flow “Receive product availability from SAP S4HANA”.
2. Click on Configure.
3. Go to Sender and Configure “Sender” Salesforce.

41
SAP S/4HANA Integration with Salesforce Configuration Guide

Figure 4.39 Configure Sender Salesforce

Parameter Description

Address The endpoint URL where your service can be accessed by a


client application.

Note: Replace the default values of the parameters in the configurations based on your
scenario and landscape.

4. Configure the “Receiver” connector named “S4HANA” to fit your specific landscape.
See Figure 4.40.

Figure 4.40 Configure Receiver S/4HANA

The description of each of the fields in Figure 4.40 is presented in the table below.

42
SAP S/4HANA Integration with Salesforce Configuration Guide

Parameter Description

Hostname Enter the API hostname of your S/4HANA system. The hostname is
part of the Address.

https://hostname:port/sap/opu/odata/sap/API_PRODUCT_AVAILY_I
NFO_BASIC

Port Enter the API port of your SAP S/4HANA system. The port is part of
the Address.

https://hostname:port/sap/opu/odata/sap/API_BUSINESS_PARTNER

Location ID: Enter the Location identifier for your SAP S/4HANA tenant.

Authentication Select “Basic” authentication Type.

Credential Enter the name of the credential you have deployed for/4HANA. See
Name below about deploying credential artifacts.

Table 16 Configure Receiver S/4HANA

5. Configure “More” as shown in Figure 4.41.

Figure 4.41 Configure More options

The description of each of the fields in Figure 4.41 is presented in the table below.

43
SAP S/4HANA Integration with Salesforce Configuration Guide

Parameter Description

ExceptionLogging Possible values “YES” / “NO”.

Specify “YES” to log the exception if any.

Specify “NO” or leave blank otherwise.

LogMessageBody Possible values “YES” / “NO”.

Specify “YES” to log the Message Body (Not recommended


in a live environment).

Specify “NO” or leave blank otherwise.

LogMessageHeader Possible values “YES” / “NO”.

Specify “YES” to log the Message Header.

Specify “NO” or leave blank otherwise.

LogMessageProperty Possible values “YES” / “NO”.

Specify “YES” to log the Message Properties.

Specify “NO” or leave blank otherwise.

Table 17 Configure More options

4.3.7 Update Account from Salesforce to SAP S/4HANA

4.3.7.1 Business Scenario

This integration flow allows updating Accounts from Salesforce to Customers in SAP
S/4HANA. Whenever an Account is modified in Salesforce it can be replicated to SAP
S/4HANA in the next run of the integration flow (if scheduled to recur).

Figure 4.42 depicts the business process to be implemented.

44
SAP S/4HANA Integration with Salesforce Configuration Guide

Figure 4.42 Process Diagram

The SAP CPI implementation of the process in Figure 4.42 is shown in Figure 4.43.

Figure 4.43 Integration Flow

4.3.7.2 Prerequisites

The following steps are the prerequisites for this integration scenario:

45
SAP S/4HANA Integration with Salesforce Configuration Guide

• Deploy the security artifacts which will be required during the configuration of
integration content.
• Customers should have been replicated from SAP S/4HANA to Salesforce.
• Users need to define the first run date-time from when to start updating.

4.3.7.3 Scope

• This integration flow will replicate only the Accounts of the category Customers.
• Only Accounts created by a pre-determined (communication user used for creation)
would be replicated.
• Since the number of field names in SAP and Salesforce is different, account names
are separated by spaces, the last value will be mapped to LastName in the case of
a person or GroupBusinessPartnerName2 in the case of a group, all other names
will go to FirstName and GroupBusinessPartnerName1, respectively.

4.3.7.4 Configuration

1. Open the Integration flow “Update Account from Salesforce to SAP S4HANA”.
2. Click on Configure.
3. Configure “Timer”. You can choose between:
Run Once: iFlow will be executed only once, can be used for the initial load.
Schedule on Day: iFlow will be executed on a specific date/time.
Schedule to Recur: iFlow will be executed at a regular interval and will replicate
the changes from the source system to the target system (suggested mode).

Figure 4.44 Configure Timer

Note: Replace the default values of the parameters in the configurations based on your
scenario and landscape.

4. Go to Receiver.
5. Configure the “Receiver” connector named “S4HANA” to fit your specific landscape.
See Figure 4.45.

46
SAP S/4HANA Integration with Salesforce Configuration Guide

Figure 4.45 Configure Receiver S/4HANA

The description of each of the fields in Figure 4.45 is presented in the table below.

Parameter Description

Hostname Enter the API hostname of your S/4HANA system. The hostname is
part of the Address.

https://hostname:port/sap/opu/odata/sap/API_BUSINESS_PARTNER

Port Enter the API port of your S/4HANA system. The port is part of the
Address.

https://hostname:port/sap/opu/odata/sap/API_BUSINESS_PARTNER

Location ID Enter the Location identifier for your SAP S/4HANA tenant.

Credential Enter the name of the credential you have deployed for S/4HANA.
Name See below about deploying credential artifacts.

Table 18 Configure Receiver S/4HANA

6. Configure the “Receiver” connector named “Salesforce”. See Figure 4.46.

47
SAP S/4HANA Integration with Salesforce Configuration Guide

Figure 4.46 Configure Receiver Salesforce

The description of each of the fields in Figure 4.46 is presented in the table below.

Parameter Description

Address The data store URL for Salesforce.

E.g.: https://login.salesforce.com

Credential Name Name of a deployed User Credentials artifact that holds


Username and Password used to authenticate with
Salesforce.

Security Token Name of a deployed Secure Parameter artifact that holds


the real Security Token. The security token is required to
log in to Salesforce from an untrusted network.

OAuth Credential OAuth credential name.


Name

Table 19 Configure Receiver Salesforce

7. Configure “More” as shown in Figure 4.47.

Figure 4.47 Configure More options

48
SAP S/4HANA Integration with Salesforce Configuration Guide

The description of each of the fields in Figure 4.47 is presented in the table below.

Parameter Description

CreatedBy Specify the salesforce identification for the user that is used
for the creation of Accounts.

ExceptionLogging Possible values “YES” / “NO”.

Specify “YES” to log the exception if any.

Specify “NO” or leave blank otherwise.

LogMessageBody Possible values “YES” / “NO”.

Specify “YES” to log the Message Body (Not recommended


in a live environment).

Specify “NO” or leave blank otherwise.

LogMessageHeader Possible values “YES” / “NO”.

Specify “YES” to log the Message Header.

Specify “NO” or leave blank otherwise.

InitialDate Date from when the integration flow will replicate for the
first time. Correct format: YYYY-MM-DD’T’hh:mm:ss.sss’Z’

(E.g.: 1970-01-01T00:00:00.000Z).

LogMessageProperty Possible values “YES” / “NO”.

Specify “YES” to log the Message Properties.

Specify “NO” or leave blank otherwise.

Table 20 Configure More options

8. Save and Deploy.

49
SAP S/4HANA Integration with Salesforce Configuration Guide

4.3.8 Replicate Sales Order from SAP S/4HANA to Salesforce

4.3.8.1 Business Scenario

This integration flow allows sending updates to SAP S/4HANA Sales Orders to Salesforce.
Changes made in SAP S/4HANA, including the addition of new materials to the Sales Order,
would be replicated to Salesforce. Figure 4.48 depicts the business process to be
implemented.

Figure 4.48 Process Diagram

The SAP CPI implementation of the process in Figure 4.48 is shown in Figure 4.49.

50
SAP S/4HANA Integration with Salesforce Configuration Guide

51
SAP S/4HANA Integration with Salesforce Configuration Guide

Figure 4.49 Integration Flow

4.3.8.2 Prerequisites

The following steps are the prerequisites for this integration scenario:

• Customers/Products should have been replicated from SAP S/4HANA


to Salesforce.
• The order should have been replicated from Salesforce to SAP S/4HANA.
• The query filter uses ‘createdBy’. A service user needs to be utilized in SAP
S/4HANA for Salesforce integration.
• Users need to define the first run date-time from when to start updating.

4.3.8.3 Scope

• Some information must be hardcoded to correctly replicate to Salesforce, such as:


Created by User and Pricebook Name.
• This integration flow only covers updating orders replicated from Salesforce,
including adding new items.

52
SAP S/4HANA Integration with Salesforce Configuration Guide

4.3.8.4 Configuration

To configure the integration flow, follow the steps below:

1. Open the integration flow.


2. Configure “Timer”. You can choose between:
Run Once: iFlow will be executed only once, can be used for the initial load.
Schedule on Day: iFlow will be executed on a specific date/time.
Schedule to Recur: iFlow will be executed at a regular interval and will replicate
the changes from the source system to the target system (suggested mode).

Figure 4.50 Configure Timer

Note: Replace the default values of the parameters in the configurations based on your
scenario and landscape.

3. Go to Receiver.
4. Configure the “Receiver” connector named “S4HANA” to fit your specific landscape.
See Figure 4.51.

Figure 4.51 Configure Receiver S/4HANA

The description of each of the fields in Figure 4.51 is presented in the table below.

53
SAP S/4HANA Integration with Salesforce Configuration Guide

Parameter Description

Hostname Enter the API hostname of your S/4HANA system. The hostname is
part of the Address.

https://hostname:port/sap/opu/odata/sap/API_SALES_ORDER_SRV

Port Enter the API port of your S/4HANA system. The port is part of the
Address.

https://hostname:port/sap/opu/odata/sap/API_SALES_ORDER_SRV

Location ID Enter the Location identifier for your SAP S/4HANA tenant.

Credential Enter the name of the credential you have deployed for S/4HANA.
Name See below about deploying credential artifacts.

Table 21 Configure Receiver S/4HANA

5. Configure the “Receiver” connector named “Salesforce”. See Figure 4.52.

Figure 4.52 Configure Receiver Salesforce

The description of each of the fields in Figure 4.52 is presented in the table below.

54
SAP S/4HANA Integration with Salesforce Configuration Guide

Parameter Description

Address The data store URL for Salesforce.

E.g.: https://login.salesforce.com

Basic Credential Name Name of a deployed User Credentials artifact that holds
Username and Password used to authenticate with
Salesforce.

Security Token Alias Name of a deployed Secure Parameter artifact that holds
the real Security Token. The security token is required to
log in to Salesforce from an untrusted network. Salesforce
automatically generates this key. If you do not have the
security token, log into your account, go to Setup > My
Personal Information > Reset My Security Token.

OAuth Credential OAuth credential name.


Name

Table 22 Configure Receiver Salesforce

6. Configure “More” to fit your use case, see example in Figure 4.53.

Figure 4.53 Configure More options

Parameter Description

CreatedByUser Specify the salesforce identification for the user that


modifies the Accounts. This ID is generated by Salesforce
can be extracted using the plug-in, the field name
is CreatdById.

55
SAP S/4HANA Integration with Salesforce Configuration Guide

ExceptionLogging Possible values “YES” / “NO” .

Specify “YES” to log the exception if any.

Specify “NO” or leave blank otherwise.

LogMessageBody Possible values “YES” / “NO”.

Specify “YES” to log the Message Body (Not recommended


in a live environment).

Specify “NO” or leave blank otherwise.

LogMessageHeader Possible values “YES” / “NO”.

Specify “YES” to log the Message Header

Specify “NO” or leave blank otherwise.

InitialDate Date from when the integration flow will replicate for the
first time. Correct format: YYYY-MM-DD’T’hh:mm:ss.sss’Z’

(E.g.: 1970-01-01T00:00:00.000Z).

LogMessageProperty Possible values “YES” / “NO”.

Specify “YES” to log the Message Properties

Specify “NO” or leave blank otherwise.

PricebookName Pricebook name in Salesforce. The default value is


“Standard Price Book”.

Salesforce API Version Choose the version of the Salesforce API to connect to.

Default is 48.0.

Table 23 Configure More options

4.3.8.5 Value Mapping

Value mapping allows the customization for OverallSDProcessStatus from Sales Orders in
SAP S/4HANA to Status in Salesforce. In the current version of the content package there
are two Record Types values as guidance: In Approval Process and Draft.

56
SAP S/4HANA Integration with Salesforce Configuration Guide

Users should rename this Order Status to fit their organization's needs.

Figure 4.54 Value Mapping Order Status

4.3.9 Receive Sales Order History from SAP S/4HANA

4.3.9.1 Business Scenario

This integration flow allows users to check the order history for a specific customer in a
defined time frame, as delivered by your SAP S/4HANA through the SOAP protocol. This
SOAP protocol can be configured in other platforms to extract the sales order history for
a specific period or sales order type.

Figure 4.55 depicts the business process to be implemented.

Figure 4.55 Process Diagram

The SAP CPI implementation of the process in Figure 4.55 is shown in Figure 4.56.

57
SAP S/4HANA Integration with Salesforce Configuration Guide

Figure 4.56 Integration Flow

4.3.9.2 Prerequisites

The following steps are the prerequisites for this integration scenario:

• Deploy the security artifacts that will be required during the configuration of
integration content.
• Users need to implement classes to consume this web service with APEX (for
reference, see Invoking Callouts Using Apex).

4.3.9.3 Configuration

Follow the below steps to configure the integration flow:

1. Open the integration flow “Receive Sales Order History from SAP S4HANA”.
2. Click on Configure.
3. Configure “Sender” SOAP and define an address for the SOAP connection.

58
SAP S/4HANA Integration with Salesforce Configuration Guide

Figure 4.57 Configure Sender SOAP

Note: Replace the default values of the parameters in the configurations based on your
scenario and landscape.

4. Configure the “Receiver” connector named “S4HANA” to fit your specific landscape.
See Figure 4.58.

Figure 4.58 Configure Receiver S/4HANA

The description of each of the fields in Figure 4.58 is presented in the table below.

Parameter Description

Hostname Enter the API hostname of your SAP S/4HANA system. The
hostname is part of the Address.

https://hostname:port/sap/opu/odata/sap/API_SALES_ORDER_SRV

Port Enter the API port of your SAP S/4HANA system. The port is part of
the Address.

59
SAP S/4HANA Integration with Salesforce Configuration Guide

https://hostname:port/sap/opu/odata/sap/API_SALES_ORDER_SRV

Authentication Select “Basic” authentication Type.

Credential Enter the name of the credential you have deployed for S/4HANA.
Name See below about deploying credential artifacts.

Table 24 Configure Receiver S/4HANA

5. Configure “More” as shown in Figure 4.59.

Figure 4.59 Configure More options

The description of each of the fields in Figure 4.59 is presented in the table below.

Parameter Description

ExceptionLogging Possible values “YES” / “NO”.

Specify “YES” to log the exception if any.

Specify “NO” or leave blank otherwise.

LogMessageBody Possible values “YES” / “NO”.

Specify “YES” to log the Message Body (Not recommended


in a live environment).

Specify “NO” or leave blank otherwise.

LogMessageHeader Possible values “YES” / “NO”.

60
SAP S/4HANA Integration with Salesforce Configuration Guide

Specify “YES” to log the Message Header.

Specify “NO” or leave blank otherwise.

LogMessageProperty Possible values “YES” / “NO”.

Specify “YES” to log the Message Properties

Specify “NO” or leave blank otherwise.

Table 25 Configure More options

5 Appendix

5.1 Generating Schema from Eclipse Plug-in and Replacing Standard Schema Used
in Integration Flow

Currently, the integration package works with the standard fields for Salesforce, except
for specific fields created in previous chapters. In case other custom fields are needed; a
new XSD must be generated with the Salesforce Eclipse Plug-in, the default XSD on
mapping must be replaced by the created one, and these fields should also be mapped.

Steps to create an XSD:

1. Open Eclipse.
2. Go to Windows > Perspective > Open Perspective > Other.
3. Select Salesforce Adapter and click Open.
4. Go to XSD Generator XSD (or XSD Generator Aggregation/Composite if more than
one object is needed).
5. Select a Version.
6. Select an API.
7. Select the operation that accommodates the integration flow.
8. Select an Object (or many in case of Aggregation/Composite).
9. Select Request XSD or Response XSD depending on the case.
10. Click on Save XSD and select a folder.
11. Replace default XSD from mapping in SAP CPI to recently created XSD

5.2 Deploying Salesforce User Credentials, Token, and OAuth in SAP Cloud
Platform Interface

Note that the information in this section is also specified in the adapter documentation.

61
SAP S/4HANA Integration with Salesforce Configuration Guide

5.2.1 Deploying User Credentials

This is necessary to hold the Salesforce username and password information used in the
authentication.

Follow the steps below:

1. In your SAP CPI tenant go to Monitor.


2. In Manage Security click on Security Material.
3. Click in the Add dropdown and select User Credentials.
4. Fill Name for future use, User with Salesforce username and Password.
5. Click on Deploy.

5.2.2 Deploying Token

Follow the steps below:

1. In your SAP CPI tenant go to Monitor.


2. In Manage Security click on Security Material.
3. Click in the Add dropdown and select Secure Parameter.
4. Fill Name for future use and Secure Parameter with your Salesforce token.
5. Click on Deploy.

5.2.3 Deploying OAuth

Follow the steps below:

1. In your SAP CPI tenant go to Monitor.


2. In Manage Security click on Security Material.
3. Click in the Add dropdown and select User Credentials.
4. Fill Name for future use and User with your OAuth token.
5. Click on Deploy.

62

You might also like