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.
cancel
Showing results for 
Search instead for 
Did you mean: 
thierry_brunet
Advisor
Advisor


This post lists the steps to deploy and configure Predictive service on your SAP Cloud Platform Trial account. This it assumes you already have a trial account. Otherwise, visit this site: https://hcp.sap.com/try.html and request for a free account.

Step 1: Enable Predictive service


From the “Services” page, click on tile “Predictive service”.



Click on the blue button “Enable”.



After few seconds, the predictive services will be enabled. You will then have to deploy them.



 

Step 2: Deploy Predictive service


From the previous page, you have a link to the online help which describe you the services and also how to configure them.

For the moment, click on the link “Go to Services” which brings you to the cockpit of the services.



Click on the tile. You arrive in a page already filled with your SAP Cloud Platform trial account and user name. Just enter your SAP Cloud Platform password and click on “Deploy” button. Click “Yes” on the confirmation dialog.



The deployment takes few seconds and you get a URL to go to the dashboard of the Predictive service.



In this URL you can recognize:

  • Your SAP Cloud Platform trial account and

  • The name of the JAVA application of the predictive services: aac4paservices


There is also a note which advise you to grant you specific role to access to this dashboard. The remark on APL is not valid for SAP Cloud Platform Trial. This means that you don’t have to install APL on your HANA database schema. You will just have to create a binding between Predictive Services and your HANA database schema, but this point will be detailed later.

So go back to the “Predictive Services – Overview” page and click on link “Configure Predictive service”.



Click on “Roles” and set roles “C4PA-USER” to your SAP Cloud Platform user name to be able to use Predictive Services. If you also want to administrate them, grant you the role “AA-Admin”.



 

Step 3: Start Predictive service


Go to the dashboard: https://account.hanatrial.ondemand.com/cockpit#/acc/xxxxtrial/app/aac4paservices/dashboard or click on “Application/Java Applications” and select “aac4paservices”.



Predictive service is stopped:



Click on “Start” button and after a while, they will start.



Step 4: Create a HANA MDC database


Such a binding must be done on a HANA MDC database. So go to “Persistence/Databases & Schemas” and click on “New” button. Fill the dialog like this (note that you can give another database ID). Remember the password for the user SYSTEM you will give because it will be used to launch “SAP HANA Web-based Development Workbench”.

 

I presume you have the roles to use this workbench otherwise visit the help of SAP HANA Web-Based Development Workbench.




Once this database created you have this in the Overview page.



Step 5: Create a technical user


Click on “SAP HANA Web-based Development Workbench” and then on the tile “Security”.

Select “Users” and on the right click, select “New user”. Complete the page like this and click on “Save” icon.

The roles to add are:

  • sap.pa.apl.base.roles::APL_EXECUTE in order to able to run APL (mandatory)

  • sap.hana.ide.roles::SecurityAdmin to log on with PS_USER and change its initial password.

  • sap.hana.ide.roles:CatalogDeveloper if in step 6 you use PS_USER to create a schema (optionnal if you connect to the HANA MDC with another user who has already this role).




Important note: Before to continue, you have to connect to the database with this new user at least once. The reason is that at the first connection the system request to change the initial password.

Step 6: Create a schema for your data


The data you will use with the SAP Cloud Platform Predictive service must be in the SAP HANA database, either in a table or a view. To guarantee data privacy, this table or this view should be in protected schema. This is why we create here the schema PS_DATA. It is also necessary to grant select privilege to PS_USER to the tables of schema PS_DATA.

From “SAP HANA Web-based Development Workbench”, click on tile “catalog”. Right click on Catalog and select New Schema. Give a name and click OK.



The schema is created. Go to Security tile and grant select privilege to PS_USER to the tables of schema PS_DATA and save.



After this you can create tables or view in the schema and import data.

Step 7: Create a HANA database binding


Now that the database technical user is created and has an access to the schema PS_DATA which contains tables that can be used as dataset, a last step to finish configuration is to establish the link between the predictive services and the schema PS_DATA.

Do to this, you will bind the application of the predictive services to your SAP HANA instance with the technical user PS_USER created before and which has the authorization to access to your data. It is through this connection that predictive services will analyze your data and provide you insights.

From SAP Cloud Platform go to the Java applications and select the Java application of the Predictive service.



Click on “Data Source Bindings” and then on New Binding. Fill the page like this and click on Save.



Once created, you get this:



To check the Predictive service is correctly bound, go to the cockpit: menu Applications/Java Applications and chose “aac4paservices”. Click on the application URLs: https://aac4paservicesxxxxtrial.hanatrial.ondemand.com/com.sap.aa.c4pa.services and click on tile “administration”.



You see the status is OK.



And a click on the tile “Binding” display the binding just created and ready to work.



 

You are now ready to use the SAP Cloud Platform Predictive service in a HTML/Javascript application or in a Java application.

To get more information about development of cloud applications using SAP Cloud Platform Predictive service visit the online technical help or watch these videos.

 

 

38 Comments