Prerequisites
You have traced your ABAP program either Tracing an ABAP Program or by
Scheduling a Trace. Your trace can be made from the ABAP Development Tools or from transaction SAT in the integrated SAP GUI.
The trace has aggregation set to No, as in this sample from the ABAP Requests view.

If a trace is aggregated, then the trace does not record individual trace events.
Rather, the trace accumulates events at the same call position into a single trace record.
The Call Tree function is not offered in the context
menu if a trace was recorded with aggregation active.
Context
Use the ABAP Trace Call Tree view to analyze the execution
path of a program. You can use the Call Tree to do the following,
for example:
- Analyze the flow of a program as part of the analysis of an error. You can see which ABAP programs are involved in the error and easily find useful places to set breakpoints.
- Understand how an unfamiliar program works and which ABAP programs play a role in its execution.
Here is how to use the Call Tree to the analyze the flow of program execution.
Procedure
- Open the Call Tree by selecting a trace in the ABAP Traces view and choosing
Display Call Tree from the context menu or from the trace overview.

The Call Tree opens in a new view of its own.
It starts with a display of the top-most branches
of the call hierarchy. The main users of run time are highlighted with boldface.
The Show/Hide toggle link lets you display or hide non-procedural trace events
in each procedure, such as database activity or use of internal tables.

- Drill down to the section of the trace that particularly interests you. There you can see which
programs participated in processing and analyze the flow of processing at the level of procedure calls.
Then expand the trace using the Expand All ... Entries function in the context menu.
In this example, we want to see how a document-reader component works by tracing
its ABAP Unit tests. We have drilled down to the RUN_ABAP_UNIT method by
following the procedures that account for the bulk of the run time. Now, we use the
context menu to Expand All Entries as of RUN_ABAP_UNIT.

- Use the information resources of the Call Tree to understand the program flow and analyze the runtime behavior of the program.
In this sample, we want to understand the most expensive call to the method GET_DOCUMENT_FROM_DOCU_SYSTEM, which had a runtime of around 17 milliseconds (Total Time).
In this first view, the structure of the method is clear:
- It calls a function module from SAPLSDOC to fetch a document.
- It then calls a series of methods that perform operations on the document, such as resolving text symbols.

As you take a closer look at the trace excerpt, there are some interesting features to look
at. First, the DOCU_GET function module uses almost as much
'own' (net) runtime as total runtime. What is it doing? Click Show to
see what used the time in DOCU_GET. In fact, the Own
runtime is accounted for by database operations on the three ABAP
documentation tables.

Then, the calls to the native methods of class CL_DOCU_ADT_ITF_DOCU_READER
have very low Own Time values. What are these methods calling?
Expanding the methods shows that they call function modules from various
function groups. A check of these function groups shows that they all belong
to the ABAP documentation system. So, class
CL_DOCU_ADT_ITF_DOCU_READER essentially encapsulates an
older function-module-based API.

Results
We now understand basically how the class works and what runtime resources it consumes.
We know that refactoring the class would require taking over and renovating the older function-module APIs that the methods of the class use.
Tip
- Should you wish to take a closer look at the code or set a break point in the code, just double-click on an entry.
The ABAP editor opens in a separate window, positioned where the aggregated trace event occurred.
- To take a look at the aggregated impact of the trace event on runtime, choose Show in Hitlist from the context menu of an entry.
You can see how the aggregated trace event ranks among the runtime consumers in the trace.
- To Displaying the Call Stack that lead to a trace event, choose Show Call Stack in the context menu.