{"id":7353,"date":"2025-08-03T14:33:37","date_gmt":"2025-08-03T09:03:37","guid":{"rendered":"https:\/\/www.sapewmhelp.com\/?question=why-you-might-use-an-amdp-inside-another-amdp"},"modified":"2025-08-03T14:33:37","modified_gmt":"2025-08-03T09:03:37","slug":"why-you-might-use-an-amdp-inside-another-amdp","status":"publish","type":"question","link":"https:\/\/www.sapewmhelp.com\/?question=why-you-might-use-an-amdp-inside-another-amdp","title":{"rendered":"Why You Might Use an AMDP Inside Another AMDP"},"content":{"rendered":"<p>Using an AMDP (ABAP Managed Database Procedure) inside another AMDP can be useful in specific scenarios, especially when trying to modularize complex logic or reuse database-side procedures. However, it comes with certain considerations and limitations.<\/p>\n<ul>\n<li>\n<p><strong>Code Reusability<\/strong><\/p>\n<ul>\n<li>\n<p>If you have logic encapsulated in one AMDP method (e.g., data transformation or filtering), and it&#8217;s needed in another AMDP, calling it avoids duplicating code.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Modular Design<\/strong><\/p>\n<ul>\n<li>\n<p>Keeping complex operations separated into smaller, purpose-specific AMDPs improves readability and maintainability.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Performance<\/strong><\/p>\n<ul>\n<li>\n<p>If the reused AMDP logic is efficient and avoids fetching data to the application server, it can help maintain end-to-end HANA-side processing.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Layered Architecture<\/strong><\/p>\n<ul>\n<li>\n<p>In multi-layered designs (e.g., data access layer, business logic layer), AMDPs may call each other to preserve architectural boundaries.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"content-img\" src=\"https:\/\/www.sapewmhelp.com\/wp-content\/uploads\/2025\/08\/amdp_procedure_inside_another_procedure.png\" \/><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","question-category":[173],"question_tags":[178,273,199,274,177],"class_list":["post-7353","question","type-question","status-publish","hentry","question-category-cdsviews","question_tags-abap","question_tags-amdp","question_tags-cds","question_tags-s-4hana","question_tags-sap"],"_links":{"self":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question\/7353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question"}],"about":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7353"}],"wp:attachment":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7353"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion-category&post=7353"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion_tags&post=7353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}