100% found this document useful (1 vote)
70 views

Debugging Techniques in SAP ABAP Programming, Working With Debugging Controls in SAP ABAP Debugging

Debugging techniques in SAP ABAP programming involve using breakpoints to pause program execution. There are two types of breakpoints: static breakpoints set using BREAK-POINT statements, and dynamic breakpoints set in the ABAP editor that are user-specific. Function keys like F5, F6, F7 and F8 are used to control the debugging process, allowing the programmer to step through code line-by-line or complete modules/programs in a single step. External breakpoints can be used to debug programs called from external interfaces.

Uploaded by

SUDHARSANA S
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
70 views

Debugging Techniques in SAP ABAP Programming, Working With Debugging Controls in SAP ABAP Debugging

Debugging techniques in SAP ABAP programming involve using breakpoints to pause program execution. There are two types of breakpoints: static breakpoints set using BREAK-POINT statements, and dynamic breakpoints set in the ABAP editor that are user-specific. Function keys like F5, F6, F7 and F8 are used to control the debugging process, allowing the programmer to step through code line-by-line or complete modules/programs in a single step. External breakpoints can be used to debug programs called from external interfaces.

Uploaded by

SUDHARSANA S
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

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.

1. Working with static break point.


Go to SE38, create a program ZSAP_DEBUGGING, add below code and activate.
REPORT ZSAP_DEBUGGING.

SKIP.

BREAK-POINT. "Static break-point

Save, activate and execute the program.

2. Working with Dynamic Breakpoint.


Go to SE38, create a program ZSAP_DEBUG, and add below code
REPORT ZSAP_DEBUG.

DATA : IT_MARA TYPE TABLE OF MARA,


WA_MARA TYPE MARA.

PARAMETERS: P_MTART TYPE MARA-MTART.

SELECT * FROM MARA INTO TABLE IT_MARA UP TO 50 ROWS


WHERE MTART = P_MTART.

LOOP AT IT_MARA INTO WA_MARA.


WRITE:/ WA_MARA-MATNR, WA_MARA-MTART, WA_MARA-MATKL, WA_MARA-MEINS, WA_MARA-SPART.
ENDLOOP.

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.

When do we use external break-point?


Whenever we wants to debug a program, function module, Web Dynpro application or any
other object from external interface (other than GUI) like portal, web dynpro etc, we need to
use external break-point. We can use external break point to debug from GUI also.

You might also like