SAP AMDP



Get Example source ABAP code based on a different SAP table
  



ABAP Managed Database Procedures (AMDP)
ABAP Managed Database Procedures are a framework for managing and calling
stored procedures or database procedures and
database functions
in AS ABAP. Accordingly, the ABAP Managed Database Procedures manage
AMDP procedures and
AMDP functions
A procedure or function of this type is implemented in a database-specific language (SQLScript
BEGIN_SECTION VERSION 5 OUT , L, ...
END_SECTION VERSION 5 OUT ) in an
AMDP procedure implementation or
AMDP function implementation
as an AMDP method in an AMDP class.
The following sections describe the components of AMDP:
AMDP - Classes
AMDP - Methods
AMDP - Inheritance
AMDP - Use
AMDP - Client Handling
AMDP - BAdIs
AMDP - Database Connections
AMDP Macros
AMDP - Exceptions
AMDP - Examples
Currently, AMDP only supports database procedures and functions from the SAP HANA database. In principle, however, AMDP is designed so that stored procedures and functions from other database systems can also be supported.
BEGIN_SECTION VERSION 5 OUT
The constant CALL_AMDP_METHOD of the class CL_ABAP_DBFEATURES can be used to query whether the current database supports AMDP procedures.
END_SECTION VERSION 5 OUT
There is a special release contract available to classify repository objects as stable public interface for use in AMDP: the C4 Contract for use in ABAP-Managed Database Procedures.



Latest notes:

ABAP developers or consumers do not need separate users for the database system to manage and call database procedures and database functions using AMDP. Instead, the AS ABAP logged on to the database system using its work processes requires the correct authorizations to manage database procedures and functions using AMDP. Missing authorizations can be detected using transaction SICK.
Table buffering is bypassed when using AMDP.
NON_V5_HINTS
To process database procedures and functions in AMDP methods, the ABAP Development Tools (ADT) are better suited than the Class Builder in the ABAP Workbench. Therefore, AMDP classes can only be edited with the ABAP Development Tools (ADT). AMDP classes can also be displayed in the Class Builder.
If the current database of an AS ABAP is an SAP HANA database and ABAP programs access SQLScript procedures that outsource code from ABAP programs to the database, ABAP Managed Database Procedures are the replacement technology for database procedure proxies. Database procedure proxies are still recommended when using a secondary connection to access SQLScript procedures that exist in a different SAP HANA database.
To manage and call database procedures and database functions with Native SQL, the AMDP framework uses the Native SQL interface to access the database.
ABAP_HINT_END

ABAP_PGL
The programming guideline Use AB_SQL is particularly relevant for AMDP too. The use of AMDP is not recommended if the same task can be achieved using AB_SQL (or ABAP CDS). The executable example AMDP, Comparison with AB_SQL demonstrates how a database access not programmed well in AB_SQL can often be optimized using an improved use of AB_SQL , making it unnecessary to use AMDP in these cases. AMDP should be used only if it enables access to database-specific functions that do not exist in AB_SQL (see the executable example for Currency Conversion) or if large process flows or analyses that incur repeated transports of large amounts of data between the database and the ABAP_ASINSTANCE can be outsourced.
ABAP_PGL_END