← Back to list

Understanding AMDP : ABAP Managed Database Procedure

Analogy: The Chef and the Restaurant Kitchen

Ruhani Garg · 2025-01-31 03:46 · 2 claps · 2.0 min read
#rap #amdp #sap #abap #hana
Open on Medium ↗
Wiki topics: 🍳 · Food & Cooking 🎵 · Music & Audio

Understanding AMDP : ABAP Managed Database Procedure

Analogy: The Chef and the Restaurant Kitchen

Imagine you own a restaurant, and you (the ABAP program) are responsible for preparing and serving food (data) to customers (users).

Traditional Approach (ABAP Processing in Application Layer)

In a regular kitchen setup, you (the chef) take orders from customers, bring all the raw ingredients from the storage (database), and prepare the food on the main counter (ABAP application server). This process takes time because:

  1. You transport a lot of ingredients back and forth.
  2. Cooking on the main counter slows everything down when you have too many orders.

AMDP Approach (Database Processing with SQLScript)

Now, imagine a new, modern kitchen setup where you delegate the cooking to expert chefs (database procedures) directly inside the storage area (HANA database).

  1. Instead of bringing raw ingredients, you send the order (SQL query) to the kitchen.
  2. The expert chefs (HANA DB procedures) prepare the dish (process the data) inside the kitchen (database) using high-speed cooking techniques (SQLScript).
  3. You receive the final, ready-to-serve dish (processed data) instantly at the counter.

AMDP(ABAP Managed Database Procedures), allowing us to leverage the power of database-specific programming languages like SAP HANA SQL Script.

Here’s a quick overview: 🔹 Implementation: Unlike traditional methods, AMDPs are implemented using database-specific languages. Specify this with BY DATABASE PROCEDURE.

🔹 FOR: Defines the database. Currently, HDB for SAP HANA is the only supported value.

🔹 LANGUAGE: Specifies the implementation language, with SQL Script being the current option.

🔹 USING: Essential for methods using ABAP Dictionary objects. Note: CDS View names aren’t supported directly; use the corresponding CDS SQL View instead.

🔹 OPTIONS: Currently, READ-ONLY is the only supported option.

🔹 Class Definition: Must implement the IF_AMDP_MARKER_HDB interface. This is mandatory for AMDP classes.

🔹 Method Parameters: Can be import, export, or changing parameters. It must be passed by value and be elementary or table types. Nested tables and structure types are not supported.

🔹 Visibility: AMDP methods can be public, protected, or private. ABAP classes can mix ABAP and AMDP methods.

🔹 Static Methods: AMDP methods are defined as static, even if declared as instance methods, they execute like static methods.

Why is AMDP Better?

Faster Processing — Since the cooking (data processing) happens inside the kitchen (database), it reduces unnecessary movement and speeds up performance.

Efficient Resource Use — The chef (ABAP) can now focus on serving, while the kitchen (HANA DB) efficiently processes large and complex orders.

Better Scalability — Handles multiple orders (data-heavy operations) without overwhelming the main counter (application server).

Conclusion

AMDP allows SAP applications to push down processing to the HANA database, making data handling more efficient, just like letting professional chefs cook inside the kitchen instead of preparing everything on the main counter. 🚀

SAP #AMDP #CODEPUSHDOWN #ABAP #RAP


메타데이터
post_id
e90e2359cbc6
slug
understanding-amdp-abap-managed-database-procedure-e90e2359cbc6
url
https://medium.com/@garg.ruhani19/understanding-amdp-abap-managed-database-procedure-e90e2359cbc6
canonical_url
https://medium.com/@garg.ruhani19/understanding-amdp-abap-managed-database-procedure-e90e2359cbc6
author_url
https://medium.com/@garg.ruhani19
status
ok
fetched_at
2026-06-15 20:49:13