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: 
amol_samte
Contributor

Hi Folks,

I came across a situation like to trigger DB procedures with having importing and exporting parameters from ABAP layer via ADBC API.

Hence I am presenting below blog which might be useful :smile: .

Before moving forward below is the link which is holding information about ADBC

ABAP Keyword Documentation

Important points : 1. Check whether secondary DB connection maintained or not with appropriate rights.

                           2. If created then test the connection working or not with program ADBC_TEST_CONNECTION.

Scenario: 1. We have created DB procedure on HDB with holding number of importing parameters and single string exporting parameter and same needs to be called in ECC system.

Steps :

1. Establish the connection to HDB and instantiate the connection object with connection name

    e.g.

          go_con = cl_sql_connection=>get_connection( 'SAP_DEV' ).

         

2. Prepare the SQL string(Calling procedure string).

     e.g

          CALL SCHEMA_NAME.PROCEDURE_NAME( 'INPUT_PARA','INPUT_PARA') WITH OVERVIEW

          (Since we are getting result from procedure so we have to write WITH OVERVIEW syntax)

    

3. Get Reference of the table and prepare result set

     e.g

         GET REFERENCE OF lt_result INTO gr_data.

         (table type lt_result should be same as exporting result from procedure since we will get result in LT_RESULT )


  4. Close connection.

Sample Code :

                   

Above is an example of calling procedure with returning some values.

Any suggestion, please feel free to comment.

Regards,

Amol Samte

1 Comment
Labels in this area