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

To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. sun shanqingpeng

    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

    (0) 
    1. Amol Samte Samte 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

      (0) 
  2. sun shanqingpeng

    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

    (0) 
    1. 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

      (0) 
  3. 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?

     

    (0) 

Leave a Reply