Single Transaction Analysis (ST12) - Introduction

 Single Transaction Analysis (ST12):

Single Transaction Analysis was developed to promote the usage of ABAP trace inside SAP Support and it integrates the ABAP- (tcode SE30) & the Performance (tcode ST05) trace into one transaction. We will show how to take a trace with ST12 in the so called 'Current Mode' scenario.

Tcode ST12 is delivered as a part of the Service tools for Applications [ST-A/PI].The note 69455 describes how to get the latest version of ST-A/PI. we should note that the ST12 transaction is not officially documented / supported & only available in the English language. Although it is mainly intended for use by SAP / certified service consultants during SAP Service Sessions and you can use it for you own performance analysis. A description of tcode ST12 is given in the note 755977 [ ST12 “ABAP Trace for SAP Early Watch/Going Live”].

Tcode ST12 main Screen:

Main screen of tcode ST12 has three main parts as shown below,

Figure 1: main screen

Snapshot one: Main screen

Using tcode ST12 with Current Mode:

During 'Current Mode' Scenario you are going to trace the execution of a program/transaction. Before we trace, it is recommended to execute your program/transaction several times to fill the buffer & caches, as filling the buffers & caches is something that can not be optimized with ABAP / SQL tuning. Before we can start the trace we have to define the measurement scope. In tcode ST12 this is done 'on the fly', no measurement variants are saved. After starting tcode ST12 & clicking on 'Current Mode' (check number1 in figure 1) you will see a screen like figure 2.

Figure 2: Current Mode

Snapshot two: Current Mode

Now we can enter a comment to give a meaningful description for the traces. Then enter your program or transaction in the corresponding field & set the appropriate radio button, see number 2 in figure 2. The Lower part of the screen which we define the measurement scope. The left part is for the ABAP trace [tcode SE30] & the right part for the Performance Trace [tcode ST05] see number 3 in figure 2.

Tips: Since tcode ST12 uses the functionality of both transactions [tcode SE30 & tcode ST05] the options are similar or the same. Tcode ST12 hides some details to make the traces more easy to use.

ABAP trace are the most important decision is if you want to trace 'with internal tables'. And it is recommended to switch this setting ON. The other options are like Particular units, Filters or 'Further opt' : are only needed in exceptional cases & beyond the scope of this 'getting started' blog.

Then if you click on 'Further opt' [see number 4 in the figure 2] the following screen pops up --

Figure 3: further Options

Snapshot three: Further Option

Increase the 'Maximum size of the file is' to 20 MB [see number 5 in the figure 3] & the 'Maximum trace runtime' to 3600 seconds [see number 6 in the figure 3] if you have long running programs. Aggregation is set to 'by calling position' by default which is recommended option. All the other option only have to be changed in exceptional case. Ex: if you get strange / negative times in the ABAP traces, you should use the low resolution clock.

aPerformance trace we can decide whether we want to take the SQL - Enqueue - and / or RFC trace. Above scenario is only for the SQL Trace when it is switched ON. SQL Traces is the most important performance trace.

This is all you have to do. You can start your program / transaction now by clicking 'Execute or start trace' [see number 7 in the figure 2]. After your program / transaction has finished & you have returned to ST12 you will see your trace in the lower part of the screen.

The status column [see number 8 in the figure 4] shows you whether your trace is ready for evaluation. There might be a red & white circle which means the ABAP trace is still being imported into the database. The yellow flash indicates a measurement error [for example: time limit exceeded and file size to small,.etc).The green tick shows that the ABAP trace has been successfully imported to the database.

Tcode ST12 imports the ABAP trace files into the database, in order to make them available in the whole system & keeps them for later analysis. In tcode SE30 the trace files are application server specific & deleted after a certain number of days. The performance trace is not imported by tcode ST12 & therefore is only available until the trace files are overwritten.

For evaluation of the traces you can click on ABAP trace [see left arrow in the figure 4] in order to display the imported ABAP trace. List on figure 3 has been sorted descending by the Net column which means the total times for each calling position is displayed in descending order only.

To evaluate the performance of traces just click the button Performance traces, then we can see right arrow in figure 4. it will display the basic list of the performance trace. For the SQL trace this is recommended to start with the statement summary.There-fore in basic list click Menu Trace List -> Summary by SQL Statements. In the figure 3 on the right bottom you can see an ex. of the SQL Trace Summary.

Tips: kindly refer to The SQL Trace [tcode ST05] – Quick and Easy Blog [The SQL Trace (ST05) – Quick and Easy] for further details on tcode ST05 analysis.

Figure 4: Trace Analysis

Snapshot four: Trace Analysis

Summary:

Order to take an ABAP & SQL Trace at the same time for a program you are going to execute the following steps as shown below,

  • 1.) Call ST12, click on CURRENT MODE (Number 1 in the figure 1)
  • 2.) Fill in the program or transaction and a meaningful comment (Number 2 in the figure 2)
  • 3.) Define the measurement variant.
  • a. Switch on ABAP and SQL Trace and use internal tables (Number 3 in the figure 3)
  • b. Increase the file size and the duration (Number 4 in figure 2 and Number 5 and 6 in the figure 3)
  • 4.) Execute your program (Number 7 in the figure 2)
  • 5.) Evaluate the trace (figure 5).

Hope this helps. Thank you everyone.

Comments

Popular posts from this blog

EVENTS IN INTERACTIVE REPORTS OF SAP ABAP

SAP ABAP Fresher Resume/ CV Writing Format..

CONCEPTS OF INNER JOIN AND OUTER JOIN in SAP ABAP