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.
Notes
Database procedure proxies are mainly intended for use with SQLScript procedures in
SAP HANA XSC. ADT only supports proxies of this type.
In exceptional cases, the API of the database procedure proxy library can be used for reads on other
SQLScript procedures. 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.
Database procedure proxies are not suitable for SQLScript procedures in
SAP HANA XSA. Alternative methods such as
AMDP or ADBC must be used instead.
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.