SAP Cloud Platform Integration – Salesforce and S/4HANA Workflow demonstration

In this post, I am going to give an example of a complete workflow to demonstrate integration capabilities of the SAP Cloud Platform. I will be using different services on the SAP Cloud Platform (Workflow, Integration, Business Rules, Document) and also the SAP Cloud Platform OpenConnectors to enable interaction between a S/4HANA system and a SalesForce system.

Should you want to have more information on each of these services, there is a lot of content on SAP Community, but here are a few links to get yourself familiar with SAP Workflow Service, SAP Cloud Platform Integration, SAP Cloud Platform Business Rules, SAP Cloud Platform Document Services and SAP Cloud Platform OpenConnectors.

Overview:

DisclaimerThis is just an example on how to leverage technologies of the SAP Cloud Platform, I will be using a fake company made up for the purpose of my demonstration and all that I will state here, has to be considered as the concerns of this fake company. These conceptual choices are not a judgement of Salesforce and their products. They are solely made for the sake of my workflow integration scenario between two systems, Salesforce and S/4HANA.

Now that this is set, let’s imagine that this fake company uses both Salesforce and S/4HANA, with Salesforce mainly used by their sales on the road and with their referential system being S/4HANA. They want to integrate these two systems and have made the choice to use the SAP Cloud Platform for the creation of the following workflow scenario.

In this company, sales are given the capabilities to initiate the referential of a new account in Salesforces. Before adding this new account in S/4HANA, the company wants to ensure that a few rules are respected. They want to perform a few checks, maybe enhance the data, add validation steps by different departments, and more importantly that this new account does not already exist in their S/4HANA system.

Workflow diagram: 

The sequence diagram below explains the scenario and interaction between components.

1 – An account creation is triggered in Salesforce by a Sales

2 – The sales forgot to input all the required information of his new account, a mail request is sent back to him to update the content of his account in Salesforce in order for the workflow to continue.

3 – The sales correctly entered the new account with no missing data, the workflow can start. We first verify that the VAT registration number is valid and use it to enhance the address with the data coming back from the EU VAT web service. In case of discrepancy between the address entered in Salesforce by the sales and the EU VAT web service, the EU VAT web service data will be used as the correct address. If the VAT registration number is invalid a mail will notify the sales and the workflow will end here.

4 – A Credit Manager has to validate the financial information of the account and upload a few documents that will be added to the document services of the SAP Cloud Platform.

5 – After the financial validation, The workflow calls the Business Rules services to verify that the bank account of this new account is not based in an NCCT (no cooperative country and territory) country. If it is the case, this will trigger a Risk Manager validation request. The Risk Manager will then have the task to approve or reject this referential request.

Since this might cause legal issues, the company wants an email will all information of this account to be sent to the Audit team for purpose of audit trail. Hence even if at the end of the workflow or process the account will not be created, this request will be tracked and a record of all data will be kept by the Audit team.

6 – An automatic check is made in the S/4HANA system to verify if this account does not already exist in the system, using the name, country and VAT regitration number as ids. If a duplicate record is found, a request is sent to the Group Referential. They have to manually decide if they want to update the existing data in S/4HANA will the new data coming from Saleforce or create a new account. Of course, the Group Referential is informed in the request of the result of the duplicate search.

7 – As a duplicate record was found – The Group Referential chooses to update the existing data in S/4HANA. The workflow finishes by updating the data enriched with all the workflow back in Salesforce using SAP OpenConnectors.

Technologies Used:

  • SAP Cloud Platform Workflow
  • SAP Cloud Platform Integration
  • SAP Cloud Platform Business Rules services
  • SAP Cloud Platform OpenConnectors
  • SAP Cloud Platform Document Services
  • SAP Cloud Platform Portal Services
  • SAP S/4HANA
  • SAP Fiori My Inbox

Demonstration:

As this is a quite complex workflow, I will not dive into the details of all the steps of setting up of the demonstration (defining Destinations in SAP Cloud Platform, setting up the document repository, creating the integration flow in SAP Cloud Platform Integration, etc…), but rather give you an overview of all the steps of the scenario and the overall process that is implied here

1. SAP Cloud Platform Workflow

We started off by creating a complete logical BPMN schema of our workflow in SAP Web IDE Full stack.

The overall process being the following :

2.  SAP Cloud Platform WorkflowScript task

