How to use ST12 trace for Analysis?
ST12 (Single Transaction Analysis) was initially developed for promoting the usage of ABAP trace, for integrating ABAP and performance traces (SQL Enqueue RFC, transaction ST05) and for making the entire process of tracing analyzing process faster and much more convenient. ABAP trace with ST12 is the main focal entry point for performance analysis. This should ideally be used for detecting any top-down issues related to performance hotspot, for functional time distribution analysis, and for optimizing ABAP/CPU bound issues. SQL trace should typically be utilized 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:
Trace Parameters:
The Trace parameters can be categorized as below:
- Trace For
- Type of Trace
Trace For:
The User/Tasks permits a developer to select a User for whom the trace is to be captured along with a task for which the trace has to be captured. The task can generally vary from Dialog, batch etc. By selecting * in Tasks show all the tasks that are captured.
The Work process permits the user to select the server for which the trace should be captured. Generally, all the servers will be captured even when not specified.
The Current Mode option is utilized for tracing the flow of a Transaction or a Program.
The Schedule option is mainly used for running the trace for a batch job for a varied selection criterion such as a user name, Job name, Program which is related to the Job.
Type of Trace:
ST12 trace can either be started as an ABAP Trace or Performance trace or both. If the trace extends to a long duration, then by setting the Size & Duration Parameter to MAX as highlighted ensures that the entire trace is successfully captured.
Start and Collect of Trace:
Assuming that the trace has to be captured for the flow associated with checking the Info type 0001 data of a user through PA20.
You need to first set the required Trace parameters. Select the User/Task option by giving the Comment, User Name, and Task type as *.
And select Start Trace.
Now user needs to open the transaction PA20 and regenerate the performance issue
Now upon selecting the End Trace in the ST12 trace screen, the user will be taken to the collect trace screen. A user should click on the execute button to collect the trace details. You need to ensure that the highlighted check box is unchecked in case the trace has to be used for future analysis.
Analyzing the Collected Trace
The trace is ready for analysis, once the trace is collected. The bottom pane is highlighted, user selects the Trace which concerns us.
User selects one of the above 4 highlighted options for the analysis. The overview of all the traced collected can be seen in the 'Full screen' button.
Traces for Batch Processing
- It is to be noted 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).
- By manually triggering a trace at the begging, middle and end of a long running job is suggested for long running jobs, if possible. The delay option allows the user to trace the job by starting at a point in the programme.
- Additionally, there is a feature which permits follow up traces where consecutive traces can be taken (for example 2 traces @ 4200 seconds per trace).
- The user can also schedule a single trace by using the Job name, User and ABAP programme for tracing the accurate issue.
ABAP Trace
In ST12, the ABAP trace is known to be one of the most useful analysis options. ABAP trace provides a Top Down flow of any Hotspot/Program/Transaction
along with providing a Functional Time Distribution of a flow. ABAP trace also displays the hierarchical order in which the call statements are executed. Therefore, it can be used for identifying the issues in the flow hierarchy.
In the above screenshot one can see the Per Call View of the ST12 trace. The view can be modified into a modularized by selecting the Per Mod Unit button as highlighted above. This will give a modularized flow of the Code called which is present inside a particular module.
The “Top Down Call Tree” option when clicked on the cursor placed on a Modularization Unit Call(Method/Performs) exhibits all the calls to the selected unit which are 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 utilized for designating the lower levels.
The user can be navigated to the source code by double clicking on any of the line and this can also be used for identifying the impact point. ST12 trace allows the user to capture the minute details of the flow such as the Loop statements performance, and this can also be utilized for a detailed analysis of the flow.
ABAP trace is a very effective tool and can be used for identifying the customer modifications or user exit, as the ABAP trace captures the complete flow.
Note: The call hierarchy contemplates the call on Methods, PAI Modules, Loops functions, Forms, SQL statements, Call Screen to PBO.
Performance Trace
Performance trace of ST12 is equal to the ST05 trace. The performance parameters of all the database statements executed in the flow are displayed here.
SQL Summary
SQL summary lists down details such as No. of records selected, server details, Execution time, Total duration, etc. on a query on a database table. By double clicking on any record takes the user to the flow to a screen which displays the list of programs which have been queried on the table and the SELECT query as such.
Statistical Records
The time-related parameter of a particular transaction flow is displayed in the statistical records.