Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
hoang_vu
Advisor
Advisor

Introduction


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, mirkohin 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


DISCLAIMER:

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.

Architecture


Below was our anticipated architecture for this project:



We had multiple components supporting us to build this application:




















System Activity
SAP S/4HANA Cloud

  • consume the read and the create commercial project APIs

  • add an extensibility field for the project location


SAP Cloud Platform

  • use the SAP Web IDE to build our application based on a template

  • use the destination service to connect to the relevant services

  • consume SAP Leonardo machine learning services to translate our project description into English


Google Places

  • determine the address of the project location based on a key word




Approach


Our approach to build this application comprised multiple steps:












































Step System Activity
1 SAP S/4HANA Cloud Understand commercial project APIs
2 SAP Cloud Platform Understand translation APIs
3 Google 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:

Understand translation APIs


Following services were required for our project:

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.

Maintain destinations


Log on to your SAP Cloud Platform subaccount and go to "destination" on the left side:



Maintain your service destination:

S/4HANA Cloud



Leonardo Machine Learning



Google Places




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"

  • Next




  • 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"




  • Next

  • Fill in your object binding as mentioned in the screenshot




  • Finish

  • 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

  • mirkohin has done a fantastic job here to bring all this together, if you want to perform these steps, you will require deep SAPUI5/Javascript knowledge


Result


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.
8 Comments