A sample mobile application built with AngularJS and linked to SAP HANA Trial backend


For HCP trial, every developer will have two schemas (DEV_XXX and NEO_XXX) by default. So, NEO_XXX should be your development schema, meanwhile DEV_XXX is the private schema of your developer user. And usually we need to create objects in NEO_XXX schema instead of DEV_XXX [1].


Figure 1


Make sure you've done some basic steps before it. 

I created in the "hanatrial" package for the example and with the same folder structure of the example on Github.
Figure 2

.xsaccess file contains some access control information and .xsapp indicates the application we are building is a xs application of HANA. (File details can be found on Github)


1. Create Models:


  •  Create two tables (people.hdbtable and taxes.hdbtable) and one sequence (peopleseq.hdbsequence). 
    • Use your NEO_*** SCHEMA for table.schemaName. In my case, it will be "NEO_91NN2NENJITDMWTLGL5DD5INO" as displayed in Fig. 3.

1:  table.schemaName = "YOUR SCHEMA STARTS WITH NEO_*** HERE";  
2:  table.tableType = COLUMNSTORE;  
3:  table.columns = [  
4:       {name = "PPSno"; sqlType = VARCHAR; nullable = false; length = 200;},  
5:       {name = "firstName"; sqlType = NVARCHAR; nullable = false;length = 200;},  
6:       {name = "lastName"; sqlType = NVARCHAR; nullable = false; length = 200;},  
7:       {name = "title"; sqlType = NVARCHAR;length = 200;},  
8:       {name = "cellPhone"; sqlType = NVARCHAR;length = 200;},  
9:       {name = "officePhone"; sqlType = NVARCHAR;length = 200;},  
10:       {name = "email"; sqlType = NVARCHAR;length = 200;},  
11:       {name = "city"; sqlType = NVARCHAR;length = 200;},  
12:       {name = "pic"; sqlType = NVARCHAR;length = 200;}];  
13:  table.primaryKey.pkcolumns = ["PPSno"];  

Figure 3
Figure 4


  • Create "init_data" folder and copy files from Gitbub to your folder.
  • Call the procedure to insert data into people and taxes tablestablespoon.
  • Copy all files to the rest folder (Fig. 6), [Run on Server] to check if the data can be accessed (Fig. 7) by your account.


Figure 7
Figure 6
  • Finally, copy all files to your client folder (and change the relative path in these files).

  • Run index.html or iphone.html. You could see the app is running as displayed in Fig 9, 10.

Figure 9

Figure 10

If the page shows insufficient privilege, give the privilege to p**** user account of yours and then try again.

1:  GRANT EXECUTE,select ON schema "NEO_***" TO p***  

No comments:

Post a Comment