Skip to Content

How to Call a HANA user Defined Function from ABAP

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

http://a248.g.akamai.net/n/248/420835/4480a17727ec60e0f163cbacdfb2929a500e4b179a07704c479d9483d8658c35/sapasset.download.akamai.com/420835/sapcom/docs/2014/04/7a7f21de-527c-0010-82c7-eda71af511fa.pdf

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

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Oct 25, 2016 at 02:36 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 27, 2016 at 08:47 AM

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

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 10, 2016 at 03:21 PM

    Thanks so much.

    Add comment
    10|10000 characters needed characters exceeded