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

Refresh issue with cl_gui_alv_grid

Former Member
0 Likes
1,912

Hi,

I am calling a zprogram with a screen from one of the user exits in vt02n. The screen contains 2 custom containers which will show one alv tree and another alv grid (cl_gui_alv_grid ). Once the screen is shown to the user, the user can close the screen and then the control comes back to the same vt02n. If the user trigger the screen again from vt02n, then the data shown in the alv controls are the same as what it showed the last time (it doesnt get refreshed). i tried freeing all the objects and refershing all the internal tables. even if the data in the internal tables are different, when the screen display comes the old values are shown. Has anyone faced this issue or please help if anyone knows the solution for this.

i tried using CL_GUI_CFW=>FLUSH , but it doesn help.

Regards,

Dinu.

Hi,

I am calling a zprogram with a screen from one of the user exits in vt02n. The screen contains 2 custom containers which will show one alv tree and another alv grid (cl_gui_alv_grid ). Once the screen is shown to the user, the user can close the screen and then the control comes back to the same vt02n. If the user trigger the screen again from vt02n, then the data shown in the alv controls are the same as what it showed the last time (it doesnt get refreshed). i tried freeing all the objects and refershing all the internal tables. even if the data in the internal tables are different, when the screen display comes the old values are shown. Has anyone faced this issue or please help if anyone knows the solution for this.

i tried using CL_GUI_CFW=>FLUSH , but it doesn help.

Regards,

Dinu.

3 REPLIES 3
Read only

sharat_chandra
Product and Topic Expert
Product and Topic Expert
0 Likes
1,080

Hi,

To refresh the front end ALV control with the latest data REFRESH_TABLE_DISPLAY is used. When the same ALV is called again with the changed data, then this method takes care of the display of the latest data present in the internal table. This is the internal table you would have used in the method SET_TABLE_FOR_FIRST_DISPLAY.

regards,

Sharat

Read only

0 Likes
1,080

would you please show us some sample code? I meet the same problem.

Read only

1,080

Hi,

Ensure free method is called only for alv:


DATA: r_cust_container TYPE REF TO cl_gui_custom_container,
          r_alv TYPE REF TO cl_gui_alv_grid.
 
  CALL SCREEN 0200.  "assuming 0200 is the screen with ALV
 
MODULE pbo_0200 OUTPUT.
  SET PF-STATUS ...
 
 "custom container created only once
  IF r_cust_container IS INITIAL.
    CREATE OBJECT r_cust_container
      EXPORTING
         container_name              = 'CUSTOM_AREA'.  "custom control name on layout
  ENDIF.
  
  "but alv recreated each time
  "free r_alv is not initial and clear reference variable 
  IF r_alv IS BOUND.
      r_alv->free( ).   
      clear r_alv.   
  ENDIF.
  
"recreate ALV
   CREATE OBJECT r_alv
        EXPORTING
           i_parent          =  r_cust_container.

   CALL METHOD g_alv_grid_ref->set_table_for_first_display
      ...

Regards

Marcin