Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Posted by Olga Dolinskaja in ABAP Testing and Troubleshooting on Nov 10, 2010 12:51:37 AM
inShare3
The New ABAP Debugger was first released by SAP with NetWeaver04. As of release
NetWeaver 7.0 it fully replaces in the scope of its functionality the "old-fashioned" Classic
ABAP Debugger. During the last SAP TechEds I learned that more and more people use the
New ABAP Debugger (that is a great news!) but still many are not aware of some of its
useful features. The purpose of this blog is to point you to these features so that you can
make the most of the New ABAP Debugger.
The New ABAP Debugger settings dialog lets you activate special debugging modes and comfort
options that can speed up your troubleshooting scenarios. Here you will find some helpful debugger
settings with instructions on when and how to use them. You can access debugger settings in the
debugger by using Settings->Display/Change Debugger Settings:
System Debugging: if you have problems that involve system programs (such as a function
that can't be accessed in the debugger), turn on this setting (or use menu Settings->System
debugging On/Of " or the command /hs in the debugger command field). You can declare a program
as a system program by setting Statusto "System Program" in its attributes in the ABAP Editor (SE38)
(check the radiobutton Attributes and pressChange button).
Update Debugging: turn on this setting if you need to analyze asynchronous updates, which
are functions that are called as follows: CALL FUNCTION ...' IN UPDATE TASK. These functions are
executed asynchronously in a special update work process (after the next COMMIT WORK statement).
The debugger can't follow them since it is attached to a single process. Set a breakpoint in the function
that is called IN UPDATE TASK, start debugging, turn on this setting, and the debugger will reach the
breakpoint in your update function.
TRFC (In Background Task): Block Sending: turn on this setting if you need to analyze
transactional Remote Function Calls (TRFC), which are called as follows: CALL FUNCTION ...' IN
BACKGROUND TASK. These functions are called asynchronously, along with other TRFC functions of
this logical unit of work (LUW), after the next COMMIT WORK statement. The debugger can't follow
them since it is attached to a single process. When you turn on this setting, these TRFC functions are
stored in the system for debugging instead of being sent. Use the TRFC Monitor (transaction SM58) to
analyze the unprocessed LUWs and select Edit->Debug LUW to debug them.
Close debugger After Continue' (F8) and Roll Area End: usually after you
press Continue (F8) in the debugger session, the debugger session remains available but inactive
when the program is finished. If you switch on this setting, then the debugger will be closed
automatically after pressing Continue (F8), when the roll area (internal session) is ended.
Always Create Exception Obj.: turn on this setting if you need to analyze exception objects
(if you catch ABAP exceptions in your program via the CATCH CX_MY_EXCEPTION without specifying a
reference variable to which the exception object can be assigned). You can then examine the created
exception objects in the debugger viaDisplay Exception Obj. magnifier button.
Afterwards your colleague can load the saved variant from a file or the database after starting a
debugging session (menu Debugger->Debugger Session->Load). All settings and breakpoints will
become active immediately. Of course he can choose which components of the variant to load: layout,
settings, options, breakpoints, or all of them.
A double-click on the variable name in the source code leads to the Variable Fast Display Tool where
you get information about variable: type, value, etc. On the Locals tab you get all parameters
(including parameter kind) and local variables of the current function module, on the Globals tab, you
can display all global variables of the current program. But sometimes this local and global information
is not enough; you maybe need to display all currently loaded programs and their global variables as
well. For this purpose, use the Loaded Programs Tool (button New Tool, Special Tools->Loaded
Programs).
Loaded Programs shows you two tabs. On the Loaded Programs tab you see the attributes of all loaded
programs and their program groups. On the Global Data tab you get global variables of each global
program just by double-clicking the program in the navigation tree.
Use the Data Explorer to view deep nested objects With the Objects Tool
(Objects desktop) you can examine object properties including visibility, inheritance, references to the
object (where-used list ). You can double-click on attributes in order to navigate to the subcomponents
of a class. But if you have to analyze deep nested objects, then the Data Explorer Tool is the better
choice. The Data Explorer lets you drill down into nested objects, structures, and references without
losing context of the upper levels.
Use Text Translation to display large hex strings and the XML Browser to display
XML data. It is very time consuming to analyze the content of a variable that contains 2000 bytes of
hex code. Therefore, the detail view (Detail Display desktop) for simple types and strings allows you to
translate hex strings into readable text using the appropriate code page (field View , choose Text
Translation). For binary XML data, there is the XML viewer (fieldView , choose XML Browser).
In order to assure good performance of the diff tool, even for deeply nested variables no "deep diff" is
executed.
This means that if you have for example an internal table as the attribute of an object, then you can at
first only check if the tables of both objects are equal. You will not get details about where they differ.
To get the details of differences, you can run a diff for the unequal subcomponents (Dif button in the
corresponding result line). You can use the Historytab to get back to the first result list.
After activating debugging, you will stop in the system code of the http requests in the debugger.
You can set new user breakpoints
or watchpoints to reach the point of interest. Don't forget
to save them before continuing.
http://scn.sap.com/community/abap/testing-andtroubleshooting/blog/2010/11/10/new-abap-debugger-tips-andtricks#jive_content_id_How_to_debug_HTTP_requests
ABAP New Debugger has few more additions to the debugger as well. Since ABAP Release
731, you can skip the breakpoints.
Introduction
ABAP 731 which is available since SAP ECC 6 EhP6 has new addition in the Breakpoint
tab. Now, you can Skip breakpoints. This would be helpful when you just want to jump few
Skip Breakpoint
Whenever you have a breakpoint, once system brings you debugger, you can now use the
Skip field for each breakpoint. Whatever number you enter in the field, system would NOT
stop to the breakpoint for those many iterations.
After the condition is met, the breakpoint behaves normally means flow of execution
would be interpreted whenever the statement is executed.