Performance Part 1: Measuring with ST05, SAT and STAD
Lessons are open to try during our launch period. Some advanced content may move to Pro later. AI practice limits apply separately.
Measure before tuning: STAD to see where the time goes (DB, CPU, wait, RFC), ST05 SQL trace (statements, executions, records, identical selects, execution plan), SAT runtime analysis (hit list, call hierarchy), and ST12 as a combined tool — with a repeatable measuring routine.
In this lessonShow sectionsHide sections
Visual overview
Expert visual walkthrough
Measuring with ST05, SAT and STAD
Performance Tuning · Chapter-specific technical teaching map
Component relationships
ST05 SQL trace
SAT ABAP trace
STAD workload
Baseline
Tutor's chapter takeaway
Measure before tuning: STAD to see where the time goes (DB, CPU, wait, RFC), ST05 SQL trace (statements, executions, records, identical selects, execution plan), SAT runtime analysis (hit list, call hierarchy), and ST12 as a combined tool — with a repeatable measuring…
In a real project
A team spent a week optimising internal table loops in a slow sales report because "the code looked inefficient". STAD then showed 92% of the runtime was database time. ST05 revealed one SELECT on VBFA executed 40,000 times…
Watch out for
• Tuning without measuring. • Tracing with tiny test data only. • Leaving ST05 traces running. • Ignoring identical/redundant selects. • Comparing cold and warm runs.
The situation: a real project scenario
A team spent a week optimising internal table loops in a slow sales report because "the code looked inefficient". STAD then showed 92% of the runtime was database time. ST05 revealed one SELECT on VBFA executed 40,000 times without a proper key.
Fixing that single access cut runtime from 25 minutes to 90 seconds. The team made "STAD first, then ST05 or SAT" their standard performance routine.
Explanation
The first rule of performance work is to measure before touching anything: STAD shows whether time is being spent in the database, in CPU/ABAP processing, in RFC calls, or in waiting, and that answer decides which tool to reach for next.
This lesson opens a ten-part series: Part 1 (this lesson) covers measuring with ST05, SAT, and STAD; Part 2 covers the database-first rule; Part 3 covers tuning in real projects — measure, fix, verify; Part 4 covers SELECT inside LOOP; Part 5 covers FOR ALL ENTRIES, its correct use and risks; Part 6 covers internal table performance across standard, sorted, and hashed tables; Part 7 covers JOIN versus FOR ALL ENTRIES versus nested SELECT; Part 8 covers HANA pushdown with Open SQL, CDS, and AMDP; Part 9 covers package processing for large volumes; and Part 10 covers indexes, selectivity, and WHERE conditions.
STAD, the statistical records transaction, shows per dialog step or job: response time, database time, CPU time, RFC time, wait time, and the number of records read. High database time points you to ST05; high CPU (ABAP) time points you to SAT; high RFC time points you toward the called system; and high wait time points toward a shortage of work processes or lock contention.
ST05, the SQL trace, is activated for your user, after which you run the program briefly, deactivate the trace, and display the results. Its summarized views include "Structure-identical statements" (the same statement executed many times) and "Value-identical" statements (the same statement with the same values, which means redundant reads). Key columns are executions, records, and duration per execution, and the "Explain" function shows the actual execution plan, including whether an index was used. Trace only for as long as you need to, since traces grow large quickly.
SAT, runtime analysis, lets you create a measurement for a program or transaction using a variant — for example, setting aggregation to none if you want the full call hierarchy. Its hit list shows statements and methods ranked by gross or net time, broken into processing blocks, including internal table operations; this is how you find expensive loops, nested reads against standard tables, and repeated calls. ST12 combines the SAT (ABAP) and ST05 (SQL) traces into a single tool, and is common on dedicated performance projects.
A sound measuring routine means using the same data, the same user, and warm buffers (so run everything twice), noting the runtime before and after each individual change you make.
To practice, run a slow report and check STAD for the split between database and CPU time, trace it with ST05 sorted by duration and look at the identical statements, and measure it with SAT and read through the hit list.
One thing to keep in mind throughout: tune based on measurements taken with realistic data volumes, since a program that's fast against 100 test records can be slow against 10 million production records. By the end, you should be able to measure where time actually goes and choose the right trace tool for the job.
Code example
* ===== Measurement routine (tools) =====* STAD : response time split -> DB / CPU / RFC / wait* ST05 : activate SQL trace (own user) -> run -> deactivate -> display* -> "Structure-identical statements": executions per statement* -> "Value-identical statements" : redundant reads* -> Explain : execution plan / index use* SAT : measure program with variant -> hit list (net/gross), call hierarchy* ST12 : combined ABAP + SQL trace * ===== Simple runtime measurement inside code (for comparisons in test programs) =====REPORT zperf_measure. DATA: lv_t1 TYPE i, lv_t2 TYPE i, lv_diff TYPE i, lt_vbak TYPE STANDARD TABLE OF vbak. START-OF-SELECTION. GET RUN TIME FIELD lv_t1. " GET RUN TIME: CPU-based stopwatch, independent of system load spikes SELECT * FROM vbak INTO TABLE lt_vbak UP TO 1000 ROWS. GET RUN TIME FIELD lv_t2. lv_diff = lv_t2 - lv_t1. " microseconds WRITE: / 'Runtime (microseconds):', lv_diff, / 'Rows:', sy-dbcnt.* Run twice: the second run shows buffered/warm times.Watch out
Common mistakes
- Tuning without measuring.
- Tracing with tiny test data only.
- Leaving ST05 traces running.
- Ignoring identical/redundant selects.
- Comparing cold and warm runs.
Do this
Best practices
- STAD first to classify DB/CPU/RFC/wait.
- ST05 for SQL, SAT for ABAP.
- Realistic data volumes.
- Measure before and after every change.
- Document findings with numbers.
In the interview
Interview angle
Questions: "How do you analyse a slow program?", "What does ST05 show?", "ST05 vs SAT?"
Strong answer: STAD for response time split; ST05 SQL trace (executions, records, duration, identical selects, explain plan) for DB time; SAT hit list/call hierarchy for ABAP time; ST12 combined; realistic data, before/after measurements.
Practice this lesson
Quick check
0 of 3 questions attempted
Question 1 of 3
STAD shows 90% database time for a slow report. Which tool do you use next?
Question 2 of 3
SQL trace is available in transaction:
Question 3 of 3
SAT (Runtime Analysis) primarily helps you find:
Practise this in an interview
Answer in your own words and get instant feedback, the way an interviewer would judge it.
1A slow finance report is blamed on the ALV display. How do you prove where the time really goes?
2A report takes 30 minutes. How would you start performance analysis?
Try a related Code Lab
This published exercise covers the same SAP topic. Apply the ideas in a hands-on scenario, then return to review your answers.
Open: Standard Table Lookup Slowing ABAP Runtime →See it in code
Each example starts from a requirement, shows the design, then the code step by step with a plain-language explanation of every part.
- The most common performance bug: SELECT in a loop versus one join, measured with ST05
- Let the database add up: GROUP BY, SUM, HAVING and a size label on sales items (VBAP)
- Modern ABAP: total per customer with VALUE, FOR, GROUP BY, REDUCE and an ABAP Unit test
- Modern ABAP expressions: VALUE, FOR, FILTER, COND, SWITCH and REDUCE
Was this lesson helpful?
Keep exploring
Interview questions on this topic
Related SAP topics
Referenced SAP objects
Reviewed reference pages for the objects this page mentions.
Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.