‎2005 Nov 01 11:26 PM
Hello All,
I have refresh button on application tool bar of the report output. The report has to be refreshed ( re-executed) once the refresh button is clicked. Just like refresh button on MD04. Can somebody please help me how do i acieve it. Thank you in advance.
‎2005 Nov 02 6:55 AM
Hi,
You can do it another way also
once clicked on report
submit Report with same parameters/select-options
thanks
Ramesh
‎2005 Nov 01 11:38 PM
Hi
I don't know how you report works, but generally when it manages a refresh function the program should be start again.
So for example, it need to show an list:
START-OF-SELECTION.
PERFORM SHOW_LIST.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'REFR'. PERFORM SHOW_LIST.
ENCASE.
FORM SHOW_LIST.
SELECT * FROM TABLE INTO TABLE ITAB WHERE ....
LOOP AT ITAB.
WRITE: / ITAB.
ENDLOOP.
ENDFORM.
The same logic is good for table control too, it's import to clear the internal table and re-load the data.
Max
‎2005 Nov 02 6:55 AM
Hi,
You can do it another way also
once clicked on report
submit Report with same parameters/select-options
thanks
Ramesh
‎2005 Nov 02 1:45 PM
Thank you Max/ Ramesh for you help.
ramesh..
Can you explain me how can I achieve this using submit statement? I tried but I could only manage to display the selection screen. But I want the report to be executed again once the refresh button is clicked. Please send me sample code if you have one.
Max...
this is an ALV report and as per your suggestion, at the user command i wrote all the performs to get and display the data. it is working fine. but i was just wondering if I can do this using SUBMIT statement.
Anybody else have any other ideas???
Thank you all
‎2005 Nov 02 2:13 PM
First, I would add one line of code to the example above.
START-OF-SELECTION.
PERFORM SHOW_LIST.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'REFR'. PERFORM SHOW_LIST.
ENCASE.
FORM SHOW_LIST.
<b>sy-lsind = sy-lsind - 1.</b>
SELECT * FROM TABLE INTO TABLE ITAB WHERE ....
LOOP AT ITAB.
WRITE: / ITAB.
ENDLOOP.
ENDFORM.
This will keep your program from dumping after refreshing 20 or so times.
If you would like to use the SUBMIT, then all of your report logic as well as the refresh logic will need to be in the sumbmitted program. This doesn't really make sense to me. If you are doing all that, then just have one program, like the above example.
Regards,
Rich Heilman
‎2005 Nov 03 1:50 AM
You have try this function module 'RS_REFRESH_FROM_SELECTOPTIONS'. Call this function module when you click on the button. It will automatically fetches the data. It will give you what you want.
Cheers,
Satya
‎2005 Nov 03 8:13 AM
Just a small subroutine, which we use to refresh the current report:
form refresh_this_report.
data:
seltab like rsparams occurs 0.
* --- Get Parameters ---
call function 'RS_REFRESH_FROM_SELECTOPTIONS'
exporting curr_report = sy-cprog
tables selection_table = seltab
exceptions others = 1.
check sy-subrc = 0.
* --- Call program again ---
submit (sy-cprog)
with selection-table seltab.
endform.
Is also used with ALV-ABAPs.
Best regards
Rabanus