In this blog, I will describe a scenario, where a Salesforce account is synchronized in near-real time to SAP, where an SAP customer is created and his number is written back to Salesforce using the following tools:

– SAP ECC system on Premise
– ERPConnect Services Core (ECS Core) for SAP Integration in cloud scenarios
– Salesforce
– Microsoft Flow as workflow

ECS Core enables you to build powerful and sophisticated cloud applications for SAP on Premise. It allows you to integrate your cloud-based apps with SAP. For that ECS Core uses only outbound connections. It pulls the pending requests from the cloud, sends the query to the SAP system for execution and then sends the SAP result back onto the cloud service.

Step 1: Define the Connection to the SAP system
In ECS Core define the connection to your SAP ECC system. This connection will be used to create the SAP customer.

SAP Connection

Step 2: Use ECS Core to provide REST Service to create SAP customers
I have used the Web Service Designer for ECS Core to create a REST Service CreateSAPCustomer based on a default SAP function module to create Customers. The REST service has different input parameters about the customers and returns the number of the created SAP customer.

ECS Core WebService Designer

ECS Core WebService Designer
I have deployed the rest web service and it is now ready to be consumed in the cloud.

REST Service

Step 3: Customize your Salesforce Account to provide related fields such as SAP Customer Number
In Salesforce, I have my Accounts where I have created some new fields to store the SAP customer number and further details required to create the SAP customer, e.g. SAP Company Code or related sales data like sales organization.

Salesforce Account

Step 4: Use Microsoft Flow to define a workflow to trigger Salesforce Account Changes
As workflow, I am using Microsoft Flow to trigger any Account changes in Salesforce, where the account type is changed from prospect to customer and no related SAP customer exists. In this case the SAP customer will be created using the Salesforce account data. When the operation is successful, the Salesforce account is updated with the SAP customer number.

Microsoft Flow


Optional steps
In your workflow, you can use further optional steps. In my sample, I am using a SharePoint Online list to log all synchronized Salesforce accounts to SAP. An additional Flow step can be used to be notified when a customer has been created.

SP Online accounts list


Now let us see that in action.

Let us change the account type to customer. As you can see the field SAP ID is empty.

Salesforce Account


the workflow runs and creates the customer in SAP.

29-May-17 4-56-20 PM



Check the customer in SAP

SAP Customer


Go to Salesforce and check that the SAP customer number is set

Salesforce Account updated

Now check the video to see that in action

Written by Khoder Elzein

Khoder is responsible for presales and always has an attentive ear for our customers, prospectives and partners. When travelling in Germany or abroad, he provides customer support at PoCs, workshops and on training courses. He also looks after the further development of our software solutions. Khoder has been working in IT since the turn of the millennium; he has been a member of team Theobald since 2009. When it comes to private interests, family, nature and reading feature at the top of his list – along with innovative fusion cuisine, as you may infer from his favourite dish of Swabian cheese noodles with tabouleh.