Build a Robotic Smart Analytic Application in SAP ...
Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
Normally, people think that an analytic app can only run at the frontend. However, this is not the case. In this blog post, I am going to showcase an example regarding an application that was built by SAP Analytics Cloud and runs as a scheduled job at the backend. This application runs as a robot for 7×24 hours to monitor the business, trigger alerts based upon exceptions, generate actionable proposals, and automatically execute transactions when the criteria of the business rules are met. My hope is that this example inspires you when you have similar use cases.
To begin, let’s first look at the demo:
DEMO SUMMARY
In this demo, the application is scheduled to run at the backend. The application monitors the prices of raw materials for a small bakery, which has 4 products and 6 variations of raw materials. The application will send out an alert when the rise of material price severely impacts the margin. Automatically, the application will generate two proposals to maximize the margin and stay within the production capability (4900 minutes) constraint:
To change the vendors for raw materials
To change the production plan and adjust the number of product pieces
In the demo, I wrote a simplified algorithm: proposal 1 picks the materials vendors that offer lowest prices, proposal 2 keeps vendors stable because you may have long contracts with them but adjust the production plan to gain biggest margin. In a real-world scenario, surely you need to consider more factors affecting a business and you can rely on experiences, smart predict features, and machine learning to create the best strategy.
In the meantime, two separate SAP Analytics Cloud Planning versions for production plan and purchase plan are automatically created for each proposal. The business user can either decide to:
Set a business rule for the robot to select one proposal and run it automatically
Manually pick one of the proposals
Perform a what-if simulation by adding new business constrains
Regardless of which approach the user selects, the production and purchase plan will be updated.
1. SCHEDULE PUBLICATION FOR AN ANALYTIC APPLICATION
You can schedule a publication for publishing and distributing analytic application views via email in a PDF format at a predefined time or frequency.
2. NOTIFICATION API
The notification API sends notifications to the application consumers in Notifications Panel and through email, mobile notification as well. While the scheduled job runs, you want to be notified once a certain business rule is met, like the quantity sold of a particular product is below 50M.
Notification Panel:
THE NOTIFICATION PANEL INCLUDES:
Title
Body content (support common HTML format like i/b/u, a, br, hyperlink)
Action button to open the Application
THE APPLICATION DEVELOPER CAN ALSO CONFIGURE:
Recipients (with the support of value helper)
View mode of the application at run time
URL parameters in key-value pairs
Send email or not
Send the notification to SAP Analytics Cloud’s iOS Mobile App or not
/*
*/
Example: Will send both notification and e-mail to user (Jack).
Notification title is 'notification title'. Notification content is "notification
content".
var param1 = UrlParameter.create("bookmarkId", "17889112-4619-4801-8954-
637818290511");
Application.sendNotification({
"title": "notification title",
"content": "notification content",
"receivers": ["Jack"],
"mode": ApplicationMode.Present,
"parameters": [param1],
SUMMARY
Once an analytic application is able to run as a scheduled job at the backend for 7×24 hours, you would be able to achieve many interesting use cases that were not possible prior.