0% found this document useful (0 votes)
17 views14 pages

Abap Debugger

Uploaded by

daniel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views14 pages

Abap Debugger

Uploaded by

daniel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

.

Sap
Abap
Debugger
Sonu Jangir Abap Developer

Documents Prepared By Sonu Jangir SAP ABAP 1


Shortcut Used for ABAP Debugger

 F5: Set a breakpoint at the current line of code.


 F6: Step over the current line of code without stepping into any function
or method calls.
 F7: Step into the current function or method call.
 F8: Skip the current function or method call.
 Ctrl+Shift+F5: Start debugging with the new ABAP debugger.
 Ctrl+Shift+F6: Step through the code line by line with the new ABAP
debugger.
 Ctrl+Shift+F7: Step into the current function or method call with the new
ABAP debugger.
 Ctrl+Shift+F8: Skip the current function or method call with the new
ABAP debugger.
 Ctrl+Shift+F11: Display the watchpoints window, where developers can
set and manage watchpoints.
 Ctrl+Shift+F12: Display the breakpoint editor, where developers can set
and manage breakpoints.
Debugger

It is used to check the programs or source code line by line and block by block for
finding and rectifying errors or bugs.

Following are the different debuggers from version ECC 6.0

1) Classic Debugger
2) New Debugger

1) Classic Debugger:
 It is also called old debugger.
 This debugger opens on same session.
 It has lots of limitations such as different desktops are not there, no
separate sections for local, global variables etc.

Documents Prepared By Sonu Jangir SAP ABAP 2


2) New Debugger:
 This debugger is available from sap version ECC 5.0.
 This debugger opens in another new session.
 This debugger is user friendly with lots of actions such as different
desktops , separate actions for local and global variables and objects.
 New debugger is default debugger from sap version ECC 6.0 and 5.0.

Note: The program or source code is stopped in classic debugger in case of


maximum number

Of Sessions (6) are opened.

Following Are Some Of Usuable Tabs In New Debugger:

1) Desktop 1:
The variables section is displayed vertically to the source code or
program in case of this desktop.
2) Desktop 2:
It contains all the events used in source code or program.

Note: An icon ABAP source code under stack type is used to open source code or
program from

The Debugger.

3) Desktop 3:
It is used to arrange variables section horizontally to source code or
program.
4) Standard: It is a combination of desktop1 &2.

Following Are Different Sub tabs Under Desktop1 &3 Are Standard:

A) Variables 1& Variables 2:

Documents Prepared By Sonu Jangir SAP ABAP 3


They are used to check different data variables, values such as variables,
work areas etc and at a run time 16 data variables can be checked (2*8).

Note: In case of classic debugger 4 data variables at a time and maximum 8


variables then only can be check.

B) Local Tab:

It contains all the local data variables and their values used in the function
modules , sub routines , methods etc.

C) Global:
It contains all the global data variables and their values in the program or
source code.

6. Structures Tab:

It is used to check data structures, variables such as work areas, structure type,
and field .

Symbols after they are assigned.

7. Tables:

It is used to check internal tables used in the program or source code.

8. Objects:

It is used to check objects of the program or source code such as work flow
objects etc.

9. Break /Watch Points:

It is used to maintain break/watch points.

Short Cuts to Check Programs Or Source Code In Debugger:

Documents Prepared By Sonu Jangir SAP ABAP 4


Following are the different short cuts to check program or source code in
debugger tool.

1) Single Step:
The function key F5 or single step icon is used to check line by line of the
program or source code.

EX:

Stop MOVE :< GV_SOURCE> TO < GV_DESTI>

F5 WRITE : ………….

2) Execute :
The function key F6 or execute icon is used to check block by block of
program or source code.

Stop PERFORM < F_BLOCK>… / CALL FUNCTION


F5 FORM < F_BOCK>…..
Process block

Write

F6 ENDFORM.

WRITE…………………

3) Return:

Documents Prepared By Sonu Jangir SAP ABAP 5


The function key F7 or an icon Return is used to return from the source code
of the process blocks such as sub-routines, function modules, methods etc.

Stop PERFORM < F_BLOCK>… / CALL FUNCTION


