-
Blogs
The ABAP Runtime Analysis (transaction SE30) is the best
starting point if you want to execute performance or flow
analysis of your ABAP program. Unfortunately many people use
ABAP Runtime Analysis only to look for performance
bottlenecks and don't know that ABAP Trace is the only tool with
which you can trace the execution flow of an ABAP
program at the statement level. This blog will show you how to
use ABAP Trace of ABAP Runtime Analysis (SE30) to follow
the flow logic of your ABAP program.
1. Why analyze the flow of an ABAP program?
The ABAP Runtime Analysis (transaction SE30) gives you one tool
for solving two problems. You can measure performance and find
bottlenecks. You can also analyze the program flow of your ABAP
program. In this blog we will focus on program flow analysis.
Why do you need to analyze the flow of ABAP program? Let me give
you just a couple examples.
First, you may need to find the exact source code location of a
particular ABAP statement (a method call, function call...) you are
interested in. You would then run the ABAP Trace and afterwards
search the required line in the result list of the ABAP
statements.
Second, you may want to compare the flow of your ABAP program in
different systems. Imagine, for example, that your ABAP program
runs as expected in the test system but shows a completely
differently behavior in the production system, or even worse,
aborts with a short dump in the production system. You could then
simply run the ABAP Trace in both test and production systems and
compare the trace results.
2. How to find exact source code line of an ABAP statement?
Just imagine, you go to the ABAP Editor (transaction SE38), type
"XXX" into the "Program" field, press the "Display" button and get
the error message on the status bar "Program XXX does not exist".
How could you find out the exact source code line of the ABAP
statement that produced the message?
You could of course start the ABAP Debugger and try to debug in
single step. And then after hours or weeks of intensive debugging
you might be lucky enough to find the source code line of the ABAP
statement. But why waste time? Here is how to use the ABAP Runtime
Analysis to find this error message in a couple of minutes.
If you press "?" button or click on the status bar near the
error message, you will see the F1 help on the message, in the
performance assistant. This tells informs you that the number of
the error message is DS017. Therefore you have to look for the
"message DS017":
ABAP Runtime Analysis (SE30) - How to analyze ABAP program
flow Olga Dolinskaja Business Card Company: SAP AG Posted on
Dec. 11, 2009 05:45 PM in ABAP, Application Server
Page 1 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) - How
to analyze ABAP progra...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050
-
To find the message, first start the ABAP Runtime Analysis and
create a measurement variant.
1. Start the ABAP Runtime Analysis (transaction SE30) via System
-> Utilities -> Runtime Analysis -> Execute or call the
transaction directly with "/nse30".
2. Type "SE38" into "Transaction" field.
3. Create a measurement variant for your user:
Type a name into "Variant" field and press "Create" button
Set aggregation to "None" on the "Duration/Type" tab
For memory usage info check the "With memory use" flag
Switch on "Particular units" on the "Program(Parts)" tab
Save your variant
Page 2 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) - How
to analyze ABAP progra...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050
-
Before we go on, some important notes.
Don't use aggregation if you want to trace ABAP in order to
follow the program logic (what we are doing here). Aggregation
summarizes the trace data for a particular type of event in a
single trace record and therefore reduces the number of entries in
the trace file. But to see the complete program flow you need all
trace data.
Try to use "Particular units" where possible in order to reduce
trace file size and trace only the code you really need to see. The
option "Particular units" allows you to switch on/off the ABAP
trace during the running transaction. The trace will be started as
soon as you enter "/ron" (trace on) in the OK field in your
transaction. With "/roff " the trace is stopped. Alternatively you
can also use the menu path: System -> Utilities -> Runtime
Analysis -> Switch On / Switch Off.
Let's execute the measurement:
1. Press "Execute" button. Transaction SE38, the ABAP Editor,
starts.
2. Type "XXX" into the "Program" field and turn on the trace
with System -> Utilities -> Runtime Analysis ->Switch
On.
3. Press the "Display" button and turn off the trace with System
-> Utilities -> Runtime Analysis -> Switch Off.
Step back to the Runtime Analysis and analyze the trace
results:
1. Press the "Evaluate" button.
2. Press the "Call Hierarchy" button and you get a list which
represents the complete path through your program.
3. Search for "message DS017" in the Call Hierarchy list.
4. Double-click on the entry in the Call Hierarchy list to jump
to the source code line, which initiated the error message.
Page 3 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) - How
to analyze ABAP progra...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050
-
3. How to trace a long running batch job?
Now imagine the following situation. You are the administrator
of a production system, and you encounter in the Process Overview
(transaction sm50) a batch process, which already has been running
several days and has been selecting data from a database table.
This process is blocking other background jobs and you have to find
out what this process is actually doing:
Page 4 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) - How
to analyze ABAP progra...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050
-
You can find this out very easily with the ABAP Runtime
Analysis. You can use the ABAP Runtime Analysis (SE30) to trace
programs which are running in a parallel session.
1. Ensure that you run SE30 on the same server as the running
process!
2. You must create or adjust a trace variant for tracing the
parallel process. Set aggregation to "None" again to get the Call
Hierarchy
3. Press the "Switch On/Off" button to trace processes running
in a parallel session. The Runtime Analysis displays a list of the
running processes similar to the Process Overview (transaction
sm50).
4. Use the "Start measurement/End measurement" buttons to
activate and deactivate trace.
Caution: Deactivate the trace again after short tracing time so
that you do not reach the trace file quota! Before deactivating the
trace, refresh the work process display. The dialog step that was
active in the work process with the activated trace may have
changed, and that deactivates the trace automatically.
Page 5 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) - How
to analyze ABAP progra...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050
-
5. Press "Evaluate" button to analyze trace results.
4. How to trace HTTP/RFC requests or processes of other
users?
Page 6 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) - How
to analyze ABAP progra...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050
-
There are also often situations where you need to trace HTTP or
RFC requests or processes of other users. Let me give you some
examples.
Imagine there is an online flight booking system. If a user
wants to reserve a flight, his HTTP request arrives in your backend
system. And you need to trace the reservation process which is
running in your ABAP backend system. In such case you don't know
which ABAP backend process handles which HTTP request and have no
idea when the HTTP request will reach your ABAP backend system.
Therefore it is difficult to capture such a request for debugging
in the appropriate ABAP backend process.
Another good example would be frequent RFC requests which reach
your ABAP system and last only several hundred milliseconds. It is
quite hard to trace such short-lived requests.
Maybe you also have to deal with a batch job that runs under
another user, which always starts at a different time and aborts
sporadically with a short dump. How can you trace something like
this?
The ABAP Runtime Analysis (SE30) provides an answer. It lets you
schedule a trace for any user on the current server.
1. Start ABAP Runtime Analysis (SE30).
2. Create your trace variant and set aggregation to "None" again
to get the Call Hierarchy.
3. Press "For User/Service" button in the "Schedule" area of the
initial screen.
4. Press "Schedule measurement" button on the Overview of
Scheduled Measurements screen.
The transaction presents a popup on which you can schedule an
asynchronous trace according to these criteria:
User
Client
External session (choose "Any" if you are not sure in which
session the application will run!)
Process Category (dialog, batch, RFC, HTTP, ITS, etc.)
Object Type (transaction, report, function module, any,
etc.)
Object (e.g. only transaction se38)
Max. No. of sched. Measurements (specify the maximum number of
traces)
Expiration Date and Time (specify the time frame when the trace
shall be active)
When the trace is scheduled, the ABAP Runtime Analysis
automatically starts the trace as soon as session that meets your
criteria is started
Page 7 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) - How
to analyze ABAP progra...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050
-
on the system. The user you have specified logs on to the system
and executes his task, and the ABAP Runtime Analysis starts to
write the trace. The trace results can be analyzed - as usual - in
the ABAP Runtime Analysis (using the "Evaluate" button on initial
screen).
Olga Dolinskaja is a Product Specialist in the SAP NetWeaver
Solution Management for ABAP
Add to: del.icio.us | Digg | Reddit
Comment on this weblog
Really helpful
2010-02-27 12:18:51 Ferran Bonamusa Francisco Business Card
[Reply]
Thank you for this helpful information.
Great !
2010-02-24 03:22:17 Avraham Kahana Business Card [Reply]
Indeed helped me find the source code of my error way faster
than I would have done otherwise.
sufficiently explanatory for newbies
2010-02-20 04:49:13 Priyanka Roy Business Card [Reply]
Very useful and well documented.
Very useful, highly recommended!
2010-01-31 14:55:52 Joo G Neves Business Card [Reply]
Hello Olga,
Thank you for this post, one of the most useful I've seen. A
great help for any SAP consultant!
Regards,
Joo
Programs which go ! in the night
2010-01-31 14:02:19 Julius von dem Bussche Business Card
[Reply]
Thank you Olga!
I have been for some time now looking for a more efficient way
to do forensics on programs from the namespace "!". Sometimes I
am
called upon to do this.
Often the security audit log is "too late" for successfully
submitted reports and I was "too slow" for STAD to give me these
details.
In addition to the developer trace, I had not thought of using
SE30's own results yet.
Many thanks!
Showing messages 1 through 47 of 47.
Titles Only Main Topics Oldest First
Page 8 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) - How
to analyze ABAP progra...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050
-
Julius
Problem tracing report
2010-01-27 05:11:30 Sebastian Millies Business Card [Reply]
Hi there,
thanks for the nice blog. I've run into a problem, though:
I've created a variant for a report of mine exactly as
described. The report is started using a variant. The report, when
debugged, makes
a couple of PERFORMS and a method call during
START-OF-SELECTION. It then starts a couple of jobs in the
background (which I don't
expect to be measured) and displays a list at the end.
However, the call hierarchy does not reflect any of this.
Instead, it contains only one line saying "Runtime analysis"
for
"CL_ABAP_TRACE_SWITCH==========CP". The measurement file has
only 5 KB. Any idea what might be going wrong?
-- Sebastian
Problem tracing report
2010-01-28 01:40:50 Olga Dolinskaja Business Card [Reply]
Hi Sebastian,
Are you sure that the report was executed, e.g. have you seen
the list at the end? If yes, for me it looks like the trace was
not
switched on.
Please make sure that you run your report on the same
application server as SE30. If the report runs correctly without
SE30 and
without debugger, please try again to run the measurement with
SE30 and explicitly switch on/off it by choosing "Particular
units"
option in your variant and using "/ron" "/roff" commands as
described in the blog.
Best Regards,
Olga.
Problem tracing report
2010-01-29 04:15:03 Sebastian Millies Business Card [Reply]
thanks, it now works (except I'm often running against a limit
on the trace file size). -- Sebastian
Problem tracing report
2010-01-31 13:43:42 Olga Dolinskaja Business Card [Reply]
Hi Sebastian,
you could increase your trace file size on the "Duration/Type"
tab in your variant. Better way would be to switch on/off the
trace only where you really need it (/ron and /roff
commands).
Regards, Olga.
Problem tracing report
2010-02-01 02:39:21 Sebastian Millies Business Card [Reply]
thanks, that worked, except I had to talk the administrator of
the server to give me a bigger quota. One idea for an
improvement for the transaction would be the possibility of
local measurement files (i. e. residing on the client, at least
Page 9 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) - How
to analyze ABAP progra...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050
-
up and download should be possible).
The reason for the big increase in file size was that some
processes got started asynchronously and the process I was
tracing then did active polling in a loop. I'd basically like to
skip this part of the trace. I think a big improvement to the
transaction would be the possibility of an exclude list in the
"particular units" part of the variant.
-- Sebastian
Problem tracing report
2010-02-02 04:32:48 Olga Dolinskaja Business Card [Reply]
Hi Sebastian,
Thank you for the feedback.
Just to let you know, we have made some improvements in the new
version of Runtime Analysis (successor of
SE30). The trace files will be written directly to the database,
and you shouldn't have a problem with a disk quota for
your trace files anymore. This feature will be available within
SAP Business Suite based on Netweaver 7.0 EHP2.
I have also forwarded your wish about the "exclude list" to the
development.
Regards,
Olga.
One of the best Webblog
2010-01-27 01:30:37 Abhinandan Alandkar Business Card
[Reply]
Hi Olga,
This is really magic man. I am happy to know that we could do
this using SE30.
Great Webblog ever..
Regards
Abhii
Run time analysis
2010-01-21 20:59:39 Sanjay Madhav Lavlekar Business Card
[Reply]
This is very good informative article.
Sanjay
SE30 for BW
2010-01-21 04:05:53 Silvia Giussani Business Card [Reply]
Hi Olga....your instructions on ABAP debug is really good. I
would like to use it with BW ABAP code (Start/End Routines,etc).
How should
I use it? Is there any change to apply?
Thanks in advance for your comments.
Silvia
Page 10 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) -
How to analyze ABAP prog...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050
-
SE30 for BW
2010-01-21 04:17:51 Olga Dolinskaja Business Card [Reply]
Hi Silvia,
the SE30 allows you to examine the runtime of any ABAP programs,
such as reports, subroutines, function modules or classes, that
you create in the ABAP Workbench.
I am not sure which type of BW applications you want to measure,
but actually it should work the same way for BW ABAP
applications as described in the blog.
Best Regards,
Olga.
Superb weblog. Empowering new knowledge.
2010-01-20 23:48:41 Ardavan Goharjou Business Card [Reply]
Yesterday did exactly as mentioned in the introduction. Spent
many hours debugging a transaction to get to the root of the
problem. I
could've saved many hours if I knew of this weblog before. But I
now know how to use SE30 and it'll be my savior.
Many thanks for sharing your knowledge.
I'll also try to learn about ST12 as suggested by another kind
soul.
BSP?
2010-01-20 20:52:12 Abhijeet Kulkarni Business Card [Reply]
Hi Olga,
It was really useful. While we regularly used to test the
t-codes, programs and FMs, we never explored the parallel session
and
user/service options. This would certainly help us reach the
root of the problem even faster. However, I was unable to trace a
BSP
application. I gave these settings from user 001671 for another
user (These were visible as on 21.01.2010)-
Measur. ID 4
User 000984
Sessn Any
ProcessCat Any
ObjectType
Object Name HAP_DOCUMENT
Scheduled 1
Started 0
Errors 0
Status Executed
Exp. Date 20.01.2010
Expir.Time 12:02:42
After setting this up, I used the BSP application HAP_DOCUMENT.
No trace was generated.
Please suggest the correct settings, or if you know any document
that can help. Thanks.
Page 11 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) -
How to analyze ABAP prog...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050
-
-Abhijeet.
BSP?
2010-01-21 03:32:36 Olga Dolinskaja Business Card [Reply]
Hi Abhijeet,
your measurement settings look ok so far.
Please verify that user mapping (on the other user) does not
take place during execution of your BSP before calling
HAP_DOCUMENT. Otherwise schedule measurement for e.g. "any"
user. Please also verify that BSP request really arrives on the
same application server of your ABAP backend system, where you
scheduled your measurement in the SE30.
For more details on measurement settings please take a look at
the Runtime Analysis Docu on SAP Help Portal:
http://help.sap.com/saphelp_NW70EHP1/helpdata/en/42/eaae4baeb732c3e10000000a1553f6/frameset.htm
I hope this helps...
Best regards,
Olga.
BSP?
2010-01-21 04:20:28 Abhijeet Kulkarni Business Card [Reply]
Hi Olga,
I would check the timing of user mapping and try tracing with
the suggested settings. Interestingly, ST12 worked! I had put
following setting in ST12-
Trace For- User
User name- 000984
Task Type- H HTTP (HTTP request/BSP)
Thanks for the guidance.
-Abhijeet.
Illuminating and very timely
2010-01-20 14:30:11 Sharon Todd Business Card [Reply]
Very useful for tracing RFC requests of other users. Thank you
for an excellent post.
timely & useful; minor edit needed
2010-01-20 12:14:38 Leon Steinhardt Business Card [Reply]
Thank you very much; this very useful tutorial link arrived in
my email just when I needed it.
I found one minor error:
'Search for "message DS017" in the Call Hierarchy list' won't
find it. As your picture shows, the code line is "Message S017"
-
Page 12 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) -
How to analyze ABAP prog...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050
-
"DS017". Same for all messages: Snnn, Ennn, etc.; the full
number from the F1 help box never shows in the code.
Amazing blog
2010-01-20 06:07:53 Mykola Gorbarov Business Card [Reply]
Great post for complex topic described in easy to read and
understandable manner
Excelent
2009-12-27 19:10:49 Mr sai Business Card [Reply]
Thanks for the blog
amazing job!
2009-12-23 17:45:21 Daixiong Jiang Business Card [Reply]
very good and thanks for sharing.
Best one
2009-12-23 00:48:50 Raghavendra C Business Card [Reply]
Hi
Thank you for all your efforts and time spent on the this.
KRC
Excellent
2009-12-22 11:54:04 chetan sakunde Business Card [Reply]
Keep it up.Gr8.
nice summary..
2009-12-22 05:16:59 A. de Smidt Business Card [Reply]
of the course COMP267 given by Boris Gebhardt on debugging at
SAP TECHED last year in Berlin.
still a pitty that this is not a regular training since it
already saved me months of cluelessness in debugging
possibilities.
I also made a summary of it but now I can link to this blog
ABAP Troubleshooting summary?
2010-01-21 01:19:59 Sebastian Millies Business Card [Reply]
Hello Arthur, I'd be most interested in your summary of COMP267,
as a complement to this excellent blog. Where can it be found?
-- Best Regards, Sebastian
Also useful for program flow ST12
2009-12-22 01:31:39 Christian Lechner Business Card [Reply]
Another tool that is very useful to gather information about the
program flow is the "Single Transaction Analysis" (ST12)
This toool has some features that go beyond SE30 e. g. the
bottom-up analysis of an ABAP trace that displays the hierarchie of
the
callers in a quite comfortable and inuitive way.
Everyone should know
2009-12-20 21:54:12 Manjunadh Lolla Business Card [Reply]
Page 13 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) -
How to analyze ABAP prog...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050
-
Often many inmportant topics are ignored to be studied in
detail. Every ABAPer should fundamentally know these. And this blog
serves
the need.
Well Done
2009-12-20 21:37:57 Gaurav Patwari Business Card [Reply]
Its great work, I have also published one article on SE30 but
not as this much detail.
Good job keep it up.
Excellent
2009-12-20 21:17:23 Benu Mariantony Business Card [Reply]
Excellent Blog.. Would have saved a lot of time if i know this
before...
Very useful blog!
2009-12-19 14:35:30 Victor Konstantinovich Alehin Business Card
[Reply]
Thanks! I just have save a few days of my life!
!
Good
2009-12-18 20:53:23 Chintan P. Contractor Business Card
[Reply]
Fantastic Blog with useful info.
well done
2009-12-16 05:39:56 Sergio Ferrari Business Card [Reply]
very useful topic
Good effort..
2009-12-14 19:02:19 Uthaman Palaniappan Business Card
[Reply]
But I do want to comment that for finding from where the message
was issued for SE38, we could still use "watch-points", which
is
equally quicker and cheaper(in terms of effort).
I appreciate your effort ...
Bye,
Uth
Good effort..
2010-01-20 15:13:06 Naimesh Kundanani Business Card [Reply]
Even better, just keep a break-point on Statment "Message" ,
it'll be seconds before you reach the desired statement.
This is how i teach the functional consultants in our team, cos
just /H & they are on their way... while SE30 & other tools
are best
left to developers.
Regardless, your blog is most enlightening, thank you :)
Good effort..
2009-12-15 00:52:45 Olga Dolinskaja Business Card [Reply]
Page 14 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) -
How to analyze ABAP prog...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050
-
Hi Uth,
in the example with a message you could indeed set a watchpoint
on a variable SY-MSGNO and debugger would stop as soon as it
changes. But it works only if you know that message number is
stored in the SY-MSGNO. If you dont know it you cannot work
with
a watchpoint. The ABAP Trace makes sense if you are not familiar
with the code and variables and need quickly to analyze its
behavior.
Best Regards,
Olga.
Good one!!
2009-12-14 08:36:57 Raja Thangamani Business Card [Reply]
Good one... Keep it up.
Raja
Great
2009-12-14 02:38:34 Bjorn-Henrik Zink Business Card [Reply]
Hi,
thanks for an excellent blog. Very useful information,
especially the part on HTTP tracing.
/Bjrn-Henrik
Great
2009-12-15 00:54:43 Olga Dolinskaja Business Card [Reply]
Thank you very much! I hope it will help to analyze the behavior
of Web Dynpro applications as well.
Great
2009-12-14 02:42:34 Bjorn-Henrik Zink Business Card [Reply]
Hi again,
in fact, the blog is fantastic and the most useful blog I have
read this year on SCN. It will surely speed up my analysis of
HTTP/RFC
applications.
/Bjrn-Henrik
Awesome..!
2009-12-13 23:57:16 Ramakrishna Sirasanagundla Business Card
[Reply]
Good one, very helpful...
ABAPer
2009-12-13 22:03:48 Kanakaraj G Business Card [Reply]
Good one, very Help for abaper to analyze the performance
issues.
at least 100 points from me
Page 15 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) -
How to analyze ABAP prog...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050
-
2009-12-12 05:35:45 greg misiorek Business Card [Reply]
very helpful and comprehensive. thank you for sharing.
Awesome!
2009-12-11 22:40:36 Ritesh Mehta Business Card [Reply]
Very Nice blog and very much required one. Helps to analyze the
performance issues.
Awesome!
2010-01-02 10:24:30 S N Business Card [Reply]
Thanks for the blog ,I am a functional person. with your blog
reference i have solved my batch job issue.
Thanks again
S.N
Showing messages 1 through 47 of 47.
Page 16 of 16SAP Network Blog: ABAP Runtime Analysis (SE30) -
How to analyze ABAP prog...
28/02/2010http://weblogs.sdn.sap.com/pub/wlg/17050