Now accepting guest editorial from SAP, Oracle, Workday and ServiceNow practitioners.Pitch a guide
The Sign-Off Table

Lesson 4 of 5

Traces

11 min

Listen to this lesson

0:00 / 7:05

When dumps and logs do not explain a problem, traces record what a program actually did: which SQL it sent, which authorizations it checked, where it spent its time. Traces are precise but expensive, so the skill is choosing the right one, limiting it to the right user and time, and switching it off afterwards.

TraceTransactionRecordsUse for
Performance trace (SQL)ST05SQL statements with duration and records; also buffer, enqueue, RFC and HTTP tracesSlow transactions; expensive or repeated database access
Authorization traceSTAUTHTRACE (and ST01)Authorization checks with object, values and resultMissing authorizations; designing test roles
System traceST01Kernel-level activity: authorization checks, database, buffers, RFC, HTTP, locksBroad technical analysis
ABAP runtime analysisSATTime spent per ABAP statement, method and functionSlow programs where the time is in ABAP, not the database
Last failed checkSU53The user's most recent failed authorization checkQuick first look at an authorization error
Choosing a trace. ST05 and SAT answer "where does the time go"; STAUTHTRACE and SU53 answer "which authorization is missing".
The Sign-Off Table · thesignofftable.com/academy/sap-bas-202

Tracing a slow transaction

  1. PrepareAgree the scenario, user and time; warm up once so first-time loading does not distort the trace
  2. ActivateIn ST05, switch on the SQL trace for the tester's user only
  3. ReproduceThe tester runs the slow step once, exactly as in the test case
  4. DeactivateSwitch the trace off immediately
  5. AnalyzeDisplay the trace; sort by duration; look for slow statements, many identical statements and large record counts
Running an SQL trace for one slow step.
The Sign-Off Table · thesignofftable.com/academy/sap-bas-202

In the trace display, three patterns deserve attention. A few slow statements suggest missing selection criteria or an unsuitable access path. The same statement executed hundreds of times (a "SELECT in a loop") suggests the program should read data in one go. Statements returning huge record counts suggest the program reads far more than it needs. If the database time is small but the step is still slow, the time is in ABAP processing or waiting, and an ABAP runtime analysis with SAT is the next tool.

The 'SELECT in a loop' pattern in an ST05 trace: the same statement once per material, against one set-based read.
The Sign-Off Table · thesignofftable.com/academy/sap-bas-202

Tracing authorization problems

For a "you are not authorized" error, SU53 shows the user's last failed check and is often enough. For a whole process, use the authorization trace (STAUTHTRACE), which records every check with the object, field values and result. That is also how to design realistic test roles: trace a business user performing the process, then compare with what the role grants. Remember that a missing authorization can also hide as a missing tile or an empty list rather than an error.

Choosing the authorization tool: SU53 for a single failed check, STAUTHTRACE for a whole process or a Fiori app, then compare with the role.
The Sign-Off Table · thesignofftable.com/academy/sap-bas-202
Many statements, database-heavyRepeated SELECTs or reading far too much: ST05 shows it; fix in code
Whole program, ABAP-heavyInefficient loops or calculations: use SAT runtime analysis
One slow statementMissing selection criteria or an unsuitable access path: ST05 plus statement analysis
One slow ABAP routineA single costly method or function: SAT points to it
Which trace answers which performance question.
The Sign-Off Table · thesignofftable.com/academy/sap-bas-202

When the failure is in a Fiori app

A Fiori app that shows "an error occurred" or simply an empty list rarely leaves a dump the user can see. Its requests are OData calls over HTTP, so the evidence sits in different places. The SAP Gateway error log, /IWFND/ERROR_LOG, records failed OData requests with the service, the HTTP status and the error text; /IWBEP/ERROR_LOG holds the back-end side of the same failure. In Contoso's embedded deployment both logs live in the same system. For authorization problems in Fiori, run STAUTHTRACE for the user while they repeat the step, because SU53 in a separate SAP GUI session does not reliably show the check the app's request failed on. The browser's developer tools (network tab) show which OData request failed and with which status, which is often the fastest first look for a tester.

Symptom in the appFirst place to lookWhat it usually means
Error dialog when saving/IWFND/ERROR_LOG, then ST22 for a dumpBack-end logic or data error behind the OData call
Empty list, no errorSTAUTHTRACE for the userMissing authorization on the app's data, often an organizational value such as sales area
Tile missing from the launchpadThe user's business roles and catalogsLaunchpad content, not the back end
HTTP 403 or 404 on every callService activation and the ICF node (/IWFND/MAINT_SERVICE, SICF)Service not activated or path blocked in this system

First looks for Fiori failures. Transaction names apply to SAP S/4HANA with an embedded front-end server.

The other ST05 traces

The performance trace in ST05 can record more than SQL. The enqueue trace shows which locks a step requests and releases, useful when two processes keep blocking each other. The RFC trace shows calls to other systems and how long they took, which separates a slow partner from a slow local program. The buffer trace shows table buffer access, and an HTTP trace covers web requests. Switch on only the traces you need: a step that waits on a remote system is diagnosed with the RFC trace, not by reading pages of SQL.

What would you do?

Contoso's stock overview for plant 1910 Monterrey takes 90 seconds in CMQ after the Wave 2 test load. An ST05 trace shows the same SELECT on the material document table executed 2,300 times, once per material. What is the best conclusion?

Key points
  • ST05 traces SQL (and buffer, enqueue, RFC, HTTP); SAT analyzes ABAP runtime.
  • STAUTHTRACE records authorization checks; SU53 shows the last failed one.
  • Trace one user, one reproduction, then switch off and save the result.
  • Look for slow statements, repeated statements and huge record counts.

Check your understanding · not graded

Lesson check

  1. 1. Which transaction runs an SQL performance trace?

  2. 2. Database time in the trace is small but the step is still slow. What next?

  3. 3. Which tool records every authorization check during a whole process?

  4. 4. What is a "SELECT in a loop" signature in ST05?