0% found this document useful (0 votes)
19 views

Simplifying AMDP Debugging for ABAP Developers A Hands On Approach

Uploaded by

kanthkrishna1998
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Simplifying AMDP Debugging for ABAP Developers A Hands On Approach

Uploaded by

kanthkrishna1998
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

AMDP Debugging

What is AMDP?

The goal of ABAP Managed Database Procedures is to make the world of database procedures
available for ABAP Developers. In order to achieve this, AMDP offers a way to create, edit and
transport database procedures nearly like standard ABAP classes. With the new AMDP
Debugger there is now also debugging support directly integrated in the ABAP tool environment.

AMDP Debugger Lifecycle:

One difference between AMDP Debugger and ABAP Debugger is the fact that the AMDP
Debugger has to be started before you can do anything else. If the debugger has not been started
your DB procedures will not stop at breakpoints. To deal with this we implemented an
automatism within ADT to start the debugger implicitly when a user creates a breakpoint for an
AMDP.

Stopping the AMDP Debugger after usage is also important because it is rather resource
intensive for the ABAP Server and it’s not affordable to have an active debugger instance for
every user in the system all the time. For this reason there are two automatisms to stop the
debugger implicitly:

• When a user closes the IDE


• When a user is idle for 10 minutes (timeout)

Besides this the user always has the possibility to start or stop the AMDP Debugger manually.
This is for example necessary when you re-open your IDE after closing it and try to start a debug
session with your old breakpoints instead of creating new ones.

Since the current activation state of the AMDP Debugger is quite important it is also reflected by
the color of the breakpoints:

• Gray – debugger is inactive


• Green – debugger is active, BP is confirmed
• Blue – debugger is active, BP confirmation is pending
Login into sap hana studio
Click on ok

Click on open perspective


Select abap and click on ok

Right click on core data services and right click on new and click on other abap repository object
Enter the object name and click on finish

Click on local object


Enter the short text and click on execute

Click on yes

Data was saved


Enter the transaction code se24

Enter the object type and click on create

Click on class radio button and click on continue


Enter the description and click on save

Click on local object


Enter the method name and click on level search

Select the instance method and click on right

Click on visibility search icon


Select the public and click on continue

Enter the description

Click on save
Data was saved

Click on activate
Click on continue

Object is activated
Right click on classes and click on new abap class
Enter the name and description and click on finish
Click on activate icon
Right click on programs and click on new abap program
Enter the name and description and click on finish
Write the program and double click the sapce

Click on break point


Here we can see the break point
Click on active icon

PROGRAM:

REPORT zabap_debug_program.
PARAMETERS :pnumber TYPE i DEFAULT 10.
DATA:lv_number TYPE i.
lv_number = pnumber.

zamdp_debug=>zamdp_debug(

EXPORTING iv_number = lv_number


iv_client = sy-mandt
IMPORTING et_top = data(lt_top)
et_flop = data(lt_flop) ).

WRITE: /'Best customers:'COLOR COL_POSITIVE.


LOOP AT lt_top ASSIGNING FIELD-SYMBOL(<f>).
WRITE:/ <f>-company_name , <f>-gross_amount.
ULINE.
WRITE:'worst coustemers:' COLOR COL_NEGATIVE.
LOOP AT lt_flop ASSIGNING FIELD-SYMBOL(<g>).
WRITE:/ <g>-company_name, <g>-gross_amount.
ENDLOOP.
endloop.

Enter the pnumber 10


Click on execute.

Click on yes

Expand the globals and Click on f8


Here we can see program and click on f8.

Expand the top 10 customers list


Expand the top 10 flop list

Enter the PNUMBER: 10 click on execute


Output:

Top 10 best customers

Top 10 worst customers

You might also like