ABAP Debugger Scripting-Basics
ABAP Debugger Scripting-Basics
Now that NetWeaver 7.0 EHP2 is available as a Mini-Basis System, we can tell you about some
of its new features.
One of the coolest of these new features for problem analysis is ABAP scripting in the New
ABAP Debugger. In this weblog, we explain what this feature is for, what the script workplace
looks like, and how to run a couple of first scripts to whet your appetite. You’ll see how to do a
complete trace of executed statements from the script overview, and how to see where particular
statements occur in your (executed) code.
What is Debugger Scripting For?
The new scripting capability lets you automate anything that you can do by hand in the New
ABAP Debugger. Debugger Scripts also make some things possible – like all kinds of tracing –
that aren’t possible by hand.
With ABAP Debugger Scripts, you can:
• Analyze and modify the contents of variables and objects in the
program you are debugging.
You can display or change the value of a variable by hand in the debugger, and you can
do the same thing with a script. The classical example: You can skip over failed
AUTHORITY-CHECK statements with a script by stopping at each AUTHORITY-
CHECK, running it, and resetting SY-SUBRC to 0. (This is still recorded in the System
Log….)
• Perform any imaginable tracing that you might want to do.
With scripts, you can
○ Do the first automated absolutely complete trace of executed ABAP
statements possible (SAT – the new ABAP Runtime Analysis - cannot
capture every executed statement.)
○ Define your own traces with any trace message content that you can
imagine. You can for example trace the value of a parameter that is
passed up or down the call stack in your application to find out where it
goes bad.
○ After Debugger Events – Debugger Single Step: Once you tell the
debugger to run the script (with Start Script), then the debugger
automatically runs the script after every debugger single step (F5 –
Single Step in manual debugging). After every statement is executed
by the debugger, the script runs again. This is the Trigger setting for a
full statement-level trace of execution.
The debugger returns to the foreground, and you can click on Exit Script or
Continue Script.
7. Display the trace in the debugger session or in an internal session by
clicking on Display or Start Analysis in New Session.
The trace shows every statement that the debugger executed. A double-click on a
line lets you jump into the source code to see the statement in context.
12. Run the script and take a look at the result, as shown above as of step 6.
As you can see, you can quickly modify a standard script to perform special tasks
in the debugger.