SAP ABAP - Advance Debugging
SAP ABAP - Advance Debugging
Agenda
• Strength Of ABAP Command Breakpoints
• Conditional Debugging
• Software Layer Aware Debugging
• Request Based Debugging
• SR Debug (Remote debugging)
• Check point activation
• Update Debugging
• Background task debugging
• Job Debugging
• Tips and Tricks of debugging
ABAP Command Breakpoints
• With the ABAP Cmnds tab, you can set a breakpoint on any of the variety of ABAP statements,
shown to you in the F4 Help.
Just Press F4
Conditional Breakpoint
• Right click on Breakpoint and choose Create Breakpoint Condition from the context menu(do it when
you are in a debugging only).
• You can use variables in the condition, as well as debugger symbols and functions.
• Use the Shift+F1 Help on the Breakpoint Condition popup to see the possible condition operands
and syntax.
Software Layer Aware Debugging (SLAD)
• We can temporarily define layers and jump from layer to layer instead of running though a complex
application with small debugger steps.
Activate
Click on Configure
Debugger Layer
• To activate the check point, go to transaction : SAAB, click on change with checkpoint group name.
Navigate to activation tab as shown below.
Check point activation
• You can activate the checkpoints for individual users using the User button.
• Now you can run the ABAP program that has checkpoints in the source. The behavior of the
checkpoints will be determined by settings that you have defined in the checkpoint group.
• If you use the Log - Point statement or Assertion statement in log mode, you can open the
checkpoint group, navigate to the Log tab, and analyze the log entries that you have created in the
ABAP program using the Log – Point statement as shown Below.
Update Task Debugging
• Go into debug mode. Activate update debugging using option setting Change debugger profile
click on check box update debugging Ok.
• Update debugging will be triggered on commit work in another session.
• Please note one session should be available for update debugger session.
Background Task Debugging
• Block TRFC during debug using option setting Change debugger profile click on check box
TRFC: Block sending Ok
• Goto Transaction SM58, select the blocked entry , Choose option Edit Debug LUW
Job Debugging
Finished Job
• Go to trxn: SM37, select the Job and enter JDBG in command field and click Enter.
Running/Active Job
• Select the active job, go to Job Capture Active Job, it will enter into debugging
Tips and Tricks Of Debugging
Debugging Endless Loop
• Just use the Process Overview (transaction SM50), select the running process, and choose from
the transaction menu Program->Debugging.
Tips and Tricks Of Debugging
Debug Popup Windows
• We can debug popup windows by creating an SAP Shortcut file for command /h and dragging this
into popup window.
• (Or) Create a text file and write following text into the file.
[Function]
Command=/H
Title=Debugger
Type = SystemCommand
Saving Test Data for FM in ABAP Debugger
• In debug mode inside FM , click on tool then click on save parameter as Test data, provide suitable
name and click
• Now The test data is saved and now you can access it via test data directory.
Tips and Tricks Of Debugging
• Use the difference tool to easily compare variables to see the difference.
Tips and Tricks Of Debugging
Handover a debugger Session
• use a debugger variant (menu Debugger->Debugger Session->Save) to store your debugger
session.
• Later this session can be uploaded using Menu Debugger->Debugger Session->Load
Helpful Debugger OK-codes
• /h activate debugging
• /hs activate system debugging
• /ha skip dynpro (PAI, PBO) and directly debug ABAP code
• /hx detach debugger
• /hmusa create memory snapshot (can be used in the transaction
S_MEMORY_INSPECTOR for memory consumption analysis)
• jdbg in SM37 restart of a finished or crashed background job for
debugging