of 19
7/23/2019 ABAP Debugger for Functional Consultant
1/19
January 27, 2015 Proprietary and Confidential - 1 -
ABAP Debugger for Functional consultant
Version1.0
Compiled by : Siddhartha SrivastavaReviewed by: Venu Gurram
Author email id : [email protected]
Review date: 27 Jan 2015
7/23/2019 ABAP Debugger for Functional Consultant
2/19
January 27, 2015 Proprietary and Confidential - 2 -
Topics to be covered
Overview
Different types of breakpoints Flow of Control
Debugger Settings
Debugging various ABAP objects
7/23/2019 ABAP Debugger for Functional Consultant
3/19
January 27, 2015 Proprietary and Confidential - 3 -
Overview - Introduction
For any day to day issue faced in SAP, debugger is the most basic tool that
can be utilized to reach the root cause. It not only lets you trouble shooteffectively but also helps you visualize what-if scenarios.
The Debugger is a programming tool that you can use to execute ABAPprograms, by line or by section. With this tool, you can display data objectsand check the flow logic of programs.
There are two types of Debugger available:
Classic Debugger for release levels up to and including 6.40
New Debugger, which is available for all releases after 6.40
7/23/2019 ABAP Debugger for Functional Consultant
4/19
January 27, 2015 Proprietary and Confidential - 4 -
Overview - Difference
Classic Debugger New ABAP Debugger Runs in the same roll area as application to
be debugged
Not all ABAP code can be debugged like
conversion exits and field exits.
No state of the art user interface
The classic Debugger analyzes a roll areathat, when canceled, itself cancels theclassic Debugger. Therefore, all theexisting settings, such as breakpoints ordisplay of variables in the classicDebugger, disappear as soon as the limitsof the roll area are exceeded.
executed in a separate externalsession , while the application to beanalyzed uses a second externalsession
a flexible interface that can beconfigured as required and has morethan eight desktops
the new Debugger analyzes anexternal mode. As long as this
external mode is active, the Debuggerwill remain open and control thismode.
7/23/2019 ABAP Debugger for Functional Consultant
5/19
January 27, 2015 Proprietary and Confidential - 5 -
Overview - Switching
Switching from new debugger to classic debugger
Switching from classic debugger to new debugger
7/23/2019 ABAP Debugger for Functional Consultant
6/19
January 27, 2015 Proprietary and Confidential - 6 -
Overview - A first look at the detailed view of new debugger
7/23/2019 ABAP Debugger for Functional Consultant
7/19January 27, 2015 Proprietary and Confidential - 7 -
Overview - Advanced features of ABAP debugger
Split screen debugging
Searching contents in internal table
Download internal table to excel sheet
Flow of control while debugging
7/23/2019 ABAP Debugger for Functional Consultant
8/19January 27, 2015 Proprietary and Confidential - 8 -
Different types of breakpoints
2. Session Breakpoint
A breakpoint set in the ABAP Editor is a session breakpoint.
It remains active independent of existence of the debugger.
It is valid for all external sessions of a logon.
3. User Breakpoint (also known as external break point) It is valid for all user logons on the current server of the current system.
It is particularly required ,when debugging BSP applications.
It is valid only for a period of 2 hours.
1. Debugger Breakpoint
When a breakpoint is set in a debugger, it is set as debugger breakpoint bydefault.
It is valid only when the debugger instance, in which it was set, is active.
When the debugger is closed, all breakpoints set in it are deleted, unless saved.
7/23/2019 ABAP Debugger for Functional Consultant
9/19January 27, 2015 Proprietary and Confidential - 9 -
Different types of breakpoints
There are different ways to put break points Hard coded / Static break points: You can put a breakpoint in a program by writing following
statements. BREAK-POINT : To stop the execution irrespective of who is executing it.
BREAK : To stop the execution only for specific user mentioned by .
Dynamic/Session break points: We can put dynamic breakpoints from SE80 or SE38 ordebugger. Dynamic breakpoints are always user-specific, and are deleted when you log off fromthe R/3 System. They can be deleted or deactivated during runtime.
7/23/2019 ABAP Debugger for Functional Consultant
10/19January 27, 2015 Proprietary and Confidential - 10 -
Different types of breakpoints
Debugging without Breakpoint : You can start the Debugger as follows
In SE80: Select a program or transaction and from the top menu chooseProgram -> Test -> Debugging.
In SE38: From the top menu choose Program -> Test -> Debugging.
From any other screen: From the top menu choose System -> Utilities -> DebugABAP
or Enter /h in the command field and press enter.
Once inside the debugger, breakpoints can be set at statements, subroutines, FM, etcas shown here.
7/23/2019 ABAP Debugger for Functional Consultant
11/19January 27, 2015 Proprietary and Confidential - 11 -
Flow of Control
F5(Single Step) :Step through the program statement by statement.
F6(Execute) :Process Line by Line .Mainly used to execute a Module orsubroutine without entering into it.
F7 (Return) :Use this option to return back to the calling program.
F8(Run/Continue) :Use this option when no more step check is required. Theprogram either executes normally or the debugger stops at thenext breakpoint.
Display Field/List Contents: Double Click on the field or structure required. Itscontents are then displayed. If the program generates a List, then an icon appears as
soon as the list is populated. Click to open the list display.
7/23/2019 ABAP Debugger for Functional Consultant
12/19January 27, 2015 Proprietary and Confidential - 12 -
Flow of Control - Watchpoints
Watch points help in monitoring the contents of individual variables. By setting awatch point, the debugger stops as soon as the value of the monitored variablechanges. To set a watchpoint, start the debugger and proceed as follows:
Choose Watchpoint.
Enter the name of the field for whichyou want to set the watchpoint. In theProgram field, the name of the program
currently running is always defaulted. You can use the Additional Condition
option to specify whether the flowshould interrupt after meeting thespecified condition.
Useful in looping conditions where you haveto reach a particular material out of severaliterations. This can be achieved by settingthe variable SY-TABIX = intended iteration.
7/23/2019 ABAP Debugger for Functional Consultant
13/19January 27, 2015 Proprietary and Confidential - 13 -
Debugger Settings
Debugger settings are accessed in ABAP debugger by navigating to Settings >Display/Change Debugger settings.
System debugging : In SE38, programs can be set to system program in thestatus. The debugger then skips the program if system debugging is turned off. Ifthere is problem that involve system programs, such as with a function that cantbe accessed in debugger, turn on this setting. System debugging can be turned onby entering /hsin the command field in the debugger.
Update debugging : To analyze asynchronous updates, we use update debugging.Asynchronous updates are functions that are called with addition IN UPDATE TASKas CALL FUNCTION .. IN UPDATE TASK .. The debugger cant follow this updatemodules, and we wont see anything for these modules during debugging, if wedont use update debugging setting.
7/23/2019 ABAP Debugger for Functional Consultant
14/19January 27, 2015 Proprietary and Confidential - 14 -
Debugging various ABAP objects Sap Script
There are 2 separate kinds of debugging available when you try to debug scripts.
Debugging the print program: This is the normal debugging we do for ourreport programs.
Debugging the script itself : You Can debug a SAP Script by activating debuggerin two ways:
In SE71 (which is the transaction for Sap script), from top menu goto Utilities->Activate Debugger. The debugger will be get activated and when your print programis executing Script Debugger will be in active state and you can proceed with yourdebugging.
Goto SE38-> Give the program name RSTXDBUG ->Execute this same as goingthrough in se71-> Menu, now debugger will be activated.
7/23/2019 ABAP Debugger for Functional Consultant
15/19January 27, 2015 Proprietary and Confidential - 15 -
Debugging various ABAP objects Smartforms
The best way to debug the form is to put a breakpoint in the function modulegenerated by the smartform. For this, open the smartform we want to debug. Goto
Environment -> Function module name.
7/23/2019 ABAP Debugger for Functional Consultant
16/19January 27, 2015 Proprietary and Confidential - 16 -
Debugging various ABAP objects Smartforms
Open the function module in SE37. From the menu GOTO -> main program. Open thelast include.
This include contains the entire code i.e. the code we have written in initialization+ form routines + program lines + sap generated code. Put a breakpoint at anypoint you want. If we issue any doc which triggers this form, when the controlreaches the break point it will stop. Prefer session break point in the relatedfunction module.
7/23/2019 ABAP Debugger for Functional Consultant
17/19January 27, 2015 Proprietary and Confidential - 17 -
Debugging various ABAP objects Batch Jobs
Debugging Active Jobs(SM50 OR SM66):
Go to SM50 (Waiting/Running/On hold jobs) : Menu > Program/Session > Program> Debugging. Now control will go to debug mode.
Go to SM66(Running/Debugging Objects) : Place cursor on your job andclick on debugging button in tool bar.
7/23/2019 ABAP Debugger for Functional Consultant
18/19
January 27, 2015 Proprietary and Confidential - 18 -
Debugging various ABAP objects
Debugging Completed/Cancelled jobs
If necessary, place a breakpoint in the program.
Go to transaction SE37 and select our job.
Enter 'jdbg in the command window and press on the enter key.
Now the control goes to the debugger .
Press F8 and control goes to our break point.
7/23/2019 ABAP Debugger for Functional Consultant
19/19
January 27 2015 Proprietary and Confidential 19
Thank You!