SAP HANA XSJS - Analytic view & XSODATA

Hello all,
We have a requirement to expose an analytic view as a xsjs service, could some one assist providing the syntax for xsjs ?
Regards.

Hey Kumar
this script will read your table an expose all Data via JSON
try {
  var conn = $.db.getConnection();
  var query = "select * from YOUR_VIEW";
  var pstmt = conn.prepareStatement(query);
  var rs = pstmt.executeQuery();
  var line = {};
  var list = [];
  var i = 1;
  while (rs.next()) {
       line = {};
       for (i = 1; i <= rs.getMetaData().getColumnCount(); i++) {
            line[rs.getMetaData().getColumnLabel(i)] = rs.getString(i);
       list.push(line);
  var body = JSON.stringify(list);
  $.response.contentType = "application/json";
  $.response.setBody(body);
} catch (e) {
  $.response.status = $.net.http.INTERNAL_SERVER_ERROR;
  $.response.setBody(e.message);

Similar Messages

  • SAP HANA: IMPORT/EXPORT Views

    We can Import/export tables using hdbsql CLI.
    But Is there any way by which we can export/import Views(attribute,analytic,calculation) using hdbsql CLI.
    I raised above question some days back
    SAP HANA: IMPORT/EXPORT Views | SCN
    Also while checking on internet I found another link for the same issue:
    http://scn.sap.com/thread/2141404
    And from experts answers, I came to conclusion that Import/Export Views(Attribute/Analytic/Calculation views)in SAP HANA is not possible through hdbsql CLI/ SQL commands.Now Is there a way where I can confirm this from SAP HANA program management guys?

    Lars,
    Thanks for the explanation.
    What I am trying to achieve is to create an automate script which should export all tables and views for a schema and again import tables and views in a different schema.
    table part is done, But stuck in view part.
    I tried the below command and was able to export the calculation view which I created in Content and exists as
    _SYS_BIC-->Package(same name as schema where all the tables are stored) --> View Name.
    Command used was:
    EXPORT  "<Schema_Name>"."<Package_Name>/<View_Name>"  INTO '<path>'
    Now I have 2 ques :
    1) I am not sure how to import this exported view. I tried below command but it failed:
    IMPORT  "<Schema_Name>"."<Package_Name>/<View_Name>"  FROM '<path>'
    2) Not sure how to export and import all the views.
    I did IMPORT SCAN of the path as well and found below entries for the exported view in the mentioned path:
    SCHEMA_NAME, OBJECT_NAME, OBJECT_TYPE, EXISTS
    "_SYS_BIC", "<Packagename>/CalculationViewName>", "VIEW", 1
    "_SYS_BIC", "<Packagename>/AnalyticViewName>", "VIEW", 1
    "_SYS_BIC", "<Packagename>/CalculationViewName>/olap", "VIEW", 1
    "_SYS_BIC", "vwTile1ALLData", "VIEW", 1
    Any Inputs would definitely help. Thanks.

  • How to make a BW Infoprovider for a SAP HANA Calculation-/Analytcial-View

    Hi
    I have got a BW 73 with a Hana.
    How can I  make a BW Infoprovider for a SAP HANA Calculation-/Analytcial-View in SAP BW ?
    Thank You
    Best Martin

    Hi Rekha,
    No need to do anything, just we need do migrate standard info cube to In-memory Optimized Info Cube. Once it is turned to In-Memory optimized Info Cube(We will have F table surrounded by master data tables) and no dimension tables in HANA.
    F-tables is nothing but Analytic View in HANA and Master data tables are nothing but Attributes in HANA.
    once you migrate to In-Memory Info Cube, your tables are ready in HANA and you can create different view.
    have a look at the below videos.
    https://www.experiencesaphana.com/blogs/bwonhana/2011/10/18/prerequisites-for-bw-on-hana
    http://www.sdn.sap.com/irj/scn/data-warehousing-elearning
    Regards,
    Venkatesh

  • Generating Dependencies for Calculation/Analytical View in SAP HANA.

    Hi Everyone,
    I am trying to find out the dependencies for a specific Calculation/Analytical View. I have used sys.object_dependencies but that gives only the table names on which the calculation view is dependent on, but not theanalytical and attribute views.
    For example, consider a calculation view which is developed by joining 2 analytical views and the analytical views in turn uses some attribute views. So my ask is to get all these object information not just the tables. This is very basic info and I assume it must be captured in some metadata views. My aim is to query such metadata views and get the dependencies. Any pointers to this would be highly helpful.
    Best Regards. 

    Hi Samarpan,
    You can right click on the view and select option 'Auto Documentation' with content type as 'Model Details' in the wizard. Select a target location for the document to generate.
    When you open the generated document, in the last there is a section as 'Cross References' which will give you full hierarchy of views/tables used.
    Hope this will solve your problem
    Regards,
    Rashmi

  • SAP HANA XSODATA service (Service exception: column store error.)

    Hi all,
    i have a problem with my calculation view using xsodata service on it. (There's an input parameter called P
    _SWERK)
    In my calculation view, the data origin are two analytic views (on which the input parameter P_SWERK should be filter data at beginning of the sql script code).
    First i read the analytic views with function CE_OLAP_VIEW and after i do a CE_PROJECTION function on them using the input parameter P_SWERK like a filter on field SWERK.
    But when i run my application on browser the following error occurs :
    <message xml:lang="en-US">Service exception: column store error.</message>
    The link is this :
    http://host:port/Project_DM/services/Test/TEST_ZIIG_PDM_CALC_VIEW_FINAL_service.xsodata/PianiDiManutenzioneParameters(P_SWERK='CO05')/Results
    The service definition is :
    service {
    "EricssonItalgas/TEST_ZIIG_PDM_VIEW_FINAL.calculationview" as "PianiDiManutenzione" keys generate local "ID"
    parameters via entity;
    The SAP HANA AWS revision is 60.
    Someone could you help me,please?
    Thanks in advance.
    Dario.

    Hi Dario,
    Does the calculation view work without xsodata service? From the URL, your XS project name should be Project_DM, but from the xsodata source, the project name is EricssonItalgas. I'm confused with this. Did you use rewrite_rules or?
    Best regards,
    Wenjun

  • HANA Analytical View Display Data Issue

    SAP Experts,
    Need your kind help for the below issue,
    I've created an analytical view from a DSO Active Table in HANA Studio. Through IDT (Information Design Tool), when I tried to view the contents of this DSO table (AYPURDA0100) by connecting to HANA, I see the following error which is mentioned below,
    Error:
    Error while refreshing the data provider.
    Cause of Error:
    SAP AGSDBODBC DLLHDB General error;7 feature not supported: cannot execute select * on olap cube: zthd/AYPURDA0100: line 1 col 26 (at pos
    Note: The AYPURDA0100 table contents are displayed in HANA Studio. However when a view was created with NO join conditions for the same table with few selected fields including measures, the display data is not working.
    Your views are greatly appreciated. Thank You in advance

    Check out the comments from Marc and Lars in the thread below.
    http://forums.sdn.sap.com/thread.jspa?forumID=491&threadID=2138937

  • Best Approach for Reporting on SAP HANA Views

    Hi,
    Kindly provide information w.r.t the best approach for the reporting on HANA views for the architecture displayed below:
    We are on a lookout for information mainly around the following points:
    There are two reporting options which are known to us and listed below namely:
    Reporting on HANA views through SAP BW  (View > VirtualProvider > BEx > BI 4.1)
    Reporting on HANA views in ECC using BI 4.1 tools
            Which is the best option for reporting (please provide supportive reasons : as in advantages and limitations)?
             In case a better approach exists, please let us know of the same.
    Best approach for reporting option on a mixed scenario wherein data of BW and HANA views is to be utilized together.

    Hi Alston,
    To be honest I did not understand the architecture that you have figured out in your message.
    Do you have HANA instance as far as I understood and one ERP and BW is running on HANA. Or there might be 2 HANA instance and ERP and BW are running independently.
    Anyway If you have HANA you have many options to present data by using analytic views. Also you have BW on HANA as EDW. So for both you can use BO and Lumira as well for presenting data.
    Check this document as well: http://scn.sap.com/docs/DOC-34403

  • What are the different types of analytic techniques possible in SAP HANA with the examples?

    Hello Gurus,
    Please provide the information on what are the different types of Analytic techniques possible in SAP HANA with examples.
    I would want to know in category of Predictive analysis ,Advance statistical analysis ,segmentation analysis ,data reduction techniques and forecast techniques
    Which Analytic techniques are possible in SAP HANA?
    Thanks and Regards
    Sushma C Narasimhamurthy

    Hi Sushma,
    You can download the user guide here:
    http://www.google.com.au/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0CFcQFjAB&url=http%3A%2F%2Fhelp.sap.com%2Fbusinessobject%2Fproduct_guides%2FSBOpa10%2Fen%2Fpa_user_en.pdf&ei=NMgHUOOtIcSziQfqupyeBA&usg=AFQjCNG10eovyZvNOJneT-l6J7fk0KMQ1Q&sig2=l56CSxtyr_heE1WlhfTdZQ
    It has a list of the algorithms, which are pretty disappointing, I must say. No Random Forests? No ensembling methods? Given that it's using R algorithms, I must say this is a missed opportunity to beat products like SPSS and SAS at their own game. If SAP were to include this functionality, they would be the only BI vendor capable of having a serious predictive tool integrated with the rest of the platform.... but this looks pretty weak.
    I can only hope a later release will remedy this - or maybe the SDK will allow me to create what I need.
    As things stand, I could built a random forest using this tool, but I would have to use a lot of hardcoded SQL to make it happen. And if I wanted to go down that road, I could use the algorithms that come with the Microsoft/Oracle software.
    Please let me be wrong........

  • Defining a recursive view in SAP HANA

    Hi All,
    Currently SAP HANA does not support defining recursive views as already mentioned in Tals discussion as per the following link:
    Defining a recursive view in SAP HANA
    I would like to ask again if this limitation is still exist in latest SAP HANA version or not?
    Some background:
    In our MDM product we can create a hierarchy tables which organizes information in a hierarchy where each record is related to a parent record and may also be related to sibling records and/or child records.
    On other hands, MDM product generates database views that are saved as database queries representing MDM data. Currently HANA limitation prevents creating a database view on top of hierarchy database tables.
    Lars Breddemann
    Best regards,
    Ahmad

    Hi Ahmad,
    just as I mentioned in BOM explosion there is a feature available in SAP HANA (column view type hierarchy aka hierarchy views) that is used (SAP-) internally.
    AFAIK there are some ideas to make this available via SQL, but I don't know when or how this functionality will make it into the standard product.
    Ruediger Karl the core HANA PM might be able to answer that.
    Until then, you might be better off contacting SAP HANA development about possibly using hierarchy views for your development.
    - Lars

  • SAP HANA Live Views for ERP

    Hi Experts,
    We are planning to implement SAP HANA Live for ERP operational reporting, I saw there are 786 views delivered with this which includes -
    1) Query views
    2) Reuse Views
    3) Private Views
    Query views always contains the word "Query" at the end of the view name which helps in identifying it but I am unable to distinguish between reuse and private views. Can anyone tell me how do we distinguish whether a view is a reuse view or a private view?
    Thanks in anticipation.
    Regards,
    Victor

    Hi Ramakrishnan
    How do you get access to the 'VDM properties' Tab ?
    I don't have it on my own HANA Studio.
    I guess this tab is also the good one to assign a view to the proper product/ module hierarchy in the HANA Live Browzer.
    Currently, all my custom view fall into the "N/A - Undefined" section, which is highly frustrating !
    Is this view dedicated to SAP developpers?
    Otherwise do you know how to get access to it.
    Thanks.
    Best Regards
    Stephane

  • Creating Logic and modeling for SAP BW datasource in SAP HANA views and SLT

    Hi to all,
    I have small question.
    We have BW system and SAP ECC as source system and to get data from SAP ECC source system we are using SAP ECC Standard data source.
    Now we required to, create modeling in SAP HANA by use of HANA View and get data from SAP ECC source table via SLT.
    So we can replicate same modeling,as we done in SAP BW system.
    But  my question is that, as SAP ECC standard data source hit multiple table and do run-time calculation, before sending to SAP BI.
    How we can derives such calculation and logic, in our HANA studio, because as we know in SLT data transformation can be done in limited way also
    in view we can not drive such logic via SQL script ?.
    Is there any way we can do such modeling and logic in SAP HANA ?
    or
    is there any standard document for this type of case, which we can use ?
    Note: We don't want to use SAP DS or DXC for data loading to HANA, as  we want it in more real time.
    Regards
    Pavneet Rana

    Thanks for reply,
    As SLT is based on ABAP, so we can write complex logic in it.
    But if we talk about SAP ECC standard data source, they have complex logic, based on multiple table.
    So we need to write code from scratch in SLT to derive same result. but it will be huge time consuming , and required good ABAP skills, also it will lead to bug in code.
    Also it will reduce the real time performance of SLT, due to complex logic.
    Second option is procedure via SQL script, which is again huge effort in term if logic and can lead to error/bug in logic.
    Does we have any other way or architecture to do this is very simple way, with high performance and less error issue.
    Regards
    Pavneet Rana

  • SAP HANA Live View - VDM Online Documentation

    Hello Experts,
    I am interested in using SAP HANA Live View for CRM, we are experiencing difficulties in installing SAP HANA Live Browser. Is there a  documentation for the VDM available online? Just like BI Content, there are documentation available online where we could see the technical details like the infoobjects, mapping etc.
    Regards,
    DaSaint

    Hi,
    Did you try checking this link https://help.sap.com/saphelp_hba/helpdata/en/9c/382618453244d8aaa9e460a77f5de0/frameset.htm Thanks & Regards   A.Dinesh

  • Getting error for Analytic Views data preview on HANA Studio

    Hello
    I have multiple Analytic Views and when trying for data preview, those all are throwing error as "Object Not active or broken" (attached below). I have activated these objects 5-6 times and got successful message but unable to data preview.
    Other persons in team and from different machine using my user id can run data preview successfully, so something problem with my PC. Already I have uninstalled - restart PC and reinstall 3 times for HANA Studio and HANA Client software but problem not solved. During re-installation, I found its getting my previous settings like system details etc. already populated. Even I installed in different folders, however problem not solved and system details automatically received on next start.
    Please guide me to solve this problem
    Below error coming while trying for data preview.
    Thanks
    Suman

    Hi Suman,
    Can you change your system workspace and also the secure storage.
    It can be done via a parameter in the shortcut of studio in the Target field after the exe write
    -data "<WorkspaceLocation>" -eclipse.keyring "<AnyLocation>"
    While usually this is a server error, it should be studio specific.
    Nevertheless, do the above settings and let me know your results.
    Regards,
    Anjali.

  • HANA Live Content views column mapping to SAP tables document | SAP HANA Live for SAP ERP Finance Reports | Hana Live RDS

    I am searching for HANA Live Content views column mapping to SAP tables document. Please let me know where can I find it.

    Hi Srinivas,
    I guess this is the same question as the one about the SD content, so my answer is the same:
    if you have access to the HANA Live RDS documentation which comes as part of the so called Step-by-Step Guide you can find a document RDS_SHL_HANA10V5_Technical_Content_Mapping_EN_XX.xls in the folder structure. To get to this file you need to drill down this path:..RDS SBS Guides\HANA Live\V5\Serv_Enabled\RDS
    In that file you find all the tables used in all the RDS content.
    Regards
    Miklos
    Solution and Knowledge Packaging
    SAP Labs

  • When will the SAP Mobile BI Android SDK to embed analytic views (Web Intelligence reports and Dashboards) in custom mobile Android App be supported/

    hi all,
       SAP Mobile BI IOS SDK provides such SDK to embed analytic views (Web Intelligence reports and Dashboards) supported by the SAP BI application inside your own custom mobile applications, while Android SDK does not provide such sdk. I would like to know if there is any plan or roadmap to support this interface in Android SDK?

    Thank you Vishwanath for your reply. We already developed an Android App, and just want to embed and open SAP BO report directly inside our own App, instead of launching SAP Mobile BI App.

Maybe you are looking for

  • Miro: When enter op number,fill a special value into  SGTXT automatically

    Hi guys    When user inputs the PO number, PO description will be filled into the field TEXT on the line item automatically. So user can view it   After my testing again and again, I did not find there is an optional user exit or badi(listed below) t

  • Request List

    Ability to add additional applications (such as word, powerpoint, etc, and possibly even custom) Share/Send with/to co-workers Send an email invite, or link into an already active member giving them the option to join project Export to PDF Perhaps an

  • Working With iTunes

    Sorry if this isn't the right forum for this question - I'm a newbie. When I import a CD into iTunes I can't enter any info in the Artist, Genre, etc columns. Any clues for me? Thanks! jeajo

  • Creating user with -S mail also gives him cal

    Hi, Using J ES 2005Q4 unpatched. Creating a user with commadmin and flags -S mail also gives him access to the Calendar Tab in UWC ! 1. Is their a default for commadmin command that enables -S cal even when it is not on the command line ? 2. How to m

  • How do you change the fan speed (rpm)

    On a mac, how do you change the fan speed to 7200 or something?