F5 FORM < F_BOCK>…..
Process block
F6
F7 WRITE
WRITE… END FORM.
Return

4) Continue:

The function key F8 or an icon continue is used to jump from one break
point into the next break point then execute once the last break point is
reached.

Note: F5 -> Line By Line.


F6 -> Block By Block.
F7 -> Return From Source Code Of Blocks such as Sub
routines, FM,
Modules..etc
F8 -> Jump From One Break Point To Another Then Execute

Break Points

Documents Prepared By Sonu Jangir SAP ABAP 6


They are used to stop the program or source code in the debugger tool for
checking line
By line or block by block.

Following are the different types of break points.

 Session break points


 Static break points
 Dynamic break points
 External break points

Note: In the real time session break points are mostly used and external break
points are used rarely

1) Session Break Points:


 An icon set or delete session break point icon (ctrl + shift+ f12) or click
on statement line at gray color vertical section in the source code.
 To set or delete session break points.
 All the session break points are deleted automatically by the system once
it is exit.

Steps To Set Session Break Points :

 Once the program or source is in display or change mode.

Note: The Program or Source Must Be Activated Before Session Or External


Break Points Are Set.

 Click on find icon find


 Enter the required find string

EX: gv_add / WRITE……………………….

 Select a radio button in main program.

Documents Prepared By Sonu Jangir SAP ABAP 7


 Click on yes button double click on required found location or line number.

EX: gv_add = p_input1 + p_input2.

(Or) WRITE: gs_final-f1…………….

 Click on STOP icon (session break point) or click on the statement line at
gray color vertical section to set or delete the session break points up to 30.

Note: The STOP icons are appeared beside the statement line once they are set.

 Execute the program or t-code.


 Fill the required fields.
 Perform the required action such as execute icon or save or enter button.

Note: The program or source is stopped in the debugger at the first set break
point.

 Use the function keys F5/F6/F7/F8 to check line by line or block by block.

2) Static Break Points

The ABAP statements BREAK-POINT or BREAK<user_name> is used to set


static points

Syntax: BREAK < BABU>. “ Advisable

* Or

BREAK-POINT . “ Strictly not advisable.

Note: In the real time the ABAP statement BREAK-POINT should not be used
since all the users are stopped.

Steps To Set A Static Break-Point:

 Once the program or source code is in change mode click on find icon.

Documents Prepared By Sonu Jangir SAP ABAP 8


 Enter required find string

EX:WRITE:…………

 Select a radio button in main program and click on yes button.


 Double click on required location or line number.
o Gv_add = p_input1 + p_input2
o WRITE :…………..
 Click on display or change icon
 Write an abap statement break followed by an user nae before which the
statement line to be stopped.
BREAK < BABU>.
Gv_add = p_input1 + p_input2
WRITE:…………

 Click on active icon & press enter button.


 Execute the program or source code fill all the required fields and perform
the required action such as execute.

Note: program or source code is stopped at the first set static break-point.

 Use the function keys f5/f6/f7/f8 to check line by line or block by block.

3) Dynamic Break Points:

 They are used to check the program or source code in case of not
possible to find a location

Where the program or source code to be stopped.

 The program or source code is stopped at the first statement line of


the performed action in case of dynamic point.
 The command /H is used to set dynamic break-points.

Steps To Set Dynamic Break-Point :

Documents Prepared By Sonu Jangir SAP ABAP 9


1) Execute the required program or T-code.
2) Fill all the required input fields or screen fields.
3) Enter /H in the command field.
4) Press enter button the system gives the success message as debugging
switched on.
5) Once the dynamic break-point is set.
6) Perform the required action such as execute or save button.

Note: program or source code is stopped at the first statement line of


performed action.

7) Use the function keys F5/F6/F7/F8 to check line by line or block by


block.

4) External Break Points:

 They are used to check cross application component such as RFC-


remote function call, BAPI, business applications programming
interface from another system.
 An icon set or delete external break-points is used to set or delete
external break-point.

Steps To Maintain External Break-Point Settings:

Click on UTILITIES menu item -> click on settings

Click on DEBUGGING tab & enter the required user name

EX: users SAPUSER & check IP MATCHING & enter .

