Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Question on refresh button

Former Member
0 Likes
1,669

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,198

Hi,

You can do it another way also

once clicked on report

submit Report with same parameters/select-options

thanks

Ramesh

6 REPLIES 6
Read only

Former Member
0 Likes
1,198

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

Read only

Former Member
0 Likes
1,199

Hi,

You can do it another way also

once clicked on report

submit Report with same parameters/select-options

thanks

Ramesh

Read only

0 Likes
1,198

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

Read only

0 Likes
1,198

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

Read only

Former Member
0 Likes
1,198

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

Read only

0 Likes
1,198

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