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
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.
1. Establish the connection to HDB and instantiate the connection object with connection name
go_con = cl_sql_connection=>get_connection( ‘SAP_DEV’ ).
2. Prepare the SQL string(Calling procedure string).
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
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.