Get Example source ABAP code based on a different SAP table
ABAP_ADBC - Stored Procedures Stored procedures> can be executed using the following instance method of the class CL_SQL_STATEMENT>>
EXECUTE_PROCEDURE> The method has a mandatory input parameter PROC_NAME> of type string> to which the name of an existing stored procedure must be passed. Similar to DML statements>, it is possible to bind ABAP data objects as actual parameters to the formal parameters of the stored procedure using the method SET_PARAM >. The type of parameter must be determined using the additional parameter INOUT>. Possible values are defined in the constants C_PARAM_IN>, C_PARAM_OUT>, and C_PARAM_INOUT> of the class CL_SQL_STATEMENT>. C_PARAM_IN> is the default value. The order of the calls determines the assignment to the formal parameters from left to right.
Latest notes:
The methods SET_PARAM_STRUCT> and SET_PARAM_TABLE> cannot be used. This means that structures and internal tables cannot be bound to actual parameters. On databases where this is allowed, a stored procedure can also be called using the method EXECUTE_QUERY>>. This method makes it possible to bind internal tables to the result set. See the example below.
On the SAP HANA database>, the stored procedures are database procedures> written in SQLScript>. In ABAP, the ABAP Managed Database Procedures (AMDP)> are available for managing and calling these stored procedures. The special statement CALL DATABASE PROCEDURE>> makes it possible to access them using a secondary connection>.
EXECUTE_PROCEDURE> can be used to call procedures with input and output parameters but cannot be used to call functions with return values. In SQL, functions are used directly in suitable operand positions.
When parameters are passed, mapping > takes place between the ABAP types and the database types. The ABAP types should match the database types. If they do not match, conversions must be made in the Native SQL interface. These conversions are platform-dependent and can raise exceptions. ABAP_HINT_END
Example ABAP Coding
Use of ADBC to call an SQLScript procedure> in the SAP HANA database managed using AMDP>. Before the ADBC call, a method of the class CL_AMDP_RUNTIME_SERVICES>> must be used to ensure that the procedure exists on the database. This would not be necessary if the associated AMDP> method were used for the call. ABEXA 00819 ABAP_EXAMPLE_END
Example ABAP Coding
Call of a stored procedure of the SAP HANA database using the method EXECUTE_QUERY>>. The stored procedure is an AMDP>-managed SQLScript procedure> with a tabular output parameter. The null value is bound to the output parameter to create a temporary table> for this parameter on the database. This table then can be linked to an internal table result> using SET_PARAM_TABLE>. ABEXA 00820 ABAP_EXAMPLE_END