09-04-2007 12:43 PM
Hi Experts,
My <b>ALV report</b> needs a <b>refresh button</b> on the output.
The <b>Refresh button</b> should be available to allow user to keep this report on screen and <b>refresh regularly</b> rather than <b>going back</b> and <b>running it again.</b>
I am using <b>Function modules</b> and not <b>OOPS Concept</b> here.............As i am<b> unaware</b> of OOPS Please provide me solution in <b>FM's Only</b>.
Kindly send me <b>sample logic</b> for this, <b>Very urgent</b> if ur reply is helpfull.... u will be <b>rewarded heavily</b>.......................
THanks in advance.
Rajesh Kumar
09-04-2007 12:56 PM
Hi Rajesh,
If u r using REUSE_ALV_LIST_DISPLAY fm then u must have declared the form:
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
when 'REFRESH'.
rs_selfield-refresh = 'X'.
endform.
Please reward points if found useful.
09-04-2007 12:47 PM
Hi,
This mean to say that if you have a 'refresh' push button in your gui status, every time you press the button, the list should get refreshed.
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
09-04-2007 12:49 PM
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
Sudheer
09-04-2007 12:49 PM
Hi Rajesh,
Refresh button will be there already on application toolbar if i am not wrong, just write the code for that
If it not there just add one button and replace that FCODE with the FCODE in below code
Try this..
1. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = W_REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
<b>I_CALLBACK_USER_COMMAND = 'USER_COMMAND'</b>
2.
FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
P_SELFLD TYPE SLIS_SELFIELD.
CASE P_UCOMM.
*refreshes ALV Grid
When '&NTE'.
SUBMIT <REPORT_NAME>.
ENDCASE.
ENDFORM.
09-04-2007 12:56 PM
Hi Rajesh,
If u r using REUSE_ALV_LIST_DISPLAY fm then u must have declared the form:
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
when 'REFRESH'.
rs_selfield-refresh = 'X'.
endform.
Please reward points if found useful.
09-04-2007 12:59 PM
Hi rajesh,
Refresh grid display
Use the grid method REFRESH_TABLE_DISPLAY
Example:
CALL METHOD go_grid->refresh_table_display.
Thanks.
09-04-2007 1:03 PM
Hi Rajesh,
Referring to my previous post to the same thread,
u have get the refreshed data in the internal table used for display.
So, ur code would be somewhat like this:
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
<b>Refreshed internal table available at this point</b>
CASE r-ucomm.
WHEN 'REFRESH'.
rs_selfield-refresh = 'X'.
ENDCASE.
ENDFORM.
09-04-2007 1:05 PM
Hi,
Write condition for refresh and In that fetch records into itab , display them by fn module. This is not efficient. But we r using fn modules here not ooabap. So no other way.
Regards,
Asreddy
09-04-2007 1:08 PM
hi,
call function module reuse_alv_grid_display.
i_callbackprogram = gd_repid.
t_fieldcatalog = d_fieldcat.
setpfstatus = 'PF_STATUS'
tables
t_outtab = itab.
form pf_status.
set pf-status 'NEWSTATUS'.
endform.
doubleclick on NEWSTATUS it will take u to menu painter where in u can include Refresh button.
Reward with points if useful.