Debugging Techniques in SAP ABAP Programming, Working With Debugging Controls in SAP ABAP Debugging
Debugging Techniques in SAP ABAP Programming, Working With Debugging Controls in SAP ABAP Debugging
Debugging is one of the important part in trouble shooting of an ABAP application, we can debug
ABAP code by using breakpoints.
SAP provides Classical Debugging & New Debugging
New Debugging is available from ECC onwards. whereas classical debugging available in sap r/3
and even in ECC also.
In SAP Programming there are two kinds of breakpoints.
Static Breakpoints: These can be set by using statement BREAK-POINT in ABAP code, these
breakpoints are not user specific, these will trigger for every user. We need to delete these
breakpoints manually.
Dynamic Breakpoints: These breakpoints are user specific, these will trigger for specific user only.
These breakpoints will be deleted automatically when you log-off from SAP. These can be set in
ABAP editor. Dynamic breakpoints can be set in active (activated) source code only. BREAK JBL.
Dynamic breakpoints are of two types.
External break-point: These is a type of break-point, which will get activated even for Non
SAP Applications, these breakpoints will be triggered from SAP or from Non-SAP example
from portal screen.
Session break-point: This break-point will be activated for call only within SAP system and its
active till the User session is on.
Ex:- SE38
These breakpoints have different behaviors in different types of coding blocks ex: Function
Modules, Sub-routines etc.
In this lesson we will discuss the behavior of breakpoints in each.
When we put break-point in some ABAP code, control will stop at the specific place when
executing the ABAP program, then it is debugging mode. We can control debugging using
function keys F5, F6, F7 and F8 or using toolbar buttons in debugging screen.
SKIP.
Go to program source code, put cursor where you wants to set break-point and click on
set/delete external break-point icon (see image below).
Now execute the program, provide input ex: FERT and execute (F8), breakpoint will trigger.
Now go to 'Desktop 3', which is friendly to see run-time variables and data, double click on
any variable to see respected value and data in right pane.
Techniques of debugging
Now, we will learn and understand the real techniques of debugging.
What are uses of F5, F6, F7 and F8 in debugging ?
These are function keys, which are used to control debugging ex: go to next break-point,
execute perform/function module which out going into it etc.
F5 - When you press F5 in debugging, you will go to next step means you program control
goes to next line.
F6 - When you press F6 in debugging, it will execute the module without going into it.F6
works for performs (subroutines), Function modules, Class methods etc.
Ex for F6: we have a program, we have some function modules in the program, when we click
F5 in debugging control will go into function module source code, we don`t want to go into
function module, in that case we use F6, it will not go into function module instead it will
execute it in one step.
F7 - When you press F7 in debugging, it will completes the current module/program in a
single step.
Ex for F7: We have a program, we have a function module in the program, we have put break
point, when we press F7 it will completes the program if the control is in program, when we
press F7 it will complete the module( FM) when the control is in function module.
F8 - When you press F8 in debugging, control will go to next break point if any or completes
the program execution.