Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Processing External Data →  ABAP Database Access →  ABAP and SAP HANA →  Access to Objects in SAP HANA XS →  Access to SAP HANA XSC Objects →  Database Procedure Proxies for SQLScript Procedures in the SAP HANA Repository 

Database Procedure Proxy

For each standalone SQL Script procedure in the SAP HANA database, database procedure proxies can be created as repository objects in ABAP Dictionary. This makes it possible to address the database procedure in the statement CALL DATABASE PROCEDURE. A database procedure proxy can be created as follows:

  • Using an API in the database procedure proxy library. This makes it possible to create and delete database procedure proxies for SQLScript procedures from any database schemas. The API is based on objects from the class CL_DBPROC_PROXY, accessed using the interface IF_DBPROC_PROXY_PUBLIC_API. A API of this type is created using the factory method GET_PROXY_PUBLIC_API from the factory class CL_DBPROC_PROXY_FACTORY. A further factory method, GET_PROXY_QUERY_API, makes it possible to create another API, which is used to get information about SQL Script procedures and database procedure proxies.

The database procedure proxy defines the mapping between the database types of the parameter interface of the SQLScript procedure and ABAP data types. The following table lists the currently supported HANA-specific data types and indicates which ABAP Dictionary types they are mapped to by default.

HANA Type Meaning Type in ABAP Dictionary
SMALLINT 2-byte integer INT2
INTEGER 4-byte integer INT4
BIGINT 8-byte integer INT8
DECIMAL Packed number DEC
SMALLDECIMAL Packed number DEC
FLOAT Binary floating point number FLTP
NVARCHAR Unicode character string CHAR
VARBINARY Byte string RAW
BLOB Byte string RAWSTRING
NCLOB Unicode character string STRING

The default mapping can be overwritten, but this also modifies the parameter names. A database procedure interface is generated for each database procedure proxy. Appropriate ABAP types are declared in this interface.

Other versions: 7.31 | 7.40 | 7.54


Notes

  • More specifically, database procedure proxies can be created for SAP HANA XSC SQLScript procedures in the SAP HANA Repository. No database procedure proxies can be used, on the other hand, for SQLScript procedures in SAP HANA XSA. Alternative methods such as AMDP or ADBC must be used instead.

  • In exceptional cases, the API of the database procedure proxy library can be used to access SQLScript procedures that are not managed in the SAP HANA Repository. The interfaces and classes from the database procedure proxy library are documented in Class Builder. They are accessed most easily from the factory class CL_DBPROC_PROXY_FACTORY.

  • If, when mapping parameter types between database types and ABAP types, a reference is made for the latter to data types of ABAP Dictionary and the dictionary type in question is modified at a later time, the database procedure proxy cannot be generated automatically. This can cause database inconsistencies. In cases like this, the database procedure proxy must be generated again explicitly.

  • ABAP Managed Database Procedures (AMDP) do not need any database procedure proxies and can be used whenever SQL Script procedures are created only for calls from ABAP and the standard database of the current AS ABAP is an SAP HANA database. Any SQL Script procedure can be called from AMDP, which means they can replace database procedure proxies (except when a secondary connection is needed to access an SAP HANA database).

  • It is possible to create database procedure proxies for database procedures managed by AMDP, but this is not a good idea.

Executable Example

The example Database Procedure Call uses a database procedure proxy created in the program to call a database procedure from the SAP HANA database created using ADBC.