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
Click on Breakpoints Tab -> Srce Code Tab -> Enter the Row number (Here it is 11, check the above screenshot) -> Enter the condition -> Press OK
Conditional breakpoint is created
Condition can be changed by clicking on condition icon
Conditional breakpoint is created in Source code
Now after pressing F8, debugger is stopped when value of LV_ITERATION is 7.
It can also be created by Right Click on breakpoint -> Create breakpoint condition
Then provide the condition in the popup.