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

Auto refresh for two ALVs

Former Member
0 Kudos

Hi ,

I am using two ALVs on single screen for display using 'REUSE_ALV_BLOCK_LIST_APPEND' and 'REUSE_ALV_BLOCK_LIST_DISPLAY'.

Now I want my report as an autorefresh.Please tell me how to do that.

Though I am able to use autorefresh using 'REUSE_ALV_GRID_DISPLAY' but I want it for two ALVs.

Thank You,

Regards,

Vijendra

12 REPLIES 12

Former Member
0 Kudos

use function module.

set_tabel_for_refresh*

0 Kudos

Hi,

I don't know the answer to your question, sorry

Actually I'm interested by your method to autorefresh an ALV list using the function REUSE_ALV_GRID_DISPLAY (and not REUSE_ALV_LIST_DISPLAY). Could you precise how you do it please?

Thank you in advance

Clemenss
Active Contributor
0 Kudos

Hi Vijendra,

it is amazingly easy but I don't have the code here - weekend, sorry.

You can start a timer with method cl_gui_timer=>start. Then you need a local class as an event handler for event finish (or what it is called). This event will restart the time and call cl_gui_cfw=>set_new_okcode.

Sorry some names may be misspelled, its not more than a dozen code lines. Search here for autorefresh or wait until monday - I could post it from my office.

Regards,

Clemens

Former Member
0 Kudos

HI

Im also looking for auto refresh functionality in ALV. Could some one send me a sample code?

Former Member
0 Kudos

Hi Vijendra,

Refer to the link below:

http://erpgenie.com/abaptips/content/view/346/61/

Hope this helps.

Reward if helpful.

Regards,

Sipra

Former Member
0 Kudos

Hi,

Go through the following links for auto refresh of ALV reports

Create automatic refresh report.

http://www.sapdevelopment.co.uk/reporting/rep_autorefresh.htm

http://abapprogramming.blogspot.com/search/label/ABAP%20ALV%20IN%20BRIEF

http://www.alvrobot.com

Reward,if useful.

Thanks,

Chandu

0 Kudos

Hi together,

there is always a simple solution for such complex things:


CONSTANTS:
  gc_cmd_refresh          TYPE sy-ucomm VALUE 'REFRESH'.

*======================================================================*
*= local event handling
*======================================================================*
*---------------------------------------------------------------------*
*       CLASS lcl_event_handler DEFINITION
*---------------------------------------------------------------------*
CLASS lcl_event_handler DEFINITION.

  PUBLIC SECTION.

    CLASS-METHODS: on_finished FOR EVENT finished OF cl_gui_timer.

ENDCLASS.                    "lcl_event_handler DEFINITION
*---------------------------------------------------------------------*
*       CLASS lcl_event_handler IMPLEMENTATION
*---------------------------------------------------------------------*
CLASS lcl_event_handler IMPLEMENTATION.

  METHOD on_finished.

* Start Timer again
    gr_gui_timer->interval = pa_autow.
    CALL METHOD gr_gui_timer->run.

* cause PAI
    CALL METHOD cl_gui_cfw=>set_new_ok_code
      EXPORTING
        new_code = gc_cmd_refresh.

  ENDMETHOD.                    "on_finished

ENDCLASS.                    "lcl_event_handler IMPLEMENTATION
START-OF-SELECTION.
  PERFORM init_autorefresh.
* create and display ALV, have REFRESH defined in GUI-Status
*&---------------------------------------------------------------------*
*&      Form  init_autorefresh
*&---------------------------------------------------------------------*
*       Timer start or stop
*&---------------------------------------------------------------------*
FORM init_autorefresh .
  IF pa_autow IS NOT INITIAL.
    CREATE OBJECT gr_gui_timer.

    SET HANDLER gr_event_handler->on_finished FOR gr_gui_timer.

    gr_gui_timer->interval = pa_autow.
    CALL METHOD gr_gui_timer->run.
  ELSEIF gr_gui_timer IS BOUND.
    gr_gui_timer->cancel( ).
  ENDIF.

ENDFORM.                    " init_autorefresh

The principle is explained in my previous posting.

Regards,

Clemens

0 Kudos

Hi

A question regarding to such functionality. Is it possible to use it for displaying a popup when user goes for example to another transaction, or will the instance of the cl_gui_timer be removed from the memory?

0 Kudos

Hi Clemens

I need to form auto refresh of a report running with the function "REUSE_ALV_GRID_DISPLAY" .

Can you advise me on this?

Thank you, koby

0 Kudos

Hi Kobi,

post a question. Explain what you did, what you tried, where you faced a problem.

Regards,

Clemens

0 Kudos

Hello,

I menage to make auto refresh using "REUSE_ALV_LIST_DISPLAY" , but not for "REUSE_ALV_GRID_DISPLAY".

Can anyone help me on this?

Thanks,

koby

Former Member
0 Kudos

You can refer to the BALVBT01 sample and read the [Auto Refresh ALV List |http://www.sap-basis-abap.com/abap/auto-refresh-alv-list.htm] . The RS_SELFIELD-REFRESH is important, you have to set 'X' into it.