ABAP · Debugging

SAP ABAP Debugging Interview Questions

Debugging is the ABAP round where interviewers stop asking what you know and start asking how you work. Almost nobody is asked to recite the debugger's screen layout; they are asked what they would do with a short dump, a wrong value on a screen field, or a job that fails only in production.

The questions on this page are drawn from ERPClimb's reviewed ABAP question bank and are ordered from foundational to advanced. They cover the mechanics — session versus external breakpoints, watchpoints, the layers and tools of the ABAP debugger — and then the situations where the mechanics stop being enough: update task processing, background work processes, calls that arrive from an external system, and code you are not allowed to change.

Each answer is written the way a good interview answer sounds out loud: what you would look at first, what the system behaviour tells you, and where the search narrows next. If you can talk through the questions below without reading them, you can hold a debugging conversation with a lead developer.

What interviewers actually probe

Where the breakpoint goes

Interviewers listen for whether you place a breakpoint by guess or by evidence — the calling stack, a message number, a database update, or an authority check are all defensible entry points, and picking the right one is most of the skill.

Debugging what does not run in your session

Update tasks, background jobs and inbound calls do not stop at a session breakpoint. Being able to explain why, and what you would use instead, separates candidates who have debugged production from candidates who have debugged a report.

Reading state instead of stepping

Senior rounds favour watchpoints, the call stack and inspecting internal table contents over pressing F5 several hundred times. Expect at least one question that punishes brute-force stepping.

Knowing when to stop

A common closing question is what you would do when the debugger shows correct code operating on wrong data. The expected answer moves outward: data, configuration, master data, interface — not deeper into the code.

25 questions with full answers

Ordered from foundational to advanced. No sign-in required.

easyDebugging

1. What is a watchpoint in the ABAP debugger and how is it different from a normal breakpoint?

A watchpoint stops program execution when a specified variable or field-symbol changes to a particular value or meets a logical condition, rather than stopping at a fixed line of code like a normal breakpoint does. Watchpoints are set inside the new ABAP debugger by specifying the variable name and a comparison condition, and they are extremely useful when you know a variable is getting corrupted or overwritten somewhere in a long program but you do not know exactly which line is responsible. Unlike a line breakpoint, which is tied to source code position, a watchpoint is tied to data, so it can catch changes that happen deep inside a called subroutine, function module, or method that you did not anticipate. A common project use case is tracking down where an internal table or a global variable gets unexpectedly cleared or overwritten with a wrong value during a long-running program.
easyDebugging

2. 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?

An external breakpoint is user-specific and works across all sessions and application servers for that user ID for a limited time (typically until midnight or logoff), which makes it useful when debugging a background job, RFC call, or update task triggered by your own user, or when a colleague needs to hit a breakpoint that you set remotely on a test system. A session breakpoint (set with Shift+F12 or by clicking the breakpoint icon in SE38/SE80) is only active in the current debugging session/dialog window and is lost once you leave the transaction or session, but it does not need special authorization and is the default choice for straightforward foreground debugging of your own program. In real project work, session breakpoints are used for quick, local dialog debugging, while external breakpoints are essential when the code path is triggered by a different work process, such as update tasks (V1/V2), background jobs, RFC-enabled function modules called from another system, or when someone else needs to trigger the transaction for you to observe it live.
easyDebugging

3. 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?

A conditional breakpoint is set at a specific line just like a normal breakpoint, but it is configured with a logical condition, such as a specific value of a key field, so the debugger only stops execution when that condition evaluates to true. Inside the ABAP editor, after setting the breakpoint, you can right-click or use the breakpoint properties to add the condition, for example ls_vbeln = '0000123456'. This is far more useful than a plain breakpoint inside a loop processing thousands of sales orders, because a plain breakpoint would stop on every single iteration, forcing the developer to press F8 repeatedly until the relevant record appears, which is slow and error-prone. A conditional breakpoint lets the debugger skip straight to the exact record or scenario of interest, which is essential in real production-support situations where you are chasing one problematic document out of a huge dataset.
mediumDebugging

