2007 Nov 07 8:52 AM
Hello,
I have an ALV Grid, for which I want to refresh the data display with a refresh button.
In the ProcessAfterInput, I´m refreshing my internal table, fill it again and call the method "refresh_table_display".
The problem is, sometimes it works fine, sometimes it does nothing. When I go out of the program and in again, it is always refreshed. Where is the problem here and what can I do?
Michael
Hello,
I have an ALV Grid, for which I want to refresh the data display with a refresh button.
In the ProcessAfterInput, I´m refreshing my internal table, fill it again and call the method "refresh_table_display".
The problem is, sometimes it works fine, sometimes it does nothing. When I go out of the program and in again, it is always refreshed. Where is the problem here and what can I do?
Michael
2007 Nov 07 8:58 AM
hi
good
when using the function module "REUSE_ALV_GRID_DISPLAY", you have a exporting parameter called "I_CALLBACK_USER_COMMAND". This is the name of a form in your report to handle all the buttons clicked. To create your own buttons just create a GUI-Status and provide the exporting parameter "I_CALLBACK_PF_STATUS_SET" with a form in your report that sets the status.
Inside your user_command-Form you can update all the records of your internal table. To make ALV refresh the display just provide the field st_selfield-refresh with 'X'.
EXAMPLE:
=========
FORM USER_COMMAND USING RC_UCOMM LIKE SY-UCOMM
ST_SELFIELD TYPE SLIS_SELFIELD.
case rc_ucomm.
check which button has been pressed
Refresh internal table
select... into itab...
endcase.
Make sure, that the updated internal table itab is displayed
st_selfield-refresh = 'X'.
ENDFORM.
FORM PF_STATUS_SET USING RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'ALV'. " EXCLUDING RT_EXTAB.
ENDFORM.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = 'ZPXYZ'
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
reward point if helpful.
thanks
mrutyun^
2007 Nov 07 9:03 AM
Hi,
thank you for the answer. I´m using ALV grid object orientated.
So I need to call the refresh method in the process after input. But can anybody tell me, why this is not working always?
Michael
2007 Nov 07 9:02 AM
in your PAI call this method very first
data: l_valid type c.
call method g_grid->check_changed_data
importing e_valid = l_valid.
and in the end of PAI
call the method REFRESH_TABLE_DISPLAY
module pai.
call method g_grid->check_changed_data
importing e_valid = l_valid.
....
.......
-
call method g_grid->REFRESH_TABLE_DISPLAY.
endmodule.
****************
ALSO CHECK GIVING THIS
CALL METHOD alv_grid->refresh_table_display
EXPORTING
is_stable = ls_stable
i_soft_refresh = 'X'.
Regards
Vasu
2007 Nov 07 11:09 AM
Hi,
In ALV, to refresh the table you have to call the method "refresh_table_display".
It has the syntax very similar to creating the table.
It has two parameters. In the first one, you can mention if you want to refresh only the data (the icons are not refreshed)
or
if you want to refresh only the icons around the grid (the data is not refreshed - this option is mostly not used in day to day applications).
the synatx is :-
call method grid (name of grid )->refresh_table_display
exporting
IS_STABLE = <STRUCT OF TYPE LVC_S_STBL> (THIS IS FOR DATA REFRESHING)
I_SOFT_REFRESH = <VARIABLE OF CHAR 01> (THIS IS FOR ICON REFRESHING).
Regards,
Bhaskar