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 about OO ALV(CL_GUI_ALV_GRID) refresh

Former Member
0 Kudos

Hi, everyone, I run into a problem about dynamic ALV as follows:

two alv grids (instances of CL_GUI_ALV_GRID, say 'grid1' 'grid2') displayed each into two spliter containers.

the columns of grid2 are dynamic (the output data internal table is field symbol - call method grid2->set_table_for_first_display ... CHANGE IT_OUTTAB = <GT_TABLE>...).

one custom application button (say 'MYBTN') is added to the second grid.

one column (say 'COL2' ) of grid2 is editable. when 'MYBTN' is pressed, another column (say 'COL1') of grid2 is copyed to 'COL2' and display alv again.

in the USER_COMMAND event, the values of 'COL2' of internal table '<GT_TABLE>' have been changed (values are same as 'COL1') already, 'grid2->REFRESH_TABLE_DISPLAY' and ' CALL METHOD CL_GUI_CFW=>FLUSH' are called at the end of USER_COMMAND, too. but the display of 'COL2' is not updated.

Pls help, your effort will be appreciated and thanks in advance !

1 ACCEPTED SOLUTION

Former Member

Hi Donnie,

At what position have you placed grid2->REFRESH_TABLE_DISPLAY ? In PBO or after the Event where you modify the table ?

I usually put my code in PBO and have not faced any issues with refresh..

I dont have access to system so cannot confirm if that is the issue. Check the code snippet below

module pbo_0101 output.

if custom_container is initial.

*--> Code for custom container...

call method grid->set_table_for_first_display....

ELSE.

call method grid->refresh_table_display.
 
endmodule.

3 REPLIES 3

Former Member

Hi Donnie,

At what position have you placed grid2->REFRESH_TABLE_DISPLAY ? In PBO or after the Event where you modify the table ?

I usually put my code in PBO and have not faced any issues with refresh..

I dont have access to system so cannot confirm if that is the issue. Check the code snippet below

module pbo_0101 output.

if custom_container is initial.

*--> Code for custom container...

call method grid->set_table_for_first_display....

ELSE.

call method grid->refresh_table_display.
 
endmodule.

0 Kudos

Hi, Rajvansh Ravi , your answer is very good and I solved the problem. Thank you very much ! And thank everyone for your wonderful answers.

former_member184578
Active Contributor
0 Kudos

Hi.,

Use method check_changed_data of cl_gui_grid., then only then modified records will be updated into your internal table.,

check my reply in this thread:

hope this helps u.,

Thanks & Regards,

Kiran