AMDP (ABAP Managed Database Procedures)
18. November 2020
With the ABAP Managed Database Procedures, or AMDP for short, SAP succeeds in making the performance of the SAP HANA database in ABAP developments easy to use. This is a framework that now includes not only SQLScript procedures, but also functions and also allows the creation of views programmed in SQLScript with the CDS-Table Functions.
On this page I have compiled some useful Information to this topic.
- Excerpts from my german book SQLScript für SAP HANA, SAP PRESS
- An example of BW AMDP transformation routines (German)
- SAP Documentation
Use cases of AMDP
The AMDP technology is used for different scenarios. Probably the most important is the useage in SAP BW/4HANA:
AMDP for SAP BW/4HANA Transformation Routines
With the BW on HANA, SAP has re-implemented the execution of data transfer processes (DTPs). Directly on the HANA database. This has brought an enormous acceleration and reduced the runtime by a factor of 10. A prerequisite for this HANA execution, however, is that no ABAP routines are used in the transformations.
The alternative to ABAP routines are procedures in SQLScript. These are developed as AMDP methods. The structure of these classes and methods is generated by the BW system to match the definition of the transformation. The developer then has to develop the SQLScript code. There is no need for a deeper understanding of the definition of database procedures.
AMDP in ABAP programs
The use of SQLScript is especially useful when
- there are large amounts of data, and
- the execution time is relevant.
Both are given in SAP BW, which is why AMDP plays a major role here. But when these factors also apply to an ABAP program, then we can also use SQLScript via AMDPs. Either to run procedures directly on the database. These can have read and write access to tables.
Or in the form of CDS-Table Functions as programmed views. These are implemented in SQLScript as a function. A CDS entity then serves as a wrapper to make it available to ABAP programs. They can be used there like a DDic view in a SELECT query.
An other use case could be the access to other database schema of your underlying HANA System. You can query them without problems from AMDP-Procedures, as long as the ABAP-DB-User (mostly SAPHANADB) has the required privileges.
The AMDP topic is interesting for all ABAP developers. Many use cases can be solved very performantly and elegantly. But a good knowledge of the SQLScript programming language is required.