Beruflich Dokumente
Kultur Dokumente
An overview ABAP Debugging Debugging Getting started Break points & Watch points Debugging Tools Debugging in Background
Debugging An overview
Stepwise The
Recognize
that the bug exists Isolate source of bug Identify cause of bug Determine the fix for the bug Apply the fix and test it.
Software
ABAP Debugging
ABAP
Debugger allows you to interrupt the running program after each step, allowing you to check intermediate results and processing logic. Debugger can be called in two ways.
By
Write
BREAK-POINT or BREAK statement in program(static) Click STOP button in the toolbar of program (dynamic)
By
Using
\h Setting break points at specified code lines. Double clicking to set break points.
Following
1.
2.
3. 4.
5.
Single step: Used to step through the program statement by statement.For subroutines, this will go inside the subroutine. .(F5 key can be used). Execute: Similar to single step , but for subroutines, this completely executes the subroutine,without going inside the routine.(F6 key can be used). Return: Used to return from a subroutine, or a called program to a calling program. Run: Used to process the program until the next static or dynamic break point.If no more breakpoints are there, this will exit the debugging mode and executes the rest of the program normally(F8 key). Watchpoints: Used to interrupt the execution of program when variable reaches a particular value.Will be discussed in detail later.
Break points
Causes
program execution to stop at that location and start the debugger. Static Break-point.
User
independent breakpoint:
Using
statement BREAK-POINT. Interrupted when execution reaches the line of code. Useful in development phase and removed before transported. Can number the break points to identify them easier.
User
dependent breakpoint:
Interrupted
only for a specific user. Using the statement BREAK <username>. Visible in program, but not active when other users use the program.
SAMPLE PROGRAM
Static
Dynamic
Done
break point:
User
specific break point. No need to change the code. Can be set even when prog. is locked by any user. Deleted when logged off the SAP system.
30
dynamic break points can be set without changing the program code. Can be set directly in ABAP editor or while debugging. While debugging, break points can be set or deleted by double clicking the line of code.
OR
Similarly, break points can be set for Function Modules, Methods, Exceptions etc.
Dynamic break points can be saved so that they are still active within the same session.
Break points will remain active until you delete it or you logoff the system. Break points can be deleted either by double clicking on the break point or selecting the menu option
Watch points
Used
to interrupt program, when contents of field or structure change. Can save up to 5 watch points including watch points for strings. Can be local or global
Local
watch points valid only in a specified program Global watch points valid only in a specified program and all the programs it calls.
OR
Provide
the program name, variable name , relational operator(=,<,<=,>= etc) and the value.
Debugging Tools
Use
Contents
Fields:
Table:
The
internal table data , during debugging, can be downloaded to excelsheet, by clicking on Save as excel worksheet button and giving the number of rows to be downloaded.
Watch
points and Break points: can be used to display them in the main program.
Debugging in Background
Debugging can be done for programs scheduled to run in background. Job should be either in Scheduled or Released status. After scheduling the program to run in background, select the job in SM37 and type jdbg in the command area.
Running
programs (ie jobs with status Active) can also be debugged. Goto SM50 to get the list of processes. Identify the process related to the program. Goto menu option Program/Mode->Program->Debugging SM50 Authorization for monitoring processes are needed for this method of debugging.
Reference documents
SAP
QUESTIONS ??