4. 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?

I would first check whether the BAdI is a classic (single-use or multi-use with filters) or a new-style enhancement spot, because filter-dependent BAdIs are frequently the cause of 'works for some, not others' symptoms; if the BAdI implementation has a filter value configured, such as plant, and the failing plant's value was never added to the filter combination, the implementation will simply not execute for that plant with no error message at all. I would check the filter values configured for the implementation in the relevant customizing or class attributes, and compare them against the plant that is failing. If filters look fine, I would set an external breakpoint inside the BAdI implementation's method and reproduce the transaction for the failing plant, confirming whether the breakpoint is hit; if it is not hit, that confirms a filter or activation issue rather than a logic bug. If the breakpoint is hit, I would inspect the importing parameters to see if the plant-specific data differs in a way that causes an early RETURN or a condition in the code to skip the intended logic, since business logic often has plant-specific IF/CASE branches that were never tested for every plant. Finally, I would check with the functional team whether the failing plant has different customizing, like a different order type or storage location determination, that changes which code path is executed before the BAdI is even reached.
mediumDebugging

5. 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?

sy-subrc is set by many ABAP statements, including SELECT, internal table READ/APPEND/MODIFY/DELETE, and CALL FUNCTION, to indicate success or failure, and skipping this check means an error can silently pass through the program and cause incorrect downstream processing that only surfaces much later, making it very hard to trace back to its root cause. sy-tabix reflects the current row index during LOOP processing or after a READ TABLE, but it is easy to misuse because sy-tabix retains its last value after certain statements and can be misread if the developer assumes it always reflects the loop's current row when in fact a nested statement or a binary search READ has changed its meaning. Junior developers commonly forget that sy-tabix is not reliable after a READ TABLE using key access with BINARY SEARCH combined with a sorted or hashed table, and they also commonly reuse sy-subrc checks incorrectly by checking it too late, after another statement has already overwritten its value. In debugging, an experienced consultant will always inspect sy-subrc and sy-tabix immediately after the relevant statement in the debugger to catch these silent failures before they cascade.
mediumDebugging

6. 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?

Since the logic runs in the update task rather than the main dialog work process, a normal session or line breakpoint set during dialog processing will never be hit, so the first step is to activate update debugging, either by using the 'Update Debugging' checkbox available in the debugger when starting from the relevant transaction, or by setting an external breakpoint combined with enabling debugging of update tasks so the system stops when the V1 module executes in its own work process. Once inside the update module in debug mode, I would first verify the module is actually being called by checking whether the breakpoint is hit at all; if not, I would check whether the CALL FUNCTION ... IN UPDATE TASK statement is even being reached in the main program, since a condition upstream might be preventing the update task registration entirely. If the breakpoint is hit, I would inspect the importing parameters passed into the update module to confirm the data matches what was entered on the order, then step through the actual INSERT statement and check sy-subrc immediately after it, since a duplicate key or a database constraint could cause the insert to fail silently if the return code isn't checked in the original code. I would also check SM13 to see if the update request terminated with an error, since a failed V1 update often leaves a clear error entry there that points directly to the failing statement or a short dump reference in ST22.
mediumDebugging

7. 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?

I would first check how the field-symbol is assigned, since a very common cause of stale or unexpected data is an ASSIGN statement that fails silently, for example ASSIGN COMPONENT lv_name OF STRUCTURE ls_struc TO <fs> when the component name is misspelled or doesn't exist, which leaves the field-symbol unassigned; in that case sy-subrc must be checked immediately after ASSIGN, and if it's non-zero the field-symbol retains whatever it pointed to previously, which explains stale data. I would set a breakpoint right after the ASSIGN statement and inspect sy-subrc and the assigned status of the field-symbol using the debugger's 'is assigned' check, since dereferencing an unassigned field-symbol either dumps or, in older code patterns, silently continues showing leftover memory content depending on context. If the field-symbol is assigned correctly, I would check whether it's being reused across loop iterations without an UNASSIGN or fresh ASSIGN at the top of the loop, which can cause it to still point to the previous iteration's memory area if the current iteration's assignment condition isn't met. I'd also verify the field-symbol's type compatibility with the structure it's assigned to, since a generic field-symbol assigned to a structure with a mismatched type can misinterpret the underlying bytes and show garbled values that look like stale data but are actually a type mismatch.
mediumDebugging

