SAP Performance Analysis - AC
SAP Performance Analysis - AC
PUBLIC
Overview of today’s topic
• Over the years there have been many tools developed for performance analysis on an SAP
NetWeaver ABAP application server. Like the tools in a toolbox, each has its own special
purpose. There is one however that over time has shown itself to be the ultimate trace tool for
transactional analysis.
• Today we are going to look at the usage of the ST12 Single Transaction Analysis trace tool, its
features and how you can apply it in your systems to the maximum effect.
• ST12 was developed internally within SAP Support due to frustrations with the limitations of the
ABAP trace (SE30) and the performance trace (ST05). It is part of the add-on ST/A-PI and is not
officially documented as it was primarily intended as a tool for SAP Support and certified
consultants during SAP Service Sessions such as the GoingLive Check or a Business Process
Performance Optimization (BPPO).
• All the details can be found in SAP Note 755977 - ST12 "ABAP Trace for SAP
EarlyWatch/GoingLive“ which whilst dated 2006 still provides a solid overview of the tool.
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 3
Agenda
▪ Key takeaways
▪ Goal
The aim of Performance Optimization is to improve the runtime of
either the overall system or individual transactions.
▪ Scope
• Use standard transactions ST02, ST03, ST06 and trace tools to
analyze the system in question and determine if there are any
system-level issues (affecting all users and transactions) or any
application-specific issues affecting individual transactions or
reports.
• In this example we can see transaction IW37 took 30 minutes
before ending in a time out situation.
• The transaction IW37 Change Operations was traced using ST12
and an expensive access to the database view AFVC was identified
and tuned, thereby reducing the average runtime to less than one
minute. The graph shows three tests on 31st March with the
optimized runtime.
▪ Benefits
• Elimination of costly performance bottlenecks
• Improvement of response times
• Improvement of database request times
• Optimization of hardware resource usage
• The ultimate reference for all things related to SAP Performance Optimization is the book
published by SAP Press. It is currently in its 8th edition. Its author Thomas Schneider has
updated the book for over twenty years.
• There are also many SAP Notes, Knowledge Base Articles, blogs and whitepapers available on
the topic.
• In our discussions of ST12 we are assuming a basic understanding of performance tuning.
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 8
Performance Optimization Prerequisites
Technical prerequisites
◼ Managed Systems / Systems to be analyzed
▪ User with sufficient authorizations as per 1405975 (ST12, ST05, SE30, STAD, ST03,
etc.)
▪ SAP Note 1634757 and SAP Note 1609155 for ST12 Trace Analysis
▪ Reproducible transactional performance problem within connected SAP systems
▪ Use report RTCCTOOL to ensure that the latest versions of add-ons ST-PI (SAP Note
539977) and ST-A/PI (SAP Note 69455) are implemented
▪ Running EarlyWatch Alert on managed systems (optional)
• Data required for this session must represent your normal daily operations
• Transactions and data to be used for this session must be suitable for a trial run of all the functions you
use in your production environment.
• All transactions can be executed several times (prepare a reusable scenario) – filling buffers
• After running the step at least once, you should execute the step together with an ST12 trace for one
action only (e.g. hit "Save" button within one transaction).
• Different ST12 trace execution modes exist which we will go into in detail
▪ Trace capturing
Collect additional data
▪ Collection of additional data
▪ Analysis of the trace Trace Analysis
• Per instance
ST12
• Across instances
• Stored in database
1 2
1. Collect external traces (Manual)
2. Activate values
4. Activate
4
5. Write to Buffer
5
Trace Recording
to login to the system can
execute the Activate Trace Execute Application
program/transaction in Dialog
mode
Display
Display
ABAP Trace Performance Trace SQL Summary Stat. Records Others
Analyze
ABAP Trace
SQL Trace
1
1. Choose Current Mode
2
2. Enter trace description
3 5
3. Enter name of program being analyzed e.g.
Z_ITAB_ALL 4
4. Choose options
5. Execute
1
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 27
ST12 trace capturing
Current Mode, back to ST12
1. Trace is finished
2. Trace is created
3. The trace is still being imported into the database
(red and white circle)
3
2
1
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 28
ST12 trace capturing
Current Mode, Trace is generated
2
1
Trace Recording
/ron, /roff
login to the system can execute
the program/transaction in Activate Trace Execute Application
Dialog mode.
Display
only a specific part of the
execution of a transaction.
ABAP Trace Performance Trace SQL Summary Stat. Records Others
Analyze
Start Report
Note: The SQL trace (dashed grey Execute Results Back
Z_ITAB_ALL
arrow) records the whole execution
of the transaction and not only
particular units of it. ABAP Trace
SQL Trace
1
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 33
1
3
ST12 trace capturing
Current Mode, particular units – tracing on
2
© 2021 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 35
1
ST12 trace capturing
Current Mode, Particular units trace result
Trace Recording
running program.
Activate Trace
Deactivate Trace
Display
Display
ABAP Trace Performance Trace SQL Summary Stat. Records Others
Analyze
1. Choose ‘Workprocess’
1
2. Enter a descriptive comment to
ease the identification of the 2 3
trace 3
5
3. Choose Application Server
4
- This will include a list of all the
Application Servers on your
system. The system used only
had a single Application Server
and thus, only the <Local >
server is listed
4. Choose options
5. Start traces for workprocress
1 3
Trace Recording
performing, or a single task type. Exec 3
Activate Trace HTTP
Exec 2
Ensure the user being traced is
DIA Deactivate Trace
only executing actions relating to
the process step being traced.
Exec 4
This makes it easier to identify the BTC
corresponding trace. Display
Display
Example – it is possible to trace
only Execution 2 by specifying the ABAP Trace Performance Trace SQL Summary Stat. Records Others
task type. If it was not specified,
traces would also be collected for
Execution 3.
Analyze
6. Start trace
Trace Recording
executions which cannot be Background Automatic Trace activation
easily traced using the other Job
means (e.g. due to long Automatic Trace activation
execution, execution on
weekends / at night etc.) but can
be executed in the background Display
Display
ABAP Trace Performance Trace SQL Summary Stat. Records Others
Analyze
– Work process tracing is used, therefore, if the scheduled trace is starting during a long running SQL
statement, and after its “OPEN CURSOR” execution, then the ABAP recording will not start, only the
performance trace will record FETCH lines, and therefore no access to the ABAP source code is possible.
(see work process tracing example)
– At any one time only one ABAP trace request can be done by ST12. So do not plan parallel requests, only
sequential requests.
– If several jobs match the criteria set for the trace, only the first job will be traced, the others will be ignored
(only 1 work process can be traced)
Background Job
Parameters to set : Delay 14400s Trace 3
1. 1st hour : no delay, duration 3600 Delay 7200s Trace 2
7. Search 5
1. Statistical records 1
2
1. Select a record for detail
analysis 1
2. Detail of this statistical
record
3. Select all the relevant
records from the chosen
timeframe
3
1
The SQL Summary is imported
2
automatically and asynchronously after
the ABAP trace collection has been 3 5
finished.
5
• ABAP transactions follow the general ACID principle of Atomicity – Consistency – Isolation -
Durability
• Transactional correctness means that all data that is logically dependent on another has to be posted
either all together or not at all. The amount of database changes required for this operation is called a
Logical Unit of Work (LUW). These exist on both the database and the functional levels.
• An SAP LUW is a logical unit consisting of dialog steps, whose changes are written to the database
in a single database LUW. Multiple SAP LUWs combine to form an SAP Transaction.
• ST12 only considers statements of type INSERT, UPDATE, DELETE, COMMIT and ROLLBACK as
well as ENQUEUE, DEQUEUE and DEQUEUE ALL and brings them into a chronological order
depending on their trace time stamp. It analyzes the contents of the trace based on rules.
• The sigma symbol gives us a summation of the functions called. It is the first indicator of whether
we have an ABAP or a database issue to investigate.
• The analysis of ST12 traces can be considered an expert task and as such, SAP have
developed a number of supporting tools to help with the analysis.
• The main tool is Guided Self Services via the Solution Manager and there are various types of
this tool.
• In our case the Guided Self Service for Performance Optimization can be used for analysing the
ST12 trace
▪ Goal
Use in all phases of your application lifecycle management the various
SAP service best practices built and proven by SAP’s Centers of
Expertise. Guided procedures enable you to tailor the service content
to the relevant one for your requirements and solution environment.
▪ Scope
• Guided analysis based on automated data collection and data
evaluation
• Guided follow-up actions
• How to implement the service recommendations
• How to control the future target to ensure that any deviations
are corrected (e.g. control of Business Process KPIs)
▪ Benefits
• Automation and Self-help industrialization
• Standardized expert collaboration and continuous learning
▪ Goal
The Guided Self Service Performance Optimization
helps to optimize your transactional performance
by using SAP Active Global Support application
analysis tools.
▪ Scope
• Automated pre-analysis of ST12 traces, Solution
Manager Diagnostics E2E traces and ST14 application
analysis
• Provide generic and specific recommendations how to
optimize SAP coding, customer coding and database
accesses
▪ Benefits
• Elimination of costly performance bottlenecks
• Improvement of response times
• Improvement of database request times
• Optimization of hardware resource usage
Starting Point
Optimal system set-up and tuning!
Technical Methods
General methods which are independent
Major from the application and which are purely technical
Focus Technical- Application Methods
Optimization techniques inside the application with a low
impact on core process
Application Methods
Major changes in the application with a high impact on the
set-up of the core process
There are different areas of tuning. As you will see later some of the tuning methods cover different areas:
▪ Parallel Processing
▪ Database Locks
▪ SAP Enqueues
▪ Workload Distribution
▪ Shared Resources
▪ Sizing
Option 1:
Goods Issue Posting in a single job
-> Time conflict
Option 2:
Goods Issue with three jobs in parallel
-> Executed within timeframe
Prerequisites:
Potential problems:
Database
NRIV
RF_BELEG 12345678
Solution: (General)
Solution: (Example)
Remarks:
Solution: (General)
Remark:
Prerequisites:
▪ Business allows a better schedule - there are no time requirements for the low priority jobs
Remark:
▪ The scheduling problem belongs to Application Operations. There are business and
technical requirements which might lead to conflict situations
Solution: (General)
App 1 App 2 App 3
▪ You can add application servers if they are required
Database
Remark:
User Exits
Solution:
Customer
Modifications
▪ Performance Tuning of ABAP Coding and SQL
Statements
▪ Specific background job constantly performing badly or even performing worse over
time
▪ Specific transaction constantly performing badly or even performing worse over time
Issue Identification
▪ Not only reactive – proactive monitoring using EWA/ST03/STAD
ST12 – Trace tool
▪ Central tool used to collect the necessary information needed for analysis
▪ Several methods available depending on the analyzed process
▪ Collects several trace types as well as collecting STAD information
▪ Start manual analysis with an overview and then classify the nature of the performance problem in terms of
which technical components are involved.
Acronym Meaning
www.sap.com/contactsap
www.sap.com/germany/contactsap