A posting works in one company code but fails in another. Both systems run the same ABAP program. This often happens after support package updates, transports, or S/4HANA conversions. Customizing, authorizations, or profile parameters may differ between clients or systems.
Developers and consultants may then step through ABAP code for hours. However, the code may behave exactly as designed. It simply uses the values available in the system. These SAP debugging techniques provide a faster path. They identify the failing layer before anyone changes working code. The layer may involve authorization, customizing, master data, or runtime behavior.
This article explains seven techniques for SAP ECC and S/4HANA. They are ordered from the quickest check to the deepest trace.
Why Configuration Errors Are Harder to Debug Than Code Errors
A code defect is usually deterministic. The same input produces the same failure across clients and users. A configuration issue behaves differently. The same program can succeed or fail based on the company code, plant, user role, or client. Consequently, these problems can be harder to reproduce on demand.
Reading the ABAP source may not reveal the cause. The code often works as designed. It simply uses whatever customizing values are available in the system. Configuration can also span several technical objects. These include customizing tables maintained in SPRO, authorization objects assigned through roles, and number range objects. System profile parameters can also affect the result.
A single failed posting can trace back to any of these layers. Opening the ABAP Debugger too early can waste time. The investigation may focus on code that was never the problem. The seven techniques below therefore begin with the fastest and most targeted checks. Deeper tracing and debugging come later. Use them when the initial checks do not isolate the cause.
Seven SAP Debugging Techniques for Configuration Issues
The techniques follow a practical order: authorization checks first, then code-level analysis, database tracing, change history and runtime errors. Each technique answers a different question, so you can stop as soon as one of them isolates the cause.
Technique 2: Run a Full Authorization Trace With ST01 or
A large share of apparent configuration issues are actually missing or misassigned authorizations. SU53 can confirm or rule this out faster than most other tools.Run SU53 immediately after a failed action. It displays the last failed authorization check in the user’s session. The result includes the authorization object, field, and missing value.
SU53 reflects only the most recent failed check. Therefore, run it immediately after the error. Otherwise, another check may overwrite the result before you review it.SU53 is shallow by design, which is why it comes first. It provides a one-screen answer within seconds. It also requires no trace to be activated in advance.
When SU53 identifies a missing authorization object, the fix is usually straightforward. Adjust the relevant role or profile instead of starting a debugging session. The remaining six techniques may then be unnecessary. If SU53 shows nothing relevant, move to a broader trace. Do the same when the issue clearly has no authorization background.
Technique 2: Run a Full Authorization Trace With STAUTHTRACE or ST01
SU53 captures only the most recent failed check. This can be insufficient when a transaction performs several authorization checks. One check may silently change system behavior without producing an error. STAUTHTRACE closes this gap. It works like the general system trace, ST01. However, it records only authorization checks. It captures every object, field, and value evaluated while the trace is active.
You can therefore complete the entire process first. Review all authorization checks afterward. This avoids relying on a single failed check. ST01 goes beyond authorization checks. It can also record database access, RFC calls, and kernel-level activity. This helps when performance or connectivity symptoms accompany a configuration issue.
The trade-off is data volume. An unfiltered trace on a busy transaction can produce a large result list. Filter duplicate entries before reviewing the trace. This keeps the analysis focused on the checks relevant to the scenario.
Technique 3: Use the ABAP Debugger to Step Through Configuration Logic
Once authorization is ruled out, the ABAP Debugger shows how the program reacts to the customizing values it reads. A session breakpoint works when the transaction runs in the same user session as the debugging session, whereas an external breakpoint is necessary when a different session triggers the code, for example through an RFC call, an HTTP request or an interface without a GUI. You set external breakpoints in the ABAP editor, such as SE38 or SE37, or in ABAP Development Tools, and they interrupt the process as soon as it reaches the ABAP stack for your user. For background jobs, the JDBG command in SM37 allows you to debug an active job directly.
Stepping through the code reveals the exact value that the program reads at each point and the logic branch that it chooses as a result. This is more precise than reviewing the SPRO screen, because SPRO often presents several layers of dependent settings, and only the debugger shows which of them the program evaluates at the moment of failure. SAP limits the number of active breakpoints (the documentation names 30 per breakpoint type), which normally suffices to follow a complete code path.
Technique 4: Set Watchpoints on the Exact Field That Is Misbehaving
A breakpoint stops execution at a fixed line, whereas a configuration issue often requires you to catch the moment a specific field changes value, regardless of where in the program it happens. A watchpoint pauses execution only when the content of the chosen field changes, which is far more efficient than stepping line by line through a long program and hoping to spot the moment when a value is overwritten or defaulted incorrectly.
Watchpoints help most when a value is correct on its first read from the customizing table but a later routine silently alters it. In practice, set an initial breakpoint to reach the general area of the program, then add a watchpoint on the suspect field. This combination catches the precise statement that changes the value and turns a broad session into a focused one.
Technique 5: Trace Customizing Table Reads With ST05
Sometimes the real question is not what the program does with a configuration value but which table and which record it reads in the first place, and ST05 answers this directly. Activate the SQL trace before you run the failing transaction, then review it afterward to see every database access, including the table, the WHERE condition and the duration of each access. For configuration debugging, this is often faster than stepping through code, because it shows immediately whether the program reads the expected table or a different one through a client-dependent lookup. Since customizing tables are frequently buffered, also activate the table buffer trace in ST05, otherwise buffered reads never reach the database and stay invisible in the SQL trace.
ST05 also exposes cases where a program falls back to a default value because the expected customizing entry does not exist for the specific key combination. In the trace, this appears as a SELECT that returns zero rows instead of an error message, which is a common root cause when an issue appears only for specific plants, company codes or document types. A missing entry never triggers an explicit message, so it changes downstream behavior quietly.
Technique 6: Check Who Changed the Configuration With SCU3
When a configuration issue appears suddenly in a system that worked before, a recent change to the customizing table is the fastest explanation to confirm or rule out. SCU3 displays the change log for tables that have the Log Data Changes flag active in their technical settings, and the rec/client profile parameter must also be set to log the relevant client. The log shows which user changed which field, the old value, the new value and the timestamp, so a vague report that a process suddenly broke becomes a concrete, attributable change that the team can review and revert if needed.
Not every table is logged by default, so check the Log Data Changes flag in the technical settings of the table in SE11 before you rely on SCU3. To list the tables with logging enabled, select the field PROTOKOLL in table DD09L with SE16 (verify this in your release). Do not assume that logging is active in a given SAP ECC or S/4HANA system, because the result depends on the table, the client and the profile parameter, so confirm it per table instead.
Technique 7: Correlate Runtime Errors With ST22 Dump Analysis
Some configuration issues do not degrade behavior quietly, because they terminate the program with a short dump that ST22 captures. A dump provides the exact point of failure, the variable values at that moment and a description of the likely cause, and this is often enough to point directly at a missing or invalid customizing entry, for example a number range that was never maintained for a new document type. Reviewing the dumps of today and yesterday quickly shows whether a reported problem is a hard runtime failure or a silent logic problem, and this distinction changes the direction of the investigation.
Putting the Techniques Together in a Real Investigation
A practical investigation rarely uses a single technique. A typical sequence starts with SU53. This can rule authorization in or out within seconds. If SU53 is inconclusive, move to STAUTHTRACE.
From there, the investigation follows the symptom. A silent behavior change points toward ST05. The trace can confirm what the program actually reads. A hard failure points toward ST22. This helps identify what caused the failure.
Debugger breakpoints and watchpoints come later. Use them after tracing narrows the suspect code area or field. Stepping through code without this context can waste time on unrelated logic.
Consider an invoice posting that fails for company code 2000 after a transport. Company code 1000 still works. SU53 shows no missing authorization. ST05 with the buffer trace then reveals a SELECT on a customizing table. The query returns zero rows for company code 2000.
SCU3 then shows that the entry was deleted in the transport target client. This confirms the root cause. It also gives the team a specific change to review.
This approach supports the immediate fix. It also helps prevent similar incidents through better change control.
Debugging Techniques at a Glance
| Technique | Transaction / tool | What it reveals | Best used when |
|---|---|---|---|
| Authorization check | SU53 | Last failed authorization object, field and value | Immediately after a failure occurs |
| Full authorization trace | STAUTHTRACE / ST01 | Every authorization check during a session | SU53 is inconclusive or several checks apply |
| Code-level stepping | ABAP Debugger | Which value is read and which branch runs | Authorization is ruled out and logic needs review |
| Field-change tracking | Watchpoints | The exact statement that changes a field’s value | The field is known but not the responsible line |
| Database read tracing | ST05 | Which table and record the program reads | Behavior changes silently with no error shown |
| Change history | SCU3 | Who changed a value, old and new value, timestamp | The issue appeared suddenly in a working system |
| Runtime error analysis | ST22 | Failure point, variable values, likely cause | The program terminates with a short dump |
Conclusion
SAP debugging techniques deliver the most value when you apply them in the right order, because each tool answers a different question. SU53 and STAUTHTRACE address authorization, ST05 shows what the program reads, SCU3 attributes configuration changes and ST22 explains runtime failures, while the ABAP Debugger and watchpoints analyze the code only after the layer is known. This sequence turns a vague symptom into an attributable cause faster than stepping through code from the start.
The approach remains valid in SAP ECC and in SAP S/4HANA, because authorization objects, customizing tables and runtime errors continue to be the places where configuration problems surface. Consultants who narrow down the layer before they open the debugger therefore resolve go-live and support package issues with fewer unnecessary code walkthroughs, which reduces stabilization effort after each release
FAQs
What is the fastest way to debug SAP configuration issues?
SU53 is the fastest starting point, since it shows the last failed authorization check without requiring a trace setup. If SU53 does not explain the issue, ST05 is usually the next fastest check, because it shows exactly which customizing table the program read.
When should I use STAUTHTRACE instead of SU53?
Use STAUTHTRACE when a transaction runs multiple authorization checks and SU53 only shows the last one. That last check may not be the one that actually caused the visible failure. STAUTHTRACE records every check during the trace window instead.
How do external breakpoints help with configuration debugging?
External breakpoints let a consultant catch code triggered by an RFC call, background job, or interface. This works even when the triggering session differs from the debugging session. It matters most for issues surfaced through automated processes rather than direct GUI navigation.
What does ST05 show that the debugger does not?
ST05 shows the exact database statements a program executes. This includes which customizing table was read and whether that read returned any rows at all. It is often faster than stepping through code when the real question is whether an entry exists.
Why would SCU3 show no results for a table that seems to have changed?
SCU3 only returns results if the table’s Log Data Changes flag is active. The rec/client profile parameter also has to be set to log the relevant client. If either condition is missing, no log was ever written, no matter how many changes occurred.
Can ST22 help with configuration issues that do not cause a dump?
Not directly, since ST22 only captures runtime errors that terminate the program with a short dump. Configuration issues that silently change behavior without an error require ST05 or the ABAP Debugger instead.
What is the difference between a breakpoint and a watchpoint?
A breakpoint stops execution at a specific line of code. A watchpoint stops execution the moment a chosen field’s value actually changes, regardless of the line. Watchpoints work better when the responsible line is unknown in advance.
Is table change logging active by default in SAP S/4HANA?
Newer SAP S/4HANA systems installed or upgraded from 2021 onward generally activate table logging by default for more tables. This cannot be assumed for older S/4HANA or ECC systems. SE11 and the RSTBHIST report should always be checked first.



