AMDP Method
AMDP Method
To create an AMDP method, you need to declare it in the implementation part of the
class using the addition BY DATABASE PROCEDURE of the statement METHOD. At the same
time, the database system where the method is used and the programming language of
the database system used to implement the method are also defined .
The SQL Script language is used to write code inside AMDP methods, which is a
database language similar to SQL script. This language is easy to understand and
code. After coding logic inside AMDP method, you can consume it in ABAP report,
or use AMDP same as delegate method in CDS table function .
However, there are some limitations to AMDP. For example, we can only create and
debug AMDP in ADT bundle or HANA studio. With AMDP, we can’t use MSEG
table. So, we can use MATDOC table or proxy object (NSDM_V_MSEG) instead.
Data type of parameter must be table or scalar type (Int, char,…). With select-option
parameters, we must convert to string value by using method
cl_shdb_seltab=>combine_seltabs at ABAP program, then pass it to parameters. After
that, we will use APPLY_FILTER to filter this condition inside AMDP method.
AMDP does not handle automatic client. You need to add client as parameter value or
using SESSION_CONTEXT (‘CLIENT’) in where condition. Sometimes, the system
will catch syntax error with SD table, in this case, you need to select from table with
alias name instead .
It enables the shipment of AMDP in the same way as any other ABAP
development object (lifecycle management) 1.
It provides tight integration between ABAP and HANA development, without
requiring additional HANA development tools 234.
It supports the top-down approach of developing SAP HANA DB procedures
on the ABAP platform, and allows easy transport via HTA container (HANA
transport for ABAP) 23.
It offers better performance and scalability by leveraging the SAP HANA
features and capabilities 14.
If you want to learn more about AMDP, you can check out the following resources: