2008 Jul 17 10:51 PM
Hi Gurus,
I am using refresh_table_display to refresh the data in my ALV, but apparantly it is not refreshing anything.
Please advice if i am missing something.
WHEN 'REFR'.
*Clear Data
PERFORM clear_data.
Data Selection.
PERFORM get_data.
CALL METHOD obj_grid->refresh_table_display
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ENDCASE.
Thanks in advance.
2008 Jul 18 2:31 AM
I think you need a " CALL METHOD cl_gui_cfw=>flush. " after the method refresh_table_display called.
You don't have to free the alv grid control.
This method is used to synchronize your SAPGui, each time you call it, a new RFC connection is opened to the SAPgui.
Ref. http://help.sap.com/saphelp_sm32/helpdata/en/06/3fa1879f2811d2bd68080009b4534c/content.htm
I think you need a " CALL METHOD cl_gui_cfw=>flush. " after the method refresh_table_display called.
You don't have to free the alv grid control.
This method is used to synchronize your SAPGui, each time you call it, a new RFC connection is opened to the SAPgui.
Ref. http://help.sap.com/saphelp_sm32/helpdata/en/06/3fa1879f2811d2bd68080009b4534c/content.htm
2008 Jul 17 11:50 PM
u need to write below code to clear custom control :
*--custom control through it ALV Grid is displayed.
IF NOT G_CUSTOM_CONTAINER2 IS INITIAL.
CALL METHOD G_CUSTOM_CONTAINER2->FREE.
CLEAR: G_CUSTOM_CONTAINER2.
ENDIF.
2008 Jul 18 2:11 PM
Hi,
Why there is a need to FREE the custom container?
IF NOT G_CUSTOM_CONTAINER2 IS INITIAL.
CALL METHOD G_CUSTOM_CONTAINER2->FREE.
CLEAR: G_CUSTOM_CONTAINER2.
ENDIF.
2008 Jul 18 2:31 AM
I think you need a " CALL METHOD cl_gui_cfw=>flush. " after the method refresh_table_display called.
You don't have to free the alv grid control.
This method is used to synchronize your SAPGui, each time you call it, a new RFC connection is opened to the SAPgui.
Ref. http://help.sap.com/saphelp_sm32/helpdata/en/06/3fa1879f2811d2bd68080009b4534c/content.htm
2008 Jul 18 3:51 AM
hi:
form user_com using r_ucomm like sy-ucomm
rs_selfield type slis_selfield .
case r_ucomm.
when: 'BACK' or 'EXIT' or 'CANCEL'. "leave back to last screen
leave to screen 0.
when: 'ZADD'. "add line
call screen '100' starting at 80 10.
when: 'ZDELETE'.
perform do_delete_line. "delete lines
endcase.
rs_selfield-refresh = 'X'.
rs_selfield-col_stable = 'X'.
rs_selfield-row_stable = 'X'.
endform. "user_com_second
if you used the oo ALV.
you need define a new object,do not use the old one.
such as:
FORM refresh_alv_dis.
data: l_grid TYPE REF TO cl_gui_alv_grid.
CALL METHOD l_grid->refresh_table_display.
ENDFORM. "REFRESH_ALV
好运,
启明星
2008 Jul 18 2:13 PM
Hi Gi
Even I am using refresh_table_display but its not working. I just added few things
CASE e_ucomm.
WHEN 'REFR'.
PERFORM clear_data.
PERFORM get_data.
CALL METHOD obj_grid->get_frontend_layout
IMPORTING
es_layout = DS_LAYO
CALL METHOD obj_grid->set_frontend_layout
EXPORTING
is_layout = ds_layo.
data ds_sort1 type LVC_T_SORT.
CALL METHOD obj_grid->get_sort_criteria
IMPORTING
et_sort = ds_sort1
.
CALL METHOD obj_grid->set_sort_criteria
exporting
it_sort = ds_sort1
.
CALL METHOD obj_grid->refresh_table_display
EXPORTING
IS_STABLE = ds_stable
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
CALL METHOD cl_gui_cfw=>flush
EXCEPTIONS CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2.
ENDCASE.
2008 Jul 18 2:14 PM
Hi Zhang,
I just added the FLUSH to my code, I Development server it was working before as well, but in production server it is was not refreshing. Lets see if this FLUSH thing will help in production server.
CASE e_ucomm.
WHEN 'REFR'.
*Clear Data
PERFORM clear_data.
Data Selection.
PERFORM get_data.
CALL METHOD obj_grid->get_frontend_layout
IMPORTING
es_layout = DS_LAYO
.
*DATA DS_STABLE TYPE LVC_S_STBL .
*DS_STABLE-ROW = 'X'.
*DS_STABLE-COL = 'X'.
CALL METHOD obj_grid->set_frontend_layout
EXPORTING
is_layout = ds_layo.
data ds_sort1 type LVC_T_SORT.
CALL METHOD obj_grid->get_sort_criteria
IMPORTING
et_sort = ds_sort1
.
CALL METHOD obj_grid->set_sort_criteria
exporting
it_sort = ds_sort1
.
CALL METHOD obj_grid->refresh_table_display
EXPORTING
IS_STABLE = ds_stable
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
CALL METHOD cl_gui_cfw=>flush
EXCEPTIONS CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2.
2008 Jul 23 3:19 PM
2008 Jul 18 4:35 AM
Hi Kamesh,
Please check this link
http://www.geocities.com/mpioud/Z_ALV_GRID_CTRL_REFRESH.html
http://www.geocities.com/mpioud/Z_DEMO_ALV_REFRESH_BUTTON.html
Best regards,
raam
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |