Skip to Content

This blog offers you a comprehensive and easy-to-use tutorial for developing an SAP HANA Cloud Web Application Scenario.

The below linked tutorial guides you step-by-step through an application development scenario which includes

  • Set up your HANA Cloud Development Environment from scratch.
  • Develop a minimal end-to-end HANA Cloud Application from UI to Database
  • Publish and run each developed increment on SAP HANA Cloud local runtime for testing
  • Finally you publish and run your developed “PersonsList” Web Application on SAP HANA Cloud by using your Trial Account

List of SAP Technology used:

  • SAPUI5 (Toolkit for HTML5)
  • HANA Cloud Persistence Service/JPA
  • Local Java Web Server for testing
  • OData (Connectivity)

View Tutorial Document

Latest Update of this Tutorial Document: Version 1.4.2 (22nd of September 2014)

Main changes added with versions 1.4.2

  • Added a consistent installation guide again (section 1.1)
  • Bugfix: Fixed ui5 dependency issues by using stable SAPUI5 CDN URL
  • Adapted documentation to newest HANA Cloud Platform changes (like Java Web Server instead of local HANA Cloud test server)

(use above download link and find in chapter 7 “Tutorial Documentation History” the main changes of all document versions)

Development Scenario Overview in one picture

In the tutorial you develop your own end-to-end PersonsList Web Application from UI to Database and publish and run each developed
increment on local Java Web Server and finally on SAP HANA Cloud

/wp-content/uploads/2012/11/scenario1_overview_diagram_personslist_221849.png

Related Tutorial Links


[1] See: SAP HANA Cloud Code Samples – Extensions of PersonsList Web Application

[2] See for other available scenario tutorials: http://scn.sap.com/community/developer-center/cross-technology

To report this post you need to login first.