8. 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.

I would first confirm the user exit is actually active by checking that the enhancement or customer include is implemented and activated, since a very common cause of 'field is blank' issues is that the exit code exists but was never activated in the transport or the project's enhancement assignment was switched off. Next, I would set an external breakpoint inside the user exit itself, since sales order save often triggers update tasks and background processing, and reproduce the issue by saving a test order, watching whether the breakpoint is even hit; if it is never hit, the problem is that the exit isn't being called at all, which could be due to a missing enhancement activation, a wrong exit variant, or the exit only firing under conditions the test case doesn't meet. If the breakpoint is hit, I would step through and inspect the input structure being passed in to see if the source data the exit depends on is actually populated at that point in the order processing, since many custom fields depend on data that gets set later in the save sequence than the exit's call point. I would also check whether the custom field is being cleared afterward by a later BAdI or user exit in the same save chain, which requires either setting more breakpoints downstream or using a watchpoint on the custom field itself to catch exactly where it gets reset to blank.
mediumDebugging

9. You receive a production dump reported in ST22 with the exception CX_SY_ITAB_LINE_NOT_FOUND, but you have no direct way to reproduce it in the test system. How would you debug this using ST22 and the call stack?

I would start in ST22 by opening the specific dump entry and reviewing the full dump details, including the 'What happened' section, the 'Error analysis' section that shows the exact source code line, and importantly the variable/value snapshot at the time of the dump, which in many cases includes the key value being searched for in the internal table READ statement that triggered CX_SY_ITAB_LINE_NOT_FOUND. From the call stack in the dump, I would identify which program, include, and line raised the exception, and also trace back through the calling chain to understand the business context, such as which transaction or background job triggered the failing code path. Using the variable values captured in the dump, particularly the key fields used in the failed READ TABLE ... statement, I would attempt to recreate the same data scenario in the test system, for example by copying the specific document or master data record referenced in the dump, since CX_SY_ITAB_LINE_NOT_FOUND typically means the code assumed a row would exist (often after a READ TABLE without checking sy-subrc, followed by unconditional use of the work area or table index) but the data conditions in production caused that row to be missing. If I still cannot reproduce it, I would review the source code around the flagged line for any READ TABLE without a subsequent sy-subrc check followed by direct indexed access, and add defensive coding or, if possible, request additional context logging temporarily to catch the exact condition next time it occurs.
mediumDebugging

10. A background job is producing incorrect output only when scheduled via SM37, but works correctly when the same program is run in foreground with the same selection screen values. How do you debug this?

I would first confirm the selection screen variant used by the background job actually matches what is being tested in foreground, since a very common cause of this exact symptom is a variant with different values, date ranges, or a checkbox flag that wasn't noticed, rather than a true foreground-versus-background behavior difference. Assuming the variant is genuinely identical, I would use job debugging by going to SM37, selecting the specific job, and using the option to debug an active or a scheduled job, which lets me attach the debugger to the running background work process; alternatively, for a job not yet released, I can release it with a breakpoint already set for my user so it stops as soon as it starts. Once attached, I would check for environment-dependent logic in the code, such as SY-BATCH, SY-UNAME-dependent branches, authorization checks that behave differently for the background user (often a technical user like a batch user) versus the interactive user, or logic that depends on system fields like sy-datum/sy-uzeit which can differ slightly if the job runs at a different time than the manual test. I would also check for implicit dependencies on screen elements or POPUP-based user interaction that silently default to a different value or get skipped entirely in background mode, since any ABAP statement requiring user interaction, like CALL SCREEN or certain dialog popups, behaves differently or is bypassed when SY-BATCH is 'X'.
mediumDebugging

