2008 Apr 22 11:04 PM
Hi experts,
I have a dialog screen that will display a report in an ALV grid. I don't know what is wrong with my code. The ALV grid is not refreshed if I back out from the screen and go back in for the new data. It is displaying the data from the previous run. Please see code below.
Thanks,
Chuong
*** BEFORE THE ALV IS DISPLAYED ****
* create object
CREATE OBJECT cust_contain_mass_ch_parm11
EXPORTING container_name = 'CONTAINER_ALL'.
* create ALV grid
CREATE OBJECT grid_mass_ch_parm11
EXPORTING
i_parent = cust_contain_mass_ch_parm11.
* Load data into the grid and display them
CALL METHOD grid_mass_ch_parm11->set_table_for_first_display
EXPORTING
is_layout = gs_layout_mass_ch
it_toolbar_excluding = lt_exclude_mass_ch
CHANGING it_outtab = itab_mass_ch
it_fieldcatalog = parm_fieldcat[] .
*** AFTER THE ALV IS DISPLAYED ****
CALL METHOD cust_contain_mass_ch_parm11->free.
CALL METHOD cl_gui_cfw=>flush.
Code Formatted by: Alvaro Tejada Galindo on Apr 22, 2008 6:07 PM
Hi experts,
I have a dialog screen that will display a report in an ALV grid. I don't know what is wrong with my code. The ALV grid is not refreshed if I back out from the screen and go back in for the new data. It is displaying the data from the previous run. Please see code below.
Thanks,
Chuong
*** BEFORE THE ALV IS DISPLAYED ****
* create object
CREATE OBJECT cust_contain_mass_ch_parm11
EXPORTING container_name = 'CONTAINER_ALL'.
* create ALV grid
CREATE OBJECT grid_mass_ch_parm11
EXPORTING
i_parent = cust_contain_mass_ch_parm11.
* Load data into the grid and display them
CALL METHOD grid_mass_ch_parm11->set_table_for_first_display
EXPORTING
is_layout = gs_layout_mass_ch
it_toolbar_excluding = lt_exclude_mass_ch
CHANGING it_outtab = itab_mass_ch
it_fieldcatalog = parm_fieldcat[] .
*** AFTER THE ALV IS DISPLAYED ****
CALL METHOD cust_contain_mass_ch_parm11->free.
CALL METHOD cl_gui_cfw=>flush.
Code Formatted by: Alvaro Tejada Galindo on Apr 22, 2008 6:07 PM
2008 Apr 23 12:44 AM
Which class are you using?
i mean what is the reference?
use Refresh method to refresh
Check out for refresh method in your class
2008 Apr 23 1:12 AM
Hi,
Use a vairiable first_flag , that is set for the first time as 'X' and only first time, u create controls and Set_Table_for_first_display function. and make first_flag as blank. and now call refresh_table_display.
char first_flag type c value 'X'.
if first_flag = 'X'.
create object
CREATE OBJECT cust_contain_mass_ch_parm11
EXPORTING container_name = 'CONTAINER_ALL'.
create ALV grid
CREATE OBJECT grid_mass_ch_parm11
EXPORTING
i_parent = cust_contain_mass_ch_parm11.
Load data into the grid and display them
CALL METHOD grid_mass_ch_parm11->set_table_for_first_display
EXPORTING
is_layout = gs_layout_mass_ch
it_toolbar_excluding = lt_exclude_mass_ch
CHANGING it_outtab = itab_mass_ch
it_fieldcatalog = parm_fieldcat[] .
first_flag = ' '.
endif.
call function grid_mass_ch_parm11->refresh_table_display.
This should work.
Sheel.
2008 Apr 23 1:13 AM
Hi,
Use a vairiable first_flag , that is set for the first time as 'X' and only first time, u create controls and Set_Table_for_first_display function. and make first_flag as blank. and now call refresh_table_display.
char first_flag type c value 'X'.
if first_flag = 'X'.
create object
CREATE OBJECT cust_contain_mass_ch_parm11
EXPORTING container_name = 'CONTAINER_ALL'.
create ALV grid
CREATE OBJECT grid_mass_ch_parm11
EXPORTING
i_parent = cust_contain_mass_ch_parm11.
Load data into the grid and display them
CALL METHOD grid_mass_ch_parm11->set_table_for_first_display
EXPORTING
is_layout = gs_layout_mass_ch
it_toolbar_excluding = lt_exclude_mass_ch
CHANGING it_outtab = itab_mass_ch
it_fieldcatalog = parm_fieldcat[] .
first_flag = ' '.
endif.
call function grid_mass_ch_parm11->refresh_table_display.
This should work.
Sheel.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |