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

Refresh Button on the report

Former Member
0 Likes
3,342

Hello Friends,

I have a report. I need to add a refresh button to the report.

Any suggestions,

Bob.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,245

Hi

Which kind of report?

ALV? Dialog?

Anyway you need to repeat the logic where u select the data and show it:

START-OF-SELECTION.
  
   PERFORM SHOW_DATA.

AT USER-COMMAND.

CASE SY-UCOMM.
  WHEN 'REFR'. PERFORM SHOW_DATA.

Max

11 REPLIES 11
Read only

Former Member
0 Likes
2,246

Hi

Which kind of report?

ALV? Dialog?

Anyway you need to repeat the logic where u select the data and show it:

START-OF-SELECTION.
  
   PERFORM SHOW_DATA.

AT USER-COMMAND.

CASE SY-UCOMM.
  WHEN 'REFR'. PERFORM SHOW_DATA.

Max

Read only

0 Likes
2,245

Thanks for the suggestion.

Its not an ALV. I will try the option and get back.

Bob

Read only

0 Likes
2,245

You can also call the same report program again using SUBMIT statement...in AT-USER COMMAND event..

This can also do the work....but not needed as said in the earlier posts.

IF using ALV...you can call refresh_table_display method...

Read only

0 Likes
2,245

Thanks All,

Its not an ALV report.

Do we have any standard report whaihc does this.

I have copied a GUI from a standard report but was wondering where do i call the PF status in the program. I mean where do I cwrite the code for it.

An example of this ould be helpful

Bob

Read only

0 Likes
2,245

Hello Bob,

At PF is a event. You can write it anywhere you want.

I found this code in abap docu, you can refer to this code as example of At PF event.

DATA NUMBER LIKE SY-INDEX.

START-OF-SELECTION.

DO 9 TIMES.

WRITE: / 'Row', (2) SY-INDEX.

NUMBER = SY-INDEX.

HIDE NUMBER.

ENDDO.

AT PF8.

CHECK NOT NUMBER IS INITIAL.

WRITE: / 'Cursor was in row', (2) NUMBER.

CLEAR NUMBER.

Regards,

Jacky.

Read only

0 Likes
2,245

Hi

Yo have to set the pf-status after start of selection.


START-OF-SELECTION.
 
  SET PF-STATUS 'TEST'.

AT USER-COMMAND.
 
  CASE sy-ucomm.
 
    WHEN 'REFRESH'.
    logic.
ENDCASE.

Hope this helps.

Regards,

Dhasarathy

Read only

0 Likes
2,245

Thanks All,

I have copied a standard GUI. However that made things bad. the problem is the back, exit button all dosent work.In addition Since its a classical report i dont have the user command. the code for interactive so everything is at-line selection.

Thanks,

Bob

Read only

0 Likes
2,245

Copy this sample code try

As per your requirements change the Change toolbar button FUN1 to REFRESH


report zars
  no standard page heading line-size 255.

data: fcode type table of sy-ucomm,
     wa_fcode type sy-ucomm.

start-of-selection.

  wa_fcode = 'FC2 '. append wa_fcode to fcode.
  wa_fcode = 'FC3 '. append wa_fcode to fcode.
  wa_fcode = 'FC4 '. append wa_fcode to fcode.
  wa_fcode = 'FC5 '. append wa_fcode to fcode.
  wa_fcode = 'PICK'. append wa_fcode to fcode.

  set pf-status 'TEST' of program 'DEMO_LIST_SET_PF_STATUS_1' excluding fcode.

  perform show_list.

at user-command.

  case sy-ucomm.
    when 'FC1'. perform show_list.
  endcase.

*&---------------------------------------------------------------------*
*&      Form  SHOW_LIST
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form show_list.

  sy-lsind = sy-lsind - 1.

  write : sy-uzeit.
endform.                    "SHOW_LIST

a®

Read only

0 Likes
2,245

Thanks ARS.

This really helps.

However i am stuck with the submit statement.

here is my selection screen

SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-b01 .

SELECT-OPTIONS : s_vbeln FOR zdeldates-vbeln .

. .

PARAMETERS : p_reject AS CHECKBOX .

.

SELECTION-SCREEN : END OF BLOCK blk1

Bob

Read only

0 Likes
2,245

What's your issue with submit ?

a®

Read only

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

If you are using ALV then either you can use the "REFRESH" button in ALV toolbar and you can handle the same in PAI or at user command.