ABAPIntermediate
Debugging
Master ABAP debugging with breakpoints, watchpoints, update debugging, background jobs, RFC/OData debugging, ST22 dump analysis and production-safe root cause analysis.
Overview
Master ABAP debugging with breakpoints, watchpoints, update debugging, background jobs, RFC/OData debugging, ST22 dump analysis and production-safe root cause analysis.
Lessons in this topic
- Debugging Part 1: How to Approach an ABAP ProblemLearn a structured way to diagnose ABAP problems before opening the debugger: reproduce, collect evidence (message, user, data, time), identify the layer (UI, program, database, update, interface, authorization), and pick the right tool — debugger, ST22, SM37, SLG1, SM13, ST05, SU53.
- Debugging Part 2: ABAP Debugger EssentialsUse the ABAP debugger efficiently: starting it (/h, breakpoints in SE38/SE80/ADT), session vs external breakpoints, stepping (F5, F6, F7, F8), breakpoints at statements/messages/exceptions, changing variables, jumping, call stack, and the desktops and tools of the new debugger.
- Debugging Part 3: External Breakpoints — Why They Are Not HitUse external (user) breakpoints for calls that don't run in your session — RFC, HTTP/OData/Fiori, background — and fix the typical reasons they are not hit: wrong user, wrong server/instance, expired validity, breakpoint set in a different system/client, code path not reached, or debugging not allowed (authorization, system settings).
- Debugging Part 4: Watchpoints, Layers and Static Checks (ATC)Find where a value changes with watchpoints (variable change, conditions, objects), combine them with breakpoints and the call stack, use layer-aware debugging for standard + custom code, and prevent bugs earlier with the extended program check (SLIN), Code Inspector (SCI) and ATC.
- Debugging Part 5: Debugging Internal Tables and Field SymbolsInspect and fix internal table problems in the debugger: table tool (content, filter, sort, row changes), READ TABLE issues (binary search on unsorted tables, default key), duplicate keys, header lines vs work areas, field symbols not assigned or assigned to the wrong row, and LOOP ... ASSIGNING changes.
- Debugging Part 6: ST22 Short Dump AnalysisRead ABAP short dumps in ST22: runtime error name and exception class, "What happened", "Error analysis", "How to correct", source code extract, active calls (call stack), chosen variables, user and transaction, and the most common dumps with their typical causes and fixes.
- Debugging Part 7: Update Task DebuggingDebug code that runs in the update task: CALL FUNCTION … IN UPDATE TASK, V1/V2 updates, PERFORM ON COMMIT, why normal breakpoints don't stop there, activating update debugging, analysing failed updates in SM13 and update dumps in ST22.
- Debugging Part 8: Background Job Debugging with SM37, JDBG and SM50Debug programs that fail only in background: differences to foreground (user, variant, printer, no GUI, sy-batch), job log and spool in SM37, JDBG to rerun a finished job in the debugger, debugging a running job from SM50/SM66, and avoiding GUI-dependent code.
- Debugging Part 9: RFC, IDoc and OData DebuggingDebug calls that arrive from outside: RFC function modules called by external systems, inbound IDocs (WE19), OData/Fiori requests (external breakpoints, /IWFND/ERROR_LOG, /IWBEP/ERROR_LOG, /IWFND/GW_CLIENT), and asynchronous tRFC/qRFC calls in SM58/SMQ2.
- Debugging Part 10: Production Debugging — Evidence FirstHandle production issues safely: evidence collection without debugging, read-only analysis tools (ST22, SM37, SLG1, SM13, ST05, STAD, SAT), when debugging in production is justified, risks (locks, changed values, commits), approvals and firefighter access, and closing incidents with root cause and prevention.
Interview questions covered
- As an architect, how would you decide, for a new complex integration involving background jobs, RFC calls, and update tasks, what proactive debugging and monitoring hooks should be built into the design from the start, rather than added reactively after production issues appear?
- While debugging a deep call stack involving multiple nested function modules and classes, how do you effectively use the call stack to identify where a wrong value actually originated?
- You are told that a piece of custom code you wrote is 'not running at all' in production, even though it works in the test system. How do you debug why the code is simply not being triggered?
- You are told a custom BAdI implementation is 'not working' for a specific plant, but works fine for others. How do you debug this systematically?
- What is a watchpoint in the ABAP debugger and how is it different from a normal breakpoint?
- A user reports 'No authorization' errors intermittently while running a custom transaction, but they claim their role setup hasn't changed. How do you debug this using SU53 and authorization trace?
- A newly onboarded developer keeps introducing production defects that could have been caught through better debugging discipline before transport. As an architect or technical lead, how would you mentor the team and design a review process to reduce this without slowing down delivery significantly?
- Why is checking sy-subrc after every database operation and sy-tabix inside loops considered a debugging best practice, and what mistakes do junior developers commonly make around them?
- What is system debugging in SAP, and when would you need to use it instead of normal application debugging?
- A SmartForm output is printing an incorrect total amount only for orders with more than one page, while single-page orders print correctly. At a high level, how would you approach debugging this?
- A custom report is taking significantly longer to run for one specific date range compared to others, even though the number of resulting rows is similar. How would you use SAT to root-cause the performance issue?
- An RFC-enabled function module is called from a non-SAP middleware system, and the caller reports a timeout, but no dump appears in ST22 on the SAP side. How would you debug this issue?
- As an architect, how would you design a team-level debugging and diagnostics strategy for a landscape where issues frequently span dialog processing, background jobs, and RFC calls to external middleware, so that root-causing production issues doesn't rely purely on ad-hoc debugging skill?
- What is the difference between an external breakpoint and a session breakpoint in ABAP debugging, and when would you use each in a real project?
- A custom update function module (registered as V1 update) is supposed to insert a record into a Z table on sales order save, but the record never appears. How would you use update debugging to find the cause?
- You suspect a field-symbol is pointing to unexpected or stale data inside a loop, causing wrong values in the output. How would you debug this?
- A user exit is supposed to update a custom field during sales order save, but the field is coming up blank in production. Walk through how you would debug this.
- During an ST05 SQL trace review, you notice the same SELECT statement is executed thousands of times inside a loop, each time hitting the database individually. How would you confirm this root cause and what direction would you recommend for the fix?
- A performance issue in a custom program occurs only in production and only during month-end, but never in the test or quality systems. How would you root-cause this without being able to fully reproduce it outside production?
- How do you set a conditional breakpoint in ABAP, and why is it more useful than a plain breakpoint inside a loop that processes thousands of records?