How to use ST12 trace for analysis

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

2018-08-17 2436955

2436955 - Step by step instructions on how to use ST12


trace for analysis
Version 5 Type SAP Knowledge Base Article
Language English Master Language English
Release Status Released to Customer Category How To
Component SV-PERF (Performance Messages) Released On 26.03.2018

Please find the original document at https://launchpad.support.sap.com/#/notes/2436955

Symptom

Documentation for how to collect and analyze ST12 trace for performance issue.

Environment

Transaction ST12 is available as of basis release 4.6B. It is delivered via the addon ST-A/PI (Application
servicetools for EarlyWatch/GoingLive, see note 69455).
The ST-A/PI version should be 01F* or higher.
The feature to switch on the ABAP trace for another user requires
-> on basis 4.6*: Addon ST-A/PI >= 01F*, Kernel 46D patchlevel >= 1805
-> on basis 6.x: Addon ST-A/PI >= 01G*, Kernel 640 patchlevel >= 83
-> on basis 7.0 or higher: Addon ST-A/PI 01G*

Resolution

ST12 was developed to promote the usage of ABAP trace, to integrate ABAP and performance traces (SQL
Enqueue RFC, transaction ST05) and to make the tracing
and analysis process faster and more convenient. ABAP trace with ST12 is the central entry point for
performance analysis. It should be used to detect top-down any
performance hotspot, for functional time distribution analysis, and to optimize ABAP/CPU bound issues. SQL
trace should be used for DB bound issues.

The ST12 trace analysis will follow the below mentioned steps:

• Selection of Trace Parameters


• Start and Collect Trace
• Analyzing the Collected Trace

Trace Parameters:
The Trace parameters can be categorized as below:

· Trace For
· Type of Trace

Trace for:

The User/Tasks allows the developer to select a User for whom the trace is to be captured and a task for
whichthe trace is to be captured. Task can vary from Dialog,
batch etc. Selecting * in Tasks indicate all the tasks will be captured.

© 2018 SAP SE or an SAP affiliate company. All rights reserved 1 of 11


2018-08-17 2436955

The Workprocess allows to select the server for which the trace is to be captured.In general all the servers will be
captured
when not specified.

You can then select "start traces".


This will bring you to a SM50 style view of your work processes for the selected server.
With this, you can then highlight the desired work process and select "activate trace".
This is a manual process so when you are satisfied with the trace runtime, you can then select "collect trace".

© 2018 SAP SE or an SAP affiliate company. All rights reserved 2 of 11


2018-08-17 2436955

The Current Mode option is used trace the flow of a Transaction or a Program.

The Schedule option is used to run the trace for a batch job for a varied selection criterion as Job name, User name,
Program
associated with the Job.
For how to trace background job using ST12, please see Note 2169881.

© 2018 SAP SE or an SAP affiliate company. All rights reserved 3 of 11


2018-08-17 2436955

Type of Trace:

ST12 trace can be initiated as an ABAP Trace or Performance trace or both. Setting the Size&Duration Parameter to
MAX as
highlighted will ensure that the whole trace is captured in case the trace extends to a long duration.

Start and Collect of Trace:

Let us assume that the trace is to be taken for flow associated with checking the Info type 0001 data of a user through
PA20.
First set the required Trace parameters. Let us select User/Task option by giving the Comment, User Name, and Task
type as *.
And select Start Trace.

© 2018 SAP SE or an SAP affiliate company. All rights reserved 4 of 11


2018-08-17 2436955

Now open the transaction PA20 and reproduce the performance issue:

Now Select End Trace in the ST12 trace screen, this will take us to the collect trace screen. Click on the execute

© 2018 SAP SE or an SAP affiliate company. All rights reserved 5 of 11


2018-08-17 2436955

button to collect
the trace details. Make sure the highlighted check box is unchecked if the trace is to be used for future analysis.

Analyzing the collected trace

Once the trace is collected the trace is ready for analysis. In the bottom pane as highlighted, select the Trace which
is of concern to us.

Then select either one of the above 4 highlighted options for the analysis.The 'Full screen' button can be used to show
the
overview of all the traces collected.

© 2018 SAP SE or an SAP affiliate company. All rights reserved 6 of 11


2018-08-17 2436955

