ERPClimb logoERPClimb
Debugging
ABAP Developmentintermediate 6 min read

Debugging Part 4: Watchpoints, Layers and Static Checks (ATC)

Preview · a free account unlocks the full lesson

Key takeaway

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.

In this lessonShow sections

Visual overview

Debugging Part 4: Watchpoints, Layers and Static Checks (ATC) — learning sheetFlow: Set a watchpoint on a variable in the practice report with a condition → Use the call stack at the stop to identify the changing routine → Run ATC on your package and fix the top 3 findings. Key ideas: WATCHPOINTS; CALL STACK; LAYER-AWARE DEBUGGING; STATIC CHECKS. Watch out: Static checks (SLIN, SCI, ATC) find many bugs before runtime — dumps from uninitialized FOR ALL ENTRIES tables, missing sy-subrc checks, performance issues.ERPClimb.com / ABAP / LESSON 4/10 / LEARNING SHEETDebugging Part 4: Watchpoints, Layers and Static Checks(ATC)1 · HOW IT FLOWS1Set a watchpoint on avariable in the practicereport with a condition2Use the call stack at thestop to identify thechanging routine3Run ATC on your packageand fix the top 3findings2 · KEY IDEAS EXPLAINEDWatchpointsCreate: Breakpoints tab → Watchpoint (orright-click variable → Create watchpoint).Variable: e.g. XVBAP-ROUTE, LS_ITEM-NETWR, anobject attribute.Call StackDouble-click entries to see the caller context andits variables — shows which user exit, BAdI orform changed the value.Layer-Aware DebuggingConfigure object sets (packages, programs) so thedebugger stops only in your layer (e.g. Z packagesor specific component).System programs are skipped unless "Systemdebugging" (/hs) is on.Static ChecksSLIN (extended program check): syntax-levelwarnings (unused variables, missing sy-subrcchecks, wrong message usage).SCI / Code Inspector: configurable checks(performance, security, robustness).3 · REMEMBER · WATCH OUTRememberA watchpoint stops the debugger when a variable changes (optionallyonly when a condition is true) — ideal for "who overwrites this…Combine watchpoints with the call stack to find the program androutine responsible for the change.Layer-aware debugging (debugger profile / "System debugging"off, software layers) keeps you in custom code or includes selected…!Watch outStatic checks (SLIN, SCI, ATC) findmany bugs before runtime — dumpsfrom uninitialized FOR ALL ENTRIEStables, missing sy-subrc checks,performance issues.4 · IN A REAL PROJECTDelivery routes were randomly cleared in sales orders. Stepping through the save took hours with no result. Awatchpoint on XVBAP-ROUTE with condition "initial" stopped after a line in a 10-year-old user exitthat cleared the route for a special order type — the condition had been extended by mistake. Fixing the…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Part 2 covered stepping through code line by line; some bugs, though, are just a value changing somewhere across thousands of lines, and that's exactly what watchpoints are built to find.

A watchpoint stops the debugger the moment a specific variable changes, optionally only when some condition you've set is true, which makes it ideal for answering "who overwrites this field?" Combine a watchpoint with the call stack to identify exactly which program and routine is responsible for the change.

Layer-aware debugging — using a debugger profile with "System debugging" switched off, or configuring software layers — keeps the debugger focused on your own custom code, or on selected packages, rather than stopping everywhere in standard SAP code too.

It's also worth knowing that static checks like SLIN, SCI, and ATC catch a lot of bugs before runtime ever happens — things like dumps from an uninitialized FOR ALL ENTRIES table, missing sy-subrc checks, or performance problems.

To create a watchpoint, go to the Breakpoints tab and choose Watchpoint, or right-click a variable directly and choose "Create watchpoint." The variable can be something like XVBAP-ROUTE, LS_ITEM-NETWR, or even an object attribute. You can attach a condition, for instance LS_ITEM-NETWR < 0 or VBAK-AUART = 'ZOR', so the watchpoint only fires when that's true.

Scope matters too — local versus global variables — and for a global variable belonging to another program, use the (PROGRAM)VARIABLE syntax to reference it. Continue execution with F8, and the debugger will stop right after the statement that actually changed the value.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

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.