11. During a report run, an internal table that should have 500 rows only shows 480 after a certain point in the code, with no error raised. How would you debug this using the ABAP debugger?

I would start by identifying every place in the code between the population of the internal table and the point where the row count is checked, where the table could be modified, focusing especially on DELETE statements, MODIFY with WHERE conditions, or REFRESH/CLEAR calls inside loops or nested subroutines. Since a plain breakpoint at every candidate line would be tedious, I would use a watchpoint on the internal table itself, if the debugger version supports table-level watchpoints, or alternatively set a watchpoint on the table's line count using a helper variable like lines( lt_table ), so execution stops the moment the row count changes unexpectedly. Once the debugger stops at the responsible statement, I would inspect the WHERE condition or DELETE criteria being applied to confirm whether the logic is intentionally removing rows based on faulty criteria, such as a wrong date range or status filter that unintentionally matches 20 valid rows. I would also check whether a nested FORM or method receives the internal table by reference (using CHANGING or a reference/field-symbol) rather than by value, since an unintended pass-by-reference into a subroutine that clears or filters the table would silently affect the caller's table without any explicit error.
hardDebugging

12. 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?

I would design the solution with explicit checkpoints for observability from the outset, meaning every significant step, such as an RFC call being sent, a background job starting a specific processing phase, or an update task being registered, writes a structured application log entry (via SLG1) with enough context, including key business document references and timestamps, that a support consultant can reconstruct what happened without needing to attach a live debugger at all. For the RFC and cross-system portions specifically, I would ensure a correlating identifier is generated at the start of the business transaction and passed through every subsequent call, background job parameter, and log entry, so that when middleware or the receiving system reports an issue, the support team can immediately search all logs, job history, and update task records by that single identifier rather than manually correlating timestamps across systems. I would also proactively define, at design time, which parts of the logic are safe candidates for external/session breakpoints during future troubleshooting (typically the dialog and validation logic) versus which parts will require update or background job debugging techniques (the actual save/RFC dispatch logic), and document this in the technical design so future support consultants immediately know which debugging technique to reach for instead of discovering it by trial and error during a live incident. Finally, I would build in a lightweight replay or simulation capability where feasible, such as being able to re-run the exact same input data through the logic in a test client using a saved snapshot of the original input, so that debugging a specific historical failure doesn't require waiting for the exact same rare condition to reoccur in production.
hardDebugging

13. 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?

In the ABAP debugger, the call stack (or 'Calls' tab in the new debugger) shows the full chain of programs, function modules, forms, and methods currently active on the stack, listed from the most recently called at the top to the original caller at the bottom, and I use this to navigate up and down the chain to inspect variable values at each level rather than assuming the bug is only in the innermost routine where the wrong value is finally visible. My approach is to first confirm the value is wrong at the innermost level, then move one level up the stack and check the same or corresponding variable's value at that caller's level, repeating this upward until I find the exact level where the value was still correct, which pinpoints the exact call boundary where the corruption or wrong calculation was introduced. This is especially important because a wrong value observed deep in the stack is very often not a bug in that deep routine at all, but rather bad data passed down from a much higher caller, and naively fixing the deepest routine would only mask the symptom rather than fix the actual root cause. I also pay attention to whether parameters are passed by value or by reference at each level, since a by-reference parameter can be modified by an intermediate routine in ways that are easy to miss if you only look at the top and bottom of the stack without checking each intermediate level.
hardDebugging

14. 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?

