Ansicht
Dokumentation

ABENADBC_PROCEDURE - ADBC PROCEDURE

ABENADBC_PROCEDURE - ADBC PROCEDURE

CL_GUI_FRONTEND_SERVICES - Frontend Services   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

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

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

Example

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.

Example

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.

ADBC, Stored Procedure






General Material Data   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 4571 Date: 20240426 Time: 230843     sap01-206 ( 76 ms )