Skip to Content

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”.

/wp-content/uploads/2016/08/01_1016947.jpg

Click on the blue button “Enable”.

/wp-content/uploads/2016/08/02_1016996.jpg

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

/wp-content/uploads/2016/08/03_1016997.jpg

 

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.

/wp-content/uploads/2016/08/04_1016998.jpg

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.

/wp-content/uploads/2016/08/05_1016999.jpg

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

/wp-content/uploads/2016/08/06_1017000.jpg

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”.

/wp-content/uploads/2016/08/07_1017001.jpg

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”.

/wp-content/uploads/2016/08/08_1017002.jpg

 

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”.

/wp-content/uploads/2016/08/09_1017040.jpg

Predictive service is stopped:

/wp-content/uploads/2016/08/10_1017047.jpg

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

/wp-content/uploads/2016/08/11_1017048.jpg


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.

/wp-content/uploads/2016/08/12_1017049.jpg

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

/wp-content/uploads/2016/08/13_1017059.jpg


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).

/wp-content/uploads/2016/08/14_1017060.jpg

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.

/wp-content/uploads/2016/08/15_1017061.jpg

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

/wp-content/uploads/2016/08/16_1017074.jpg

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.

/wp-content/uploads/2016/08/17_1017075.jpg

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

/wp-content/uploads/2016/08/18_1017076.jpg

Once created, you get this:

/wp-content/uploads/2016/08/19_1017089.jpg

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”.

/wp-content/uploads/2016/08/20_1017090.jpg

You see the status is OK.

/wp-content/uploads/2016/08/21_1017091.jpg

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

/wp-content/uploads/2016/08/22_1017098.jpg

 

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.

 

 

To report this post you need to login first.

37 Comments