The first thing I check is whether the code is actually part of the active version being executed in production, since a very common and often embarrassing cause is that the transport containing the change was never imported into production, or was imported but a related object like an enhancement implementation, BAdI activation, or a customizing entry that controls whether the code path fires was left inactive; I would check the object's version and transport status directly rather than assuming activation succeeded just because the transport 'shows green'. Next, I would check whether the entry condition to reach that code is actually met in production, since the same code can be gated by a configuration switch, a condition table entry, or a company-code/plant-specific customizing setting that differs between test and production, meaning the code is 'reachable' in principle but the specific condition to trigger it isn't satisfied by production data. I would then set an external breakpoint at the very first line of the relevant include or method and reproduce the transaction in production (with appropriate care and approval, since this is a production system), confirming directly whether execution ever reaches that point at all; if it doesn't, I would work backward through the calling logic to find exactly which condition or missing call is preventing the code from being reached. I would also check whether there are multiple similarly named objects (for example, multiple implementations of an enhancement spot, or a customer include used in more than one program) and confirm the change was actually made in the object that is truly being executed in this specific production scenario.
hardDebugging

15. 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?

I would first ask the user to reproduce the failure and immediately run SU53, since it shows the last failed authorization check for that user session, including the authorization object, field values, and whether the check failed due to a missing value in the role or a value mismatch; however, SU53 only captures the most recent failed check, so if multiple checks occur in sequence, it might not show the true first failure, especially in a background or a different session. Because the issue is intermittent, I would use STAUTHTRACE (the authorization trace transaction) to capture all authorization checks over a broader window for that user, which is more reliable than SU53 for catching an intermittent issue since it logs every check, not just the last failure, letting me see the exact pattern of which object and field combination fails only sometimes. Once I have the failing object and field values from the trace, I would compare them against the roles assigned to the user, checking for any composite role that might have been recently changed, or a role assignment with a validity date that has expired without the user's knowledge, since role validity dates are a common and overlooked cause of intermittent-looking authorization failures that appear to happen 'randomly' but are actually date-driven. I would also check whether the intermittent nature correlates with the user's login through a different application server, batch job, or via a different logon method like RFC, since authorization buffers can sometimes behave differently across application servers if role assignments were changed and not fully synchronized.
hardDebugging

16. 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?

I would introduce a lightweight but mandatory pre-transport debugging checklist for custom developments touching critical processes, requiring the developer to demonstrate, during peer/code review, that they have actually stepped through their new logic in the debugger for both the happy path and at least one edge case, such as an empty internal table, a failed sy-subrc condition, or a boundary date/quantity value, rather than relying purely on a single successful test run. I would pair this with a short mentoring habit where senior consultants walk newer developers through a real past production defect during onboarding, showing the actual debugging steps used to root-cause it, since seeing a concrete example of how a wrong sy-tabix assumption or an unchecked ASSIGN caused a real defect is far more effective at building debugging discipline than abstract guidelines alone. To keep this from slowing delivery, I would keep the checklist short and targeted only at genuinely defect-prone areas identified from past incidents, rather than applying an exhaustive process uniformly to every minor change, and I would track a simple metric, such as the number of post-transport defects per developer or per module over time, to confirm whether the mentoring and checklist approach is actually improving quality rather than just adding process overhead. Over time, I would rotate newer developers through pairing sessions on live debugging of real (non-production, but production-like) issues so debugging becomes a practiced skill rather than something only learned reactively after a defect occurs.
hardDebugging

17. What is system debugging in SAP, and when would you need to use it instead of normal application debugging?

System debugging is a special debugger mode that allows stepping into SAP kernel-level and system-level processing, such as screen (dynpro) processing logic, ABAP runtime system internals, or standard SAP framework code that is normally protected or hidden from regular debugging, and it typically requires a higher authorization level because it can expose sensitive system internals and, if misused, can affect the stability of the session. I would use system debugging in a scenario where I need to understand exactly how a standard SAP screen flow logic (PBO/PAI sequence) is invoking my custom code, for example, understanding precisely when and how a custom subscreen or a customer-include is called by the standard dynpro flow logic, which isn't visible through normal application-level debugging alone. It is also used when troubleshooting deep issues in areas like screen field visibility, standard table control processing, or when the normal debugger doesn't stop at a point you expect because the relevant logic is being executed by generated or dynamically compiled programs, such as those generated for table maintenance generators or certain Web Dynpro internal processing, where system debugging can reveal the underlying generated code. In practice, for typical custom development issues like a wrong calculation or a BAdI not firing, system debugging is unnecessary and normal application debugging with breakpoints is sufficient; system debugging is reserved for genuinely deep framework-level investigation, usually done together with or under guidance of Basis or senior technical leads given its sensitivity.
hardDebugging

