Application Development 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: 

Problem with two custom container objects for a single screen container; ALV is not refreshing

former_member302318
Discoverer
0 Kudos

I have a container in screen called 'CONTAINER'. I have two objects from the same class, this class consists instance variable for both container and grid.

object1->container type ref to cl_gui_custom_container,

object1->grid type ref to cl_gui_alv_grid. ; When I instantiate these objects, I will create both container objects and grid object for each instances. Based on a button click I will select these object from a table and call the display method.

Inside this display method I will call local grid->set_table_for_first_display. Since object1 and object 2 are completely different variable, I planned to use different objects for different data in ALV(using same container 'CONTAINER'), but table is not refreshing. It always show records loaded first time.
Any help would be highly appreciated!

3 REPLIES 3

Patrick_vN
Active Contributor
0 Kudos

How about using 1 container object displaying 1 alv grid? You could use a globally defined field-symbol as the data source (that is assigned to either the first or the second table). Only thing that remains to be done then is changing the field-catalog (there's a method defined for that if I'm not mistaken).

Ah, and make sure to refresh the display of the alv grid after any changes of course.

0 Kudos

Hi Patrick,

I guess, you didn't get my question. I can't get what you explained. I will try to explain bit more.

QUES:How about using 1 container object displaying 1 alv grid?

ANS:It's working fine. In fact, when I instantiate the first object with some data it's displays(here, i use a screen container 'CONTAINER'), now in second loop, I will instantiate the second object of the same class, this object also refers the same screen container 'CONTAINER'. But both ALV data is different since both are from two different object(field catalog is same for both grid in two objects).
If I use the first object, then it displays the data of first object. In second loop, second object created well and passed its local data to same screen container with all necessary parameter, it not refreshing the first object data.

If i instantiate the second object first, then it displays the data of second, but when next instantiation of the first object, it doesn't get changed the second object' data.

QUES:You could use a globally defined field-symbol as the data source (that is assigned to either the first or the second table)

ANS: There is only one table which holds the instance of two categories of data with one column of a same class.

QUES: and make sure to refresh the display of the alv grid after any changes of course.

ANS: Of course i do. But no effect.

0 Kudos

Another option then, if you have only one table, wouldn't it be enough to change the columns that are shown? By manipulating the field catalog for example?