Consume HANA Procedure in XSODATA Service

Hi Experts,
I created on procedure with out output table parameter with "WITH RESULT VIEW" on the same.
When I am executing the procedure in the console , I am getting the result as expected. Can I expose the service as OData via XSODATA ? Or do I need to create XSJS or Scripted Calc View ? Procedure is taking one mandatory input parameter .
Regards
Sreehari

Here is an example from SHINE.  The Call is basically the same in the scripted calculation view. Main difference is the output parameter gets named instead of the ?.  In the SHINE example we have some intermediate SQL and then pass that result into the input of the procedure as well.
/********* Begin Procedure Script ************/
BEGIN
  var_rank =
  select company_name, region, sales, orders, sales_rank, order_rank from(               
            select  "CompanyName" as company_name, "Region" as region, sum("NETAMOUNT") as sales, count("SALESORDERID") as orders,
           dense_rank() over ( order by sum("NETAMOUNT") desc ) as sales_rank,
           dense_rank() over ( order by count("SALESORDERID") desc ) as order_rank
               from "sap.hana.democontent.epmNext.models::AN_SALES_ORDER_RANKING"
               where date_sql between :IP_FR_DTE and :IP_TO_DTE
                 and "Region" = :IP_REGION
               group by "CompanyName", "Region"
               order by sales_rank, "CompanyName"
  where sales_rank < 11;  
CALL "_SYS_BIC"."sap.hana.democontent.epmNext.models/DT_CUSTOMER_DISCOUNT_CALCULATION" (:var_rank, var_out);
END /********* End Procedure Script ************/

Similar Messages

  • How to call a Stored procedure from xsodata service?

    Hi Everyone,
    I have created an stored procedure and I'm trying to consume this store procedure from xsodata service.
    But unable to activate the service because of an error.
    Invalid procedure or parameter list in procedure "package.WebContent.src.hana.procedures::PROCEDURE
    I have activated both store procedure as well as attribute view.
    Here is my stored procedure.
    PROCEDURE "SCHEMA"."package.WebContent.src.hana.procedures::PROCEDURE" (
    IN row "SCHEMA"."package.tables::object" )
      LANGUAGE SQLSCRIPT
      SQL SECURITY INVOKER AS
      --DEFAULT SCHEMA <default_schema_name>
      --READS SQL DATA AS
    BEGIN
      Write your procedure logic
    declare shortdesc string;
    SELECT SHORT_DESCRIPTION INTO shortdesc FROM :row;
    END;
    Service:
    service namespace "package.WebContent.src.hana.service"{
    "package/OBJECT.attributeview" as "OBJECTS"
    key ("OBJECT_ID")
        create using "package.WebContent.src.hana.procedures::PROCEDURE";
    Is there anything wrong in the way i'm calling the procedure??

    Hi Arjun,
    You can expose the procedure as an Odata Service if you wrap it in a Scripted Calculation View..
    Firstly You will have to create a Scripted Calculation View from the Modeller perspective.
    Below is an example I just tried.
    Add Columns & Input Parameters
    Consume this Calc View in your Odata service :
    service namespace "services.test"
    "pda.Models::CV_TEST" as "Customer"
    keys generate local "ID"
    parameters via entity;
    Check your service by Passing the Input Parameters
    http://<host>:<port>/<>/services/test.xsodata/CustomerParameters(2)/Results?$format=json
    Hope this was Helpful
    Regards,
    Avinash Raju

  • 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

  • How to call a write procedures which has output parameters in an xsodata service?

    Hi,
    I have a use case where we call a Stored procedure from an xsodata service, where in I also need some output from procedure.
    We couldn’t achieve this because whenever I pass some output from my procedure , framework is considering the response as an error always.
    Looks like we cannot pass back any values apart from errors.
    Since we are doing some insert statements in our procedure I couldn't even wrap the procedure using calculation view
    because from calculation view we can call only call only read only procedure.
    What is the right way of calling a write procedure which returns some output always apart from error from an xsodata service?
    Thanks and Regards,
    Arjun

    Another suggestion Arjun,
    you said you have a writeable procedure with you, which will return a result set after the processing. You split the procedure into two, one writeable and one read only, so that the writeable will update the data, and read only procedure would return the required result set. The, use xsjs to call the writeable, and use xsodata to call the read only procedure(complicate it man ). 
    Sreehari

  • How to Call HANA Procedure in ABAP

    Hi Everyone,
    I am new to ABAP
    I have created a procedure in HANA that accepts two input parameters and outputs a table
    I am using HANA as a Secondary Database
    How can I call this procedure in my ABAP program?
    Regards,
    Vivek

    Hi Vivek,
    depends on how you would like to call it :-)
    1. Use native SQL to call the procedure (see report ADBC_DEMO_PROC_CALLS_HDB; available in any system with a minimum NetWeaver release 7.40 SP5).
    2. Create a DB Procedure Proxy and call the DB Procedure Proxy (Tutorial: How to consume SAP HANA Procedures in ABAP; only "directly" available if HANA is the primary DB underlying your system, for secondary DB system see discussion Execute Procedure with input parameters as table from ABAP).
    3. (Method of choice available as of NetWeaver 7.4 SP5): Create an ABAP managed DB procedure (instead of the native HANA procedure) as described in ABAP Managed Database Procedures - Introduction
    Cheers,
      Jasmin

  • Consuming HANA views using ABAP

    Hi Experts,
    We have ABAP reports in ECC which is taking very long time to process it. So we decided to push down the complex logic to HANA where ever it is taking long time to fetch data.
    We have standalone HANA System. So can we use HANA as secondary database??? If yes, how can i consume HANA views in ABAP reports??
    Can some one guide me.
    Thanks in advance.
    Best Regards,
    Krishna.

    Hi Sundar,
    Thanks a lot for your valuable inputs.
    You need to access the native HANA artefacts (like HANA information views) from your ABAP system using native SQL and ADBC in case HANA is not the primary DB.
       - If i want to pass values to the views can we use HANA input parameters in this case as a PLACE HOLDER       in Native SQL??? else do i need to create a procedure for it???
    Basically ABAP team is optimized the code but still we are hitting with performance. So we want to utilize existing HANA databse as secondary db to push down the complex logic to HANA.
    Best Regards,
    Krishna

  • How to access Fiori App Content (consuming HANA Live models) directly from XS in HANA?!

    Hi,
    Can someone please provide more information on how to use the Fiori Content directly on HANA?!
    Is there any Delivery unit which bundles the Fiori content, importing and deploying of which allows to create a Fiori App?! If no,
    Then could you please provide the guidelines for adding ABAP front end server on HANA to run the UI part?!
    And for the latter case, will the requirement of the UI be rendered by ABAP front end server with the  XSODATA service provided by XS layer and the business logic computation taken care  by Indexserver?!
    Thanks a lot in advance,
    Poorna

    Hi Poorna,
    Please look at Installation of SAP Smart Business Products on SAP HANA Server - SAP Fiori for SAP Business Suite - SAP Library.
    Regards, Masa
    SAP Customer Experience Group - CEG

  • Post blob content via xsodata service

    Hi All,
    I would like to know if it is possible to post a blob object to an xsodata service.
    Requirement
    I have a table which has few string fields and a edm.binary field which is supposed to hold a file object which has been exposed as xsodata service. Now I need to make a post entry to this table, using xsodata service from my UI5 based application. I know I can achieve this using xsjs service but I would like to know if this is possible with xsodata.
    I believe it could be done if we can model it as a media link entity and then use the ../$value endpoint to get the media link entity (which would also support Post/Put/Delete operations).
    Is this feasible? Or is there any other way of achieving the same?
    Any inputs in this regard would be of great help.
    TIA.
    Regards,
    Suhas

    As I understand:
    The procedure works.
    The link 'appears' to work. (ie you saw the procedure run a 2nd at the database level)
    But it doesn't actually work (because you get a 404)
    I think I ran into an issue, on a completely different page type, that produced an 'error 404'. (I can't seem to reproduce it, though)
    The only way I discovered what was really going on was with an HTTP sniffer. (eg HTTPFox for FireFox)
    Through that, I noticed that the browser was (for some reason) calling a completely non-sensible APEX page. (hence the PAGE NOT FOUND error)
    My solution was to add a "submit to self" branch point.
    If that doesn't work, I'm at a loss.
    MK

  • Xsodata service redirecting to sap account page.

    Hello All,
    whenever i m trying to access .xsodata service, its redirecting to sap account page.
    instead of this is it possible to take username and password from popup, and then it will display data directly.
    i don't want to redirect to sap account page again n again.
    and yes i don't want to remove the authentication part from odata service.

    Hi Thomas,
    Yes we are running the UI5 application and HANA from the same system,
    When we try to get the odata services with basic auth , it is redirecting to the sap login page (HTML) even if we are logged in a different tab to the scn account
    we are calling like this
    var oModel2 = new sap.ui.model.odata.ODataModel("proxy/https/s3hanaxs.hanatrial.ondemand.com/pxxxxxxxxtrial/dev/test/projects.xsodata/LISTS", false, "username" , "password"
    and in the console we get the error
    The following problem occurred: Invalid metadata document200,OK, <!DOCTYPE html><html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    and the full html page
    Also in the trial instance how will the path of xsadmin be?
    the application path is
    https://s3hanaxs.hanatrial.ondemand.com/pxxxxxtrial/dev/test/

  • How to use Batch operation for two xsodata services?

    Hi All,
    I have two xsodata services. How to use submit batch for two xsodata services
    Thanks,
         Mj

    Gateway Batch Calls from SAPUI5

  • How to restrict number of column exposed by xsoData service at runtime

    Hi All,
    I have created one xsoData service over calculation view (imported one BW cube).
    I want to expose few characteristics of cube and a key figure.
    I want to decide this key figure at run time,means if i have say three key figures say quantity, cost and revenue apart of my characteristics.
    when i run this service, i should be able to pass key figure name for which i want to see data.
    Can i have a variable for column name for this purpose and how i can pass it its value ?
    Please suggest.
    Regards,
    Rohit

    Hi Thomas,
    Thanks for the reply.
    I have already used to restrict the number of columns using 'WITH' keyword.
    Say there are 10 characteristics and 10 keyfigures in my calculation view.
    Out of which i have exposed 3 chars and 3 KFs using 'WITH' keyword, for keyfigures i want to have one variable or placeholder in my xS ODATA  service whose value i want to pass from UI( through XS service URL).
    So my service should fetch 3 Characteristics and a keyfigure say qty or cost or revenue.
    Please let me know if anything is still not clear.
    Regards,
    Rohit

  • Trying to call HANA procedure via ABAP

    Hi everyone,
       I am using ABAP in Eclipse in order to call a HANA procedure within a BPC process chain. While referring to an SCN blog written by Baris Cekic, I have put together a working ABAP Class. This works as my proxy to a functioning HANA stored procedure. My issue is with the ABAP program I am using for the process chain. I believe that I'm passing my input parameter using the wrong format. Please bear with me, as I am not an ABAP programmer! Any help would be much appreciated! Please take a look at the screenshots. Thanks!
    ABAP CLASS - ZCL_BPC_AMDP:
    HANA PROCEDURE - ZPROC_BPC_AMDP:
    ABAP PROGRAM - ZBW_BPC_AMDP:
    This is my issue!! -----> INPUT of SP Name: (I've tried with and without the schema):
    ABAP PROGRAM ERROR:

    Hi Anand,
    you should preferentially use "NVARCHAR" instead of the non-unicode derivate "VARCHAR". As ABAP supports both unicode and non-unicode systems, we only allow the mapping of Strings/character literals from ABAP to NVARCHAR variables in HANA in all ABAP on HANA systems.
    Please find an example of a _SYS_BIC procedure in an AMDP in class CL_EPM_OIA_SIMP_BP_CLSF_AMDPDT (method AMDP_GET_BP_CLASSIFICATION). Should be available in your system.
    And you can additionally try to execute the call you put into the AMDP directly in the HANA SQL console.
    Cheers,
      Jasmin

  • HANA Procedure with parameter in create part

    Hi!
    I have a problem with creating a HANA procedure. My procedure looks like this:
    CREATE PROCEDURE myProcedure
    ( IN ToDate TIMESTAMP)
    LANGUAGE SQLSCRIPT AS
    d1 TIMESTAMP;
    BEGIN
    d1:= :ToDate;
    CREATE LOCAL TEMPORARY TABLE #Avst AS
    ( SELECT *
    FROM ITR1 A1
        INNER JOIN OITR A ON A."ReconNum"= A1."ReconNum"
    WHERE A."ReconDate"<= :d1
    SELECT * from #Avst;
    DROP TABLE #Avst;
    END
    The communicate I get is:
    SAP DBTech JDBC: [467]: cannot use parameter variable: D1: line 4294967295 col 4294967295 (at pos 4294967295)
    Can someone help me with that?
    Thanks
    Jadia

    Hi Krishna!
    Thank you for reply. However, the code does not work, unfortunately. I have a message:
    Could not execute 'CREATE PROCEDURE myProcedure ( IN ToDate TIMESTAMP) LANGUAGE SQLSCRIPT AS d1 TIMESTAMP; BEGIN ...' in 1 ms 697 µs .
    SAP DBTech JDBC: [257] (at 214): sql syntax error: incorrect syntax near "Insert into #Avst (SELECT * 
    FROM ITR1 A1  
        INNER JOIN OITR A ON A."ReconNum"= A1."ReconNum" 
    WHERE A."ReconDate"<= :d1)": line 9 col 11 (at pos 214)

  • How to consume sap xi pi web services or sap RFC with oracle 11g forms.

    Dear All
    how to consume sap xi pi web services or sap RFC with oracle 11g forms.
    or
    how to config 11g forms with sap xi....
    or how to call sap xi web services in 11g forms....
    or can send sample code....
    Regards
    smfatmi
    Edited by: smfatmi on Oct 17, 2011 2:16 AM
    Edited by: smfatmi on Oct 17, 2011 2:17 AM

    Dear All
    how to consume sap xi pi web services or sap RFC with oracle 11g forms.
    or
    how to config 11g forms with sap xi....
    or how to call sap xi web services in 11g forms....
    or can send sample code....
    Regards
    smfatmi
    Edited by: smfatmi on Oct 17, 2011 2:16 AM
    Edited by: smfatmi on Oct 17, 2011 2:17 AM

  • Publish PL/SQL procedures as web services?

    I am investigating JDeveloper for possible use in a project we are starting. We already have existing PL/SQL Procedures that we want to use and I have done a prototype using XSQL and OWA in JDeveloper 9i Candidate version. I am trying to figure out what the changes and improvements are in the most recent version of JDeveloper. On this page http://technet.oracle.com/products/jdev/htdocs/jdev903_fo.html#web_services it says there is broader support for Publishing PL/SQL procedures as web services. Is there any more information out there on this? What exactly has been improved and what are the current limitations. I did find some documentation in the Oracle9i Application Server Developers Guide on the limitations (release 2 (9.0.2) http://download-west.oracle.com/docs/cd/A97329_01/web.902/a95453/plsqlservices.htm#1030066 Do I assume this is the same limitations for JDeveloper since the Oracle9iAS included with it? I am getting confused by all this documentation.
    Thanks for any help
    Natalie

    Natalie,
    Please take a look at the tutorials on
    http://otn.oracle.com/tech/webservices/database.html
    Also, read the Web Service discussion forum where you will find some useful hints. Using 9.2.x DB, OC4J 9.0.4 and JDev9.0.3.1 it is really funny to start publishing PL/SQL as Web Service.
    Flemming

Maybe you are looking for

  • Questions on Logical corruption

    Hello all, My DB version is 10g+ - 11.2.0.3 on various different OS.  We are in process of deploying RMAN on our system and i am having a hard time on testing/get a grip around the whole logical corruption... from what i understand(please correct me

  • Lightroom 5 is quite slow in importing photos

    Lightroom 5 is quite slow in importing photos from a memory card connected to a reader using USB 3.0! After installing LR5, I didn't change any default settings. Interestingly, this wasn't found in beta testing. LR4 was what I call quick or snappy. B

  • Message bar in form6

    hi, my messsage bar i.e. where the results of "message('place message on bar')" are shown , is not showing all of a sudden. This has happened before but I can not remember how I corrected it. Any ideas on this please. thanks. n.

  • Mac Book Pro fans

    I have a two month old MacBook Pro and lately I've been having strange fan issues.  I'm not doing anything and the fans ramp up to over 5000 rpm's and don't shut down.  Sometimes they'll ramp down if I put the computer in sleep.  Goes on for a long t

  • Create multiple users

    Hi, I would like to create multiple users from my Table Users (Username & Passwords) instead to pass by the express Application Users from apex. I have like 100 users, it will take so long to create with apex. Is anyone know the sql code to create th