18. 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?

At a high level, I would first isolate whether the issue is in the ABAP driver program that fetches and prepares the data, or inside the SmartForm's own logic such as its window conditions, loops, or program lines used for subtotal accumulation, since multi-page-specific bugs are very often related to how subtotals or running totals are reset or carried over across page breaks within the form itself. I would set a breakpoint in the driver program at the point where the internal table of line items is built and passed to the SmartForm function module, to confirm the data itself is correct and complete for the multi-page order before the form even processes it, ruling out a data-preparation bug. If the data going into the SmartForm is correct, I would use the SmartForm's own trace/debug capability, activating the SmartForm debugger from the form's test transaction, which allows stepping through the form's internal program lines, including any global variables used to accumulate totals, and specifically check the logic used to detect page breaks and whether the total-accumulation variable is being reset unintentionally at each new page rather than only being reset once at the start of the whole form. I would treat this as a strong hypothesis specifically because the bug only manifests on multi-page documents, which strongly points to page-break-related reset logic rather than a general calculation bug.
hardDebugging

19. 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?

I would run the report through SAT (the ABAP runtime analysis / trace tool) for both the slow date range and a normal date range, capturing a full trace of each execution so I can directly compare where time is being spent, rather than guessing based on code review alone. In the SAT results, I would look at the hit list sorted by gross or net time to identify which statements or subroutines consume the most time, paying particular attention to whether the time is concentrated in database access statements versus ABAP-internal processing like nested loops or internal table operations, since these point to very different root causes. If the slow run shows a disproportionate amount of time in a specific SELECT or LOOP construct that isn't proportionally slower in the fast run despite similar row counts, I would suspect the date range is causing a different execution path, such as a date filter that isn't using an existing index efficiently for that particular range, or a nested SELECT/LOOP combination whose complexity depends on some other factor correlated with the date range, like a higher number of intermediate records being filtered out after being fetched rather than filtered at the database level. I would cross-check with ST05 SQL trace for the same two runs to see if the number of physical database accesses or the amount of data read differs significantly, which would confirm whether the root cause is at the database access level or in ABAP-side processing logic, and then target the fix specifically at whichever layer the evidence points to rather than optimizing code broadly without proof.
hardDebugging

20. 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?

First, I would clarify whether the RFC call is synchronous or if it uses a background/transactional RFC pattern like tRFC or qRFC, since the debugging and monitoring approach differs significantly; for a synchronous RFC, I would check SM50 or SM66 on the application servers around the reported time window to see if a work process was actually running the RFC-enabled function module and appeared to hang or run unusually long, which points to a performance issue rather than a hard failure, explaining why no dump was generated. If the process shows as genuinely stuck, I would use the debugger's 'Debugging → RFC' capability, or set an external breakpoint on the RFC function module combined with enabling RFC debugging, so that the next incoming call from the middleware stops in the ABAP debugger, letting me see exactly where the processing is spending time or looping. I would also check whether the RFC destination or gateway has connection or timeout settings shorter than the actual processing time required, since a timeout reported by the caller doesn't always mean the ABAP side failed; it can mean the ABAP side is simply slower than the caller's configured wait time, which shifts the investigation toward SQL trace (ST05) or runtime analysis (SAT) on the function module logic itself rather than assuming an outright error. Finally, I would check the gateway logs and SM58 for any transactional RFC queue entries stuck in error status if the call pattern is asynchronous, since a stuck tRFC/qRFC entry would explain a perceived timeout without any dump in ST22.
hardDebugging

21. 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?

