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

Enable Refresh Button/Menu in the Generated Report

Former Member
0 Likes
3,644

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,030

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

7 REPLIES 7
Read only

Former Member
0 Likes
2,031

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

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
2,030

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

Read only

Former Member
0 Likes
2,030

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 ..

Read only

0 Likes
2,030

i'm not using the alv, i just used the basic write syntax. thanks.

Read only

former_member219162
Contributor
0 Likes
2,030

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 <----:

Read only

former_member873340
Active Participant
0 Likes
2,030

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

Read only

Former Member
0 Likes
2,030

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