You must be Logged on to comment or reply to a post.

  1. Edison Lim

    Hello Thierry,

    I have the trial account and am trying to follow your sets. I see some differences though:

    1. When I deploy Predictive Service, the system creates aac4paservices AND corresponding database schema “p1941601526trial.aac4paservices.web”. –> Does this mean I don’t need to create the “tbmdc” data source you mentioned (and the database user)?

    2. HCP automatically did the binding. I do not have a chance to define database user and use the user in the creation of the binding.

    3. The schema also does not contain any link to Web based development workbench. So, I don’t see how to grant roles to db user.

    4. When I try to run the java service, I see errors like “No database binding has been defined”


    Do you know what might be wrong?


    Here are some screen prints:


    Capture3.PNGCapture2.PNGCapture1.PNG

    (0) 
      1. Thierry BRUNET Post author

        Hi,

        Thanks for your feedback.All your problems comes from the fact you have not created a HANA MDC database. It is necessary to create a HANA MDC database because on HCP Trial, APL will correctly work only with HANA MDC.

        Create first a HANA MDC database, create a technical user, delete this default binding and create a new one on the HANA MDC and the technical user.

        Best regards

        Thierry

        (0) 
          1. Thierry BRUNET Post author

            Hi,

            ok, that’s good, so you can like this post !!

            I wish the HCP predictive services will give you what you expect. If you have questions, feel free to contact me.

            Best regards

            Thierry

            (0) 
            1. Jino Jose

              Thierry,

              Great post..

              I am already using the HANA MDC and got a user and schema. I have granted the existing  user with the role APL_execute, then did the the data source binding. However while doing accessing the application URL it says “No data base binding”

              Do I need to create a new MDC and user only for predictive analytics

              SCN1.PNGscn2.PNG

              Thanks,

              Jino

              (0) 
              1. Thierry BRUNET Post author

                Hi Jino,

                You don’t need to create again a HANA MDC. Can you check that your technical user has a SELECT access to the schema where your data are (see screenshot)?

                Best regards

                Thierry/wp-content/uploads/2016/09/16_1035582.jpg

                (0) 
                1. Jino Jose

                  Thanks for the response, My user had the required authorization. I stopped and restarted the application, now its working, I hope the binding has to be done without starting the application.

                  (0) 
  2. Jay Zhao

    Hi Thierry,

    I deployed predictive service as you mentioned, but after I started the service and tried to access administration and online documentation, I got the error that

    “HTTP Status 403 – Access to the requested resource has been denied”

    Do you have any idea what’s the problem is?

    Best Regards,

    Jay Zhao

    (0) 
    1. Jan Fetzer

      Hi Jay,

      I experienced the same when trying to launch my WebIDE for my newly created tenant-ed database. After I assigned sap.hana.ide.roles::Developer to my SYSTEM user, that user could open the WebIDE. I assume it is the same for you. Also, I consider this completely unrelated to HCPps, but rather as a general HCP auth topic.

      Cu, Jan

      (0) 
      1. Thierry BRUNET Post author

        Hi,


        Once you have deployed the predictive services, you have to set roles C4PA-USER” to your HCP user name to be able to use Predictive Services. If you also want to administrate them, grant you the role “AA-Admin” (For the details, refer to the last past of the Step 2).


        Regarding the roles,

        – The PS_USER must have role sap.pa.apl.base.roles::APL_EXECUTE (refer to step 5)

        – To work correctly with SAP WebIDE, the SYSTEM user should have roles mentioned here: SAP HANA Web-Based Development Workbench – Introduction to SAP HANA Development – SAP Library.


        Best regards

        Thierry


        (0) 
        1. Jan Fetzer

          Hi Thierry,

          after assigning those roles to my HCP user, I needed to restart the app aac4paservices for these changes to take effect. Until then, I experienced the same issue as Jay and the system claimed that my database binding was missing (which it wasn’t, but the changed wasn’t effective then). Therefore the order of config steps matters (which I feel it shouldn’t for a cloud solution, should it?)

          Cu, Jan

          (0) 
    2. Jay Zhao

      I seems found the issue. Previously when I set roles “C4PA-USER” and “AA-Admin”, I use HCP account number “<I User Name>trial”. Then I got the HTTP 403 error.

      Later I tried to use “<I User Name>” to set roles “C4PA-USER” and “AA-Admin“. It is working now.

      (0) 
      1. Thierry BRUNET Post author

        Hi,

        You’re right. It is important to distinguish the account name and the login. Roles are set to login. I will check if this is clearly mention in the documentation.

        (0) 
  3. Ritesh123 Nag

    Hi Thierry ,
    Thank you for this awesome post ,
    I followed each step and able to create the Java App Mdc architecture etc . i did each and every step as described but at the end when i am clicking on the Application URL of the JAVA application , it is showing that No database Binding have been found .
    I have restarted the JAVA app and did everything described in the Previous chat but unable to solve the problem please help .


    2.

    (0) 
  4. Göran Westin

    Hi

    Thank you for a very nice blog.

    I have followed your steps above but I can’t find the role APL_EXECUTE in the list when searching for roles that I would like to add to my user “PS_USER.”

    PS. I’m using a HCP trial account DS.

    Br
    Göran

    (0) 
    1. Thierry BRUNET Post author

      Hello

       

      Can you post a screenshot of your dev environment (Eclipse or SAP Web IDE) where you edit properties of the user PS_USER. In the tab “Granted Roles”, click on the green “+” sign and type sap.pa. This should be enough to filter roles sap.pa.apl.base.roles::APL_EXECUTE.

      Best regards

      Thierry

      (0) 
    2. Pavan Krishnaa MULPUR

      Hi Goran,

      Here is the screen shot below showing the role APL_EXECUTE. As Theirry mentioned, “In the tab “Granted Roles”, click on the green “+” sign and type sap.pa. This should be enough to filter roles sap.pa.apl.base.roles::APL_EXECUTE.”

      Thank you.

      Regards,

      Pavan.

      (0) 
  5. Arun Godwin Patel

    Hello,

     

    When adding the sap.pa.apl.base.roles::APL_EXECUTE role, I still didn’t have permission to open the catalog or editor.

     

    In order to give me full permission to open these, I had to add some additional roles, see the screenshot:

     

    Best regards, 

    Arun Godwin Patel

    (0) 
    1. Thierry BRUNET Post author

      Hi,

       

      This was not necessary when this document was created. I have updated the blog to reflect this change.

      Best regards

      Thierry

      (0) 
  6. Pandari Kubendran

    Hello Thierry,

    Thanks for your blog. I’m trying to integrate IoT services data with predictive services. My predictive services was working yesterday, but when i tried to register the dataset, i got a message – javascript was not enabled. Then i changed the security->trust, got rid of the javscript error, but i got 401 error – no permission. from then on it’s a downhill.

    i’m getting the error “No database binding has been defined”. I followed your tutorial, but the problem i have is, i already have sensor data in another schema “s001672XXXXtrial.aac4paservices.web”, now if i create another database/schema as mentioned in your tutorial, how do i integrate these two.

    Is there another way to integrate these two schemas. any pointers. I deleted and recreated the bindings, predictive services, stopped multiple times,  etc, but none worked.

    Any thoughts.

    Regards

    Pandari

    (0) 
    1. Thierry BRUNET Post author

      Hello Pandari,

      Here are several points to get into account:

      1) The predictive service on trail must be connected to a HANA MDC database.

      2) I am not sure that on trial you can use the database of another trial account. This means that if you want to use IoT service and Predictive service, you have to do this on the same trial account and on a HANA MDC database.

      Best regards

      Thierry

       

      (0) 
    1. Thierry BRUNET Post author

      Hello Pandari,

      On trail you don’t have to install APL yourself because it is already done by HCP dev/ops. Now don’t forget to create a HANA MDC database.

      I hope this answer to your question.

      Best regards

      Thierry

      (0) 
  7. Daniel Liu

    Hello Thierry,

    I tried to access administration and online documentation, I got the error “HTTP Status 401 – Unauthorized“.

    Thanks

    (0) 
  8. sidharth dubey

    Hello Thierry,

    I am successfully using Predictive services with my trial account.In that i had created New user and working with that is fine.

    But i am getting error while i am registering my Dataset with IOT table which is existed in SYSTEM user. I have made all changes in SYSTEM user.

    While i am registering with Postman service i am getting following error-

    {
    “errors”: [
    {
    “errorCode”: “EDS101”,
    “errorMessage”: “\”DATA/IOT\” is not accessible. Please make sure that hanaURL is correct and that access rights were granted to the predictive services.”
    }
    ]
    }

    Regards,

    sidharth

     

    (0) 
    1. Thierry BRUNET Post author

      Hi,

       

      I think that the user you have used to create the data binding (PS_USER in the blog) must be granted at least a SELECT access to your table DATA/IOT.

       

      Best regards

      Thierry

      (0) 
  9. Rubane s

    Hi Thierry,

    I’m getting below error while executing java application for predictive service and going to admin section.

     

    HTTP Status 403 – Access to the requested resource has been denied

     

    Can you please help here? In services of PS I’ve two roles and its been assigned to both ps_user and my s user. Not sure what else I need to do to fix this??

    Thanks

     

    (0) 
  10. Miyan aleem

    Hi Thierry BRUNET,

    HTTP Status 403 – Access to the requested resource has been denied.

    I am getting the error when I run the service. I have assigned all the roles to my user. please help me in that

     

    Thanks and Regards,

    Miyan Abdul Aleem

    (0) 

Leave a Reply