Conditional Breakpoint in SAP ABAP

To debug on some particular condition or debug a certain cycle (e.g. seventh iteration of the loop), conditional breakpoint can be used. It is difficult to check the status of variable in loop when it is having large number of iterations. Using conditional breakpoint, we can stop debugger in exact iteration of the loop.

In below code, we will check the value of variable lv_iteration in the seventh iteration using Conditional breakpoint.

DATA lv_iteration TYPE i.

DO 20 TIMES.
lv_iteration lv_iteration + 1.
ENDDO.

In Debug mode -> Click on Break./Watchpoints tab

1

Click on Breakpoints Tab -> Srce Code Tab -> Enter the Row number (Here it is 11, check the above screenshot) -> Enter the condition -> Press OK

2

Conditional breakpoint is created

3

Condition can be changed by clicking on condition icon

4

Conditional breakpoint is created in Source code

5

Now after pressing F8, debugger is stopped when value of LV_ITERATION is 7.6

 

It can also be created by Right Click on breakpoint -> Create breakpoint condition

101

Then provide the condition in the popup.

102

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s