You are on page 1of 53

SAP HANA Developer Center: SAP HANA

Extended Application Services


Posted by Thomas Jung Nov 29, 2012
*

With SAP HANA SP5 on page

, we introduce an exciting new capability called SAP HANA Extended

Application Services (sometimes referred to unofficially as XS or XS Engine). The core concept of SAP HANA
Extended Application Services is to embed a full featured application server, web server, and development
environment within the SAP HANA appliance itself. However this isn't just another piece of software installed
on the same hardware as SAP HANA; instead SAP has decided to truly integrate this new application services
functionality directly into the deepest parts of the SAP HANA database itself, giving it an opportunity for
performance and access to SAP HANA differentiating features that no other application server has.
Before SAP HANA SP5 if you wanted to build a lightweight web page or REST Service which
consumes SAP HANA data or logic, you would need another application server in your system
landscape. For example, you might use SAP NetWeaver ABAP or SAP NetWeaver Java to connect
to your SAP HANA system via a network connection and use ADBC (ABAP Database Connectivity)
or JDBC (Java Database Connectivity) to pass SQL Statements to SAP HANA. Because of
SAP HANAs openness, you might also use Dot Net or any number of other environments or
languages which support ODBC (Open Database Connectivity) as well. These scenarios are all still
perfectly valid. In particular when you are extending an existing application with new SAP HANA
functionality, these approaches are very appealing because you easily and with little disruption
integrate this SAP HANA functionality into your current architecture.
However when you are building a new application from scratch which is SAP HANA specific, it makes sense to
consider the option of the SAP HANA Extended Application Services. With SAP HANA Extended Application
Services you can build and deploy your application completely self-contained within SAP HANA; providing an
opportunity for a lower cost of development and ownership as well as performance advantages because of the
closeness of the application and control flow logic to the database.
Applications designed specifically to leverage the power of SAP HANA, often are built in such
a way to push as much of the logic down into the database as possible. It makes sense to

place all of your data intensive logic into SQL, SQLScript Procedures, and SAP HANA Views, as
these techniques will leverage SAP HANAs in-memory, columnar table optimizations as well
as massively parallel processing. For the end-user experience, we are increasingly targeting
HTML5 and mobile based applications where the complete UI logic is executed on the client
side. Therefore we need an application server in the middle that is significantly smaller than the
traditional application server. This application server only needs to provide some basic validation
logic and service enablement. With the reduced scope of the application server, it further lends
credit to the approach of a lightweight embedded approach like that of the SAP HANA Extended
Application Services.

Generated by Jive on 2015-02-28+01:00


1

SAP HANA Developer Center: SAP HANA Extended Application Services

Figure 1 - Architectural Paradigm Shift

SAP HANA Studio Becomes a Development Workbench


In order to support developers in creating applications and services directly within this new SAP HANA
Extended Application Services, SAP has enhanced the SAP HANA Studio to include all the necessary tools.
SAP HANA Studio was already based upon Eclipse; therefore we were able to extend the Studio via an Eclipse
Team Provider plug-in which sees the SAP HANA Repository as a remote source code repository similar to Git
or Perforce. This way all the development resources (everything from HANA Views, SQLScript Procedures,
Roles, Server Side Logic, HTML and JavaScript content, etc.) can have their entire lifecycle managed with
the SAP HANA Database. These lifecycle management capabilities include versioning, language translation
export/import, and software delivery/transport.
The SAP HANA Studio is extended with a new perspective called SAP HANA Development. As Figure 2
shows, this new perspective combines existing tools (like the Navigator view from the Modeler perspective)
with standard Eclipse tools (such as the Project Explorer) and new tools specifically created for SAP HANA
Extended Application Services development (for example, the Server Side JavaScript editor shown in the
figure or the SAP HANA Repository browser). Because SAP HANA Studio is based on Eclipse, we can also
integrate other Eclipse based tools into it. For example the SAP UI Development Toolkit for HTML5 (SAPUI5)
is also delivered standard in SAP HANA Extended Application Services. HANA 1.0 SP5 comes pre-loaded
with the 1.8 version of the SAPUI5 runtime and the SAPUI5 development tools are integrated into SAP HANA
Studio and managed by the SAP HANA Repository like all other XS based artifacts. Although the SAPUI5

Generated by Jive on 2015-02-28+01:00


2

SAP HANA Developer Center: SAP HANA Extended Application Services

development tools are integrated into SAP HANA Studio, they are not installed automatically. For installation
instructions, please see section 10.1 of the SAP HANA Developers Guide.

Figure 2 - SAP HANA Development perspective of the SAP HANA Studio


These extensions to the SAP HANA Studio include developer productivity enhancing features such as project
wizards (Figure 3), resource wizards, code completion and syntax highlighting for SAP HANA Extended
Application Services server side APIs, integrated debuggers, and so much more.

Generated by Jive on 2015-02-28+01:00


3

SAP HANA Developer Center: SAP HANA Extended Application Services

Figure 3- Project Wizards for XS Based Development


These features also include team management functionality. All development work is done based upon
standard Eclipse projects. The project files are then stored within the SAP HANA Repository along with all the
other resources. From the SAP HANA Repository browser view, team members can check out projects which
have already been created and import them directly into their local Eclipse workspace (Figure 4).
After projects have been imported into the local Eclipse workspace, developers can work offline on them. You
can also allow multiple developers to work on the same resources at the same time. Upon commit back to the
SAP HANA Repository, any conflicts will be detected and a merge tool will support the developer with the task
of integrating conflicts back into the Repository.
The SAP HANA Repository also supports the concept of active/inactive workspace objects. This way a
developer can safely commit their work back to the server and store it there without immediately overwriting
the current runtime version. It isn't until the developer chooses to activate the Repository object, that the new
runtime version is created.

Generated by Jive on 2015-02-28+01:00


4

SAP HANA Developer Center: SAP HANA Extended Application Services

Figure 4 - Repository Import Project Wizard


For a deeper look at the basic project creation and Repository object management within SAP HANA Studio,
please view the following videos on the topic.

OData Services
There are two main parts of the SAP HANA Extended Application Services programming model. The first is
the ability to generate OData REST services from any existing SAP HANA Table or View. The process is
quite simple and easy. From within an SAP HANA Project, create a file with the extension xsodata. Within this
service definition document, the developer needs only to supply the name of the source table/view, an entity
name, and, if using an SAP HANA View, the entity key fields.
For example, if you want to generate an OData service for an SAP HANA table named teched.epm.db/
businessPartner in the Schema TECHEDEPM, this would be the XSODATA definition file you would create:

Generated by Jive on 2015-02-28+01:00


5

SAP HANA Developer Center: SAP HANA Extended Application Services

service namespace "sap.hana.democontent.epm" {

"TECHEDEPM"."teched.epm.db/businessPartner" as "BUYER"; }

Figure 5 - XSODATA Service Definition and Test


Upon activation of this XSODATA file, we already have an executable service which is ready to test. The
generated service supports standard OData parameters like $metadata for introspection (see Figure 6), $filter,
$orderby, etc. It also supports body formats of ATOM/XML and JSON (Figure 7 for an example). Because
OData is an open standard, you can read more about the URL parameters and other features at http://
www.odata.org/.

Generated by Jive on 2015-02-28+01:00


6

SAP HANA Developer Center: SAP HANA Extended Application Services

Figure 6 - OData $metadata support

Generated by Jive on 2015-02-28+01:00


7

SAP HANA Developer Center: SAP HANA Extended Application Services

Figure 7 - Example OData Server JSON Output


The examples in the above figures demonstrate how easily these services can be tested from the web browser,
but of course doesn't represent how end users would interact with the services. Although you can use a variety
rd

of 3 party tools based upon JavaScript, like Sencha, Sencha Touch, JQuery, JQuery Mobile, and PhoneGap,
just to name a few; SAP delivers the UI Development Toolkit for HTML5 (SAPUI5) standard in SAP HANA
Extended Application Services. A particularly strong feature of SAPUI5 is the integration of OData service
consumption not just at a library level but also with special features within the UI elements for binding to OData
services.
For example, within SAPUI5, you can declare an OData model object and connect this model object to the URL
of the XSODATA service. Next, create a Table UI element and connect it to this model object. Finally you call
bindRows of the Table UI element object and supply the OData entity name you want to use as the source of
the table.

