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.
PUBLICSECTION.
METHODSstop.
PRIVATESECTION.
DATA: t_sbook TYPETABLEOF sbook,
wa_sbook LIKELINEOF t_sbook.
ENDCLASS. "lcl_watchpoint DEFINITION
CLASS lcl_watchpoint IMPLEMENTATION.
METHODstop.
SELECT *
FROM sbook
INTOTABLE me->t_sbook.
LOOPAT me->t_sbook INTO me->wa_sbook.
WRITE'Breakpoint Here!'.
ENDLOOP.
ENDMETHOD. "stop
ENDCLASS. "lcl_watchpoint IMPLEMENTATION
DATA: watchpoint TYPEREFTO lcl_watchpoint.
START-OF-SELECTION.
CREATEOBJECT 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:
- Copy-paste this sample code into SE38
- Put a breakpoint at line WRITE 'Breakpoint Here'
- Execute
- Clear the breakpoint
- Try to create a watchpoint for WA_SBOOK-PASSNAME = 'Amelie Buchholm' (or whatever name that exists in SBOOK table)
(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!