‎2010 Dec 27 9:31 AM
Hi All,
I need to to refresh the data in the container (OOP's) according to the selection, fieldcatalogue has to be same but data will be changed from internal table. Can any one suugest me any method to refresh the data.
‎2010 Dec 27 9:45 AM
Hi Nilanjana,
You can refersh the container data using method refresh_table_display.
Please refer below pseudocode:
**In PBO of screen
If v_container is initial.
Your code to fill container initially
Else.
**Container already contains data, that needs to be modified
CALL METHOD v_container->refresh_table_display.
endif.
Thanks & Regards
Radhika
‎2010 Dec 27 9:45 AM
Hi Nilanjana,
You can refersh the container data using method refresh_table_display.
Please refer below pseudocode:
**In PBO of screen
If v_container is initial.
Your code to fill container initially
Else.
**Container already contains data, that needs to be modified
CALL METHOD v_container->refresh_table_display.
endif.
Thanks & Regards
Radhika
‎2010 Dec 27 9:58 AM
Thanks for the reply Radhika, I tried this method but there is no change. please check the codes below -
IF gv_cust_container IS INITIAL.
****ALV Display
*Instantiate an ALV Container (Container Type)
CREATE OBJECT gv_cust_container
EXPORTING
container_name = 'ALV_CONTAINER'.
*Instantiate an ALV List Viewer
CREATE OBJECT gv_ref_grid
EXPORTING
i_parent = gv_cust_container.
Display the ALV Grid
lwa_layout-sel_mode = 'A'.
lwa_layout-zebra = 'X'.
CALL METHOD gv_ref_grid->set_table_for_first_display
EXPORTING
is_variant = lwa_variant
i_save = 'A'
i_default = 'X'
is_layout = lwa_layout
CHANGING
it_outtab = <fs_2>
it_fieldcatalog = gi_field_cat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD cl_gui_cfw=>flush
EXCEPTIONS
cntl_system_error = 1
cntl_error = 2.
IF sy-subrc <> 0.
error handling
ENDIF.
ELSE.
CALL METHOD gv_ref_grid->refresh_table_display .
ENDIF.
‎2010 Dec 27 10:05 AM
Hi,
Use the grid method REFRESH_TABLE_DISPLAY
also chk the link
‎2010 Dec 27 10:14 AM
Hi Nilanjana,
Your code seems to be correct. Are you using the same grid name gv_ref_grid in some other container? This name must be unique for each ALV if there are multiple ALVs on the same screen.
Regards
Radhika
‎2010 Dec 27 10:18 AM
There is only one ALV in my output. so there is no chance of duplicacy.