var oModel = new sap.ui.model.odata.ODataModel ("../../services/buyer.xsodata/", false); oTable = new sap.ui.table.Table("t

Generated by Jive on 2015-02-28+01:00


8

SAP HANA Developer Center: SAP HANA Extended Application Services

This creates an UI Element which has built-in events, such as sort, filter, and paging, which automatically call
the corresponding OData Service to fulfill the event. No additional client side or server side programming is
necessary to handle such events.

Figure 8 - OData Bound Table UI Element


For more details on OData service creation in SAP HANA Extended Application Services and utilizing these
services within SAPUI5, please view these videos.

Server Side JavaScript


The XSODATA services are great because they provide a large amount of functionality with minimal amounts
of development effort. However there are a few limitations which come with such a framework approach. For
example in SAP HANA SP5, the OData service framework is read only. Support for Insert, Update, and Delete
operations is available with SAP HANA SP6.
Luckily there is an option for creating free-form services where you can not only perform update operations but
also have full control over the body format and URL parameter definition. SAP HANA Extended Application
Services also allows development on the server side using JavaScript (via project files with the extension

Generated by Jive on 2015-02-28+01:00


9

SAP HANA Developer Center: SAP HANA Extended Application Services

XSJS). Core APIs of SAP HANA Extended Application Services are, therefore, exposed as JavaScript
functions; providing easy access to the HTTP Request and Response object as well database access to
execute SQL or call SQLScript Procedures.
In this simple example, we can take two numbers as URL Request Parameters and multiply them together and
then return the results as text in the Response Body. This is an intentionally basic example so that you can
focus on the API usage.

Figure 9 - Simple XSJS Service


However the power of XSJS services comes from the ability to access the database objects, but also have full
control over the body output and to further manipulate the result set after selection. In this example, we use
XSJS to create a text-tab delimited output in order to support a download to Excel from a user interface.
function downloadExcel(){

var body = '';

var query = 'SELECT TOP 25000 \"PurchaseOrderId\", \"PartnerId\", to_nvarcha

Generated by Jive on 2015-02-28+01:00


10

SAP HANA Developer Center: SAP HANA Extended Application Services

Closing
This blog hopefully has served to give you a small introduction to many of the new concepts and possibilities
with SAP HANA SP5 and SAP HANA Extended Application Services.

Over the coming weeks, we will be posting additional blogs with more advanced examples and techniques as
well how to integrate SAP HANA Extended Application Services content into additional environments. Likewise
there is a substantial Developers Guide which expands on many of the concepts introduced here.
It is also important to note that while SAP HANA Extended Application Services ships as
productive software (meaning customers can go live in production with it) in SAP HANA SP5; it is
a controlled release initially, with a special Project Solution program in place around this new
functionality. Please refer to Service Note 1779803, for additional details on the current status
of the Project Solution. This Project Solution approach is designed to provide the highest levels
of support possible to initial customers and partners who choose to develop using SAP HANA
Extended Application Services. It also provides a channel for feedback to Product Management
and development so that we take suggestions and ideas and quickly integrate them into future
revisions of SAP HANA and SAP HANA Extended Application Services.
103803 Views Tags: sapmentor, hana, developer, code, database, in_memory, sap_mentor, hana_devcenter,
sap_hana, sapui5, hana_studio, xs, hde, xsjs, xsodata

Glen Ooi
Dec 23, 2014 3:45 PM
Hi Thomas,
In need of your expert advice.
I have a situation where I am using BO Dashboards to create my Dashboard which is consuming the data from
HANA.
I have a requirement to allow the user to comment in the dashboard and it will write back to the HANA DB and
also display the comments in the Dashboard.
In order for the BO Dashboard to write back to HANA DB is via web services.
Is there any way i can create a WSDL URL and consume the XSJS or ODATA services in HANA?
Muhammad Sadiq
Dec 10, 2014 1:40 PM
I need your help in writing an API(XSJS service) which will take JSON format data and inserted into HANA
database.
Tarasankar Banerjee in response to Thomas Jung on page 14
Nov 5, 2014 8:52 AM
Thanks Thomas. Could you give an example of how to redirect.

Generated by Jive on 2015-02-28+01:00


11

SAP HANA Developer Center: SAP HANA Extended Application Services

I'm facing a strange issue while trying to import weather data from several cities together. The issue appears to
be connected with the content of the response object.
Following is the code of the Weather.xsjs file:
try
{
var cmd = $.request.parameters.get("cmd");
var body;
var response;
var obj;
var propertyName;

if(cmd === "import")


{
var dest = $.net.http.readDestination("root.work.Tara02.XSTest01.XSHttpTest01", "weather");
var client = new $.net.http.Client();
var req = new $.web.WebRequest($.net.http.GET, "/group?
id=1275004,1264527,1277333,1273294,1275339&units=metric");
client.request(req, dest);
response = client.getResponse();
}

$.response.contentType = "text/plain";
if(response.body)
{
body = response.body.asString();
obj = JSON.parse(body);
}
/*
body = cmd + "\n \n" + response.status + "\n \n" + response.contentType
+ "\n \n" + response.body + "\n \n" + obj.getOwnPropertyNames();
*/
$.response.setBody(body);

Generated by Jive on 2015-02-28+01:00


12

SAP HANA Developer Center: SAP HANA Extended Application Services

$.response.status = $.net.http.OK;
}
catch(e)
{
$.response.contentType = "text/plain";
$.response.setBody(e.message);
$.response.status = $.net.http.INTERNAL_SERVER_ERROR;
}
Following is the weather.xshttpdest:
host = "api.openweathermap.org";
port = 80;
description = "my weather checker";
useSSL = false;
pathPrefix = "/data/2.5";
authType = none;
useProxy = true;
proxyHost = "<proxy_details>";
proxyPort = "<proxy_port";
timeout = 0;
On accessing http://<hostname>:8000/root/work/Tara02/XSTest01/XSHttpTest01/Weather.xsjs?
&cmd=import, I am receiving the error message: Body.asString : unsupported charset specified in
Content-Type header ("utf8") .
If the body = response.body.asString(); statement is commented out, I receive the error message
JSON.parse: unexpected character because the response.body.asString() itself could not work correctly.
However the URL http://api.openweathermap.org/data/2.5/group?
id=1275004,1264527,1277333,1273294,1275339 returns data correctly.

I am using the same URL in my code.

Generated by Jive on 2015-02-28+01:00


13

SAP HANA Developer Center: SAP HANA Extended Application Services

Could you please advise regarding this issue. Thanks for your help.
Regards
Tarasankar
Thomas Jung in response to Tarasankar Banerjee on page 14
Nov 4, 2014 3:19 PM
>Is it possible to read files using XS? For example some configuration file kept in the server?
No there is no API to read from the file system of the underlying operating system. You can read the HANA
configuration ini files however because they are exposed via SQL.
>Is it possible to call a html file from the xsjs file? Something likerequest.getRequestDispatcher().forward() from
JAVA servlets?
In the body of the response you send back to the client your could issue a redirect.
Tarasankar Banerjee in response to Tarasankar Banerjee on page 15
Nov 4, 2014 10:34 AM
Hi Thomas,

Finally got my application running.. It is now fetching weather data from external sites..

..

Have two more questions:


1. Is it possible to read files using XS? For example some configuration file kept in the server?
2. Is it possible to call a html file from the xsjs file? Something like
request.getRequestDispatcher().forward() from JAVA servlets?

Thanks.
Regards
Tarasankar
Robert Weber
Nov 3, 2014 11:36 AM
If someone is having difficulties with the alert "log full" on the xsengine:
you can do the same trick as for the statisticserver in oder to reset the log area, see details in OSS Notes
2019148 and 1950221.
The commands are then:
select VOLUME_ID from m_volumes where service_name = 'xsengine';
ALTER SYSTEM ALTER CONFIGURATION ('daemon.ini', 'host', '<hostname>') UNSET
('xsengine','instances') WITH RECONFIGURE;

Generated by Jive on 2015-02-28+01:00


14

SAP HANA Developer Center: SAP HANA Extended Application Services

ALTER SYSTEM ALTER CONFIGURATION ('topology.ini', 'system') UNSET ('/host/<hostname>', 'xsengine')


WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('topology.ini', 'system') UNSET ('/volumes', '<volume_id>') WITH
RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('daemon.ini', 'host', '<hostname>') SET ('xsengine','instances') =
'1' WITH RECONFIGURE;
Then restart the HANA instance and after that make a full backup (and schedule the regular backup in order to
prevent this situation again).
Hope this will help someone like me :-).
Have a nice day.
Regards,
Robert
Tarasankar Banerjee in response to Tarasankar Banerjee on page 15
Nov 3, 2014 10:31 AM
Update:
I tried to access the XS Admin console from another user and faced only the 'No valid Crypto' error. However
could still update the proxy user details and the sample application successfully ran at last. The relevant roles
were provided in 'Granted Roles' not 'Application Privileges'. Probably that was the issue earlier.
I would check again with new Http Destination and Server side Java Script.

Thanks a lot Thomas for all your help.


Regards
Tarasankar
Tarasankar Banerjee in response to Thomas Jung on page 18
Nov 3, 2014 9:29 AM
Hi Thomas,
I also tried to use the sample code from section '8.4.1 Tutorial: Use the XSJS Outbound API' of the HANA
Developer Guide with minor modifications (for package structure, proxy settings etc.). This time the destination
was found. The new project structure with the sample files yahoo.xshttpdest and sapStock.xsjs is as below.

Generated by Jive on 2015-02-28+01:00


15

SAP HANA Developer Center: SAP HANA Extended Application Services

However it did not bring any data. The content of the response object indicated that there was Proxy
authentication issue.

When I tried to check the Destination in the XS Admin Console, surprisingly none of the fields are populated
and everything (except the 'Trust Store' drop down) is disabled. All these fields are supposed to be populated
as indicated in the Modeling Guide.

Generated by Jive on 2015-02-28+01:00


16

SAP HANA Developer Center: SAP HANA Extended Application Services

However the User already has the following privileges.

The same scenario was present for the Http Destination I prepared earlier. There are couple of internal errors
at the bottom. On clicking them the following list is displayed.
1. Internal Error: dbError(Connection.prepareStatement): 258 - insufficient privilege: Not authorized at
ptime/query/checker/query_check.cc:2418
2. No valid SAP Crypto configuration.

Generated by Jive on 2015-02-28+01:00


17

SAP HANA Developer Center: SAP HANA Extended Application Services

It appears from various blogs that the second error (No valid SAP Crypto configuration) is related to SSL
configuration in HANA. I would contact the HANA Administrator to look into this issue. Of course it would be
great if you could provide some insight.
However I have no clue regarding the first error. Request your help and cooperation in this regard.
The initial issue of not finding the HttpDestination which I created still persists.
Thanks for all your help.
Regards
Tarasankar
Thomas Jung in response to Tarasankar Banerjee on page 18
Oct 31, 2014 3:42 PM
First of all, you would never use the workspace name. It isn't ever part of anything. It is only the package
structure that counts. The first item in your list is the only one with the correct package. Off hand it looks right to
me. You are supposed to supply the full package path. Have you configured this HTTP Destination in the XS
Admin tool yet?
Tarasankar Banerjee in response to Thomas Jung on page 18
Oct 31, 2014 3:26 PM
Updated it. Thanks.
Regards
Tarasankar
Thomas Jung in response to Tarasankar Banerjee on page 18
Oct 31, 2014 3:13 PM
Your comment got cut off. We never really get to see what your problem is.
Tarasankar Banerjee in response to Thomas Jung on page 21
Oct 31, 2014 2:56 PM
Thanks Thomas.
I am facing as issue while trying to use an HTTP Destination. I understand that the .xshttpdest and .xsjs file
need to in the same folder. Following is the structure of my test project.

Generated by Jive on 2015-02-28+01:00


18

SAP HANA Developer Center: SAP HANA Extended Application Services

As you can see the HTTP Destination and the XSJS files are in the same folder 'services'. The workspace
name is 'XS_Workspace' and the package structure is as follows:

Generated by Jive on 2015-02-28+01:00


19

SAP HANA Developer Center: SAP HANA Extended Application Services

Now I am trying to read this destination.

Generated by Jive on 2015-02-28+01:00


20

SAP HANA Developer Center: SAP HANA Extended Application Services

When I am using full package structure destination_package =


"root.work.Tara02.XSTest01.XSHttpTest01.services", I am receiving the
error message http.readDestination: destination not found (package:
root.work.Tara02.XSTest01.XSHttpTest01.services, name: XSHttpDest01).
On using the workspace name destination_package = "XS_Workspace.services", I am receiving the
error message User is not authorized to use destination (package: XS_Workspace.services, name:
XSHttpDest01).
On using destination_package = "root.work.Tara02.XSTest01.services" also, I am receiving the error
message User is not authorized to use destination (package: root.work.Tara02.XSTest01.services,
name: XSHttpDest01). Strangely the 'services' folder is not directly under 'XSTest01'.
Lastly I deliberately gave a wrong service name. destination_package = "XS_Workspace.services" and
destination_name = "XSHttpDest02". But even then I received the error message User is not authorized to
use destination (package: XS_Workspace.services, name: XSHttpDest02), not that the destination is not
found!!
Could you please help me to resolve this issue.
Thanks a lot for your helps.
Regards
Tarasankar

Generated by Jive on 2015-02-28+01:00


21

SAP HANA Developer Center: SAP HANA Extended Application Services

Thomas Jung in response to Tarasankar Banerjee on page 22


Oct 30, 2014 1:52 PM
Since SPS06 its possible to use outbound HTTP destinations and to call out to external services using XSJS.
Thomas Jung in response to Tarasankar Banerjee on page 22
Oct 30, 2014 1:50 PM
>So when the program runs in server, would it automatically consider the OS user credentials?
No. It doesn't automatically use anything. You have to specific the user and password that you want to use for
the proxy. Although many proxy servers don't require a username and password.
Tarasankar Banerjee in response to Thomas Jung on page 23
Oct 30, 2014 7:07 AM
Hi Thomas,

Just watched the video you shared above. Thanks a lot for it. It is really informative and helpful.

Regards
Tarasankar
Tarasankar Banerjee in response to Tarasankar Banerjee on page 22
Oct 30, 2014 3:46 AM
Got answer for the second point. SAP HANA XS Administration Tool is the place to configure Proxy settings.
Regards
Tarasankar
Tarasankar Banerjee in response to Tarasankar Banerjee on page 22
Oct 29, 2014 3:14 PM
Dear Thomas,
another question is that does the proxy settings in the HttpDestination refer to the OS user of the HANA
server? We specify 'useProxy' as 'true' and 'authType' as 'basic' in the HttpDestination, but not maintain any
user credentials. So when the program runs in server, would it automatically consider the OS user credentials?
Thanks.
Regards
Tarasankar
Tarasankar Banerjee in response to Thomas Jung on page 23
Oct 29, 2014 1:32 PM
Thanks Thomas. I am currently checking this option only

...

Generated by Jive on 2015-02-28+01:00


22

SAP HANA Developer Center: SAP HANA Extended Application Services

My current requirement is to fetch Weather Data and Social Media data from various OData services and store
them in HANA for further analysis. What might be the best way for this? I am currently checking the option of
creating an XS application which would connect to the external services, fetch the data and save that in HANA
using DB Connection. Is this the best way? Or should we try to use JAVA or some other way?
Your valuable suggestions are most welcome. Thanks.
Regards
Tarasankar
Thomas Jung in response to Tarasankar Banerjee on page 23
Oct 29, 2014 12:56 PM
>However is it possible to consume XSODATA service from XSJS instead of using DB Connection?
You can via an outbound HTTP destination; although I certainly wouldn't recommend it. It would be rather
complex and not well performing.
>Also is it possible to consume data from external OData services for weather data, social media data etc from
XSJS?
Sure, with the same Outbound HTTP Connectivity.
https://www.youtube.com/watch?v=fWirvj9l7eY
Maintaining HTTP Destinations - SAP HANA Developer Guide - SAP Library
Tarasankar Banerjee
Oct 29, 2014 11:19 AM
Dear Thomas,
Thanks for the great blog!!
I am able to connect to Database and execute queries from XSJS service. However is it possible to consume
XSODATA service from XSJS instead of using DB Connection?
Also is it possible to consume data from external OData services for weather data, social media data etc from
XSJS?
If possible it would be great if you could provide some code sample or guidelines.
Thanks.
Regards
Tarasankar
Thomas Jung in response to Weiping Lu on page 24
Sep 25, 2014 8:33 AM
Please refer to service note 1849775:

Generated by Jive on 2015-02-28+01:00


23

SAP HANA Developer Center: SAP HANA Extended Application Services

http://service.sap.com/sap/support/notes/1849775
I believe it will address your issue.
Weiping Lu
Sep 24, 2014 5:19 PM
Hi Tom,
Great post and videos! I have a tough issue: calling a HANA procedure from XS takes > 5min, but from HANA
studio < 1 min. We're using Amazon AWS rev 70 and 73. Any help will be greatly appreciated.
Thanks,
WPL
Thomas Jung in response to Su Srikanth on page 24
Aug 11, 2014 2:53 PM
You transport XSODATA services like you would any other repository content - via a Delivery Unit.
Su Srikanth
Aug 11, 2014 7:50 AM
Hi Thomas,
Great blog!
I've a query here - we create the odata services(and/or URLs created to view in the web browser) in
development environment, now if we have to transport it to the quality and/or production environment, how
can we do this - is the same as import/export? or is there any specific way to do. please help with any useful
pointers..
Many thanks as always!
Su
Thomas Jung in response to ARSHAD SHAIKH on page 24
May 15, 2014 2:31 PM
I've never written any blogs on calculation views. I don't cover that topic. That is why I suggested you ask your
question in the proper SCN forum.
Although looking at your your above SQL Statement, I don't see why you couldn't do this directly in XSODATA
off of the table STATUS without the need for the calculation view or the SQLScript Procedure.
ARSHAD SHAIKH in response to Thomas Jung on page 25
May 15, 2014 11:54 AM
Hello Thomas..
I am new to hana. Please suggest me the blogs of you. related to calculation view that calling
procedures(procedures have out parameter).

Generated by Jive on 2015-02-28+01:00


24

SAP HANA Developer Center: SAP HANA Extended Application Services

I am trying to fetch the result of procedure in calc view and want to create odata service for that calculation
view.
procedure code goes like this:
--------------------------------------CREATE PROCEDURE TWEETS_TODAY(OUT OP BIGINT)
language SQLSCRIPT sql security invoker default schema "SOCIAL360" reads sql data as
BEGIN
SELECT COUNT(*) INTO OP FROM "SOCIAL360"."STATUS" WHERE CREATED_AT = CURRENT_DATE;
END
calc view code goes like this:
---------------------------------------/********* Begin Procedure Script ************/
BEGIN
DECLARE OP BIGINT;
CALL "SOCIAL360".TWEETS_TODAY(:OP,var_out);
END /********* End Procedure Script ************/

Thanks
-Arshad
Thomas Jung in response to ARSHAD SHAIKH on page 25
May 15, 2014 9:44 AM
Your question seems to have no relation to the content in this blog. Please consider instead asking general
HANA questions in the appropriate SCN Forum.
ARSHAD SHAIKH
May 15, 2014 9:17 AM
Hi Thomas,
I want to call procedures in calculation view, (procedures have out parameter.)

Please suggest me step by step procedure with example and supporting documents.

Thanks
ARSHAD SHAIKH.
Henrique Pinto in response to Blair Krotenko on page 26
Apr 16, 2014 7:11 PM

Generated by Jive on 2015-02-28+01:00


25

SAP HANA Developer Center: SAP HANA Extended Application Services

Hmm not really sure of that, I see it but that might be because I'm an employee.
But the .NET development partner I was working with was not enrolled in any kind of beta testing program and
they were able to download it, so I guess you should as well.
Make sure to go in the "Installation and Upgrades" menu and not the "Support Packages and Patches".
Go to http://service.sap.com/swdc -> Installations and Upgrades -> Browse our Download Catalog -> SAP InMemory (SAP HANA) -> SAP HANA ADO.NET 1.0.
Best regards,
Henrique.
Blair Krotenko in response to Henrique Pinto on page 26
Apr 16, 2014 6:56 PM
Thanks for the info Henrique, but I can't find it. I don't know if it is an authorization issue or do we need to be a
ramp-up customer to d/l and use a beta product?
Thanks,
Blair
Henrique Pinto in response to Thomas Jung on page 27
Apr 16, 2014 6:14 PM
The ADO.NET provider is available for download in the SAP Service Marketplace (in beta edition so far).
Thomas Jung in response to Kamal Jain on page 26
Apr 16, 2014 5:14 PM
For general OData structure and syntax I find that the Odata.org website is very helpful. For example on this
topic:
http://www.odata.org/documentation/odata-version-2-0/uri-conventions/
The syntax of a $expand query option is a comma-separated list of Navigation Properties. Additionally each
Navigation Property can be followed by a forward slash and another Navigation Property to enable identifying a
multi-level relationship.
The page also has some sample URLs.
Kamal Jain
Apr 16, 2014 5:36 AM
Dear Thomas,
I agree that we need to pass all the associations in the expand. I tried with some of options, but was not
through.
Now i just tried with below syntax and able to achive. Thx.

Generated by Jive on 2015-02-28+01:00


26

SAP HANA Developer Center: SAP HANA Extended Application Services

http://dewdftzld025.pgdev.sap.corp:8000/DTHCP/XS/ZPMIS_PRO_ACTUAL.xsodata/
ZPROHEADER('PR07_000002')?$expand=ZACTU/ZEMPD
Regards,
Kamal Jain
Thomas Jung in response to Blair Krotenko on page 27
Apr 15, 2014 6:23 PM
We do plan to release an ADO.NET provider specific to HANA in the near future. This would probably be the
best option for consumption from .NET. Until then I would think that ODBC is probably the next best option. It
gives you generally easy portability from already existing database code. You could consume OData as well,
although that is more generally consumed from the UI layer itself. It guess it somewhat depends upon where
you are calling the service from in your .NET application.
Blair Krotenko
Apr 15, 2014 4:09 PM
Hi Thomas,
We are looking at consuming HANA data in a .NET application and from what I can see, there are 2 options OData and ODBC. It seems to me that OData might be the better option when consuming HANA data in an XS
application, while ODBC might be the better option for .NET. What are your thoughts? Is there a paper on this
subject? I haven't been able to find a comparison document for this. Are there any security caveats to be aware
of for these options?
Thanks,
Blair
Thomas Jung in response to Kamal Jain on page 27
Apr 15, 2014 1:36 PM
You have to list both associations in the expand on the URL if you want both relationships to be processed.
Kamal Jain
Apr 15, 2014 12:49 PM
Hi Thomas,
Thx for valuable and useful information.
I have an query regarding XS Odata service creation for more than 2 tables and get all the data in one
command.
There is req. in which service needs to be created for 3 tables to get data from all these.
First table has Project ID as key, second table has composite
ProjectID and Employee Id as key and third table has Employee id as

Generated by Jive on 2015-02-28+01:00


27

SAP HANA Developer Center: SAP HANA Extended Application Services

key.
So if I create navigation for first 2 tables based on project id and use expand comand than its working fine and I
can see data of both the tables.
Further, if I add navigation for third table also as below, then below expand is displaying data for first two tables
only. Pls share how to use expand command in this case if possible to get all tables data based on project id.
How to use navigation ZEMPD here.

http://dewdftzld025.pgdev.sap.corp:8000/DTHCP/XS/ZPMIS_PRO_ACTUAL.xsodata/
ZPROHEADER('PR07_000002')?$expand=ZACTU&
service namespace
"DTHCP.XS" {
"DTHCP"."DTHCP.DB::HCP_PROJECT_HEADER"
as "ZPROHEADER"
navigates ("PROJECT" as
"ZACTU");
"DTHCP"."DTHCP.DB::HCPT_ZPMIS_ACTUAL"
as "ZACTU"
navigates ("EMPLOYEE" as
"ZEMPD" );
"DTHCP"."DTHCP.DB::HCP_ZPMIS_RES_MASTER"
as "ZEMPD";
association "PROJECT" principal
"ZPROHEADER"("PROJECTID")

multiplicity "1" dependent


"ZACTU"("PROJECTID") multiplicity
"*";
association "EMPLOYEE" principal
"ZACTU"("EMPLOYEEID")
multiplicity "1" dependent
"ZEMPD"("EMPLOYEEID") multiplicity
"1";

Generated by Jive on 2015-02-28+01:00


28

SAP HANA Developer Center: SAP HANA Extended Application Services

Pls suggest if there is anything to add or correct in XS odata service syntax above.
Regards,
Kamal Jain.
Vikas Madaan in response to Thomas Jung on page 29
Apr 14, 2014 4:58 PM
Thanks Thomas,
Under which component?
Regards,
Vikas Madaan
Thomas Jung in response to Vikas Madaan on page 29
Apr 14, 2014 4:50 PM
No this isn't a known issue I've seen. Nor can I recreate the problem in my system. No you can't maintain the
authentication in XSHTTPDEST itself. It intentionally must be set in XSADMIN tool. I can really only suggest
that you open a support ticket.
Vikas Madaan
Apr 14, 2014 4:31 PM
Hi Thomas,
I am trying to pull data from SAP system onto HANA Database using XSJOB files. I am calling RFC enabled
function modules over HTTP request. It helps me replicating the real time ECC data onto HANA as well with
back ground jobs.
I am facing one problem in the XSHTTPDEST file. I am able to create and activate the file using studio and this
file is even visible in the web based XS administration tool. But in the web based tool when i provide user and
password for basic authotication then system just clears the user id and password when i try to save. This the
reason our HTTP requests are getting failed and below is the response we are getting in the response body.
<html><head><title>Logon Error Message</title>
Is this known issue or we are missing something? Is it possible to provide user and password in the
XSHTTPDEST file. Is there any particular syntax?
I checked and i have the required authorizations as well develper Guide.
Please help.
Regards,

Generated by Jive on 2015-02-28+01:00


29

SAP HANA Developer Center: SAP HANA Extended Application Services

Vikas Madaan
Abdul Hakim
Feb 22, 2014 3:59 AM
Hi Thomas - Any recommended book or resource to learn and master Server Side Javascript? There were
many books available in the market but as a beginner need to know the right resource / book to start with and
master this stuff..Also whether SAP plan to conduct any training to teach Server Side Javascript similar to other
standard training offerings?
Thanks
Hakim
Samuel Tanor-Gyedu
Feb 20, 2014 8:39 AM
Thanks Thomas
I will definitely have a look at SHINE.
Thomas Jung in response to gentilini andre on page 30
Feb 19, 2014 4:22 PM
Difficult to say what is wrong. I several things which are different than our sample that does this. You are using
a POST for instance instead of a GET. However if you are gettting a 200 then I assume the service call is
correct. In client side tools (like Chrome Developer Tools) you should be able to see the response object from
the call.
However what I would really recommend is that you study the SHINE content (SAP HANA Interactive
Education). There is already a sample application which does this in SHINE. Also it has some special
JavaScript in the UI to handle the file attachment via AXAJ call. Perhaps that is the part you are missing.
You can read more about SHINE here. It is also included already installed in the latest version of the HANA
Developer Center trial image (SP7 based).
http://help.sap.com/hana/SAP_HANA_Interactive_Education_SHINE_en.pdf
gentilini andre
Feb 19, 2014 3:25 PM
Hi Thomas,
well I followed your hints but it still dont work.
I created a xsjs File like below:
function downloadExcel(){
try {
var body = '';

Generated by Jive on 2015-02-28+01:00


30

SAP HANA Developer Center: SAP HANA Extended Application Services

alert('drin');
var query = 'SELECT "CompanyName", "PartnerId", "PostalCode", "City", "PurchaseOrderId",
"LifecycleStatus", "GrossAmount", "TaxAmount", "CM_NET_Amount_001", "Currency" FROM
"_SYS_BIC"."Workshop_001.PG1_BL_TI.ANGE1/CA_TBN_001" order by "PurchaseOrderId"';
var conn = $.db.getConnection();
var pstmt = conn.prepareStatement(query);
var rs = pstmt.executeQuery();
alert('drusse');
body =
"\tCompanyName \tPartnerId \tPostalCode \tCity \tPurchase Order Id \tLifecycle Status \tGross Amount
\tTax Amount \tNetto Amount \tCurrency \n";
while(rs.next()) {
body += rs.getString(1)+

"\t"+rs.getString(2)+"\t"+rs.getString(3)+"\t"+rs.getString(4)+"\t"+rs.getString(5)+"\t"+rs.getString(6)+"\t"+rs.getDecimal(7)+"\t"+
$.response.setBody(body);
$.response.contentType = 'application/vnd.ms-excel; charset=utf-16le';
$.response.headers.set('Content-Disposition','attachment; filename=Excel.xls');
$.response.headers.set('access-control-allow-origin','*');
$.response.status = $.net.http.OK;
} catch (e) {
alert('db conn funktioniert nicht');}
}
var a = $.request.parameters.get('cmd');
$.response.setBody('Invalid Command: '+a);
switch (a) {
case "doex":
$.response.setBody('Invalid Command: '+a);
alert("filedownload");
this.downloadExcel();
break;
default:
$.response.status = $.net.http.INTERNAL_SERVER_ERROR;
$.response.setBody('Invalid Command: '+a);
}
The Controller.js File:

Generated by Jive on 2015-02-28+01:00


31

SAP HANA Developer Center: SAP HANA Extended Application Services

doFileDownload : function (oEvent){

jQuery.sap.require("sap.ui.commons.MessageBox");
//
sap.ui.commons.MessageBox.show("Export Starten?", sap.ui.commons.MessageBox.Icon.confirm,
"Information");

//

//

sap.ui.commons.MessageBox.confirm("Export starten?",inform, "Confirmation");


return false;

function inform(rValue){
alert ("drinnnnne!");
var aurl = "FileDownload.xsjs?cmd=doex";
if(rValue) //If User presses 'Ok'
{
alert(aurl);

jQuery.ajax({
url: aurl,
method: "POST",
dataType: "json",
data:{cmd:"doex"},
success: sap.ui.commons.MessageBox.alert("Export wird ausgefhrt!",'',"Confirmation"),
error:function onErrorCall(jqXHR, textStatus, errorThrown){
alert(jqXHR.status);
sap.ui.commons.MessageBox.show(jqXHR.status,
"ERROR",
"Error in calling Service" );
return;
},
complete: sap.ui.commons.MessageBox.alert("Export Erfolgreich
abgeschlossen!",'',"Confirmation")
});
//

return false;
}
else // If the user presses 'Cancel'
{

Generated by Jive on 2015-02-28+01:00


32

SAP HANA Developer Center: SAP HANA Extended Application Services

sap.ui.commons.MessageBox.alert("Vorgang abgebrochen!",'',"Notification");
}

});

at last but not least the view


sap.ui.jsview("zag1_ui_cv_03.Index", {
/** 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 zag1_ui_cv_03.Index
*/
getControllerName : function() {
return "zag1_ui_cv_03.Index";
},
/** 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 zag1_ui_cv_03.Index
*/
createContent : function(oController) {
//

create a lite button with an icon and a text


var oButton3 = new sap.ui.commons.Button({
text : "Save to Excel",
icon : "images/save_button.jpg",

Generated by Jive on 2015-02-28+01:00


33

SAP HANA Developer Center: SAP HANA Extended Application Services

lite: true
}).placeAt("btn");
oButton3.attachPress(oController.doFileDownload);

//
//
//

var oButton4 = new sap.ui.commons.Button({


text : "Refresh",
icon : "images/refresh.jpg",
lite: true,
press : function() {var data = oTable.val();
if(data == '')
alert("no data found");
return;
print('content');
print(DatArray);
if (data != '')
alert('Funzt');
JSONToCSVConvertor(data, "CUSTOMER AMOUNT", true);
}
}).placeAt("btn");

jQuery.sap.require("sap.ui.table.Table");
// create table control with properties
var oTable = new sap.ui.table.Table({
width : "100%",
rowHeight : 50,
title : "Amount per Partner",
selectionMode : sap.ui.table.SelectionMode.None
});

oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "Company Name"
}),
template : new sap.ui.commons.TextView({
text : "{CompanyName}"
})
,sortProperty : "CompanyName"
}));

Generated by Jive on 2015-02-28+01:00


34

SAP HANA Developer Center: SAP HANA Extended Application Services

oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "Partner ID"
}),
template : new sap.ui.commons.TextView({
text : "{PartnerId}"
})
,sortProperty : "PartnerId"
}));

oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "Postal Code",
textAlign : sap.ui.core.TextAlign.End
}),
template : new sap.ui.commons.TextView({
text : "{PostalCode}",
textAlign : sap.ui.core.TextAlign.End
}),
sortProperty : "PostalCode"
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "City"
}),
template : new sap.ui.commons.TextView({
text : "{City}"
}),
sortProperty : "City"
}));

oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "Purchase ID"
}),

Generated by Jive on 2015-02-28+01:00


35

SAP HANA Developer Center: SAP HANA Extended Application Services

template : new sap.ui.commons.TextView({


text : "{PurchaseOrderId}"
}),
sortProperty : "Currency"
}));

oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "Lifecycle Status"
}),
template : new sap.ui.commons.TextView({
text : "{LifecycleStatus}"
}),
sortProperty : "LifecycleStatus"
}));

oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "Gross Amount"
}),
template : new sap.ui.commons.TextView({
text : "{GrossAmount}"
}),
sortProperty : "GrossAmount"
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "Tax Amount"
}),
template : new sap.ui.commons.TextView({
text : "{TaxAmount}"
}),
sortProperty : "TaxAmount"
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "Amount Netto"
}),
template : new sap.ui.commons.TextView({

Generated by Jive on 2015-02-28+01:00


36

SAP HANA Developer Center: SAP HANA Extended Application Services

text : "{CM_NET_Amount_001}"
}),
sortProperty : "CM_NET_Amount_001"
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "Currency"
}),
template : new sap.ui.commons.TextView({
text : "{Currency}"
}),
sortProperty : "Currency"
}));

