SAP HANA Cloud Application Development Scenario End-to-End Tutorial
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
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
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.
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.
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
Hi Jens,
excellento, thank you so much.
Very nice doco.
All the best,
Andy.
Hi Jens,
thanks a lot for sharing this excellent work.
Well done, congratulations!
Regards,
Mirco
Simply great! Thanks a lot!
Cheers, Carlos
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
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:
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
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:
Can you help me to understand this complex entity handling to get this done?
Thanks,
Luis Ayala
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):
Thanks a lot to all who sent their feedback and I hope you continue with it 🙂
Best regards,
Jens
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
Hi Alexander,
From what you wrote I can't imagine what is wrong but please send me an e-mail (jens.glander@sap.com) when you have time and then we can figure out how to solve that problem.
Best regards,
Jens
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
Hi Jens,
thank you very much for your quick and intensive help. No it works very well!
Best regards,
Alexander
Hi,
just to check, if I were to try the tutorial what is the hardware configuration requirement?
many thanks.
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
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
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
Thanks Jens for the information. 🙂
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
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?
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
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
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 : )