Professional Documents
Culture Documents
DEBUGGING
DEBUGGING
TECHNIQUES
The ABAP Debugger is a tool used to execute and analyze programs line by line. Using it we can check the flow logic of a program and display runtime values of the variables. Currently, SAP offers two types of Debuggers:
program RSDEBUG_01.
....
if SY-SUBRC <> 0.
break-point.
endif.
....
Dynamic Breakpoints
Dynamic breakpoints are user-specific. You
should, therefore, use them when you only
want the program to be interrupted when you
run it yourself. All dynamic breakpoints are
deleted when you log off from the
R/3 System.
Dynamic breakpoints are more flexible than
static breakpoints, because you can deactivate
or delete them at runtime.
You do not have to change the program code
You can set them even when the program is locked by another programmer
You can define a counter (for example, only activate the breakpoint after it has been reached five times).
30 dynamic break points can be set.
EXTERNAL BREAK-POINT
External breakpoints are valid for all user logons on the current server of the current
system. External breakpoints are specifically required when debugging BSP or Web
Dynpro applications. In these cases, you do not log on using the SAP GUI but via a
browser. User breakpoints are only valid for a period of 2 hours
Breakpoint Variants
DEBUGGING KEYS
DEBUG.BAT
DEBUGGER VARIANTS
With the help of Debugger Variant you can save the current debugger
settings into the database or to a local file. These settings include
breakpoints, UI customizations and other special options for debugging
tools.
Next time, when you will be debugging the same application you will not
have to set breakpoints again or to do all the settings again. Also, when
you are working in a large team then you can also pass the debugging
variants to other users.
To save the ‘Debugging Variant’ go to Debugger→ Debugger Session→
Save
You can save the current debugger session either to a file or in the
database.
MODIFICATION TO DATABASE
RECORD
Many a times, due to an incorrect entry in a database table or a table without maintenance
view we are not able to create, edit or delete a database record. In these cases we can use
this debugging trick.
Attached document file below has detailed steps on how to modify database record.
Microsoft Word
Document
GO TO STATEMENT
You can use go to statement to bypass a specific line of code such as a normal sy-
subrc check or an authorization check. To jump or bypass any line/lines of code all
you have to do is just put your cursor on the desired line and then press the SHIFT +
F12 key(both preceding and following lines).
Continue to Cursor option executes the program to the line where you have placed the
cursor. The function does not work if the cursor is placed on a line preceding the
currently executed statement.
Navigation Functions
• We can navigate to the source code from the debugger.
Update Debugging can be used to debug function modules that were called
using the option IN UPDATE TASK. Without update debugging activated,
you will not go into these functions that are processed in another task.
Example attached below
Update
Debugging example
TRFC
TRFC debugging
exmaple
Limitations of new Debugger
Debug screen programs:
When you try to set breakpoints in screen/dialog programs, you get the message stating
that debugging is not yet supported. To get by this and debug your screen/dialog
programs just switch back to the classical debugger.
Go to st22 source code extract and locate for symbol “>>>>”. We ll get the line
where the error is triggered.
Also ST22 provides inputs on ‘possible reason for dump’ and ‘possible solution’.
COMMON RUNTIME ERRORS
• COMPUTE_BCD_OVERFLOW
• CX_SY_ZERODIVIDE
• TABLE_ILLEGAL_STATEMENT
• LOAD_PROGRAM_LOST
• TSV_TNEW_PAGE_ALLOC_FAILED
• DBIF_RSQL_INVALID_RSQL
• DBIF_RSQL_TABLE_UNKNOWN
• CONVT_NO_NUMBER
• GETWA_NOT_ASSIGNED
• CALL_FUNCTION_PARM_MISSING
• CALL_FUNCTION_CONFLICT_TYPE
• STRING_OFFSET_TOO_LARGE
• DYNPRO_SYNTAX_ERROR
THANK YOU