Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Breakpoint on variable read

Former Member
0 Likes
1,134

Hi,

Is it possible to set up a breakpoint on variable read/access ?

i.e.

MOVE var_1 to var_2. <---- var_1 is being read and transferred to var_2 so debugger should break here

Little background story: I have an ALV Grid control with property stylefname = 'XXXX'. Now in every source data itab I add some entries to color individual cells. Now I would like to catch the piece of SAP code where the value is actually read and used to format the cell. (What I am trying to do is to check how are the styles interpreted and used to color font and background).

Cheers,

Bart

8 REPLIES 8
Read only

MarcinPciak
Active Contributor
0 Likes
1,013

Hi,

You can use [Watchpoint|http://help.sap.com/saphelp_nw2004s/helpdata/EN/f1/792442db42e22ce10000000a1550b0/content.htm] to stop on var2 value change.

Regards

Marcin

Read only

0 Likes
1,013

Hi,

It was just an example. I don't need to stop on var_2 change but var_1 read. In my scenario I don't know whether the value is transferred to any other variable, and even if it is being transferred to other variable I don't know its name nor source file it might be located in.

Cheers,

Bart

Read only

Former Member
0 Likes
1,013

Hi,

Create a watchpoint for a vaiable var_2 eq var_1.

Control will stop at move statement.

Read only

0 Likes
1,013

Hi,

Well the problem is I'm trying to debug ALV classes.

Hundreds if not thousands of 'MOVE' instructions there. Move was just an example. What I'm trying to achieve is to break on variable read, being that by MOVE or IF var IS NOT INITIAL, doesn't matter. Any read access performed on the variable should be caught.

Cheers,

Bart

Edited by: Bartosz Bijak on Mar 22, 2010 11:46 AM

Read only

0 Likes
1,013

well in that case i guess, wherever you have this "Var1", it is being read there!

i.e. all the statements having var1

Sumit

Read only

0 Likes
1,013

Hi,

Assume this:


DATA: 
    my_var(3).

    CALL FUNCTION 'SOME_SAP_FUNCTION_I_DONT_KNOW' EXPORTING param = my_var

Now I want to break inside SOME_SAP_FUNCTION_I_DONT_KNOW as soon as my variable is accessed.

-


I should have rephrased the breakpoint criterion from my first post as I see it is misleading.

MOVE var_1 to var_2. <---- var_1 is being read and transferred to var_2 so debugger should break here

Cheers,

Bart

Read only

Former Member
0 Likes
1,013

Hi,

In this case you can create a break-point on ABAP statements..like on 'move' or 'call function'.

Check function modules as some FM may be used for moving values.

Read only

Former Member
0 Likes
1,013

hi,

in such a case where you do not know the source name, target name, function module name, etc... it is difficult to suggest where to place breakpoint. As you said that you are using ALV classes, so you can place breakpoint in the class interface code where the data extraction is done.

i have checked 'stylefname' property of ALV layout. It is used to pass the name of the cell table for displaying cells as pushbuttons.

you can go through the below link for ALV grid control page 18 for Layout Adjustments:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415...

mostly we can get the stripped pattern in ALV grid by setting 'zebra' property of layout.