AMDP - ABAP Manage Database Procedure
AMDP – ABAP Managed Databased Procedure
ABAP Managed Database Procedures, is a procedure, we can write code inside AMDP by using SQLSCRIPT which is a database language same as 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.
With AMDP, We can take advantage of new features of HANA (code push-down technique), hence we still code all logic on application layer, then this logic will be executed on the database layer.
AMDP is only supported in ADT bundle or HANA studio, and don’t be supported in SAP GUI. So if you want to learn AMDP, please change IDE to ADT bundle instead SAP GUI.
Besides HANA DB, AMDP can support many other DB, maybe in the future. So, at this time, we can only use it in HANA DB
Limitations of AMDP
We can only create, 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. (I don’t know another system, but in my system, when transport TR to staging environment, it always catches syntax error
- An AMDP is implemented in an AMDP class with a regular static method or instance method in any visibility section. The editing environment for AMDP is the ABAP class editor.
- The AMDP class must contain the appropriate tag interface. IF_AMDP_MARKER_HDB is Marker Interface for DB Procedures.
- In Class Definition provide interface IF_AMDP_MARKER_HDB.
- Define the table type TT_ORDER and structure type TY_ORDER.
- Define the method GET_SALESORDER_DETAILS (Method parameters should be Passed by value).
Activate the AMDP Class and check the created class in Transaction SE24
Comments
Post a Comment