SAP ABAP Debugger Scripting
SAP ABAP Debugger Scripting is a new tool added in SAP Netweaver 7.0 EHP2. It is a feature available in the new ABAP debugger. However, just like some of the other debugger options, you need to check whether the security team has provided access for the debugger script tool.
Most of ABAP programmers regularly use Break-Points & Watch-Points for debugging. These are necessary in an ABAP programmers role to find the bugs in custom developments, analyze the Standard SAP program or find a BADi for that matter. So where does this Debugger scripting come into play?
Designed To Make Debugging ABAP Code Easy
The debugger scripting is a tool is designed to make debugging easy. Sometimes debugging can be very tiresome, especially when debugging SAP standard code is involved. The debugger scripting tool can sometimes come to the rescue of ABAP programmers, as it helps automate the process of debugging.
Some of the benefits of Debugger Scripting are:
- Automation of repeatedly changing the value of some variable in debugging – You can write a script to do all the changes required.
- Perform any custom trace possible – Even track the call to the ABAP stack. It can be used to trace when new programs are called, as the ABAP stack is updated every time a new program is called.
- Create custom (conditional) watch-points and break-points. script watch-points & break-point are different from the normal debugger watch-points or break-points. Scripts can be implemented for these to work only when required.
- Program Tools for standard tasks like checking data consistency, test error handling, etc.
- It can help make the debugging to be user interactive (pop-up based) where one can enter the value, rather can each time double clicking on the variable to change the value. Since the script can be saved and loaded again, this makes the task for programmer easier to use.
A Debugger script is simply a local Object Oriented ABAP program that is run by the New ABAP Debugger. The script uses the ADI (ABAP Debugger Interface) to automate actions and to add capabilities that otherwise would not be available.
So Let’s Take A Look At The Debugger Scripting Tool.
In the new ABAP debugger there is a separate TAB “Script” after the TAB “Diff”(Diff-Tool).
In this TAB, are various options for creating and executing an ABAP script. Let us explore these options.
There is a standard create button, to create a new script, as per our debugging requirement. Each new script that is created has four methods that can be implemented. These methods are triggered at specific moments and thus it defines their purpose. Also as you can see in Fig 1, all this code is generated automatically whenever a script is created.