10-17-2009 6:00 PM
Hi all,
i'm using class CL_SALV_TABLE for creating a simple two-dimensional table; I added some custom buttons in toolbar which are handled by a local class.
Is there some method or another way to reference the internal table containing the data in the local class used for handling events ?
I know that a solution is to use a global internal table so to be accessible in every environment in the program: but how when the internal table used by the main class is not global ?
Thanks in advance,
Antonio
10-17-2009 9:55 PM
Hi,
you can always declare a reference variable and use it like
data:
gr_tab type ref to data.
...
get reference of lt_whatever into gr_tab.
...
Field-symbols:
<tab> type table.
...
assign gr_tab->* to <tab>.
if sy-subrc = 0.
loop at <tab> ...
..
endif.
I don't know much about your specific task, but the use of reference variables allows you to access any kind of data anywhere. You could declare a class as a container with just a get and a set method for the attribute to store the reference.
Regards,
Clemens