In this blog, I will describe a scenario, where a Dynamics 365 account is synchronized in near-real time to SAP, where an SAP customer is created and the SAP customer number is written back to the Dynamics 365 account.

For this scenario, I am using the following tools:

– SAP ECC system on Premise
– ERPConnect Services Core (ECS Core) as SAP Integration platform and the Business Content for SAP customer master data management
– Dynamics 365 CRM Account
– Microsoft Flow as workflow

Let me give you more details about the scenario.

The workflow is triggered by an account update event in Dynamics 365, e.g. a new account was created for an opportunity.

In the next step, the account is created in SAP so that a sales order or billing document can be created. You can see the configuration fields on the right, there are no SAP or other specific technical skills required to configure this action.

After the account is created in SAP, the CRM account is updated with the SAP account number and the record is also stored in SharePoint (just to show the SharePoint integration).



What is ECS Core?

ECS Core enables you to build powerful and sophisticated cloud applications for SAP. 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 to the cloud service.


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

SAP Connection

Step 2: Install the Business Content for the SAP customer master data management

This comes with a REST Web Service to create and update SAP customers. Additionally, you get an OpenApi (aka swagger) File that can be used to create your custom connector in Flow.
I have deployed the rest web service and it is now ready to be consumed in the cloud.

REST Service

Step 3: Customize your Dynamics 365 Account to provide related fields such as SAP Customer Number
In Dynamics 365, I have my Accounts where I have created a new field to store the SAP customer number.

Dynamics-CRM-Account_ Peakboard - Seattle-new

Step 4: Use Microsoft Flow to define a workflow to trigger Dynamics 365 Account Changes

In Flow create a custom connector using the delivered json file (openApi definition) as part of the business content. Once you install the connector you would find the following actions in flow


As a workflow, I am using Microsoft Flow to trigger any Account changes in Dynamics 365, 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 Dynamics 365 account data. When the operation is successful, the account is updated with the SAP customer number.




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 Dynamics 365 accounts to SAP. An additional Flow step can be used to be notified per email when a customer has been created.

Now let us execute the workflow.

Let us change the account type to customer. The workflow runs and creates the customer in SAP.





Check the account in Dynamics 365

Dynamics-CRM-Account_ Peakboard - Seattle

Check the customer in SAP


In this blog, I have described a scenario, where a Dynamics 365 account is created in near-real time in SAP and the SAP customer number is written back to the Dynamics 365 account.

For more information about ECS Core and the business content check the webpage.

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.