Just to give you an insight, if we focus on the first part of the workflow, we perform the data validation to check if any fields are missing using a custom javascript code.

3.  SAP Cloud Platform WorkflowExclusive gateway

Then we have an exclusive gateway, either sending an email and ending the workflow or continuing the workflow and launching the validation from the EU VAT web service depending on the result of our previous script task in javascript.

3. SAP Cloud Platform Integration – Integration flow

If the message is valid, we then have the EU VAT validation request, for that we call an integration flow defined in SAP Cloud Platform Integration (for that I defined a CPI destination in SAP Cloud Platform).

In SAP Cloud Platform Integration, we have created the following integration flow. If you are not familiar with the creation of such an integration flow, SAP offers a 3 days course that will get you up to speed, the SAP Cloud Platform Integration course, CLD900. Basically we are getting the request, performing a few actions on the message to shape in the way that the EU Web Service is expecting and then when getting back the response we are shaping it in a way understandable for us.

4.  SAP Cloud Platform WorkflowMail task

Going back to the workflow, sending the user email is straightfoward. We can use ${context.<>} to access elements in our workflow. You could also create nice HTML pages to use instead of Plain Text. This solution was just simpler for us.

5. SAP Cloud Platform Workflow – User Task

Then we need to perform a user task, the user will choose wether to approve or reject, and maybe add some information. For that we can create an application or in a simplier way use forms. Let’s look at our forms for our financial validation process.

This is also very easy to implement. In the fields, enter the fields you want to present in the user task and if they can be edited or not.

In the decisions, the different decisions the user can make.

For the financial validation, we have used a user task with form, but in some case during this workflow, we can also create applications instead of forms (SAP UI5 Components).

6. SAP Cloud Platform Workflow – SAP Fiori My Inbox

Now that we have created a form user task in the financial validation. How will the user interact with this financial validation task?

He will be accessing his tasks thru the SAP Fiori My Inbox. As you can see in the following screenshot, this is the SAP Cloud Platform Portal and I used it also for monitoring my Workflow instances.

The user had a task – By clicking on the inbox we get the following form with high priority. The end user can input information and approve or reject the request. If the user does not provide the mandatory fields, the task cannot be completed.

7. SAP Cloud Platform Document Repository

In one of the other user task of this specific workflow, the RAG validation, the user will have to upload his validation documents into SAP Cloud Platform, and for that we are going to be using the SAP Cloud platform Document Service.

In order for the user to be able to use this document repository, we have created a small SAP UI5 html application.

The user will then use this interface to upload their documents when approving or rejecting their user tasks.

7. SAP Cloud Platform Business Rules

As explained in the scenario, we want to verify that our account creation request’s bank account is not based in an NCCT. For this, we are using Business Rules, enabling end users to manage these rules directly, instead of hard-coding them in our workflow. This is very powerful has the rules will be maintained by end users and they will not have to dive into the workflow. For more information on how to configure the Business Rules in your SAP Cloud Platform, you can use the SAP help or refer to blogs such as Using business rules in SAP Cloud Platform Workflow.

This is the call from SAP Cloud Platform Workflow, going into SAP Cloud Platform Business Rules interface.

This is the interface that end users will be using to manage and deploy their rules.

8. SAP Cloud Platform OpenConnectors

Now for the last part of our workflow, we have done all verifications, with the different teams, we found a duplicated value and decided to update the data already existing in S/4HANA with the OData adapter and the one in Salesforce with the OpenConnectors adapter. For that we will be creating another integration flow in SAP Cloud Platform Integration.

Opening the SAP Cloud Platform OpenConnectors , after connecting directly to own Salesforce environment, we can use directly the APIs in a very simple way. You can browse thru the APIs, try them out and immediately see how they will function.

After calling OpenConnectors, from our integration flow, the account is updated in Salesforce.

And that is all – I hope that this demonstration was helpful, and gave you a good insight of the amazing capabilities of the SAP Cloud Platform. This demonstration was just a glimpse of a few of the capabilities of SAP Cloud Platform and especially for the Workflow and integration part. We also used different services on the SAP Cloud Platform (Workflow, Integration, Business Rules, Document, SAP Fiori My Inbox) and also the SAP Cloud Platform OpenConnectors to enable interaction between a S/4HANA system and a SalesForce system.

3 thoughts on “SAP Cloud Platform Integration – Salesforce and S/4HANA Workflow demonstration”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.