Sap Hana Extended Application Services

53
Generated by Jive on 2015-02-28+01:00 1 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 HANA’s 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 HANA’s 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.

description

Sap Hana Extended Application Services

Transcript of Sap Hana Extended Application Services

  • Generated by Jive on 2015-02-28+01:001

    SAP HANA Developer Center: SAP HANAExtended Application Services

    Posted by Thomas Jung Nov 29, 2012With SAP HANA SP5* on page , we introduce an exciting new capability called SAP HANA ExtendedApplication Services (sometimes referred to unofficially as XS or XS Engine). The core concept of SAP HANAExtended Application Services is to embed a full featured application server, web server, and developmentenvironment within the SAP HANA appliance itself. However this isn't just another piece of software installedon the same hardware as SAP HANA; instead SAP has decided to truly integrate this new application servicesfunctionality directly into the deepest parts of the SAP HANA database itself, giving it an opportunity forperformance 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 whichconsumes SAP HANA data or logic, you would need another application server in your systemlandscape. For example, you might use SAP NetWeaver ABAP or SAP NetWeaver Java to connectto 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 ofSAP HANAs openness, you might also use Dot Net or any number of other environments orlanguages which support ODBC (Open Database Connectivity) as well. These scenarios are all stillperfectly valid. In particular when you are extending an existing application with new SAP HANAfunctionality, these approaches are very appealing because you easily and with little disruptionintegrate 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 toconsider the option of the SAP HANA Extended Application Services. With SAP HANA Extended ApplicationServices you can build and deploy your application completely self-contained within SAP HANA; providing anopportunity for a lower cost of development and ownership as well as performance advantages because of thecloseness of the application and control flow logic to the database.

    Applications designed specifically to leverage the power of SAP HANA, often are built in sucha way to push as much of the logic down into the database as possible. It makes sense toplace all of your data intensive logic into SQL, SQLScript Procedures, and SAP HANA Views, asthese techniques will leverage SAP HANAs in-memory, columnar table optimizations as wellas massively parallel processing. For the end-user experience, we are increasingly targetingHTML5 and mobile based applications where the complete UI logic is executed on the clientside. Therefore we need an application server in the middle that is significantly smaller than thetraditional application server. This application server only needs to provide some basic validationlogic and service enablement. With the reduced scope of the application server, it further lendscredit to the approach of a lightweight embedded approach like that of the SAP HANA ExtendedApplication Services.

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    Figure 1 - Architectural Paradigm Shift

    SAP HANA Studio Becomes a Development WorkbenchIn order to support developers in creating applications and services directly within this new SAP HANAExtended 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 EclipseTeam Provider plug-in which sees the SAP HANA Repository as a remote source code repository similar to Gitor 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 withthe SAP HANA Database. These lifecycle management capabilities include versioning, language translationexport/import, and software delivery/transport.

    The SAP HANA Studio is extended with a new perspective called SAP HANA Development. As Figure 2shows, 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 HANAExtended Application Services development (for example, the Server Side JavaScript editor shown in thefigure or the SAP HANA Repository browser). Because SAP HANA Studio is based on Eclipse, we can alsointegrate 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-loadedwith the 1.8 version of the SAPUI5 runtime and the SAPUI5 development tools are integrated into SAP HANAStudio and managed by the SAP HANA Repository like all other XS based artifacts. Although the SAPUI5

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    development tools are integrated into SAP HANA Studio, they are not installed automatically. For installationinstructions, 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 projectwizards (Figure 3), resource wizards, code completion and syntax highlighting for SAP HANA ExtendedApplication Services server side APIs, integrated debuggers, and so much more.

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    Figure 3- Project Wizards for XS Based Development

    These features also include team management functionality. All development work is done based uponstandard Eclipse projects. The project files are then stored within the SAP HANA Repository along with all theother resources. From the SAP HANA Repository browser view, team members can check out projects whichhave 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. Youcan also allow multiple developers to work on the same resources at the same time. Upon commit back to theSAP HANA Repository, any conflicts will be detected and a merge tool will support the developer with the taskof integrating conflicts back into the Repository.

    The SAP HANA Repository also supports the concept of active/inactive workspace objects. This way adeveloper can safely commit their work back to the server and store it there without immediately overwritingthe current runtime version. It isn't until the developer chooses to activate the Repository object, that the newruntime version is created.

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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 ServicesThere are two main parts of the SAP HANA Extended Application Services programming model. The first isthe ability to generate OData REST services from any existing SAP HANA Table or View. The process isquite simple and easy. From within an SAP HANA Project, create a file with the extension xsodata. Within thisservice definition document, the developer needs only to supply the name of the source table/view, an entityname, 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:

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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. Thegenerated 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). BecauseOData is an open standard, you can read more about the URL parameters and other features at http://www.odata.org/.

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    Figure 6 - OData $metadata support

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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 varietyof 3rd 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 HANAExtended Application Services. A particularly strong feature of SAPUI5 is the integration of OData serviceconsumption not just at a library level but also with special features within the UI elements for binding to ODataservices.

    For example, within SAPUI5, you can declare an OData model object and connect this model object to the URLof the XSODATA service. Next, create a Table UI element and connect it to this model object. Finally you callbindRows of the Table UI element object and supply the OData entity name you want to use as the source ofthe table.

    var oModel = new sap.ui.model.odata.ODataModel ("../../services/buyer.xsodata/", false); oTable = new sap.ui.table.Table("test",{tableId: "tableID", visibleRowCount: 10}); ... oTable.setModel(oModel); oTable.bindRows("/BUYER");

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    This creates an UI Element which has built-in events, such as sort, filter, and paging, which automatically callthe corresponding OData Service to fulfill the event. No additional client side or server side programming isnecessary 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 theseservices within SAPUI5, please view these videos.

    Server Side JavaScriptThe XSODATA services are great because they provide a large amount of functionality with minimal amountsof development effort. However there are a few limitations which come with such a framework approach. Forexample in SAP HANA SP5, the OData service framework is read only. Support for Insert, Update, and Deleteoperations is available with SAP HANA SP6.

    Luckily there is an option for creating free-form services where you can not only perform update operations butalso have full control over the body format and URL parameter definition. SAP HANA Extended ApplicationServices also allows development on the server side using JavaScript (via project files with the extension

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    XSJS). Core APIs of SAP HANA Extended Application Services are, therefore, exposed as JavaScriptfunctions; providing easy access to the HTTP Request and Response object as well database access toexecute SQL or call SQLScript Procedures.

    In this simple example, we can take two numbers as URL Request Parameters and multiply them together andthen return the results as text in the Response Body. This is an intentionally basic example so that you canfocus 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 fullcontrol over the body output and to further manipulate the result set after selection. In this example, we useXSJS 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_nvarchar(\"CompanyName\"), \"LoginName_1\", \"CreatedAt\", \"GrossAmount\" FROM \"_SYS_BIC\".\"teched.epm.db/PO_HEADER_EXTENDED\" order by \"PurchaseOrderId\"'; $.trace.debug(query); var conn = $.db.getConnection(); var pstmt = conn.prepareStatement(query); var rs = pstmt.executeQuery(); body = "Purchase Order Id \tPartner Id \tCompany Name \tEmployee Responsible \tCreated At \tGross Amount \n"; while(rs.next()) { body += rs.getString(1)+ "\t"+rs.getString(2)+"\t"+rs.getString(3)+"\t"+rs.getString(4)+"\t"+rs.getTimestamp(5)+"\t"+rs.getDecimal(6)+"\n"; } $.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; }

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    ClosingThis blog hopefully has served to give you a small introduction to many of the new concepts and possibilitieswith 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 aswell how to integrate SAP HANA Extended Application Services content into additional environments. Likewisethere 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 asproductive software (meaning customers can go live in production with it) in SAP HANA SP5; it isa controlled release initially, with a special Project Solution program in place around this newfunctionality. Please refer to Service Note 1779803, for additional details on the current statusof the Project Solution. This Project Solution approach is designed to provide the highest levelsof support possible to initial customers and partners who choose to develop using SAP HANAExtended Application Services. It also provides a channel for feedback to Product Managementand development so that we take suggestions and ideas and quickly integrate them into futurerevisions 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 OoiDec 23, 2014 3:45 PMHi 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 fromHANA.I have a requirement to allow the user to comment in the dashboard and it will write back to the HANA DB andalso 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 SadiqDec 10, 2014 1:40 PMI need your help in writing an API(XSJS service) which will take JSON format data and inserted into HANAdatabase.

    Tarasankar Banerjee in response to Thomas Jung on page 14Nov 5, 2014 8:52 AMThanks Thomas. Could you give an example of how to redirect.

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    I'm facing a strange issue while trying to import weather data from several cities together. The issue appears tobe 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);

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    $.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 = "";proxyPort = "

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    Could you please advise regarding this issue. Thanks for your help.

    RegardsTarasankar

    Thomas Jung in response to Tarasankar Banerjee on page 14Nov 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 HANAconfiguration 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() fromJAVA 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 15Nov 4, 2014 10:34 AMHi 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.

    RegardsTarasankar

    Robert WeberNov 3, 2014 11:36 AMIf 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 Notes2019148 and 1950221.The commands are then:select VOLUME_ID from m_volumes where service_name = 'xsengine';ALTER SYSTEM ALTER CONFIGURATION ('daemon.ini', 'host', '') UNSET('xsengine','instances') WITH RECONFIGURE;

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    ALTER SYSTEM ALTER CONFIGURATION ('topology.ini', 'system') UNSET ('/host/', 'xsengine') WITH RECONFIGURE;ALTER SYSTEM ALTER CONFIGURATION ('topology.ini', 'system') UNSET ('/volumes', '') WITHRECONFIGURE;ALTER SYSTEM ALTER CONFIGURATION ('daemon.ini', 'host', '') 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 toprevent 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 15Nov 3, 2014 10:31 AMUpdate:

    I tried to access the XS Admin console from another user and faced only the 'No valid Crypto' error. Howevercould still update the proxy user details and the sample application successfully ran at last. The relevant roleswere 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.

    RegardsTarasankar

    Tarasankar Banerjee in response to Thomas Jung on page 18Nov 3, 2014 9:29 AMHi Thomas,

    I also tried to use the sample code from section '8.4.1 Tutorial: Use the XSJS Outbound API' of the HANADeveloper Guide with minor modifications (for package structure, proxy settings etc.). This time the destinationwas found. The new project structure with the sample files yahoo.xshttpdest and sapStock.xsjs is as below.

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

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

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

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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 errorsat the bottom. On clicking them the following list is displayed.

    1. Internal Error: dbError(Connection.prepareStatement): 258 - insufficient privilege: Not authorized atptime/query/checker/query_check.cc:2418

    2. No valid SAP Crypto configuration.

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    It appears from various blogs that the second error (No valid SAP Crypto configuration) is related to SSLconfiguration in HANA. I would contact the HANA Administrator to look into this issue. Of course it would begreat 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.

    RegardsTarasankar

    Thomas Jung in response to Tarasankar Banerjee on page 18Oct 31, 2014 3:42 PMFirst of all, you would never use the workspace name. It isn't ever part of anything. It is only the packagestructure that counts. The first item in your list is the only one with the correct package. Off hand it looks right tome. You are supposed to supply the full package path. Have you configured this HTTP Destination in the XSAdmin tool yet?

    Tarasankar Banerjee in response to Thomas Jung on page 18Oct 31, 2014 3:26 PMUpdated it. Thanks.

    RegardsTarasankar

    Thomas Jung in response to Tarasankar Banerjee on page 18Oct 31, 2014 3:13 PMYour comment got cut off. We never really get to see what your problem is.

    Tarasankar Banerjee in response to Thomas Jung on page 21Oct 31, 2014 2:56 PMThanks Thomas.

    I am facing as issue while trying to use an HTTP Destination. I understand that the .xshttpdest and .xsjs fileneed to in the same folder. Following is the structure of my test project.

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

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

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    Now I am trying to read this destination.

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    When I am using full package structure destination_package ="root.work.Tara02.XSTest01.XSHttpTest01.services", I am receiving theerror 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 theerror 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 errormessage 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" anddestination_name = "XSHttpDest02". But even then I received the error message User is not authorized touse destination (package: XS_Workspace.services, name: XSHttpDest02), not that the destination is notfound!!

    Could you please help me to resolve this issue.

    Thanks a lot for your helps.

    RegardsTarasankar

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    Thomas Jung in response to Tarasankar Banerjee on page 22Oct 30, 2014 1:52 PMSince 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 22Oct 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 forthe proxy. Although many proxy servers don't require a username and password.

    Tarasankar Banerjee in response to Thomas Jung on page 23Oct 30, 2014 7:07 AMHi Thomas,

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

    RegardsTarasankar

    Tarasankar Banerjee in response to Tarasankar Banerjee on page 22Oct 30, 2014 3:46 AMGot answer for the second point. SAP HANA XS Administration Tool is the place to configure Proxy settings.

    RegardsTarasankar

    Tarasankar Banerjee in response to Tarasankar Banerjee on page 22Oct 29, 2014 3:14 PMDear Thomas,

    another question is that does the proxy settings in the HttpDestination refer to the OS user of the HANAserver? We specify 'useProxy' as 'true' and 'authType' as 'basic' in the HttpDestination, but not maintain anyuser credentials. So when the program runs in server, would it automatically consider the OS user credentials?

    Thanks.

    RegardsTarasankar

    Tarasankar Banerjee in response to Thomas Jung on page 23Oct 29, 2014 1:32 PM

    Thanks Thomas. I am currently checking this option only ...

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    My current requirement is to fetch Weather Data and Social Media data from various OData services and storethem in HANA for further analysis. What might be the best way for this? I am currently checking the option ofcreating an XS application which would connect to the external services, fetch the data and save that in HANAusing 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.

    RegardsTarasankar

    Thomas Jung in response to Tarasankar Banerjee on page 23Oct 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 rathercomplex and not well performing.

    >Also is it possible to consume data from external OData services for weather data, social media data etc fromXSJS?Sure, with the same Outbound HTTP Connectivity.https://www.youtube.com/watch?v=fWirvj9l7eYMaintaining HTTP Destinations - SAP HANA Developer Guide - SAP Library

    Tarasankar BanerjeeOct 29, 2014 11:19 AMDear Thomas,

    Thanks for the great blog!!

    I am able to connect to Database and execute queries from XSJS service. However is it possible to consumeXSODATA 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 fromXSJS?

    If possible it would be great if you could provide some code sample or guidelines.

    Thanks.

    RegardsTarasankar

    Thomas Jung in response to Weiping Lu on page 24Sep 25, 2014 8:33 AMPlease refer to service note 1849775:

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    http://service.sap.com/sap/support/notes/1849775

    I believe it will address your issue.

    Weiping LuSep 24, 2014 5:19 PMHi Tom,

    Great post and videos! I have a tough issue: calling a HANA procedure from XS takes > 5min, but from HANAstudio < 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 24Aug 11, 2014 2:53 PMYou transport XSODATA services like you would any other repository content - via a Delivery Unit.

    Su SrikanthAug 11, 2014 7:50 AMHi Thomas,Great blog!I've a query here - we create the odata services(and/or URLs created to view in the web browser) indevelopment environment, now if we have to transport it to the quality and/or production environment, howcan we do this - is the same as import/export? or is there any specific way to do. please help with any usefulpointers..Many thanks as always!

    Su

    Thomas Jung in response to ARSHAD SHAIKH on page 24May 15, 2014 2:31 PMI've never written any blogs on calculation views. I don't cover that topic. That is why I suggested you ask yourquestion 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 XSODATAoff of the table STATUS without the need for the calculation view or the SQLScript Procedure.

    ARSHAD SHAIKH in response to Thomas Jung on page 25May 15, 2014 11:54 AMHello Thomas..

    I am new to hana. Please suggest me the blogs of you. related to calculation view that callingprocedures(procedures have out parameter).

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    I am trying to fetch the result of procedure in calc view and want to create odata service for that calculationview.

    procedure code goes like this:---------------------------------------

    CREATE PROCEDURE TWEETS_TODAY(OUT OP BIGINT)language SQLSCRIPT sql security invoker default schema "SOCIAL360" reads sql data asBEGINSELECT 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 25May 15, 2014 9:44 AMYour question seems to have no relation to the content in this blog. Please consider instead asking generalHANA questions in the appropriate SCN Forum.

    ARSHAD SHAIKHMay 15, 2014 9:17 AMHi 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.

    ThanksARSHAD SHAIKH.

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

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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 andthey 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 In-Memory (SAP HANA) -> SAP HANA ADO.NET 1.0.

    Best regards,Henrique.

    Blair Krotenko in response to Henrique Pinto on page 26Apr 16, 2014 6:56 PMThanks 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 aramp-up customer to d/l and use a beta product?

    Thanks,Blair

    Henrique Pinto in response to Thomas Jung on page 27Apr 16, 2014 6:14 PMThe 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 26Apr 16, 2014 5:14 PMFor general OData structure and syntax I find that the Odata.org website is very helpful. For example on thistopic:

    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 eachNavigation Property can be followed by a forward slash and another Navigation Property to enable identifying amulti-level relationship.The page also has some sample URLs.

    Kamal JainApr 16, 2014 5:36 AMDear Thomas,

    I agree that we need to pass all the associations in the expand. I tried with some of options, but was notthrough.

    Now i just tried with below syntax and able to achive. Thx.

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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 27Apr 15, 2014 6:23 PMWe do plan to release an ADO.NET provider specific to HANA in the near future. This would probably be thebest option for consumption from .NET. Until then I would think that ODBC is probably the next best option. Itgives 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 whereyou are calling the service from in your .NET application.

    Blair KrotenkoApr 15, 2014 4:09 PMHi 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 XSapplication, while ODBC might be the better option for .NET. What are your thoughts? Is there a paper on thissubject? I haven't been able to find a comparison document for this. Are there any security caveats to be awareof for these options?

    Thanks,Blair

    Thomas Jung in response to Kamal Jain on page 27Apr 15, 2014 1:36 PMYou have to list both associations in the expand on the URL if you want both relationships to be processed.

    Kamal JainApr 15, 2014 12:49 PMHi 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 onecommand.

    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 compositeProjectID and Employee Id as key and third table has Employee id as

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    key.So if I create navigation for first 2 tables based on project id and use expand comand than its working fine and Ican 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 tablesonly. 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";

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    }

    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 29Apr 14, 2014 4:58 PMThanks Thomas,

    Under which component?

    Regards,Vikas Madaan

    Thomas Jung in response to Vikas Madaan on page 29Apr 14, 2014 4:50 PMNo this isn't a known issue I've seen. Nor can I recreate the problem in my system. No you can't maintain theauthentication in XSHTTPDEST itself. It intentionally must be set in XSADMIN tool. I can really only suggestthat you open a support ticket.

    Vikas MadaanApr 14, 2014 4:31 PMHi Thomas,

    I am trying to pull data from SAP system onto HANA Database using XSJOB files. I am calling RFC enabledfunction modules over HTTP request. It helps me replicating the real time ECC data onto HANA as well withback ground jobs.

    I am facing one problem in the XSHTTPDEST file. I am able to create and activate the file using studio and thisfile is even visible in the web based XS administration tool. But in the web based tool when i provide user andpassword for basic authotication then system just clears the user id and password when i try to save. This thereason our HTTP requests are getting failed and below is the response we are getting in the response body.Logon Error Message

    Is this known issue or we are missing something? Is it possible to provide user and password in theXSHTTPDEST file. Is there any particular syntax?

    I checked and i have the required authorizations as well develper Guide.

    Please help.

    Regards,

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    Vikas Madaan

    Abdul HakimFeb 22, 2014 3:59 AMHi Thomas - Any recommended book or resource to learn and master Server Side Javascript? There weremany books available in the market but as a beginner need to know the right resource / book to start with andmaster this stuff..Also whether SAP plan to conduct any training to teach Server Side Javascript similar to otherstandard training offerings?

    ThanksHakim

    Samuel Tanor-GyeduFeb 20, 2014 8:39 AMThanks Thomas

    I will definitely have a look at SHINE.

    Thomas Jung in response to gentilini andre on page 30Feb 19, 2014 4:22 PMDifficult to say what is wrong. I several things which are different than our sample that does this. You are usinga POST for instance instead of a GET. However if you are gettting a 200 then I assume the service call iscorrect. In client side tools (like Chrome Developer Tools) you should be able to see the response object fromthe call.

    However what I would really recommend is that you study the SHINE content (SAP HANA InteractiveEducation). There is already a sample application which does this in SHINE. Also it has some specialJavaScript 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 HANADeveloper Center trial image (SP7 based).http://help.sap.com/hana/SAP_HANA_Interactive_Education_SHINE_en.pdf

    gentilini andreFeb 19, 2014 3:25 PMHi Thomas,

    well I followed your hints but it still dont work.

    I created a xsjs File like below:

    function downloadExcel(){

    try {

    var body = '';

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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"+rs.getDecimal(8)+"\t"+rs.getDecimal(9)+"\t"+rs.getString(10)+"\n";} $.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:

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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 Erfolgreichabgeschlossen!",'',"Confirmation")

    });

    // return false; }

    else // If the user presses 'Cancel' {

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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 isconstructed. * 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",

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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"

    }));

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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" }),

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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({

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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 thexsjs.file to generate the excel-file. I wondered that in the ajax part the error-, success- and complete-part willbe executed at the same time, and not only one of this statements. The message is "200" (The request hassucceeded. 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

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    Andr

    Thomas Jung in response to Samuel Tanor-Gyedu on page 38Feb 19, 2014 5:23 AMI don't think I can help you. This appears to a question about how odata4j works not about XS. I have noexperience with odata4j myself.

    Samuel Tanor-GyeduFeb 18, 2014 9:13 AMHi Thomas,

    I have an odata service with this endpointhttps://s5hanaxs.hanatrial.ondemand.com/.../services/User.xsodataI 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.

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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 39Feb 18, 2014 4:31 AMYou have a fundamental misunderstanding here. You are placing server side JavaScript code in your clientside UI5 application. The function downloadExcel is something you need to execute on the server. It needs tobe in an XSJS file and it is called from the client side via AJAX - as a REST service not as a local function.

    gentilini andreFeb 17, 2014 4:51 PMHello 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

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    My Button for this looks like:

    var oButton3 = new sap.ui.commons.Button({ text : "Save to Excel", icon : "images/save_button.jpg", lite: true, press : function() {alert(oButton3.getText()); downloadExcel();}

    and the function for this action looks like:

    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 \tTaxAmount \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"+rs.getDecimal(8)+"\t"+rs.getDecimal(9)+"\t"+rs.getString(10)+"\n";} } $.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;

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    }

    Im afraid and hope that you can help me.

    Kind regards

    Andr

    Thomas Jung in response to Vikas Madaan on page 41Feb 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 41Feb 11, 2014 12:45 PMThanks 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 XSJSLIBfiles?

    Regards,Vikas Madaan

    Thomas Jung in response to Vikas Madaan on page 41Feb 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 approachesEven with the CRUD support and exits in XSODATA, its still pretty hard to do 100% via XSODATA. There arestill valid use cases for XSJS when you need custom body, custom read processing, job scheduling, etc. Itsgood to try and use XSODATA whenever possible, but I wouldn't automatically exclude the use of XSJS.

    Vikas MadaanFeb 11, 2014 10:08 AMHi 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 onementioned below:

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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 likeany REST base service and from my understanding it is Scalable as well. I would love to use XSOData alwaysbecuase development effort is very less compare to XSJS and it is very easy to rampup the team on ODatarelated development objects.

    XSJS were as provide more control becuase of server side scripting becuase it allows development on theserver side using JavaScript. Core APIs of SAP HANA Extended Application Services are, therefore, exposedas JavaScript functions; providing easy access to the HTTP Request and Response object as well databaseaccess to execute SQL or call SQLScript Procedures. It provide us control over the body format and and URLparameter 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 theapproaches 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 complexapplication. Corrent me If i am wrong.Thanks!

    Regards,Vikas Madaan

    Thomas Jung in response to Raghuveer Phull on page 42Feb 5, 2014 3:12 PMYes 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 PhullFeb 5, 2014 1:22 AMDo 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 43Jan 29, 2014 4:11 PMThe source code for the examples shown here are shipped as part of SHINE (SAP HANA InteractiveEducation):

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    http://help.sap.com/hana/SAP_HANA_Interactive_Education_SHINE_en.pdf

    Vivek Singh Bhoj in response to reda miraoui on page 43Jan 29, 2014 3:52 PMHi Reda,

    You can import Shine Content in HANA and then check all these source codeshttp://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 PMHey Thomas,Is it possible to download source code of your project from this HANA tutorial?

    ThanksReda

    Thomas Jung in response to Abdul Hakim on page 43Nov 21, 2013 11:33 PMYes River can be used as an alternative and when activated it will generate Server Side JavaScript and/orSQLScript.

    Abdul Hakim in response to Thomas Jung on page 44Nov 21, 2013 7:47 PMHi 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 / SQLScript..Once RDL is rolled out whether RDL can be used for native application development instead of Serverside Java script / SQL / SQL Script?? I am very much new to this stuff so appreciate if you can also help onhow to get started with Server Side Java script / SQL / SQL Script for HANA...

    ThanksHakim

    ashutosh dixit in response to Thomas Jung on page 45Oct 30, 2013 7:50 AMHi Thomas ,

    Thanks for your response , I am talking about more content on shine.

    thanksAshutosh

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    Baskar Gopalakrishnan in response to Thomas Jung on page 44Oct 30, 2013 12:49 AMHi Thomas, I'm a SAP PI Middleware consultant/SAP topic leader in XI/PI heavily worked on Java relatedNetweaver stack. I have knowledge in ABAP but not worked heavily in abap. I have enrolled your sap hananative application development course. I feel very interesting... I did work heavily in java and javascript projectsusing eclipse development tool. Do you think if I invest my time in just native hana development and proceedin HANA field is a good step? I don't have BW experience either...

    Abdul Hakim in response to Thomas Jung on page 44Oct 29, 2013 8:19 PMThanks for the clarification. Much appreciated..

    Thomas Jung in response to Abdul Hakim on page 44Oct 29, 2013 1:20 PM>ABAP Close to HANA means whether we can expect a similar 2 tier architecture similar to HANA XS in thefuture or what does that meanNo it doesn't mean that ABAP will become a 2 tier architecture. We will not move the ABAP VM/Kernel intoHANA itself. It will remain a separate application server. At least for the current plans/foreseeable future. Whathe was referring to was bringing the programming models closer. For instance the new 7.40 SP5 feature thatallows you to write SQLScript directly within an ABAP class method.

    Abdul Hakim in response to Thomas Jung on page 44Oct 29, 2013 6:50 AMThomas - Thanks for the clarification...Much appreciated...I was listening to ABAP on HANA session byThorsten Schneider @ this year Teched and he was mentioning that SAP Plans to bring ABAP very close toHANA in the coming future but not much details have been discussed in the session...ABAP Close to HANAmeans whether we can expect a similar 2 tier architecture similar to HANA XS in the future or what does thatmean...??

    ThanksHakim

    Thomas Jung in response to Abdul Hakim on page 45Oct 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 isrecommended by SAP then kindly share the pros and cons of each of the item

    Taken from the TechEd CD103 session slides:

    Guidanceuse 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 HANAcombine ABAP and HANA Native Development to enrich existing applications (e.g. SAP HANA Live, Fiori)

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    ABAPapplications follow 3-tier architectureABAP is in general database agnostic, but with release 7.4 optimized for SAP HANAProgramming language: ABAP / ABAP OO with the option to use SAP HANA featuresIDE: eclipse-based ABAP Development Tools

    HANA Native Developmentapplications follow 2-tier architectureHANA Native Development is SAP HANA specific and embedded in the databaseProgramming language: River; server-side JavaScript, SQL/SQLScriptIDE: eclipse-based SAP HANA Studio + web IDE

    Thomas Jung in response to ashutosh dixit on page 45Oct 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 deliveredin SP7.

    Abdul HakimOct 28, 2013 3:26 PMThomas - Let us say a customer is running SAP Netweaver 7.4 ABAP with HANA DB and they have HANAextended service as well...If the customer wants to do new developments then what is the recommendationfrom SAP ie. whether to build application using HANA XS or use SAP Netweaver 7.4 ABAP..If any one of theoption is recommended by SAP then kindly share the pros and cons of each of the item (SAP Netweaver 7.4ABAP Vs SAP HANA XS)...

    ThanksHakim

    ashutosh dixit in response to Thomas Jung on page 45Oct 28, 2013 2:21 PMHi Thomas ,

    Thanks a lot for your its working now .Is there any more demos for the SHINE ??

    ThanksAshutosh

    Thomas Jung in response to ashutosh dixit on page 46Oct 25, 2013 8:09 PM

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    As this content is now standard in SP6 as part of SHINE (SAP HANA INteractive Education), there also somesetup instructions on help.sap.comhttp://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 tocreate some data? Have the role assigned? Added client 001 to your user profile?

    ashutosh dixitOct 24, 2013 1:30 PMHi 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 yourDEMO.

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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.

    ThanksAshutosh

    Naveen KumarSep 26, 2013 11:30 AMGood Document...

    Heber FabianoAug 27, 2013 3:23 PMGreat content as always. Keep sharing with us.

    Thomas Jung in response to Orel Stringa on page 48Aug 27, 2013 1:47 PMThis is currently not possible. The CORS support is for all origins. We don't yet have the feature to maintain awhitelist of CORS origins.

    Orel Stringa in response to Thomas Jung on page Aug 27, 2013 8:01 AMHi Thomas,

    nice to see that SAP has made it possible with SP6 to specify cross origin resource sharing (CORS) supportvia 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 UthayakumarAug 27, 2013 1:31 AMHighly informative & digestible! Fantastic work!

    Jerry WangAug 1, 2013 9:55 AMHi Tomas,

    Thank you.

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    Jerry

    Thomas Jung in response to Milan Vrozina on page 49Jul 21, 2013 6:44 PMJSLint checks are very strict and often produce syntax errors for items that just stylistic and won't actuallycause an error upon activation or runtime. You can either ignore the JSLint errors or deactivate JSLint for thisproject in these cases. However it might also be an indication that the JavaScript code you are trying to importisn'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 49Jul 21, 2013 6:24 PMThanks 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 pasteof the original code.

    Thomas Jung in response to Milan Vrozina on page 49Jul 21, 2013 3:43 PMWhat kind of problem are you having using this library? Strict mode JavaScript which doesn't try to access theDOM, Window, or other client side specific objects should work in Server Side XSJS. Generally if you have alibrary you just cut and paste into your XSJS or an XSJSLIB file and then call the functions from your code.

    Milan VrozinaJul 21, 2013 3:39 PMHello,first and foremost, thank you for perfect openSAP classes related to HANA development and for this blog aswell.

    I have one question related to server-side javascript. You mentioned in course, that is possible to use 3rd partylibraries or reuse 3rd party code. But I can't find a possible way how to import 3rd party javascript library -asis- to server and use it. For example I would like to use JSZip library to zip some file, before sending it to clientfrom xsjs application. Is that possible ? Thank you.

    Chandrashekhar MahajanJul 3, 2013 7:34 PM

    This is excellent blog! Now HANA XS is very much clear to me

    Mohan krishnaJul 1, 2013 1:44 PMWOW - great blog Thomas! This will be very helpful in understanding SAP hana .Good Job

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    Abdul Hakim in response to Thomas Jung on page 50Jun 27, 2013 8:33 PMThanks for the clarification.

    Thomas Jung in response to Abdul Hakim on page 50Jun 27, 2013 6:59 PMHANA Extended Application Services uses SQLScript and JavaScript as its two primary programminglanguages.

    >whether the current SAP Business suite based on ABAP will be completely migrated to HANA serviceNo. The Business Suite already runs on HANA but still via the ABAP application server. It will continue toleverage HANA via a combination of enhancements to ABAP and utilizing some of the technologies describedin this blog.

    >Also whether ABAP can be used to built application in HANA extended servicesNo. There is no ABAP language container in HANA Extended Application Services.

    Abdul HakimJun 27, 2013 4:05 PMHi 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 moreapplications will be built on HANA i have question as how the future SAP ERP system looks like..whether thecurrent SAP Business suite based on ABAP will be completely migrated to HANA service in the future or SAPABAP server will continue to evolve and receive focus investment from SAP.. Also whether ABAP can be usedto built application in HANA extended services? Your thoughts.

    ThanksAbdul Hakim

    Thomas Jung in response to Ravindra Channe on page 50Jun 11, 2013 8:30 PMYes, it is still planned. However we are still a couple of weeks away and I've not seen the final installers to sayfor certain its there.

    Ravindra ChanneJun 11, 2013 8:15 PMHi 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

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    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 tothe 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 SearchServices (InA). You can expect more such high level frameworks to be added to the HANA ExtendedApplication Services in the future.

    Thomas Jung in response to Manav Mehra on page Jun 7, 2013 9:39 PMHave you used something like the Chrome developer tools to see see if you are getting any client sidejavascript errors or to see if the request to your xsodata service is successful?

    Thomas Jung in response to Christian Hufnagl on page 52Jun 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). Thedelivery units are also part of this week's updates to the Cloudshare and AWS developer center images. Theyare also available for download as part of the content of the openSAP course.

    Thomas Jung in response to Matthew Pickell on page 51Jun 7, 2013 9:37 PMCORS support will come with SPS6 at the end of June.

    Thomas Jung in response to Jeroen Custers on page 51Jun 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 theworkaround of closing and reopening isn't too difficult. Just annoying. This also probably makes the bug lowpriority.

    Jeroen Custers in response to Vivek Singh Bhoj on page 52Jun 7, 2013 4:11 PMThis issue also occurs on rev56.

    Matthew PickellJun 7, 2013 2:58 PMThomas,

    Has CORS been included in a release yet?

    Thanks!

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    Vivek Singh Bhoj in response to Chandra Edem on page 52Jun 5, 2013 6:01 AMHi Chandra,Date for Week1 Assignment has been extended till June 11,So you can give Week 1 Assignment now

    Christian HufnaglJun 4, 2013 5:43 PMHi 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 togethervideo? And if yes: Where can I download it?Thanks!Christoph

    Vivek Singh BhojJun 4, 2013 11:16 AMHi 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 HeilmanSAP HANA Product Management

    Will this bug be fixed in HANA ver 56?

    Chandra Edem in response to Thomas Jung on page 53Jun 4, 2013 6:46 AMThomas,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 takethat WEEK1 Assignment Test.

  • SAP HANA Developer Center: SAP HANA Extended Application Services

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

    ThanksChandra

    Thomas Jung in response to Alexander Bauer on page Jun 3, 2013 8:56 PMSAPUI5 gets updated auutomatically when you apply HANA revisions. There is no additional download orupdate needed.