Documents Prepared By Sonu Jangir SAP ABAP 10


Watch Points

 They are used to stop the programs or source code once the set condition is
reached or true.

 Watch points are defined inside the debugger only.

Note: Up to 9 watch points can only be created & up to 30 break-points can


only be set in a system.

Steps To Create Watch Points in New Debugger

1) Once the program or source code is stopped in new debugger.


2) Click on button WATCH POINT & create watch point.
3) Enter the required data variable or fieldname.
Ex: variable gv_add
4) Click on an icon display condition.
5) Enter the required free condition.
Ex: gv_add = 700 or gs_final-field = < field name>.
6) Click on yes button.

Note: The system gives a success message as watch point created once
watch point is created.

7) Click on F8 function key or continue icon.

Note: The program or source code is stopped once the set condition of watch
point is reached.

8) Use the function keys F5/F6/F7/F8 to check line by line or block by


block.

Documents Prepared By Sonu Jangir SAP ABAP 11


Steps To Switch From New Debugger<--------->Classic Debugger

1) Once the program or source code is stopped in new debugger.


2) Click on debugger menu item----> switch to classic debugger ------>
switch to new debugger .
3) Use the function keys f5/f6/f7/f8 to check line by line or block by block.

Steps To Create Watch Points In Classic Debugger

1) Once the program or source code is stopped in classic debugger.


2) Click on the field name or variable name.
3) Enter the required relational operator.
4) Enter the required component field / value.
5) Click on yes button.

Note: The System gives a success massage as ‘watch point created’ once the
watch point is created.

6) Press F8 function key.

Note: The program or source code is stopped once the set condition of
created watch point is reached.

7) Use the function keys F5/F6/F7/F8 to check line by line or block by


block.

Steps To Check Data Variables In New Debugger Or Classic Debugger:

1) Once the program is stopped in debugger double click on the data


variable name such as variables, work areas, internal tables etc..
2) Once the compiler icon is crossed the statement line.

Note: The corresponding data variables, type & length are displayed when the
cursor is

Placed on data variable name in new debugger.

Documents Prepared By Sonu Jangir SAP ABAP 12


STOP 29. Gv_add = p_input1 + p_input2 “compiled

F5 30. Move …………… “Yet to


compile

3) The corresponding values are displayed under value field or field


contents.
EX: Field names : gv_char
Field contents : m

Note: Double click on the data structure variables (work area, internal tables)
under variable column to check

The corresponding content or data.

Steps To Change Data Variable Values In New Debugger:

1) Once the program or source code is stopped in new debugger double click
on data variable name such as variable name, field name or field value of an
internal table (scrolls the data variable section in right hand side).

Note: Data variable values can be change while debugging in development


systems only.

2) Double click on change contents icon that appears beside value column
change data variable value.

3) Press enter.

4) Use the function keys f5/f6/f7/f8 to check line by line or block by block.

Steps To Change Data Variable Values In Classic Debugger :

1) Once the program or source code is stopped in classic debugger.


2) Double click on the required data variable name such as variables, field, and
field contents of an internal table.
3) Change corresponding field contents & click on icon change field contents.

Documents Prepared By Sonu Jangir SAP ABAP 13


4) Use the function keys f5/f6/f7/f8 to check line by line or block by block.

Steps to Use Goto Statement Function:

1) Once the program or source code is stopped in new debugger .


2) Place a cursor on the statement line from which program or source code to
be re-checked.
3) Click on debugger menu item & click on “go to statement”.
4) Use the function keys F5/F6/F7/F8 to check line by line or block by block.

Differences Between Classic Debugger & New Debugger:

Classic Debugger:

1) It doesn’t have different desktops.


2) It opens on same session.
3) It doesn’t have different tabs to captures local variables, global variables,
objects etc.
4) It has lots of limitations such as four data variables can only be checked at a
time.
5) It is not possible to go back into the source code from debugger.

New Debugger:

1) It has different desktops.


2) It requires new session to open.
3) It has different tabs to captures local variables, global variables, objects etc.
4) It is user friendly with much functionality.
5) It is possible to get into the source code using desktop 2 (ABAP stack).

Documents Prepared By Sonu Jangir SAP ABAP 14

You might also like