Skip to Content
Author's profile photo Amol Samte

ADBC Procedure Calls From Side Car HDB

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 🙂 .

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 :

                    Sample_code.JPG

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

Any suggestion, please feel free to comment.

Regards,

Amol Samte

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Srinivasa Mukka
      Srinivasa Mukka

      As always your blogs are awesome....