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 in ALV grid

sachin_jadhav8
Participant
0 Likes
2,046

Hello All,

I have developed one ALV program on some "Z" tables which are filling through interface.I am getting correct output after executing it but if I try to execute same report in another session after 5 min time with same selection parameters then i will get output but not those records which are updated in those "Z" tables in between that time interval.

Could you please tell me how to acheive this.

Regards,

Sachin

Moving to ABAP Forum <SAP XI Moderator>

Edited by: Aashish Sinha on Sep 21, 2011 6:38 AM

Hello All,

I have developed one ALV program on some "Z" tables which are filling through interface.I am getting correct output after executing it but if I try to execute same report in another session after 5 min time with same selection parameters then i will get output but not those records which are updated in those "Z" tables in between that time interval.

Could you please tell me how to acheive this.

Regards,

Sachin

Moving to ABAP Forum <SAP XI Moderator>

Edited by: Aashish Sinha on Sep 21, 2011 6:38 AM

5 REPLIES 5
Read only

Former Member
0 Likes
1,262

Hi ,

One option is to put refresh button in application tool bar. Once you click that button , fetch the data from that ztable again and display the output.

Thanks,

Srikanth.A

Read only

Former Member
0 Likes
1,262

Hi Sachin,

Are you specifying the time interval in the selection screen?

Regards,

Asit

Read only

Former Member
0 Likes
1,262

Hi,

Is your Z-table a fully buffered table ?

Danish.

Edited by: Danish2285 on Sep 21, 2011 11:03 AM

Read only

sjeevan
Active Contributor
0 Likes
1,262

Your question is confusing, your refresh button is not working or your report itself not displaying the newly updated data in z tables when you re-execute after a few minutes?

Edited by: Jeevan Sagar on Sep 21, 2011 1:15 AM

Read only

Former Member
0 Likes
1,262

Class Definitio,

CLASS lcl_event_receiver DEFINITION .

PUBLIC SECTION .

METHODS:

*--To implement user commands

handle_user_command

FOR EVENT user_command OF cl_gui_alv_grid

IMPORTING e_ucomm,

  • Method to handle toolbar

handle_toolbar

FOR EVENT toolbar OF cl_gui_alv_grid

IMPORTING e_object e_interactive, "#EC *

ENDCLASS . "lcl_event_handler DEFINITION

class lcl_event_receiver implementation.

method handle_toolbar.

  • add push button to the alv tool bar

clear ls_toolbar.

move 'REFR' to ls_toolbar-function.

move 'Refresh' to ls_toolbar-quickinfo.

move ' ' to ls_toolbar-disabled.

append ls_toolbar to e_object->mt_toolbar.

endmethod.

  • Logic to handle the push button

METHOD handle_user_command.

  • To handle user command

PERFORM handle_user_command USING e_ucomm .

ENDMETHOD. " METHOD HANDLE_USER_COMMAND

Endclass.

  • Handle Refresh Button

FORM handle_user_command USING p_ucomm TYPE any.

IF p_ucomm EQ 'REFR'.

CALL METHOD g_alv_grid->refresh_table_display.

ENDIF.

ENDFORM. "handle_user_command

  • ALV call

call method g_alv_grid->set_table_for_first_display

exporting i_structure_name = 'SFLIGHT'

is_layout = gs_layout

changing it_outtab = gt_sflight.

create object event_receiver.

set handler event_receiver->handle_user_command for grid1.

set handler event_receiver->handle_toolbar for grid1.

call method g_alv_grid->set_toolbar_interactive.