An Example of Side-by-Side extensibility for S/4HANA Cloud with Google Places and Leonardo Machine Learning
In this blog I want share with you a SAP Cloud Platform application, which was build with S/4HANA Cloud, SAP Leonardo Machine Learning and Google Places.
For one of our projects, Mirko and me had the requirement to build an application on SAP Cloud Platform that would be able to manage projects in S/4HANA Cloud. The application should be able to:
- read and create projects in S/4HANA Cloud
- determine from a key word regarding the project location the actual project address including postal code and country
- translate the project description from any language into English
This blog does not cover any commercial topics nor does it cover other important topics, such as security or identity provisioning. Its sole purpose is to showcase the possibilities with the SAP cloud offerings and should not be implemented like this in a productive environment without further considerations.
Below was our anticipated architecture for this project:
We had multiple components supporting us to build this application:
|SAP S/4HANA Cloud||
|SAP Cloud Platform||
Our approach to build this application comprised multiple steps:
|1||SAP S/4HANA Cloud||Understand commercial project APIs|
|2||SAP Cloud Platform||Understand translation APIs|
|3||Understand places API|
|4||SAP S/4HANA Cloud||Extend commercial project|
|5||SAP S/4HANA Cloud||Activate commercial project APIs|
|6||SAP Cloud Platform||Maintain destinations|
|7||SAP Cloud Platform||Develop cloud application|
Understand commercial project APIs
There is plenty of material out there regarding the commercial project APIs in S/4HANA Cloud. You can go through the following as a starting point:
- commercial project (read): reads current projects
- commercial project (create): creates new projects
- Blogs (1 & 2)
Understand translation APIs
Following services were required for our project:
- Language detection: detects the language of a text
- Translation: translate a text from language A into language B
Understand places API
We wanted to consume following service from Google:
- Place Search: retrieve places information on a variety of categories, such as: establishments, prominent points of interest, geographic locations
You will require an API key to call this service, more information on this can be found on the link mentioned.
Extend commercial project
As we required a field to maintain the project location in S/4HANA Cloud, a custom field needed to be created. For this purposes we did the following:
- create new custom field in application “custom fields & logic”
- make it available through the relevant APIs
- adapt the UI of the relevant applications, such as application “Plan Customer Projects”
Once you have adapted, you can create a new project via the API and see whether your custom field “project location” gets filled:
Activate commercial project APIs
To activate your APIs, simply activate communication arrangement SAP_COM_0054 in application “Communication Arrangements”. If you require further information, check out my earlier blogs for more details.
Log on to your SAP Cloud Platform subaccount and go to “destination” on the left side:
Maintain your service destination:
Leonardo Machine Learning
Once you maintained your destinations, you can consume them in your application development in the SAP Web IDE.
Develop cloud application
Now we are ready to develop the cloud application on SAP Cloud Platform:
- Open SAP Web IDE an create a new project from template
- Under Category remove “Featured” and select “All categories”
- choose “CRUD Master-Detail Application”
- Give a project name, title and namespace
- Under Service URL, search for your destination S4HC & insert “/sap/opu/odata/cpd/SC_PROJ_ENGMT_CREATE_UPD_SRV”
- Fill in your object binding as mentioned in the screenshot
- Go to your manifest.json and open it in Descriptor Editor mode
- Add a new service, for example your commercial project read service with “/sap/opu/odata/cpd/SC_PROJ_ENGMT_CREATE_UPD_SRV”
- If you have done all steps correctly, you should be able to run the application, which shows the current projects in the system including a “+”-button at the bottom of the application to create projects
- Now you need to go further and develop your application to also detect the language of your project description and translate it into English with the translation API
- Then you will need to make use of the Google Places API to convert the incoming key word (for example in our case “Brandenburger Tor”) to the complete address
And here a video of our final cloud application:
You can see that when a project gets created, the application detects the language DE and then translates the project description into English
- From: Projekt für Finanzbuchhaltung
- To: Project for Financial Accounting
It also determines the address from our keyword
- From: Brandenburger Tor
- To: Brandenburger Tor, Pariser Platz, 10117 Berlin, Germany
The end result can be seen in the respective S/4HANA Cloud system.
Thanks for sharing this practical example of S/4HANA Cloud Extensibility. I would appreciate it if you could clarify how the custom Create Projects UI5 app is consumed via the Fiori Launchpad? Based on the architecture diagram and video, it seems that the app is deployed to the SAP Cloud Platform and consumed via a Fiori Launchpad which is also on the SAP Cloud Platform, rather than being consumed via the Fiori Launchpad embedded in S/4HANA Cloud. If this is the case, then a user has two different portal entry points for app consumption instead of just one, one for the custom app and another for the standard S/4 app, which is not an ideal user experience.
Is it possible to deploy the custom Create Projects UI5 app to SAP Cloud Platform but allow users to consume it via a tile on the S/4HANA Cloud Fiori Launchpad?
yes it should be possible. Once you deploy the application on your SCP tenant, you will need to create a new tile in S/4HANA Cloud with application “Custom Tiles” and insert the respective URL of your SCP application.
With the "Custom Tiles", I'll be able to add the URL of a UI5 application deployed in SCP, but I'm not understanding how we can integrate into the user access with just that...
I cannot publish the app as Public in SCP, but does that mean I should manage user access / roles in SCP too? I would like to benefit from the user roles I attributed in S/4HANA Cloud and not have to redo them and have a double maintenance for every new user.
Thanks in advance,
Any new insights regarding the matter? I thought your remark was more than valid so I was wondering if you figured it out 🙂
I'm sorry I haven't got the notification for giving you an answer.
For our purpose, we finally ended up using Custom Business Object.
We wanted to have a Fiori Tile to start an HCI interface to extract data and put them into a file on SFTP.
The Custom Business Object allowed us to have the fiori app integrated into S/4HANA Cloud and Custom Logic of the object allowed us to send an HTTP request to HCI with the data of the business object as parameters. This also allowed us to track all the call that were done.
I highly doubt this way of doing will answer your problem but it was a valid workaround for us.
The solution I can think of is to configure SSO between SCP and S/4 and then use oAuth in the destination setting which will enable us to use the existing roles created in S/4 for access control.
Hope this helps.
Thanks and Regards,
Hello Mustafa Bensan
This is the same question that I have ..By any chance did you get an answer to this question .
Difference between Fiori LaunchPad on SAP cloud Platform and Fiori LaunchpPad on S/4 HANA cloud | SAP Community
Thanks for sharing the info, it was very good write up.