var oModel = new sap.ui.model.odata.ODataModel


("http://qperior.vm.cld.sr:8000/ZAG1_WS_001/ZAG1_CV_001.xsodata;", false);
oTable.setModel(oModel);
oTable.bindRows("/Amount");
return oTable;

});
It wont call the function or better said the action of the button works fine till to the point where it should call the
xsjs.file to generate the excel-file. I wondered that in the ajax part the error-, success- and complete-part will
be executed at the same time, and not only one of this statements. The message is "200" (The request has
succeeded. The information returned with the response is dependent on the method used in the request).
Maybe you can see where my mistake is, or whats going wrong?
Ive the developer edition on cloudshare (Hana Studio rev.68; Server is on SPS05).

Thanks

Generated by Jive on 2015-02-28+01:00


37

SAP HANA Developer Center: SAP HANA Extended Application Services

Andr
Thomas Jung in response to Samuel Tanor-Gyedu on page 38
Feb 19, 2014 5:23 AM
I don't think I can help you. This appears to a question about how odata4j works not about XS. I have no
experience with odata4j myself.
Samuel Tanor-Gyedu
Feb 18, 2014 9:13 AM
Hi Thomas,
I have an odata service with this endpointhttps://s5hanaxs.hanatrial.ondemand.com/.../services/User.xsodata
I am now trying to consume it from eclipse with the odata4j libraries.
This is how I get the endpoint.
public UserServiceOdata(String endpointUri) {
this.endpointUri = endpointUri;
ODataConsumer.dump.responseHeaders(true);
consumer = ODataConsumers.create(endpointUri);
}
This is my method to add a user.
public User addUser(User user) {
consumer.createEntity(entitySet).properties(OProperties.int32(propertyUserId,
user.getId())).properties(OProperties.string(propertyUserName,
user.getName())).properties(OProperties.string(propertyUserEmail,
user.getEmail())).execute();
return user;
}
When I call addUser method I get an Error:
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[78,253]
Message: The reference to entity "sourceUrl" must end with the ';' delimiter.