I would start by establishing a layered diagnostics standard that every custom development must follow, including consistent application logging using SLG1 with meaningful object/subobject naming so that key business events, error conditions, and decision points are captured automatically without requiring live debugging for every issue, since a well-placed log entry at critical junctures often eliminates the need to reproduce and debug an issue at all. I would define clear guidelines for when each debugging technique should be used, for example: session/external breakpoints for dialog-only issues, update debugging for save/update-task problems, background job debugging via SM37 for scheduled job issues, and RFC debugging combined with SM58/gateway monitoring for cross-system middleware issues, so junior team members have a decision framework rather than guessing which technique applies. I would also establish a standard for correlation IDs or a shared business document reference passed through logs, RFC headers, and background job parameters, so that when an issue spans dialog, background, and RFC layers, the team can trace a single business transaction's journey across all three without needing to debug each layer live, purely by correlating logs. Finally, I would build in periodic review of ST22 dumps and recurring performance traces (via SAT/ST05) as a proactive practice rather than purely reactive debugging, and mentor the team on root-cause discipline, meaning that a fix is not considered complete until the actual originating cause is identified and addressed, not just the symptom nearest to where the issue was first observed.
hardDebugging

22. 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?

In the ST05 trace, I would look at the summarized view grouped by statement, which shows the number of executions and total/average time per statement, and if a single SELECT is executed thousands of times with a nearly identical WHERE clause pattern differing only in a key value, that is a strong and clear signal of a SELECT-inside-LOOP anti-pattern, which is one of the most classic and costly performance problems in ABAP because each iteration incurs full database round-trip overhead rather than benefiting from set-based processing. I would then go back to the ABAP source code at the point identified by the trace's call location to confirm the loop structure, checking whether the driving internal table being looped over could instead be used directly in a single SELECT ... FOR ALL ENTRIES IN itab or, if a proper join key exists in the database and the two tables are small to moderately sized, a database JOIN, both of which would replace thousands of individual round-trips with one or a few efficient set-based accesses. I would also check whether the internal table driving the loop has duplicate or overlapping key values that could be reduced beforehand, since deduplicating before doing FOR ALL ENTRIES is a well-known follow-up optimization that avoids redundant reads for the same key. My recommendation would be to restructure the code to fetch all required data in bulk before or instead of the loop, and only use the original loop for in-memory processing of already-fetched data rather than for making repeated database calls.
hardDebugging

23. 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?

I would first establish exactly what is different about month-end in production versus other times and other systems, most importantly data volume, since test and quality systems typically hold a small fraction of production data, and a query or loop that performs acceptably against a few thousand records can behave very differently against millions, especially if it relies on a full table scan, a missing index, or an algorithm with non-linear complexity such as nested loops over large internal tables. I would use ST03/ST03N or workload statistics for the exact time window during a previous month-end to identify which specific step or program consumed the most database or CPU time, then use SAT or ST05 directly against the production system (with appropriate authorization and change control approval) during the next month-end occurrence, or as close to it as possible, to capture live trace data rather than relying on guesses. From the trace, I would look specifically for statements whose cost scales with data volume, such as SELECTs without adequate WHERE clause selectivity, or FOR ALL ENTRIES calls against a very large driving table, and compare the estimated row counts and actual data volume at month-end against what exists in test/quality systems to confirm the volume-based hypothesis. If direct production tracing during the live event isn't feasible, I would ask Basis to help create a production-volume-like dataset in a copy system, or use a system-copy/refreshed system, purely to reproduce and confirm the volume-dependent behavior in a safer environment before applying a fix.
hardDebugging

24. A custom enhancement in the goods receipt process is calculating a wrong stock quantity only for batch-managed materials. How would you debug the data flow to find the root cause?

