‎2009 Apr 15 7:48 AM
Dear Experts,
I have created a program that generates report based on the user defined parameters.
My question is, how do I enable the Refresh button/menu in the generated report so that user
won't have to back to the parameter screen and re-execute?
Thanks.
Kath
‎2009 Apr 15 7:53 AM
Hi Kathy,
From the GUI Status you can enable the refresh button,
but you have to do manually that your grid shoud refresh.
like below
if sy-ucomm = 'REFRESH',
,," all your select queries run as per requirement to show in the in the grid.
endif.Thanks
‎2009 Apr 15 7:53 AM
Hi Kathy,
From the GUI Status you can enable the refresh button,
but you have to do manually that your grid shoud refresh.
like below
if sy-ucomm = 'REFRESH',
,," all your select queries run as per requirement to show in the in the grid.
endif.Thanks
‎2009 Apr 15 7:54 AM
Hi Kathy,
As you mentioned that your report generates o/p based on selection parameters entered by the user.
So if you add refresh button as well the program needs new i/p to generate the reprot again.
Rgds,
Sandeep
‎2009 Apr 15 7:54 AM
hi,
how r u generating the report is it slis or grid display.if ur using REUSE_ALV_LIST_DISPLAY,then in the event set pf ststaus,in the pf status u created u can give the standard code for the buttons.If it is grid u can use refresh table ..
‎2009 Apr 15 8:10 AM
i'm not using the alv, i just used the basic write syntax. thanks.
‎2009 Apr 15 7:57 AM
You can enable the REFRESH PUSH BUTTON using the "PF-STATUS" screen (TCODE : SE41). Below code can re-execute the report once more.
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'REFRESH'.
:----> Call the section of the report that fetches data and prints it <----:
WHEN 'BACK'.
:----> LEAVE TO SCREEN 0. (that means go back to main screen <----:
‎2009 Apr 15 7:59 AM
Add a button(say Refresh ) in the application toolbar of the GUI Status.
When the user clicks on REFRESH button, execute the report for the same set of input parameters which the user has entered while executing the report.
When 'REFRESH'.
submit <report> skipping the selection screen. ( not sure of the syntax, check it out).
Gowri
‎2009 Apr 15 8:04 AM
How is the output shown on the screen ?
With Write statements it won't be possible, but with an ALV it is. You need to add a button to the application toolbar, usually it is present in the standard PF-STATUS, but if not then simply add one.
Now when you capture the user command in the subroutine for handling user commands which looks like this,
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Follow these steps
1. Refresh the output table that you have passed to the ALV.
2. Fetch all the data again and populate the output table.
3. Set the rs_selfield-refresh = 'X'. , this structure is passed to the user_command subroutine as shown above.
regards,
Advait