2014 Sep 02 12:22 PM
Hey there,
I'm trying to create a watchpoint for a private attribute in one of my classes, but I'm not sure why I'm not being able to do it. Take a look in the following code:
REPORT zwatchpoint_test.
CLASS lcl_watchpoint DEFINITION.
PUBLIC SECTION.
METHODS stop.
PRIVATE SECTION.
DATA: t_sbook TYPE TABLE OF sbook,
wa_sbook LIKE LINE OF t_sbook.
ENDCLASS. "lcl_watchpoint DEFINITION
CLASS lcl_watchpoint IMPLEMENTATION.
METHOD stop.
SELECT *
FROM sbook
INTO TABLE me->t_sbook.
LOOP AT me->t_sbook INTO me->wa_sbook.
WRITE 'Breakpoint Here!'.
ENDLOOP.
ENDMETHOD. "stop
ENDCLASS. "lcl_watchpoint IMPLEMENTATION
DATA: watchpoint TYPE REF TO lcl_watchpoint.
START-OF-SELECTION.
CREATE OBJECT watchpoint.
watchpoint->stop( ).
What I want to do is set a watchpoint for attribute "WA_SBOOK", whenever field WA_SBOOK-PASSNAME reaches some value (ex.: 'Amelie Buchholm').
Steps to reproduce my issue:
(If you don't have data in SBOOK on your system, run program SAPBC_DATA_GENERATOR )
What am I missing? I keep getting the 'area of validity varies', even if I try to set the watchpoint as an object attribute...
Thank you!
2014 Sep 03 12:09 PM
The regular watchpoint works for me (NW 7.40 SP 7), it stops at the desired value.
2014 Sep 02 12:55 PM
It works (at least creating the watchpoint works) as long as you don't try to impose an additional condition on it...
Looks like it has something to do with the fact that the free conditions are assumed to have global variables in them, while you are using an object attribute.
I get more strange behavior whenever I first define the watchpoint on an object (says WATCHPOINT CREATED), navigate to the right tab in de debugger to watch my ...-points, and try to change the watchpoint by (only then!) adding a condition: I get the message WATCHPOINT CREATED, but the watchpoint is actually deleted...
But I don't think what you want to achieve is possible to be honest.
Sorry...
2014 Sep 02 1:11 PM
Problem is I really wanted to impose a condition to the Watchpoint. Thanks for the try anyway!
Maybe this is something related the AS ABAP version? I'm in 7.31 ...
2014 Sep 02 1:37 PM
2014 Sep 02 1:05 PM
Hello Mauricio.
I tried your code and followed your instructions but my watchpoints works correctly
2014 Sep 02 1:12 PM
Hey Simone, could you please confirm if you're in an AS ABAP with version greater than 7.31 ? Maybe this thing only works in 7.4+ .
I've tried 2 different systems (7.31 / 7.02) and the error persists.
Thank you!
2014 Sep 03 4:25 AM
Hi Mauricio,
Not exactly what you asked for, but I think will do the trick. Instead of creating a watch-point I added a condition to the break-point and it worked like a charm:
Cheers,
Custodio
2014 Sep 03 6:24 AM
2014 Sep 03 1:11 PM
2014 Sep 03 12:09 PM
The regular watchpoint works for me (NW 7.40 SP 7), it stops at the desired value.
2014 Sep 03 1:12 PM
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |