Leseprobe
2.1 Performance analysis
There are different tools for performance analysis in SAP systems. Examples include:
- Performance trace with transaction ST05
- ABAP runtime analysis with transaction SAT
- Single transaction analysis with transaction ST12
In the following I will explain the first two tools.
2.1.1 Analysis with transaction ST05
Transaction ST05 is probably the best known tool for performance analysis. As an alternative to using the transaction code, you can access the tool via the pull-down menu System • Tools • Performance Trace. This tool allows you to perform different performance analyses:
- SQL trace: records database access to programs and transactions
- RFC trace: records access to RFC function modules (remote function call) across several SAP systems
- Enqueue trace: records object locks
- Buffer trace: records access to the table buffer
- HTTP trace: analyzes the data interface between the SAP server and the web application server when using the Web Dynpro technology
The performance analysis allows you to record one or several of these aspects. The detailed explanation below is limited to the SQL trace, that is, the recording of database accesses.
In an additional screen session we use the example program ZCU_ABAP_PERFORMANCE and select the programming technique VIEW. In a program run, 2,295 records are selected for 300 selected business partners (table BUT000) with their contract accounts (table FKKVKP) and their contracts (table EVER).
Before starting the program, use transaction ST05 to access the performance analysis on another screen (see Figure 2.1).
Figure 2.1: Selection screen of transaction ST05 (performance trace)
After selecting the SQL trace, start the performance recording of database accesses for the current user by clicking .
No parallel program runs during performance analysis
When using the performance analysis, make sure that no further programs are running on the SAP system under your user name (e.g., background programs), otherwise the analysis will return incorrect results.
Now start program ZCU_ABAP_PERFORMANCE in another session. As soon as the program displays the selected records, change to the session where the SQL trace performance analysis is running. Click to stop the performance recording.
Next, start the display of the SQL trace by clicking .
Figure 2.2: Selection screen for displaying the SQL trace
On the subsequent screen (see Figure 2.2), you can restrict the selection of the performance trace. On this selection screen, the period of the last performance trace of the user is defaulted. Accept the selection without any changes by clicking . The log of the database accesses of the last program run appears.
Figure 2.3: SQL trace of a program run with the programming technique VIEW
The performance log in Figure 2.3 shows that in total, the selection of the records takes 48,038 microseconds (0.000001 seconds). Hence, the program run lasts approximately 0.048 seconds.
On certain lines you can navigate directly to the record source code. Select a line and double-click one of the buttons shown in Figure 2.4. This allows you to get additional information from the trace log.
Figure 2.4: Button strip in SQL trace
The button, for example, shows the SELECT
statement recorded for the corresponding line (see Figure 2.5).
Figure 2.5: Display of a SELECT statement in the SQL trace
By clicking the button, you can display information from the Data Dictionary for the table or view used in the SELECT
statement (see Figure 2.6).
Figure 2.6: Dictionary information in the SQL trace
Clicking the buttons on this screen allows you to display further information:
- : index fields of the table or view
- : all selected table fields
- : the tables involved
- : all indexes of tables involved
Clicking the button in the SQL trace allows you to display the strategy of the database system for selecting the records: the respective costs and the respective number of lines selected. You can use both values only as a benchmark but not as absolute values.
2.1.2 Runtime analysis with transaction SAT
With transaction SAT, you can perform runtime analysis for any ABAP programs. This transaction is the modern alternative for the “old” transaction SE30.
This ABAP runtime analysis allows a complete check of the program in question. The possibilities go far beyond a simple SQL trace with transaction SE05. To explain the runtime analysis with transaction SAT, we again use program ZCU_ABAP_PERFORMANCE (see Figure 2.7).
On the selection screen for this transaction, in the area In Dialog, select Program and enter the name of the program. No further input is necessary.
Figure 2.7: Selection screen for transaction SAT
Start program ZCU_ABAP_PERFORMANCE by clicking . The selection screen for the program appears and here you can enter the necessary input for selection. Then start the program run in the normal way. In this example we use the program variant View with Pre-Selection.
Once the program run is ready, go back to the runtime analysis by clicking twice. The program analysis displays the result overview shown in Figure 2.8.
Figure 2.8: Runtime analysis of a program run
On the tab Desktop 1, you can see the time the program needs to process commands in the various program parts and the database accesses required to do so (see Figure 2.9).
The right-hand side of the screen allows you to consider different analysis results simultaneously.
Figure 2.9: Runtime trace results
On the Hit List tab, you can group trace events of the same kind. The times of the grouped trace events are added up. The DB Tables tab shows the database tables used in the program and the times for the access to these tables (see Figure 2.10).
Figure 2.10: Database accesses and their times
The Times tab shows the program commands in detail and the times needed for processing (see Figure 2.11).
Figure 2.11: Times of statements and events
The figures in the runtime analysis also show the database accesses and the program commands of the SAP system programs. They also show database accesses and program statements of SAP system programs. This is the only thing that the developer cannot influence.
As you can see, the runtime analysis with transaction SAT offers significantly more detailed analysis results compared to the performance trace with transaction SE05.
Alle Inhalte. Mehr Informationen. Jetzt entdecken.
et.training - Ihre Lernplattform für SAP-Software
- Zugriff auf alle Lerninhalte1
- Regelmäßige Neuerscheinungen
- Intelligenter Suchalgorithmus
- Innovatives Leseerlebnis
- Maßgeschneidere Lernpfade
- Zertifikate & QA-Tests2
1 Sie erhalten Zugriff auf alle Lerninhalte. Online-Trainings, Zertifikate sind NICHT Teil der Flatrate.
2 Weitere Informationen auf Anfrage.