Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Hi All,

Recently I had a need to create virtual procedures in a HANA Services (2.0 SP04) under CF environment using SAP HANA Web IDE on a SQL Server DB and as usual I tried to find something in help.sap.com and I found 2 documents as following:

Document 1

Document 2

But none of them were clear and direct to the point and besides there was a tricky that took some time to realize and then it motivated me to write this post and help someone else to avoid this time loss…

My problem was how to get JSON definition in format from for any procedure from any DB(in my case it was SQL Server)

The tricky regards to this procedure: "PUBLIC"."GET_REMOTE_SOURCE_FUNCTION_DEFINITION" ('remote_source','procedure',?,?,?)

When I read the first doc it led me to think this function only works when you are trying to get virtual procedure definition from SDI adapters like FileAdapter and/or it was related only to SAP environments…

Then just out of curiosity I tried to use the procedure to get the JSON definition from a test procedure I created in SQL Server side. Procedure´s name is "proc_MASSHANA_TESTE" and simply returns “1” when called.

The steps to accomplish this task are below.

1 – Print from procedure in remote source I needed to pass as input parameter…


2 – The following print shows how to call the JSON procedure definition correctly…


3 – The following prints shows parameters “from-to” and virtual procedure coding...


 

4 – After build the virtual procedure I just opened SQL console, ran the call command and checked results...


 

Hope it saves your time…

William
3 Comments
Labels in this area