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
– 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.
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.
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.
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.
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.
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.
the workflow runs and creates the customer in SAP.
Check the customer in SAP
Go to Salesforce and check that the SAP customer number is set
Now check the video to see that in action