Blogs / SAP / SAP BW/HANA / SAP BW / How to debug AMDP routines in BW Transformation?

How to debug AMDP routines in BW Transformation?

Jan 10, 2020

SHARE

ABAP Managed Database Procedures are a framework for managing and calling stored procedures or database procedures. AMDP is a procedure written in a database-specific language ( Native SQL, SQL Script) implemented in an AMDP method of anAMDPclass. 

By using AMDP, we want to achieve complete pushdown of transformation execution as the logic will be executed on the database layer instead of on the application layer. 

Activating the AMDP Debugger 

To debug any ABAP Managed Database Procedures, open the object that you would like to debug. Before moving ahead, you must first activate the AMDP Debugger in an ABAP project before using it. 

1. Explicit activation of the Debugger

To activate the AMDP Debugger explicitly, position the cursor within the ruler (left bar) of the source editor at the line that contains the AMDP code and choose “Activate AMDP Debugger” from the context menu.

How to debug AMDP routines in BW Transformation?

2. Implicit activation of the Debugger by setting Breakpoint:

You can set the breakpoint by double-clicking the line that contains the executable statement or by position the cursor and by choosing the  “Toggle Breakpoint” from the context menu. Note that there will be two AMDP classes (A & M) generated. M class are not considered for DTP execution. AMDP Breakpoints must be set in the A-class instead.

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

  • Grey – Debugger is inactive
  • Green – Debugger is active, Breakpoint is confirmed
  • Blue – Debugger is active, Breakpoint confirmation is pending
How to debug AMDP routines in BW Transformation?

DTP Execution

1. Once the breakpoint is set, you can go ahead and trigger the DTP. This will, in turn, open the Debugger Perspective and stops at the breakpoint. Now we can use the tools provided by the SQL Script Debugger.

2. You can see the list of active breakpoints from the Breakpoints tab.

How to debug AMDP routines in BW Transformation?

3. We have icons/buttons in the top-left corner in the debugger perspective to help us to navigate through the source code.

How to debug AMDP routines in BW Transformation?

IconFunction
ResumeRun to the next AMDP breakpoint or end the program
TerminateCancel the debugger and the debugged application as well
DisconnectCancel the debugger while the application resumes execution
Step Into (F5)Execute the next single statement in the program
Step Over (F6)Execute the next statement and if the next step is a procedure call, run the entire procedure
Step Return (F7)Run until the current procedure returns to its caller or until the program ends.
Run to line (F8)Run to the statement on which the cursor is positioned

4. In the Variable tab, you can see the Variables filled with values. However, we were not able to change the value of the variables as in the case of the traditional ABAP debugger. Now the OutTab is also visible and contains 0 records as the control is at the first breakpoint at line 80.

How to debug AMDP routines in BW Transformation?

5. For the Control execution to go to the next breakpoint, press F6. Now you can see the control is at line 85 and the Variable OutTab is shown in the Variable list and contains 17 rows.

How to debug AMDP routines in BW Transformation?

6. We can see the data of InTab and OutTab by double-clicking on the table and you can notice that our code is working as per logic to set a value as “DEBIT” when the indicator is “S”, else “CREDIT”.

InTab:

How to debug AMDP routines in BW Transformation?

OutTab:

How to debug AMDP routines in BW Transformation?

Know more about our Visual BI offerings and to read more related content click here.


Corporate HQ:
5920 Windhaven Pkwy, Plano, TX 75093

+1 888-227-2794

+1 972-232-2233

+1 888-227-7192

solutions@visualbi.com


Copyright © Visual BI Solutions Inc.

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!

Share This!

Share this with your friends and colleagues!