SCP Business Rules put to the test with Microsoft Power Platform
Today I am going to take you on a ride with me to enjoy a fully blown prototype to make real-time sales incentive adjustments with a low-code solution. Many routes lead to the city of Rome but for my implementation I chose to do it with the beloved SCP Business Rules service, the demo SAP S4 cloud system ES5 and Microsoft Teams. Exciting, isn’t it? ?
The business context
With increasing need to influence business in near-real time, comes the desire to do it from one pane instead of many different ones. Even more pressing to do that without approaching a developer to implement your changes over the course of multiple days or even weeks.
For many knowledge-workers around the globe their daily routine starts somewhere in the M365 portfolio with Outlook or Teams for instances and is revisited multiple times throughout the day. Me personally I deactivated all notifications to get anything done at all. ?
However, surfacing some of your SAP processes on collaboration products like Teams is a logical step to become more streamlined.
The employees who perform the integration with low-code/no-code solutions are often called citizen developers and play a fundamental part in lifting the burden from IT to provide custom developments and unleash the power of the functional departments.
Let’s have a look at the moving parts
Fig.1 Overview of integration architecture
Remember, all above software integration components are implemented using a low-code solution, which is feasible for a citizen developer. So far so good. I am just checking, because I normally throw code at the community ? but no worries the snippets, templates etc. will be provided on GitHub. Back to the process…
The process is kicked off by a sales agent, who is talking to his customer and providing some details to a Microsoft power app. We will walk along the architecture outlined in figure 1 “bubble” by “bubble”. So the following numbers represent the steps from the architecture overview.
- At some stage during that call the agent must put up a number for the sales quote currently agreed on. The power app can tell him if the deal size qualifies for the target bonus scheme of that product.
Fig.2 PowerApp in Teams for Seller with SAP ES5 and SCP integration
- Have a look at the star icon. It changes its colour (red/green) based on the result of the call to the SCP Business Rules service. The text down below gets updated with the current bonus threshold level (40k in above example) maintained on the SCP service for that product.
Fig.3 Decision Table with bonus threshold on SCP Business Rules Service
- Once the sales quote is finalised the sales agent sends it to the customer trigged by the Power App. The flows on Power Automate do all the heavy lifting of the integration.
Fig.4 Screenshot from send quote section of PowerApp
- First, we are sending that email with the quote details to the customer put on the recipient field on the power app.
Fig.5 Screenshot from quote e-mail on Outlook
Fig.6 Screenshot of collapsed Power Automate Flow
- Notify the corresponding sales managers in their Teams Channel about a deal that is close to the bonus threshold. I maintained two conditions that basically define a corridor between 80% and 120% of the current threshold maintained in the SCP Business Rules Service.
The managers receive an adaptive card with the deal size info and two options to take immediate action. You will see some details on this in step 7.
Fig.7 Screenshot of uncollapsed condition steps
- As you can see on the Power Automate flow above, that there are some http calls before the actual email was sent. First, I need to retrieve a CSRF token for the following calls to SAP ES5. Secondly, I am updating the price of the server product with the given value from the PowerApp and finally create the sales order in ES5.
Fig.8 Screenshot from flow step to create sales order in ES5
Fig.9 Screenshot from ES5 with sales order initiated from PowerApp
Did you spot the difference in price on the PowerApp and the shopping cart on ES5? We created the sales order on the power app in Euros and send that to ES5.
Fig.10 Screenshot from product overview on ES5
The amount was converted on the shopping cart, because it is setup to be processed in USD. So even the conversion happened ?
Now to the next section. Let’s revisit where we are in the process (see bubble number 7):
Fig.11 architecture overview with highlighted step 7
- The managers can directly change the bonus threshold in the SCP service, do nothing or jump to the modelling view. All of that can happen from the adaptive card in Teams (see fig. 12). That card was developed using the online designer. Note on the side: Of course, you would need to contact the SAP backend for bonus scheme changes for a full-cycle example too. Unfortunately, the ES5 does not offer the capabilities to finish the example in that regard. Therefore, we left that piece for another post with a custom SAP System on Azure.
Fig.12 Screenshot of adaptive card in sales manager Teams channel
- In our example the manager decides to lower the threshold to sell more “aggressively” for instance. (see input on fig.12)
Fig.13 Screenshot of flow section for SCP Business Rules Service update
With the update rule flow (see bottom left on fig.13) the decision table on SCP Business Rules gets updated:
Fig.14 Screenshot from updated SCP Business Rules Service
- The sellers get immediately notified about the change in bonus thresholds for that product in their Teams channel.
Fig.15 Screenshot from Seller channel with live update notice for server product
When the seller goes back to the PowerApp the updated bonus threshold will be reflected immediately. Remember the red star icon, which indicated the missed bonus eligibility of the deal amount?
Fig.16 Screenshot of updated PowerApp deal indicator (note green star icon)
That’s it. Now you have a fully working prototype that allows your sales management to influence sales processes from within Teams. The sellers can also interact with the PowerApp from the same location. The whole experience is straight forward because of the adaptive cards with simple inputs and buttons.
Thoughts on production readiness
To make this scenario more production ready you would need to fine-tune a couple of things:
- Wait times, that Power Automate uses to get feedback from one of the managers
- Think about scalable maintenance on product level on the SCP Business Rules service
- Additional OData integration with your SAP backend to update the bonus schemes
- Race conditions when multiple sellers interact with the same products at the same time
- Filtering/avoiding multiple requests for the same thing to keep the Teams channels understandable
- Polish the PowerApp
Hopefully, I got your thinking-machine up to speed with ideas on what systems to connect for your own processes ?
Some prerequisites to get started
- Setup for SCP Business Rules on CloudFoundry (you need a Router app for the service on SCP deployed via WebIDE for instance): https://developers.sap.com/mission.cp-rules-get-started.html
- Getting started with PowerAutomate: https://docs.microsoft.com/en-us/power-automate/getting-started
- Create account on SAP ES5: https://developers.sap.com/tutorials/gateway-demo-signup.html
- Understand ES5 OData interfaces: https://blogs.sap.com/2017/12/05/new-sap-gateway-demo-system-available/
- Adaptive card designer: https://adaptivecards.io/designer/
Aaaaand done! I showed you today that citizen developers have the means to create interesting business processes or process enablers without heavy coding. We did that with the SAP Cloud Platform Business Rules Service and Microsoft Power Platform. The adaptive card designer speeds up the design of the UIs used in Teams and closes the cycle of efforts for the citizen developer.
All above was created using no-code/low-code software over the course of hours, not days or weeks. It could become even easier once we create a connector for the SCP services to avoid the OAuth authorization flows.
#KUDOS to @Michael Kaufmann and @Mustafa Kurtulus for their invaluable collaboration.
Here is another PowerApp example with a custom connector for SAP ES5 to work with the products from my colleague Holger Bruchelt:
Find my GitHub repos with the materials to replicate yourself here: https://github.com/MartinPankraz/PowerApp-SCP-BizzRules-Prototype
Ready to enrich your business process with SAP Cloud Platform and Power Platform? I’d like to hear from you how you make sure that your workers leverage the right tools for the right task.
As always feel free to leave or ask lots of follow-up questions.