24 Comments

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

  1. Andy Silvey

    Hi Jens,

    a huge thanks, this is fantastic documentation and leadership.

    For anybody interested in Cloud and SAP this is just what the doctor ordered.

    All the best,

    Andy.

    (0) 
  2. Andy Silvey

    Hi Jens,

    is there anywhere documentation on:

    . User Provisioning for Cloud Applications

    . User Authentication for Cloud Applications

    . Single Sign On for Cloud Applications

    . Cloud Applications integration to on-Premise backend systems

    This is the glue which appears to be missing at the moment in the Cloud area.

    All the best,

    Andy.

    (0) 
    1. Jens Glander Post author

      Hi Andy,

      thanks a lot for your comments.

      For the first three topics you can find s.th. in Securing SAP NetWeaver Cloud Applications and for the last topic you might have a look here How to Use an On-Premise Back-End Service in a Cloud Application

      It would be helpful to have the above topics also documented as part of an easy-to-use, step-by-step scenario tutorial. I don’t want to promise it soon but we are working already on another scenario tutorial which covers parts of the topics above 😉 .

      Regards,

      Jens

      (0) 
  3. Sunil Kumar Maurya

    Hi Jens,

    I am doing according to document, and it is really a great help from you.

    However I am facing one problem after converting JPA-model into Maven project.

    depcrition of error is as below and this error is on first line of pom.xml

    “Multiple annotations found at this line:

    – Error resolving version for plugin ‘org.apache.maven.plugins:’ from the repositories [local (C:\Users\sunil.kumar.maurya

      \.m2\nwcloud.samples.repository), central (http://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository

    – Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from http://repo.maven.apache.org/maven2 was cached in

      the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not

      transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): connection

      timed out to http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom

    Please help me to sort it out and moving forward

    Thanks:

    Sunil

    (0) 
    1. Jens Glander Post author

      Hi Sunil,

      Unfortunately I don’t have a clue what caused this error and from remote it is hard to analyse the problem.

      What I would suggest is to import first the NW Cloud SDK “hello-world” sample as Maven project to check if this basic Maven for Eclipse functionality works.

      For this execute the following steps:

      1. Delete all contents of your folder C:\Users\sunil.kumar.maurya\.m2\nwcloud.samples.repository to start from a clean local Maven repository
      2. Eclipse main menu: File > Import…
      3. Select Maven > Existing Maven Project and then choose Next
      4. Choose Browse… and navigate to C:\<local-path-to-nw.sdk>\samples\hello-world
      5. Choose OK and then choose Finish to import hello-world sample as maven project.

      Does this work without any error?

      If yes, then please try to convert a jpa project as Maven Project. Try it first with newly created jpa project (call it test-jpa) where you just added one java entity by mean of the graphical modeler, save it that’s all.

      Does this work?

      Regards,
      Jens

      (0) 
  4. Luis Gonzalo Ayala Cruz

    Hi Jens,

    I did as this tutorial says, it was perfect. But i wanted to upgrade the scenario adding a relationship many to one in the JPA (Items -> Category).

    It worked fine when i used a Servlet to manage the oparation, then using the SAPUI5 and oData I can read all the Items and Categories, but I only can create Categories with this UI (just like the example), as they don’t depend on anything.

    As I know that Items depend on Categories to be created, I’ve tried several methods to create an item. This is the last script I used:

    ***************************************************************************************

                        var items = {};

                             items.Category = {

                                            __metadata : {

                                                      id : window.location.protocol

                                                      + “//”

                                                      + window.location.hostname

                                                      + (window.location.port ? “:”

                                                                          + window.location.port : “”)

                                                      + “/personlist-web/personlist.svc/Categorys(‘”

                                                                          +  sItemCategory + “‘)” ,

                                                      uri : window.location.protocol

                                                      + “//”

                                                      + window.location.hostname

                                                      + (window.location.port ? “:”

                                                                          + window.location.port : “”)

                                                      + “/personlist-web/personlist.svc/Categorys(‘”

                                                                          +  sItemCategory + “‘)”

                                            }

                                  };

                        items.Name = sItemName;

     

                        this.getView().getModel().create(“/Items”, items, null,

                                            this.successMsg, this.errorMsg);

    *************************************************************************************************

    I notice a few thing while playing with the oData URL:

    • The oData is the responsible for the wrong plural for Category, it just adds a “s” at the end of the table’s name.
    • In the URL is that to refer the Category information as “CategoryDetails” field (http://localhost:8080/squareUp-web/squareup.svc/Items('2‘)), and not as the Northwind example shows.
    • If we use the default type of the key field (Long) it has trouble to retrieve the information, I changed it to String to use the /Entity(‘ABC’) method.  

    Can you help me to understand this complex entity handling to get this done?

    Thanks,

    Luis Ayala


    (0) 
  5. Jens Glander Post author

    Hi All,

    just wanted to let everyone know that I published an improved version of the tutorial (version 1.0). This new version is based on the feedback I got from many users and contains the following most important improvements (see also chapter “Tutorial Documentation History” for the included changes):

    1. Added a best practice PersonsList application which can be downloaded fromhttp://sap.github.io/ and enables users to compare their developed with the best practice PersonsList
    2. Used EclipseLIst version 2.5 to ease usage of persistence service
    3. Added automated UI5 integration test (selenium)
    4. Improved pdf formatting (e.g. copy code snippets work now much better)

    Thanks a lot to all who sent their feedback and I hope you continue with it 🙂

    Best regards,

    Jens

    (0) 
    1. Alexander Kunz

      Hello Jens,

      I tried your tutorial, too. It is very nice and easy to understand, but I have problems while importing any maven-project. I get the Errors: “No marketplace entries found to handle Execution default-compile, in personslist-model-jpa/pom.xml in Eclipse.”

      It refers to the personlist-model-jpa/pom.xml and personlist-web/pom.xml and their tests.

      Did I install Eclipse and/or Maven(plugIns) wrongly? What can I do?

      Best regards, thanks,

      Alexander

      (0) 
      1. Jens Glander Post author

        Hi Alexander,

        I’m happy that we could find in our session the reason for the Maven problems which you observed.

        Just to let other users know:

        Using the recommended java sdk as described in the ESPM installation guide was one issue and also using the newest v-1.3 sources (which contains a bug fix for the corrupt v-1.2 sources) is mandatory to avoid the observed Maven problems.

        Good Luck for your further development.

        Best regards,
        Jens

        (0) 
    1. Jens Glander Post author

      Hi ong ai wei,

      thank you for your question.

      I myself tested the tutorial for Windows 7 (64 bit), 4 GB RAM and an Intel Core i7 2.7 GHz and this worked.  

      In general the SAP HANA Cloud Platform (HCP) online help for Product Restrictions says in section “Development Platform Support for SAP HANA Cloud Platform Tools and SDK” says

      SAP HANA Cloud Platform Tools for Java and SDK run fine in many operating environments with Java SE 6 and Java SE 7 that are supported by Eclipse. However, we do not systematically test all platforms” (see section )

      and

      SAP HANA Cloud Platform Tools for Java and SDK have been tested on Windows 7 (64 bit) with Java Standard Edition 6 (Java SE 6)

      For executing the tutorial you need these HCP Eclipse Tools for Java and the SDK. Beside that you basically need a running Eclipse IDE (recommended is Kepler as described in the ESPM Scenarios Installation Guide which is used by the above tutorial).

      Hope that helps and enjoy executing the Getting Started tutorial.

      Best regards,
      Jens

      (0) 
      1. ong ai wei

        Thanks Jens for the reply.

        Just to check what is the duration of the trail account and whether we are allow to create a little application apart of doing the tutorial specify?

        Regards,

        Ai Wei

        (0) 
        1. Jens Glander Post author

          Hi ong ai wei,


          The duration of a trial account is not limited.

          And you can deploy any other application you develop also to your trial account.


          But keep in mind:

          1. For Trial accounts you are only allowed to start one deployed application at the same time.

          2. For Trial accounts applications can be stopped after a “certain time” (so you cannot rely on the fact that if you once started your application that it will run for weeks and months). So these Trial accounts are not meant for productive applications but “try-out development”.


          Best regards,

          Jens

          (0) 
  6. Tjarliman Rusadi

    Hi,

    I followed the instruction on the PDF file, but now i am having problem on running/testing personslist-web project.

    In the PDF file (Section 4.3 Publish and Test PersonsList Application on local Java Web Server), it is said just to click RUN AS > RUN ON SERVER, but when I clicked the RUN AS, the RUN ON SERVER option was not available…

    Can you suggest me on what to do to solve this?

    Thanks

    Tj

    (0) 
  7. dylan drummond

    Hello,

    when I try to do the test build into the other developer account (so I am p1940881060, an admin of the jenkins applicaction, trying to run the build job to build in p1941256426), the build fails as follows:

    Started by user P1940881060

    Building in workspace /usr/sap/ljs/home/.jenkins/workspace/cloud-hello-world

    Fetching changes from the remote Git repository

    Checking out Revision 3e172e26fed67aefcb7999cdfc586dda8d016ff5 (origin/master)

    [cloud-hello-world] $ /usr/sap/ljs/home/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.5/bin/mvn -DSAP_CLOUD_ACCOUNT=p1941256426trial ******** -DSAP_CLOUD_USERNAME=p1941256426 -DPROXY_PORT=8080 -DPROXY_HOST=proxy-trial.od.sap.biz -Dmaven.repo.local=/usr/sap/ljs/home/.jenkins/workspace/cloud-hello-world/.repository clean verify -B -e -P cloud-integration-tests

    FATAL: command execution failed

    java.io.IOException: Cannot run /usr/sap/ljs/home/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.5/bin/mvn – execve failed (EACCES – Permission denied)

    at java.lang.UNIXProcess.forkAndExec(Native Method)

    at java.lang.UNIXProcess.access$500(UNIXProcess.java:20)

    at java.lang.UNIXProcess$1$1.run(UNIXProcess.java:113)

    Build step ‘Invoke top-level Maven targets’ marked build as failure

    Finished: FAILURE

    Any ideas as to what i am doing / have done wrong here?

    (0) 
    1. Dobromir Zahariev

      On first reading it look like you do not hve permissions to execute mvn application:

      java.io.IOException: Cannot run /usr/sap/ljs/home/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.5/bin/mvn – execve failed (EACCES – Permission denied)

      My proposal is to go to /usr/sap/ljs/home/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.5/bin/ folder and check do you have permissions to read and execute mvn executable file (r and x flags of the file).

      Best regards,

      Dobri

      (0) 
      1. dylan drummond

        Hi,

        first of all I accidentally put the previous comment to the wrong blog, should’ve gone to Run your own Jenkins on SAP HANA Cloud Platform

        …as that is what i am trying to test.

        Basically i don’t know how to check if I have permissions to {r,x} that file from within the cloud-jenkins or from HCP. Sure I put myself all available jenkins app permissions, but generally I guess i don’t have any way to go to the unix filesystem and check those specific permissions.

        I must be doing something wrong though, as the github and blog post mentioned don’t mention anything about having to set any other specific permissions.

        -dylan

        (0) 
  8. Laura Trevino

    Hi Jens!  I am confused and stuck!   When I run my index.html i gives me a undefined attribute name (role).  I have read and read and changed my <!DOCTYPE HTML> to <!DOCTYPE html>  but am still getting the error.  Here is my file.  My file publishes but it does not show Hello World…thanks for your help!

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv=”X-UA-Compatible” content=”IE=edge”>
    <meta http-equiv=’Content-Type’ content=’text/html;charset=UTF-8’/>

    <script src=”resources/sap-ui-core.js”
    id=”sap-ui-bootstrap”
    data-sap-ui-libs=”sap.ui.commons”
    data-sap-ui-theme=”sap_bluecrystal”>
    </script>
    <!– add sap.ui.table,sap.ui.ux3 and/or other libraries to ‘data-sap-ui-libs’ if required –>

    <script>
    sap.ui.localResources(“personslist-web”);
    var view = sap.ui.view({id:”idpersonslist1″, viewName:”personslist-web.personslist”, type:sap.ui.core.mvc.ViewType.JS});
    view.placeAt(“content”);
    </script>

    </head>
    <body class=”sapUiBody” role=”application”>
    <div id=”content”></div>
    </body>
    </html>

     

    Here also is my personslist.view.js file:

    sap.ui.jsview(“personslist-web.personslist”, {

    /** Specifies the Controller belonging to this View.
    * In the case that it is not implemented, or that “null” is returned, this View does not have a Controller.
    * @memberOf personslist-web.personslist
    */
    getControllerName : function() {
    return “personslist-web.personslist”;
    },

    /** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.
    * Since the Controller is given to this method, its event handlers can be attached right away.
    * @memberOf personslist-web.personslist
    */
    createContent : function(oController) {
    // create the button instance var myButton = new sap.ui.commons.Button(“btn”);
    // set properties, e.g. the text (there is also a shorter way of setting several properties) myButton.setText(“Hello World!”);
    // attach an action to the button’s “press” event (use jQuery to fade out the button) myButton.attachPress(function(){$(“#btn”).fadeOut();});
    return myButton;

    }

    });

     

    Desperate : )

    (0) 

Leave a Reply