ERPClimb logoERPClimb
Performance Tuning
ABAP Developmentbeginner 6 min read

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.

Key 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 routine.

In this lessonShow sections

Visual overview

Performance Part 1: Measuring with ST05, SAT and STAD — learning sheetFlow: Run a slow report; check STAD for DB vs CPU time → Trace it with ST05 and sort by duration; look at identical statements → Measure it with SAT and read the hit list. Key ideas: STAD (STATISTICAL RECORDS); ST05 SQL TRACE; SAT (RUNTIME ANALYSIS); ST12. Watch out: Tune with measurements from realistic data volumes — a program fast on 100 test records can be slow on 10 million production records.ERPClimb.com / ABAP / LESSON 1/10 / LEARNING SHEETPerformance Part 1: Measuring with ST05, SAT and STAD1 · HOW IT FLOWS1Run a slow report; checkSTAD for DB vs CPU time2Trace it with ST05 andsort by duration; look atidentical statements3Measure it with SAT andread the hit list2 · KEY IDEAS EXPLAINEDStad (Statistical Records)Per dialog step/job: response time, DB time, CPUtime, RFC time, wait time, records read.High DB time → ST05; high CPU (ABAP) time → SAT;high RFC time → the called system; high wait →work process shortage/locks.ST05 SQL TraceActivate trace for your user → run program (short)→ deactivate → display.Summarised views: "Structure-identicalstatements" (same statement executed manytimes), "Value-identical" (same…SAT (Runtime Analysis)Create measurement for a program/transaction witha variant (e.g. aggregation none for callhierarchy).Hit list: statements/methods by gross/net time;"Processing blocks"; internal tableoperations.ST12Combines ABAP (SAT) and SQL (ST05) traces in onetool; common in performance projects.3 · REMEMBER · WATCH OUTRememberMeasure first: STAD shows whether time is in database, CPU (ABAP),RFC, or waiting — that decides which tool to use next.ST05 SQL trace shows each statement with executions, records,duration, identical selects and the execution plan — the main tool for…SAT (runtime analysis) shows where ABAP time is spent — hit list byduration, call hierarchy, internal table operations.!Watch outTune with measurements fromrealistic data volumes — a programfast on 100 test records can be slowon 10 million production records.4 · IN A REAL PROJECTA team spent a week optimising internal table loops in a slow sales report because "the code lookedinefficient". STAD then showed 92% of the runtime was database time. ST05 revealed one SELECT on VBFAexecuted 40,000 times without a proper key. Fixing that single access cut runtime from 25 minutes to 90…Original ERPClimb learning sheet • Verify against your SAP release and edition

Expert visual walkthrough

ABAP DEVELOPMENT ACADEMY · Component relationshipsERPClimb.com

Measuring with ST05, SAT and STAD

Performance Tuning · Chapter-specific technical teaching map

Component relationships

1Central concept

ST05 SQL trace

2Connected capability

SAT ABAP trace

3Connected capability

STAD workload

4Connected capability

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.

Conceptual study map, not an SAP configuration screenshot or a guaranteed runtime sequence. Consult the lesson for implementation prerequisites and exceptions.

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

ABAP Code
* ===== 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?

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.

Was this lesson helpful?

Keep exploring

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.