Generated by Jive on 2015-02-28+01:00


38

SAP HANA Developer Center: SAP HANA Extended Application Services

When I use this endpoint https://s5hanaxs.hanatrial.ondemand.com/.../services/User.svc everything works fine.


With the https://s5hanaxs.hanatrial.ondemand.com/.../services/User.xsodata I get errors.
Please I would be very grateful for assistance.
Thanks in advance.
Regards,
Samuel
Thomas Jung in response to gentilini andre on page 39
Feb 18, 2014 4:31 AM
You have a fundamental misunderstanding here. You are placing server side JavaScript code in your client
side UI5 application. The function downloadExcel is something you need to execute on the server. It needs to
be in an XSJS file and it is called from the client side via AJAX - as a REST service not as a local function.
gentilini andre
Feb 17, 2014 4:51 PM
Hello Thomas,
Thank you for this great How-To Guide.

Im pretty new in SAPUI5 and tried your export-sample in my little trial project, but it doesnt work

Generated by Jive on 2015-02-28+01:00


39

SAP HANA Developer Center: SAP HANA Extended Application Services

My Button for this looks like:


<code>
var oButton3 = new sap.ui.commons.Button({
text : "Save to Excel",
icon : "images/save_button.jpg",
lite: true,
press : function() {alert(oButton3.getText());
downloadExcel();}
</code>
and the function for this action looks like:
<code>
function downloadExcel(){
var body = '';
alert('drin');
print($query);
var query = 'SELECT "CompanyName", "PartnerId", "PostalCode", "City", "PurchaseOrderId",
"LifecycleStatus", "GrossAmount", "TaxAmount", "CM_NET_Amount_001", "Currency" FROM
"_SYS_BIC"."Workshop_001.PG1_BL_TI.ANGE1/CA_TBN_001" order by "PurchaseOrderId"';
var conn = $.db.getConnection();
var pstmt = conn.prepareStatement(query);
var rs = pstmt.executeQuery();
body =
"\tCompanyName \tPartnerId \tPostalCode \tCity \tPurchase Order Id \tLifecycle Status \tGross Amount \tTax
Amount \tNetto Amount \tCurrency \n";
while(rs.next()) {
if(rs.next() == ''){
alert($.response.setBody( "Failed to retrieve data" ));
alert($.response.status = $.net.http.INTERNAL_SERVER_ERROR);}

else{
body += rs.getString(1)+
"\t"+rs.getString(2)+"\t"+rs.getString(3)+"\t"+rs.getString(4)+"\t"+rs.getString(5)+"\t"+rs.getString(6)+"\t"+rs.getDecimal(7)+"\t"+
} $.response.setBody(body);
$.response.contentType = 'application/vnd.ms-excel; charset=utf-16le';
$.response.headers.set('Content-Disposition','attachment; filename=Excel.xls');
$.response.headers.set('access-control-allow-origin','*');
$.response.status = $.net.http.OK;

Generated by Jive on 2015-02-28+01:00


40

SAP HANA Developer Center: SAP HANA Extended Application Services

}
</code>
Im afraid and hope that you can help me.

Kind regards
Andr
Thomas Jung in response to Vikas Madaan on page 41
Feb 11, 2014 12:46 PM
>Is there any restriction or development limitation in the XSJSLIB files?
That's a very general question. Difficult to answer without any context.
Vikas Madaan in response to Thomas Jung on page 41
Feb 11, 2014 12:45 PM
Thanks Thomas.
I think we are on same page.
Once quick question that came to my mind: Is there any restriction or development limitation in the XSJSLIB
files?
Regards,
Vikas Madaan
Thomas Jung in response to Vikas Madaan on page 41
Feb 11, 2014 12:30 PM
>Could please help me in understanding in more advantages/disadvantages for both techniques?
You've summarized it pretty well already.
>becuase i don't want to use both the approaches
Even with the CRUD support and exits in XSODATA, its still pretty hard to do 100% via XSODATA. There are
still valid use cases for XSJS when you need custom body, custom read processing, job scheduling, etc. Its
good to try and use XSODATA whenever possible, but I wouldn't automatically exclude the use of XSJS.
Vikas Madaan
Feb 11, 2014 10:08 AM
Hi Thomas,
Thanks a lot for sharing useful information through various blogs.
In my current project we are evaluating use of XSOData or XSJS applications. I saw your videos like the one
mentioned below:

Generated by Jive on 2015-02-28+01:00


41

SAP HANA Developer Center: SAP HANA Extended Application Services

http://www.saphana.com/docs/DOC-4376
Want i understood from various blog is this:
From SP7 we can write exsits in the OData services and it is very easy to consume at the client side just like
any REST base service and from my understanding it is Scalable as well. I would love to use XSOData always
becuase development effort is very less compare to XSJS and it is very easy to rampup the team on OData
related development objects.
XSJS were as provide more control becuase of server side scripting becuase it allows development on the
server side using JavaScript. Core APIs of SAP HANA Extended Application Services are, therefore, exposed
as JavaScript functions; providing easy access to the HTTP Request and Response object as well database
access to execute SQL or call SQLScript Procedures. It provide us control over the body format and and URL
parameter definition.
Could please help me in understanding in more advantages/disadvantages for both techniques?
I am very keen to understand and also explain the same to team members becuase i don't want to use both the
approaches and even sometimes customer can also ask the same to us.
Also If we are on SP6 then from my understanding XSJS provides us more capability in terms of complex
application. Corrent me If i am wrong.
Thanks!
Regards,
Vikas Madaan
Thomas Jung in response to Raghuveer Phull on page 42
Feb 5, 2014 3:12 PM
Yes there are videos on the CRUD features of XSODATA which were new in SP6:
For more on CRUD support in SP6, see this video:
oData Create/Update/Delete Support in SAP HANA SPS6
For the extended support for XSJS exits in SP7, see this video:
SAP HANA SPS 07 XSODATA Exits in XSJS
Raghuveer Phull
Feb 5, 2014 1:22 AM
Do you have an example/documentation/video where you can write a service which will populate Hana DB ?
What I am asking for is a way for my external script to populate the DB tables i have created in Hana DB.
Thomas Jung in response to reda miraoui on page 43
Jan 29, 2014 4:11 PM
The source code for the examples shown here are shipped as part of SHINE (SAP HANA Interactive
Education):

Generated by Jive on 2015-02-28+01:00


42

SAP HANA Developer Center: SAP HANA Extended Application Services

http://help.sap.com/hana/SAP_HANA_Interactive_Education_SHINE_en.pdf
Vivek Singh Bhoj in response to reda miraoui on page 43
Jan 29, 2014 3:52 PM
Hi Reda,
You can import Shine Content in HANA and then check all these source codes
http://help.sap.com/hana/SAP_HANA_Interactive_Education_SHINE_en.pdf
Regards,
Vivek
reda miraoui in response to Thomas Jung on page
Jan 29, 2014 3:44 PM
Hey Thomas,
Is it possible to download source code of your project from this HANA tutorial?
Thanks
Reda
Thomas Jung in response to Abdul Hakim on page 43
Nov 21, 2013 11:33 PM
Yes River can be used as an alternative and when activated it will generate Server Side JavaScript and/or
SQLScript.
Abdul Hakim in response to Thomas Jung on page 44
Nov 21, 2013 7:47 PM
Hi Thomas - Was going through blog regarding River (RDL)...Just a question on this...
When you say Programming language for HANA native development is Server side Javascript / SQL / SQL
Script..Once RDL is rolled out whether RDL can be used for native application development instead of Server
side Java script / SQL / SQL Script?? I am very much new to this stuff so appreciate if you can also help on
how to get started with Server Side Java script / SQL / SQL Script for HANA...
Thanks
Hakim
ashutosh dixit in response to Thomas Jung on page 45
Oct 30, 2013 7:50 AM
Hi Thomas ,
Thanks for your response , I am talking about more content on shine.
thanks
Ashutosh

Generated by Jive on 2015-02-28+01:00


43

SAP HANA Developer Center: SAP HANA Extended Application Services

Baskar Gopalakrishnan in response to Thomas Jung on page 44


Oct 30, 2013 12:49 AM
Hi Thomas,
I'm a SAP PI Middleware consultant/SAP topic leader in XI/PI heavily worked on Java related
Netweaver stack. I have knowledge in ABAP but not worked heavily in abap. I have enrolled your sap hana
native application development course. I feel very interesting... I did work heavily in java and javascript projects
using eclipse development tool. Do you think if I invest my time in just native hana development and proceed
in HANA field is a good step? I don't have BW experience either...
Abdul Hakim in response to Thomas Jung on page 44
Oct 29, 2013 8:19 PM
Thanks for the clarification. Much appreciated..
Thomas Jung in response to Abdul Hakim on page 44
Oct 29, 2013 1:20 PM
>ABAP Close to HANA means whether we can expect a similar 2 tier architecture similar to HANA XS in the
future or what does that mean
No it doesn't mean that ABAP will become a 2 tier architecture. We will not move the ABAP VM/Kernel into
HANA itself. It will remain a separate application server. At least for the current plans/foreseeable future. What
he was referring to was bringing the programming models closer. For instance the new 7.40 SP5 feature that
allows you to write SQLScript directly within an ABAP class method.
Abdul Hakim in response to Thomas Jung on page 44
Oct 29, 2013 6:50 AM
Thomas - Thanks for the clarification...Much appreciated...I was listening to ABAP on HANA session by
Thorsten Schneider @ this year Teched and he was mentioning that SAP Plans to bring ABAP very close to
HANA in the coming future but not much details have been discussed in the session...ABAP Close to HANA
means whether we can expect a similar 2 tier architecture similar to HANA XS in the future or what does that
mean...??
Thanks
Hakim
Thomas Jung in response to Abdul Hakim on page 45
Oct 28, 2013 7:03 PM
>. whether to build application using HANA XS or use SAP Netweaver 7.4 ABAP..If any one of the option is
recommended by SAP then kindly share the pros and cons of each of the item
Taken from the TechEd CD103 session slides:
Guidance
use ABAP for optimization of existing progams (in context of SAP Business Suite or BW)
consider HANA Native Development for development of new applications which will solely run on SAP HANA
combine ABAP and HANA Native Development to enrich existing applications (e.g. SAP HANA Live, Fiori)

Generated by Jive on 2015-02-28+01:00


44

SAP HANA Developer Center: SAP HANA Extended Application Services

ABAP
applications follow 3-tier architecture
ABAP is in general database agnostic, but with release 7.4 optimized for SAP HANA
Programming language: ABAP / ABAP OO with the option to use SAP HANA features
IDE: eclipse-based ABAP Development Tools
HANA Native Development
applications follow 2-tier architecture
HANA Native Development is SAP HANA specific and embedded in the database
Programming language: River; server-side JavaScript, SQL/SQLScript
IDE: eclipse-based SAP HANA Studio + web IDE

Thomas Jung in response to ashutosh dixit on page 45


Oct 28, 2013 7:01 PM
>Is there any more demos for the SHINE ??
I'm not exactly sure what you mean by that. We are building additional content for SHINE that will be delivered
in SP7.
Abdul Hakim
Oct 28, 2013 3:26 PM
Thomas - Let us say a customer is running SAP Netweaver 7.4 ABAP with HANA DB and they have HANA
extended service as well...If the customer wants to do new developments then what is the recommendation
from SAP ie. whether to build application using HANA XS or use SAP Netweaver 7.4 ABAP..If any one of the
option is recommended by SAP then kindly share the pros and cons of each of the item (SAP Netweaver 7.4
ABAP Vs SAP HANA XS)...
Thanks
Hakim
ashutosh dixit in response to Thomas Jung on page 45
Oct 28, 2013 2:21 PM
Hi Thomas ,
Thanks a lot for your its working now .
Is there any more demos for the SHINE ??
Thanks
Ashutosh
Thomas Jung in response to ashutosh dixit on page 46
Oct 25, 2013 8:09 PM

Generated by Jive on 2015-02-28+01:00


45

SAP HANA Developer Center: SAP HANA Extended Application Services

As this content is now standard in SP6 as part of SHINE (SAP HANA INteractive Education), there also some
setup instructions on help.sap.com
http://help.sap.com/hana/SAP_HANA_Interactive_Education_SHINE_en.pdf
Basic points to check - have you generated the synonyms in the data generator? Ran the data generator to
create some data? Have the role assigned? Added client 001 to your user profile?
ashutosh dixit
Oct 24, 2013 1:30 PM
Hi Thomas ,
Amazing blog - once again Thomas, thanks.
I have been following you for many days , attended your OPEN SAP course also.
That was an amazing course for new learner like me .
One of our client is looking forward for XS based search Application identical to what you have created in your
DEMO.

Generated by Jive on 2015-02-28+01:00


46

SAP HANA Developer Center: SAP HANA Extended Application Services

Generated by Jive on 2015-02-28+01:00


47

SAP HANA Developer Center: SAP HANA Extended Application Services

But I am not able to fetch the data on blank HTML page is coming with no data .
If there is any step by step document related to this please help in getting that .
Any help will be highly appreciated.
Thanks
Ashutosh
Naveen Kumar
Sep 26, 2013 11:30 AM
Good Document...
Heber Fabiano
Aug 27, 2013 3:23 PM
Great content as always. Keep sharing with us.
Thomas Jung in response to Orel Stringa on page 48
Aug 27, 2013 1:47 PM
This is currently not possible. The CORS support is for all origins. We don't yet have the feature to maintain a
whitelist of CORS origins.
Orel Stringa in response to Thomas Jung on page
Aug 27, 2013 8:01 AM
Hi Thomas,
nice to see that SAP has made it possible with SP6 to specify cross origin resource sharing (CORS) support
via the .xsaccess file. SP6 HANA development guide has example of how to specify CORS support.
I have build an XS application and would like to serve SAPUI5 on a diff.host than XS/HANA.
How can I specify that I would like to allow cross origin access restricted to certain domain(s) only ?
Is there a special keyword / syntax for specifying that?
Thank yoi.
Orel
Vijay Uthayakumar
Aug 27, 2013 1:31 AM
Highly informative & digestible! Fantastic work!
Jerry Wang
Aug 1, 2013 9:55 AM
Hi Tomas,

Thank you.

Generated by Jive on 2015-02-28+01:00


48

SAP HANA Developer Center: SAP HANA Extended Application Services

Jerry
Thomas Jung in response to Milan Vrozina on page 49
Jul 21, 2013 6:44 PM
JSLint checks are very strict and often produce syntax errors for items that just stylistic and won't actually
cause an error upon activation or runtime. You can either ignore the JSLint errors or deactivate JSLint for this
project in these cases. However it might also be an indication that the JavaScript code you are trying to import
isn't compatible with Strict mode.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/
Strict_mode
Milan Vrozina in response to Thomas Jung on page 49
Jul 21, 2013 6:24 PM
Thanks for clarification. I thought there would be some kind of import.
But anyway, in case of this specific library I have some problems with JSLint validation when I do cut and paste
of the original code.
Thomas Jung in response to Milan Vrozina on page 49
Jul 21, 2013 3:43 PM
What kind of problem are you having using this library? Strict mode JavaScript which doesn't try to access the
DOM, Window, or other client side specific objects should work in Server Side XSJS. Generally if you have a
library you just cut and paste into your XSJS or an XSJSLIB file and then call the functions from your code.
Milan Vrozina
Jul 21, 2013 3:39 PM
Hello,
first and foremost, thank you for perfect openSAP classes related to HANA development and for this blog as
well.
I have one question related to server-side javascript. You mentioned in course, that is possible to use 3rd party
libraries or reuse 3rd party code. But I can't find a possible way how to import 3rd party javascript library -as
is- to server and use it. For example I would like to use JSZip library to zip some file, before sending it to client
from xsjs application. Is that possible ? Thank you.

Chandrashekhar Mahajan
Jul 3, 2013 7:34 PM
This is excellent blog! Now HANA XS is very much clear to me
Mohan krishna
Jul 1, 2013 1:44 PM
WOW - great blog Thomas! This will be very helpful in understanding SAP hana .Good Job

Generated by Jive on 2015-02-28+01:00


49

SAP HANA Developer Center: SAP HANA Extended Application Services

Abdul Hakim in response to Thomas Jung on page 50


Jun 27, 2013 8:33 PM
Thanks for the clarification.
Thomas Jung in response to Abdul Hakim on page 50
Jun 27, 2013 6:59 PM
HANA Extended Application Services uses SQLScript and JavaScript as its two primary programming
languages.
>whether the current SAP Business suite based on ABAP will be completely migrated to HANA service
No. The Business Suite already runs on HANA but still via the ABAP application server. It will continue to
leverage HANA via a combination of enhancements to ABAP and utilizing some of the technologies described
in this blog.
>Also whether ABAP can be used to built application in HANA extended services
No. There is no ABAP language container in HANA Extended Application Services.
Abdul Hakim
Jun 27, 2013 4:05 PM
Hi Thomas - What is the programming language used for HANA Extended application services?
As HANA is more than a database i.e application platform by itself and as you mentioned that more and more
applications will be built on HANA i have question as how the future SAP ERP system looks like..whether the
current SAP Business suite based on ABAP will be completely migrated to HANA service in the future or SAP
ABAP server will continue to evolve and receive focus investment from SAP.. Also whether ABAP can be used
to built application in HANA extended services? Your thoughts.
Thanks
Abdul Hakim
Thomas Jung in response to Ravindra Channe on page 50
Jun 11, 2013 8:30 PM
Yes, it is still planned. However we are still a couple of weeks away and I've not seen the final installers to say
for certain its there.
Ravindra Channe
Jun 11, 2013 8:15 PM
Hi Thomas,
Thanks for a wonderful and very informative blog. Is there any update on 32 bit REGI file ?
Is it expected along with SPS6 ?
Regards,
Ravi

Generated by Jive on 2015-02-28+01:00


50

SAP HANA Developer Center: SAP HANA Extended Application Services

Thomas Jung in response to Amanda Rzepka on page


Jun 7, 2013 9:42 PM
>Can the XS Services be used in a BW on HANA Scenario?
Yes. XS is part of ALL HANA systems. You should check and make sure you are licensed for direct access to
the underlying HANA instance, however.
Thomas Jung in response to Holger Schimanski on page
Jun 7, 2013 9:41 PM
>Is there a similar library which could be used in XS Engine?
The XSODATA development object is similar. We also have higher level frameworks for XMLA and Search
Services (InA). You can expect more such high level frameworks to be added to the HANA Extended
Application Services in the future.
Thomas Jung in response to Manav Mehra on page
Jun 7, 2013 9:39 PM
Have you used something like the Chrome developer tools to see see if you are getting any client side
javascript errors or to see if the request to your xsodata service is successful?
Thomas Jung in response to Christian Hufnagl on page 52
Jun 7, 2013 9:38 PM
It will ship as non-automatic content in SPS6 (all systems will have it and it just needs to be imported). The
delivery units are also part of this week's updates to the Cloudshare and AWS developer center images. They
are also available for download as part of the content of the openSAP course.
Thomas Jung in response to Matthew Pickell on page 51
Jun 7, 2013 9:37 PM
CORS support will come with SPS6 at the end of June.
Thomas Jung in response to Jeroen Custers on page 51
Jun 7, 2013 9:36 PM
>Will this bug be fixed in HANA ver 56?
Personally I've still experienced this bug in SPS6 internal builds. Must be a tricky one to find. Luckily the
workaround of closing and reopening isn't too difficult. Just annoying. This also probably makes the bug low
priority.
Jeroen Custers in response to Vivek Singh Bhoj on page 52
Jun 7, 2013 4:11 PM
This issue also occurs on rev56.
Matthew Pickell
Jun 7, 2013 2:58 PM
Thomas,
Has CORS been included in a release yet?
Thanks!

Generated by Jive on 2015-02-28+01:00


51

SAP HANA Developer Center: SAP HANA Extended Application Services

Vivek Singh Bhoj in response to Chandra Edem on page 52


Jun 5, 2013 6:01 AM
Hi Chandra,
Date for Week1 Assignment has been extended till June 11,
So you can give Week 1 Assignment now
Christian Hufnagl
Jun 4, 2013 5:43 PM
Hi Thomas,
thank you for the interesting tutorial.
Can you tell me whether it is possible to download the source code of the Putting it all together
video? And if yes: Where can I download it?
Thanks!
Christoph
Vivek Singh Bhoj
Jun 4, 2013 11:16 AM
Hi Thomas,
Thanks for OpenSAP classes.
Your Youtube Account also have very good exercises.
IN OpenSAP Week 2 Unit 3 tutorial, after assigning admin role to my user Id, i am not able to see sequences,
synonyms, triggers under my schema or any other schema, i am only able to see Column Views, Procedures,
Tables and Views.
Though now i am able to insert data into my created table.
Can you let me know how i will be able to see Sequences under my schema without removing the admin role?
I am using HANA revision 52.
Got to know from OpenSAP that:
This is a known issue, and the only way that I've seen to fix it is to actually close the studio and open it again,
then refresh the node.
Cheers,
Rich Heilman
SAP HANA Product Management
Will this bug be fixed in HANA ver 56?
Chandra Edem in response to Thomas Jung on page 53
Jun 4, 2013 6:46 AM
Thomas,
I registered for OpenSAP course "Introduction to Software Development on SAP HANA" on June 2, 9.00PM.
I didn't know that it is going to end WEEK1 assignment test on 6/3/2013 3.00PM. Is there any way can take
that WEEK1 Assignment Test.

Generated by Jive on 2015-02-28+01:00


52

SAP HANA Developer Center: SAP HANA Extended Application Services

Thanks
Chandra
Thomas Jung in response to Alexander Bauer on page
Jun 3, 2013 8:56 PM
SAPUI5 gets updated auutomatically when you apply HANA revisions. There is no additional download or
update needed.

Generated by Jive on 2015-02-28+01:00


53

You might also like