Debugging Part 1: How to Approach an ABAP Problem
Free sample lesson · open to everyone
Learn 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.
In this lessonShow sectionsHide sections
Visual overview
Expert visual walkthrough
How to Approach an ABAP Problem
Debugging · Chapter-specific technical teaching map
Integration path
Reproduce issue
Define expected state
Trace execution
Validate fix
Tutor's chapter takeaway
Learn 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…
In a real project
A developer spent a day stepping through sales order code for "pricing error in item". A senior colleague double-clicked the message, found its ID/number, used SE91 where-used to find the check, and saw it depended on a…
Watch out for
• Starting the debugger without reproduction or hypothesis. • Not recording the message ID/number. • Testing with a different user or data. • Ignoring authorization and update task layers. • Fixing symptoms without a…
The situation: a real project scenario
A developer spent a day stepping through sales order code for "pricing error in item". A senior colleague double-clicked the message, found its ID/number, used SE91 where-used to find the check, and saw it depended on a missing condition record in one sales area.
Master data fixed it in minutes. The team made "message ID, where-used, hypothesis" the first step of every incident.
Explanation
Good debugging actually starts before you ever open the debugger: reproduce the problem and collect evidence first — the exact message, the user, the data, the time, the transaction.
This lesson opens a ten-part series: Part 1 (this lesson) covers how to approach an ABAP problem; Part 2 covers the ABAP debugger essentials; Part 3 covers external breakpoints and why they sometimes aren't hit; Part 4 covers watchpoints, layers, and static checks (ATC); Part 5 covers debugging internal tables and field symbols; Part 6 covers ST22 short dump analysis; Part 7 covers update task debugging; Part 8 covers background job debugging with SM37, JDBG, and SM50; Part 9 covers RFC, IDoc, and OData debugging; and Part 10 covers production debugging with evidence-first discipline.
To reproduce a problem, use the same user (or at least the same authorizations), the same data, and the same system and client, keep the reproduction steps minimal, and note whether the problem happens every time or only sometimes.
To collect evidence, get the message ID and number (double-click the message to see its technical info) and a screenshot; note the transaction, program, and time, and for background jobs, the job name and its log; and record the input data involved, such as a document number or a file row.
Identifying the layer comes next: a wrong result points to program logic or data/customizing; a dump points to ST22; a "no authorization" error points to SU53, checked right after the error in dialog mode, or to STAUTHTRACE; data saved but then missing points to the update task, checked via SM13; a problem that only shows up in background points to the job log in SM37, and to differences in user or variant; an interface problem points to IDoc status, SLG1, or SM58; and a slow-running problem points to ST05 and SAT, covered in the performance series.
From there, state a hypothesis — for example, "the discount is missing because condition ZDIS isn't found for customer group 02" — and then check it against the debugger or the data itself, recording what you've ruled out along the way. Once you've found and fixed the cause, verify the fix using the same reproduction steps, add a regression test (an ABAP Unit test or another kind of test case), and document what happened.
A trap worth avoiding: stepping through code in the debugger without a hypothesis wastes hours — form a hypothesis first, then use the debugger to confirm or reject it.
To practice, take a recent issue and write down its evidence as described above, classify which layer it belongs to and choose the matching tool, and write your hypothesis down before you even start the debugger. By the end, you should be approaching problems systematically, and choosing the right tool for each layer rather than guessing.
Follow the actual business flow
ABAP debugger investigation
Starting business input
Reproducible transaction and expected result
Stage 1 · What to verify
Stop
Set the right internal/external breakpoint under the executing user
Conceptual business process. Configuration and exceptional branches vary by SAP release and implementation.
Code example
* ===== Tool map by symptom =====* Symptom First tool* Wrong value / wrong logic Debugger (/h), breakpoints, watchpoints* Short dump ST22 (error analysis, source position, variables)* "No authorization" SU53 (dialog) / STAUTHTRACE (any user, background, RFC)* Saved but data missing SM13 (update records), ST22 (update dumps)* Only in background SM37 job log, JDBG, SM50* Interface error WE02/BD87 (IDocs), SLG1 (application log), SM58 (tRFC)* Slow ST05 (SQL trace), SAT (runtime analysis)* System-level errors SM21 (system log) * ===== Getting message details programmatically for evidence =====REPORT zdebug_evidence. PARAMETERS: p_msgid TYPE symsgid DEFAULT 'V1', p_msgno TYPE symsgno DEFAULT '382'. DATA lv_text TYPE t100-text. START-OF-SELECTION. SELECT SINGLE text FROM t100 INTO lv_text WHERE sprsl = sy-langu AND arbgb = p_msgid AND msgnr = p_msgno. " T100 holds every message's text by ID+number WRITE: / p_msgid, p_msgno, lv_text.* Where-used list of the message (SE91 -> where-used) shows which programs raise it* -> often the fastest way to find the code location without stepping.Watch out
Common mistakes
- Starting the debugger without reproduction or hypothesis.
- Not recording the message ID/number.
- Testing with a different user or data.
- Ignoring authorization and update task layers.
- Fixing symptoms without a regression test.
Do this
Best practices
- Reproduce with the same user/data.
- Collect evidence first.
- Classify the layer and pick the tool.
- Form and test hypotheses.
- Verify the fix and document it.
In the interview
Interview angle
Questions: "How do you approach a production issue?", "Which tools do you use for which symptom?"
Strong answer: reproduce with same user/data, collect evidence (message ID/number, user, time, data), classify layer, use debugger/ST22/SU53-STAUTHTRACE/SM13/SM37/SLG1/SM58/ST05/SAT, hypothesis-driven debugging, message where-used, fix and verify with regression test.
Practice this lesson
Quick check
0 of 3 questions attempted
Question 1 of 3
A user reports "No authorization" in a custom transaction. Which tool gives the missing check fastest in dialog?
Question 2 of 3
Before starting the debugger for an error message, what is the most useful first step?
Question 3 of 3
Data appears saved to the user but is missing in the database. Which tool fits this layer first?
Practise this in an interview
Answer in your own words and get instant feedback, the way an interviewer would judge it.
1You 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?
2You are told a custom BAdI implementation is 'not working' for a specific plant, but works fine for others. How do you debug this systematically?
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: Update Task Breakpoint Not Triggering →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.