I would begin by setting an external breakpoint inside the custom enhancement's code and reproducing the goods receipt for a batch-managed material, then comparing the same breakpoint hit for a non-batch-managed material side by side, focusing on exactly where the two code paths diverge, since the enhancement likely has an IF or CASE branch that treats batch-managed materials differently, whether intentionally or due to an overlooked edge case. I would inspect the importing structures for batch-specific fields, such as the batch number and batch-level quantity fields, to check whether the enhancement is reading quantity from a document-level field when it should be summing quantities across multiple batch splits, since goods receipts for batch-managed materials can generate multiple line items or batch splits for a single material document item, and code that assumes one line equals one quantity will under- or over-count when batch splits are involved. I would also check whether the enhancement runs once per document versus once per item, since if it's coded to run once per header but batch-managed receipts create multiple items, the total quantity could be picked from only the first batch split rather than summed across all splits. Once I identify the specific structural difference, I would trace back through the enhancement's data flow to confirm exactly which source table or structure it should be reading from to correctly aggregate quantity across all batch splits for that material document.
hardDebugging

25. You need to debug a live production issue affecting real customer data, but you must not risk changing any data during the investigation. What precautions and techniques would you use?

First, I would avoid stepping through any code that includes a COMMIT WORK, database update, or a call to a BAPI/function module that performs a save, and instead use the debugger purely to observe variable values and control flow up to the point just before any data-changing statement, stopping there rather than executing it, since even 'just checking' by executing an update statement in production can create real, hard-to-reverse data changes. I would prefer using non-invasive techniques first wherever possible, such as reviewing ST22 dumps, SAT/ST05 traces, and application logs (SLG1) that already captured relevant information from when the issue occurred, rather than attempting to reproduce the exact live scenario in production if it isn't strictly necessary. If live debugging in production is unavoidable and approved through proper change control, I would use a display-only or read-focused approach: setting breakpoints before any modifying statements, inspecting variable values, and then either stopping debugging (letting the transaction continue naturally without interference) or, if I must go past a data-changing statement, doing so with explicit awareness and approval since this could genuinely alter data, and ideally coordinating a rollback plan or working in a system-cloned test client if any modification risk exists. I would also avoid setting update-task or system debugging breakpoints casually in production without prior approval, since these can hold database locks longer than normal and impact other users, and I would always debug with the least invasive breakpoint scope (session/external for my own user only) rather than broad, disruptive debugging settings.

Practise by experience level

Architect8-12 years4-7 yearsFresher12+ years1-3 years

The questions above are tagged by the experience levels they are normally asked at, so the same page works for a first interview and for a lead-developer round.

SAP ABAP Debugging Interview Questions FAQ

What is the difference between a session breakpoint and an external breakpoint?

A session breakpoint only stops processing inside your current dialog session, so it is right for a report or transaction you are running yourself. An external breakpoint is bound to a user and stops processing that is triggered outside your session — for example a call arriving from a web or RFC entry point — which is why it is the one you need when reproducing an interface issue.

How do you debug a background job in ABAP?

You cannot stop a running background work process with a session breakpoint. The usual answers interviewers accept are: reproduce the same processing in dialog, debug the job from the job monitoring screen while it is running, or use the debugger settings that allow the process to be captured — and, where nothing else is possible, add temporary logging and analyse the result rather than the run.

When would you use a watchpoint instead of a breakpoint?

When you know which value is wrong but not where it changes. A watchpoint stops execution the moment a field or internal-table component takes a given value, which turns an unbounded search through a call stack into a single stop. It is the standard answer for 'a field arrives at the screen with an unexpected value'.

How do you debug code you are not allowed to modify?

You debug it without changing it: external and session breakpoints, watchpoints, the call stack and, where the behaviour is driven by configuration, tracing the read of that configuration. Explaining that you would not add temporary statements to standard code is itself part of the expected answer.

What do interviewers expect when a short dump is given to you?

A method, not a guess. Read the dump's error category and the statement it stops on, look at the call stack to see who called it, check the values it shows, and only then decide whether the fault is code, data or configuration. Candidates who jump straight to a code change usually lose the question.

Next practice step

Related SAP interview topics

ERP Climb is an independent educational platform and is not affiliated with SAP SE.