cancel
Showing results for 
Search instead for 
Did you mean: 

How to Call a HANA user Defined Function from ABAP

marc_daniau
Advisor
Advisor
0 Kudos

There is a document showing how to call an HANA procedure from ABAP.

http://a248.g.akamai.net/n/248/420835/4480a17727ec60e0f163cbacdfb2929a500e4b179a07704c479d9483d8658c...

I'd like to know if we can call an HANA function (UDF) from ABAP ?

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member205436
Participant

Hi Marc,

ideally, in this case, you would not implement your UDF directly in HANA but rather implement an ABAP managed CDS Table Function. ABAP CDS Table Functions are available since SAP NetWeaver AS ABAP 7.50. You can find more details here. The advantage of using CDS Table Functions is that they are optimally integrated into the ABAP lifecycle management and the ABAP runtime.

If you need to call an existing UDF and don't want to migrate it to an ABAP CDS Table Function, then I would still suggest to wrap the UDF with an ABAP CDS Table Function or ABAP Managed Database Procedure (see here). You will still have to sychronise the lifecycle of the UDF (HANA managed) and CDS Table Function (ABAP managed) yourself, but with this wrapper you won't have to implement native SQL, e.g. ADBC, in your ABAP programs to call the UDF. ABAP CDS Table Functions can be used in OPEN SQL statements and also be called in the SQL Script of ABAP managed AMDPs. AMDPs can be called as ABAP methods in ABAP programs.

Kind regards

Chris

marc_daniau
Advisor
Advisor
0 Kudos

Thanks so much.

marc_daniau
Advisor
Advisor
0 Kudos

Thanks Christian. Would you recommend the same approach wih a scalar HANA function returning a single value ?