Skip to Content
Author's profile photo Amol Samte

Call AMDP(ABAP Managed Database Procedure) Inside AMDP Method

Dear All,

Yet another very interesting topic in AMDP, which is how to call AMDP method inside AMDP method.

Well, before moving forward let’s see an overview of AMDP is

here

ABAP Managed Database Procedures – Introduction

Accessing tables from different schema through AMDP.

Scenario :-

                    1. Create  AMDP method which will get flight id(airline code) and aggregated price from currency and later will be called in another AMDP.

                    2. Create  AMDP method which will get flight name from airline code which is derived from AMDP in step1.

Steps :-

AMDP Definition

Defination.PNG

AMDP Implementation

Implimentation.PNG

Calling AMDP in program

Program.PNG

Desire Output

Output.PNG

I hope during realization that might be useful.

-Cheers 😎

Amol

Assigned Tags

      9 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi Amol,

        many thanks for your artical, i am very interesting about AMDP.
      i met 2 issues, could you please help me ?

      the first one is that i am tesing SAP Demo program se38:DEMO_AMDP.

            i met abap dump 2015-2-28 14-15-08.jpg

      i debugged the program and found the dump area.

      2015-2-28 14-17-53.jpg

      system will check the Class in DB table 'd010dbobj'. could you please help to tell me how to register or do the configruation related DB table 'd010dbobj'.

      the second question is that. i try to copy your example in my system , when i create the your class 'ZCL_AMDP_TEST' in my system with SE24 , after i input interface 'IF_AMDP_MARKER_HDB', system show message '

      Class ZCL_AMDP_TEST contains stored procedures which cannot be changed in
      SAP GUI'

      could you tell me what is the solution for you createing your class 'ZCL_AMDP_TEST' ?

      many thanks.

      Sun

      Author's profile photo Amol Samte
      Amol Samte
      Blog Post Author

      Hi Sun,

      Sorry for late reply, I was on vacation.

      1. I am not aware of your first issue.

      2. Regarding your 2nd issue, please use ADT  i.e. ABAP in Eclipse  then it will work.

      -Amol

      Author's profile photo Thomas Fiedler
      Thomas Fiedler

      Hi Sun,

      ABAP managed database procedures are only supported in ABAP in Eclipse. In SE24 you can only display the code but editing is not allowed.

      Please check the Eclipse community for further details:

      http://scn.sap.com/community/abap/eclipse

      Regards,

      Thomas.

      Author's profile photo Former Member
      Former Member

      many thanks Amol and Thomas.

      i download Eclipse and set up ABAP plug in. it works now.

      about the first issue, i guess the reason is that our HANA system upgrated recently, for the Demo Class  CL_DEMO_AMDP,there is no record be registered in table  'd010dbobj'. but for the new class which i created manully, i found table  'd010dbobj' has data realted my new class. so the new class works well .

      although i don't know the reason but it is not a big problem, if i want to use the Demo Class,i can copy them to a new one.

      thanks again .

      Sun

      Author's profile photo Jasmin Gruschke
      Jasmin Gruschke

      Hi Sun,
      just a quick comment. The database procedure corresponding to the AMDP is created at first execution - therefore you might not see the CL_DEMO_AMDP in case it has never been executed. You might give it a try yourself - exectue the class and have a look again at the DDIC tables.

      The behaviour of "create at first execution" might change in higher releases, but I just assume it's as described above in your system.
      Cheers,

      Jasmin

      Author's profile photo Amit Diwane
      Amit Diwane

      Hello Amol,

       

      It's a nice article. Thanks for sharing it out.

      Can you please let me know how can we call the instance AMDP method inside other instance/class method?

       

      Author's profile photo Lavanya A
      Lavanya A

      Guys, How can I call the method from a CDS view??

      Author's profile photo Amol Samte
      Amol Samte
      Blog Post Author

      you can not call any method from CDS view.

      Author's profile photo Mainak Aich
      Mainak Aich

      Hi Lavanya,

      In CDS table function view, you can call AMDP methods.

      Cheers,

      Mainak