Traces for Batch processing

Please note that the maximum duration for an ST12 trace will be 4200 seconds and a file size of 99MB (default size is
20MB which is recommended).
The recommendation for long running jobs is to manually trigger a trace at the begging, middle and end of a long
running job if possible.
There is alao an additional option to trace the job using a delay option, to start at a point in the programme.
Furthermore, there is an feature that allows follow up traces (see highlighted below) where consequtive traces can be
taken (for example 2 traces @ 4200 seconds per trace).

You can also schedule a single trace using Job name, User and ABAP programme to trace the correct issue.

ABAP Trace

The ABAP trace is one of the most useful analysis options available in ST12 trace. It provides a Top Down flow of any
Hotspot/Program/Transaction
and provides a Functional Time Distribution of a flow. It displays the hierarchical order in which the call statements are
executed. So it can be used
to identify the issues in the flow hierarchy.
For Basics of ABAP trace,please see Note 755977.

© 2018 SAP SE or an SAP affiliate company. All rights reserved 7 of 11


2018-08-17 2436955

The above screenshot is a Per Call View of the ST12 trace. The view can be changed into a Modularized by selecting
the Per Mod Unit button
as highlighted above. This will give a modularized flow of the Code called inside a particular module.

The “Top Down Call Tree”(as highlighted below) option clicked when the cursor placed on a Modularization Unit
Call(Method/Performs) displays
all calls to the selected unit labeled as ‘0’,’1′ are statements inside this modularization units, ‘2’ the
statements in modularization units one level below,
and then iteratively down up to 30 levels. Letters are used to designate lower levels.

© 2018 SAP SE or an SAP affiliate company. All rights reserved 8 of 11


2018-08-17 2436955

Double clicking on any of the line navigates us to the source code. This can be used to identify the impact point.
ST12 trace captures the minute details of the flow such as the Loop statements performance, which can be used for a
detailed analysis of the flow.

As the ABAP trace captures the complete flow, this can be used as an effective tool to identify the Customer
Modifications or User Exit.

Note: The call hierarchy considers the call on Forms, Methods, Functions, SQL statements, Loops, Call Screen to
PBO, PAI Modules.

Comparison of ST12 with ST05 trace

ST12 ST05
Traces only a specific user context or a Traces every action of a user on a server
transaction
ST12 trace automatically turns off with a ST05 trace has to be manually turned off
transaction
Stores the trace into database and is Stores the trace into local files and
permanent overwritten regularly
Provides a Top-Down flow used to find Provides a bottom-up flow which is
performance hotspot, issues identified by suitable for identifying DB bound
which are usually solved by code changes. performance issues, which are usually
solved by Performance Tuning.

Performance Trace

Performance trace of ST12 is equivalent to the ST05 trace. It displays performance parameters of all the database
statements executed in the flow.

© 2018 SAP SE or an SAP affiliate company. All rights reserved 9 of 11


2018-08-17 2436955

SQL Summary

SQL summary provides the details like Execution time, No. of records selected, Total duration, server details, etc. on a
query on a database table. Double clicking on any record takes the flow to a screen which displays the list of
programs which has queried on the table and the SELECT query as such.

Statistical Records

The statistical records display the time related parameter of a particular transaction flow.

See Also

© 2018 SAP SE or an SAP affiliate company. All rights reserved 10 of 11


2018-08-17 2436955

755977 - ST12 "ABAP Trace for SAP EarlyWatch/GoingLive"


2424940 - How to get ST12 trace for Planning Sequence
1959493 - How to get ST12 trace for DTP request
2169881 - How to trace background job using ST12

Keywords

ST12 trace , performance analysis tool , single transaction , high response time , st12 abap trace , net time ,
performance traces , SQL summary, stat records , ENQUEUE trace , RFC trace , ST05,SE30

Other Components

Component Description

SV-SMG-SDD Service Data Download

This document refers to

SAP Note/KBA Title

2424940 How to get ST12 trace for Planning Sequence

2169881 How to trace background job using ST12

1959493 How to get ST12 trace for DTP request

755977 ST12 "ABAP Trace for SAP EarlyWatch/GoingLive"

© 2018 SAP SE or an SAP affiliate company. All rights reserved 11 of 11

You might also like