cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a (catalog) stored procedure directly in a xsodata file with in/output parameters

0 Kudos

I am new to XS but i managed to enable a table through xsodata:

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

  "AA465342"."TMP_HENK" as "TMP_HENK"; 

  } 

But now i am looking for code that can call a stored procedure that has 2 input- and 3 output parameters.... who can help me out with this?

View Entire Topic
vivekbhoj
Active Contributor
0 Kudos

Hi Henk,

Call this procedure inside a calculation View.

Then use this view in the xsodata service.

Also check:

Consume HANA Procedure in XSODATA Service | SCN

Regards,

Vivek

0 Kudos

Hi Vivek, thanks for the quick response!

I already found that blog, but it does not completely answer my question. i am struggling to get my content procedure working. call the R (catalog) stored procedure:

the code

/********* Begin Procedure Script ************/

BEGIN

    call "AA465342"."MO_PP_SENTIMENT"(SP_IN,SP_OUT) with overview;

END;

/********* End Procedure Script ************/

where it goes wrong:

: Only table variable is allowed in input parameter in a nested call

I have defined SP_IN and SP_OUT....

Can someone give me a clue what i have to change?

vivekbhoj
Active Contributor
0 Kudos

Hi Henk,

I have not worked with R.

But procedures support both scalar and table variables in HANA.

Is your " call "AA465342"."MO_PP_SENTIMENT"(SP_IN,SP_OUT) with overview;" working fine when calling it in sql console?

Can you try it without using WITH OVERVIEW?

Regards,

Vivek

0 Kudos

the call works fine from sql perspective

christianlechne
Active Contributor
0 Kudos

Hi Henrik,

did you check the R integration guide http://help.sap.com/hana/sap_hana_r_integration_guide_en.pdf?

In section 4.4 you find a sample call of an R procedure called by an SQLScript procedure. Perhaps that gives you a hint for your problem

BR

Christian

0 Kudos

Hi Christian,

thanks for your help but that is not what my problem is. I have succesfully created a stored procedure calling R. That piece works fine.

What i want is to offer the stored procedure as a (json/xsodata) service through hana xs. I have been able to create an xsodata that can read a hana table, now i want to turn that concept into a service that calls a stored procedure with input and output parameters

vivekbhoj
Active Contributor
0 Kudos

Hi Henik,


Can you show the definition of your sqlscript view?

Is SP_IN a table or a scalar variable?

Inside the procedure, you should call an input parameter as :SP_IN

call "AA465342"."MO_PP_SENTIMENT"(:SP_IN,SP_OUT)

You can also check this thread: