AMDP Statement Performance Trace - SAP Blogs
AMDP Statement Performance Trace - SAP Blogs
Community
Technical Articles
Ankit Rastogi
February 13, 2019 4 minute read
1. Objective
The objective of this blog is to explain step-by-step process to trace AMDP method to analyze the performance
and pin-point any performance bottlenecks.
2. Requirement
Requirement is to analyze performance of any AMDP method which gives us a fair idea about its execution
times across it’s modularization units such as subsequent AMDP method calls within any AMDP method. The
developer would like to leverage AMDP statement trace utility to address this requirement.
https://blogs.sap.com/2019/02/13/amdp-statement-performance-trace/ 1/11
4/26/2020 AMDP Statement performance trace | SAP Blogs
transaction gives us idea that AMDP method is taking how much time, but it is displayed as single row in SAT
analysis snapshot mentioning as database procedure (DB: Exec).
The limitation arises when AMDP method is not so much straight forward. What if AMDP method itself has
thousands of lines of code with multiple AMDP methods call with in an AMDP method. See below screenshot.
One can see here one AMDP method CL_FR_DAYS_CALCULATION=CALC_FR_DAYS_PLAN takes majority time
approx. 28% of total (5.2 secs) in it’s processing. When we see this AMDP method, we nd that it has around
1500 lines of code with multiple AMDP method calls from with in. So it becomes di cult to pin point the
bottleneck in performance by seeing SAT results.
https://blogs.sap.com/2019/02/13/amdp-statement-performance-trace/ 2/11
4/26/2020 AMDP Statement performance trace | SAP Blogs
One can see here ST05 trace also provides high level view on AMDP method performance. It tells us that around
5.3 sec is execution time of our AMDP method, but it does not provide any further information on what caused
this execution time.
The following steps explain step by step process for AMDP method trace:
https://blogs.sap.com/2019/02/13/amdp-statement-performance-trace/ 3/11
4/26/2020 AMDP Statement performance trace | SAP Blogs
Here we see self-explanatory buttons similar to transaction ST05 where one can switch on and switch o AMDP
statement trace.
Once your transaction is complete, click on button ‘Deactivate trace’ and then button ‘Display Trace Entries’ to
display the trace result.
https://blogs.sap.com/2019/02/13/amdp-statement-performance-trace/ 4/11
4/26/2020 AMDP Statement performance trace | SAP Blogs
Con rmation message is displayed that trace is switched on for current user.
Step 5.2:
Now run your transaction and once your transaction is nished click on ‘Deactivate Trace’ button.
Step 5.3:
Now click on ‘Display Trace Entries’ button.
It list down all the AMDP method calls within your transaction and also displays execution time against each
AMDP method. Once can see here our AMDP method
https://blogs.sap.com/2019/02/13/amdp-statement-performance-trace/ 5/11
4/26/2020 AMDP Statement performance trace | SAP Blogs
We see a column ‘Display’. We can click on this button against any particular AMDP and it will display details
about each processing block with in AMDP method.
Step 5.4:
Click display button in front of AMDP method CL_FR_DAYS_CALCULATION=>CALC_FR_DAYS_PLAN_AMDP
https://blogs.sap.com/2019/02/13/amdp-statement-performance-trace/ 6/11
4/26/2020 AMDP Statement performance trace | SAP Blogs
We can see from here that out of 5.4 secs, 3.35 secs were spent while executing one underlying AMDP
CL_FR_DAYS_CALCULATION=>CALC_OUTB_QTY_EXTEN. Rest other AMDP’s are executing at fairly normal
level.
Step 5.5:
As we now know the performance pain point, we can focus our analysis in this AMDP only. After analyzing this
AMDP CL_FR_DAYS_CALCULATION=>CALC_OUTB_QTY_EXTEN, it was found that we have put SELECT
DISTINCT unnecessarily in one of it’s select query. This SELECT DISTINCT was causing underlying select query
to run slow.
Once we removed this SELECT DISTINCT, the performance is greatly improved. We can see the stats after this
change.
https://blogs.sap.com/2019/02/13/amdp-statement-performance-trace/ 7/11
4/26/2020 AMDP Statement performance trace | SAP Blogs
Alert Moderator
Earlier same AMDP method was taking approx. 5.4 secs (28% of total), now after code changes, it takes only
0.3 secs to execute less than 2% of total execution time.
Assigned tags
ABAP Development | SAP S/4HANA | AMDP execution plan | AMDP Optimization | AMDP Performance |
View more...
Related Questions
https://blogs.sap.com/2019/02/13/amdp-statement-performance-trace/ 8/11
4/26/2020 AMDP Statement performance trace | SAP Blogs
6 Comments
Badal Bhasin
Jonathan Bourne
It is available in 1709
Vijayakumar Mukunthan
Hi Ankit
The blog is very clearly explained step by step execution and new learning to me. Keep it up. Good job.
https://blogs.sap.com/2019/02/13/amdp-statement-performance-trace/ 9/11
4/26/2020 AMDP Statement performance trace | SAP Blogs
Vijay
Gaurav Sharan
We are on SAP BW 750, SP 08 and don’t have the the transaction: AMDP_UTILS or some of the other programs
you’ve mentioned in this blog. What’s the minimum system requirement to perform the various AMDP traces
you’ve outlined in your blog ?
Add Comment
Find us on
Newsletter Support
https://blogs.sap.com/2019/02/13/amdp-statement-performance-trace/ 10/11
4/26/2020 AMDP Statement performance trace | SAP Blogs
https://blogs.sap.com/2019/02/13/amdp-statement-performance-trace/ 11/11