Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8076

Watchpoint + Class Attributes

$
0
0

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:

 

  1. Copy-paste this sample code into SE38
  2. Put a breakpoint at line WRITE 'Breakpoint Here'
  3. Execute
  4. Clear the breakpoint
  5. 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!


Viewing all articles
Browse latest Browse all 8076

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>