‎2009 Feb 11 9:52 AM
Hello,
I want to combine a breakpoint and a watchpoint to debug a program.
The idea is to set a watchpoint for a variable, but only for a specif line in my source code (combination breakpoint and watchpoint).
I know it's possible to enter conditions for a watchpoint, but I don't know whether it's possible to define the line of the source code in the condition. I did check the system variables, but couldn't find one which keeps the current row of the source code.
Anyone can help me with my problem?
Thanks
‎2009 Feb 11 9:55 AM
HI Glenn
One thing you could do if you don't mind changing the source code is to put this in the line you want
IF variable EQ value.
BREAK-POINT.
ENDIF.
Pushpraj
‎2009 Feb 11 9:55 AM
HI Glenn
One thing you could do if you don't mind changing the source code is to put this in the line you want
IF variable EQ value.
BREAK-POINT.
ENDIF.
Pushpraj
‎2009 Feb 11 9:59 AM
Unfortunately, it's standard SAP code (with an enhancement spot), so I can't use this one.
Thanks
‎2009 Feb 11 10:27 AM
‎2009 Feb 11 10:32 AM
So, what should I enter as condition for my watchpoint?
Something like:
variable = value AND ABDBG-CLINE = 200
Because it says "Unknown variable ABDBG".
Also, when I add the variable ABDBG in my debugger, it's unknown.
Thanks
‎2009 Feb 11 9:58 AM
If u wan to debug a specific line, then jus gve BREAK-POINT bfore that.
or if ur in a loop and u wan to debug from say only 100th rec, u can gve the cond. as sy-tabix = 100 while setting the watch point.
‎2009 Feb 11 10:00 AM
The problem is that it's indeed in a loop, but I have no idea at which record my variable changes to a specific value. That's the thing I want to know.
‎2009 Feb 11 10:12 AM
if its having a large num of entries in the table..u jus need to chk by the values of sy-tabix while creating the watchpoint. if u hve debuuged it for some time, u might hve got an idea of where exactly the chg might happen.
‎2009 Feb 11 10:35 AM
Hi,
Use SY-LILLI field.It will give the current line number..
Regards
Kiran
‎2009 Feb 11 10:36 AM
I tried this before, but the value doesn't change (it says 0) even when I go through the code by F5/F8.
Thanks
‎2009 Feb 11 10:41 AM
if u hve the idea of the variable that is being changed.
jus gve the wa-variable = value
and condition as sy-tabix = 100.
if u know to wat value this variable is being chged, u can gve that value in the condition n chk.
‎2009 Feb 11 10:46 AM
The program is reading a file, so I can't use sy-tabix.
The file is very big, so there are a lot of loops.
I can keep pushing F8 at the breakpoint to see when the variable becomes empty (the one I need), but it's taking very long to find out where this happens...
‎2009 Feb 11 10:50 AM
y don u try this.
u say that the variable is being set to blank...right.
so while creating the watch point give this con. variable = ' ' "space
and it will take u to that record when it is being set to blank.
‎2009 Feb 11 11:01 AM
That was how I initially did it, but there is also a line in the code that clears the variable.
So when I create the watchpoint, it also stops at this line.
‎2009 Feb 11 11:29 AM
as uknow the line which clears the variable, instead of watchpoint keep a break point there and press F8. chk at which record this is cleared.