<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Refresh the Report in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-the-report/m-p/3838192#M922864</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out this related thread&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="4906853"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 May 2008 03:22:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-19T03:22:23Z</dc:date>
    <item>
      <title>Refresh the Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-the-report/m-p/3838190#M922862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I have to build an ALV report .. The Problem I am facing is that I need to Create a Report in which the Information for the Client Gets Updated Frequently . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg:- The way it is done at AIRPORT when the Information for flights Keeps on Getting Refreshed .. after every 5 mins...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.) I know I have to Use a Function Module .. BUT which one ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.) How to find the compatible Function Module with any other Scenerio..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Help..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ashutosh Sharotri on May 19, 2008 5:03 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 03:01:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-the-report/m-p/3838190#M922862</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T03:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh the Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-the-report/m-p/3838191#M922863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashutosh Sharotri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please check this code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT z_alv_auto_refresh.
*&amp;gt;*********************************************************************
* This report displays User's info (SM04) using the FM :              *
* REUSE_ALV_LIST_DISPLAY                                              *
* The list is auto-refreshed (refresh time : 5 seconds)               *
*---------------------------------------------------------------------*

TYPE-POOLS: slis.                      " ALV Global Types

DATA :
  gt_user LIKE uinfo OCCURS 0 WITH HEADER LINE. " User info in SM04

*---------------------------------------------------------------------*
START-OF-SELECTION.

  PERFORM f_read_data.

  PERFORM f_display_data.

*---------------------------------------------------------------------*
*       Form  F_LIRE_DATA
*---------------------------------------------------------------------*
FORM f_read_data.

  REFRESH gt_user.

* Get User's info
  CALL FUNCTION 'THUSRINFO'
       TABLES
            usr_tabl = gt_user.

* Wait in a task
  PERFORM f_call_rfc_wait.

ENDFORM.                               " F_READ_DATA
*---------------------------------------------------------------------*
*      Form  F_DISPLAY_DATA
*---------------------------------------------------------------------*
FORM f_display_data.

  DEFINE m_sort.
    add 1 to ls_sort-spos.
    ls_sort-fieldname = &amp;amp;1.
    append ls_sort to lt_sort.
  END-OF-DEFINITION.

  DEFINE m_event_exit.
    clear ls_event_exit.
    ls_event_exit-ucomm = &amp;amp;1.
    ls_event_exit-after = 'X'.
    append ls_event_exit to lt_event_exit.
  END-OF-DEFINITION.

  DATA :
    ls_layout     TYPE slis_layout_alv,
    lt_sort       TYPE slis_t_sortinfo_alv,
    ls_sort       TYPE slis_sortinfo_alv,
    lt_event_exit TYPE slis_t_event_exit,
    ls_event_exit TYPE slis_event_exit.

* Build Sort Table
  m_sort 'ZEIT'.

* Build Event Exit Table
  m_event_exit '&amp;amp;NTE'.                 " Refresh

  ls_layout-zebra = 'X'.
  ls_layout-colwidth_optimize = 'X'.

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
            i_callback_program      = sy-cprog
            i_callback_user_command = 'USER_COMMAND'
            is_layout               = ls_layout
            i_structure_name        = 'UINFO'
            it_sort                 = lt_sort
            it_event_exit           = lt_event_exit
       TABLES
            t_outtab                = gt_user.

ENDFORM.                               " F_DISPLAY_DATA
*---------------------------------------------------------------------*
*       FORM USER_COMMAND                                             *
*---------------------------------------------------------------------*
FORM user_command USING i_ucomm     TYPE syucomm
                        is_selfield TYPE slis_selfield.     "#EC CALLED

  CASE i_ucomm.
    WHEN '&amp;amp;NTE'.
      PERFORM f_read_data.
      is_selfield-refresh = 'X'.
      SET USER-COMMAND '&amp;amp;OPT'.         " Optimize columns width
  ENDCASE.

ENDFORM.                               " USER_COMMAND
*---------------------------------------------------------------------*
*      Form  F_CALL_RFC_WAIT
*---------------------------------------------------------------------*
FORM f_call_rfc_wait.

  DATA lv_mssg(80).                                         "#EC NEEDED

* Wait in a task
  CALL FUNCTION 'RFC_PING_AND_WAIT' STARTING NEW TASK '001'
    PERFORMING f_task_end ON END OF TASK
    EXPORTING
      seconds               = 5        " Refresh time
      busy_waiting          = space
    EXCEPTIONS
      RESOURCE_FAILURE      = 1
      communication_failure = 2  MESSAGE lv_mssg
      system_failure        = 3  MESSAGE lv_mssg
      OTHERS                = 4.

ENDFORM.                               " F_CALL_RFC_WAIT
*---------------------------------------------------------------------*
*      Form  F_TASK_END
*---------------------------------------------------------------------*
FORM f_task_end USING u_taskname.

  DATA lv_mssg(80).                                         "#EC NEEDED

* Receiving task results
  RECEIVE RESULTS FROM FUNCTION 'RFC_PING_AND_WAIT'
    EXCEPTIONS
      RESOURCE_FAILURE      = 1
      communication_failure = 2  MESSAGE lv_mssg
      system_failure        = 3  MESSAGE lv_mssg
      OTHERS                = 4.

  CHECK sy-subrc EQ 0.
  SET USER-COMMAND '&amp;amp;NTE'.             " Refresh

ENDFORM.                               " F_TASK_END&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;raam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 03:04:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-the-report/m-p/3838191#M922863</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T03:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh the Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-the-report/m-p/3838192#M922864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out this related thread&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="4906853"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 03:22:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-the-report/m-p/3838192#M922864</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T03:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh the Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-the-report/m-p/3838193#M922865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your displaying ALV report using classes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is one method to refresh the alv   REFRESH_TABLE_DSIPLAY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check out this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF o_grid IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;In background no container object should be created&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF cl_gui_alv_grid=&amp;gt;offline( ) IS INITIAL.  "online&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create the container&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CREATE OBJECT o_custom_container&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          container_name = c_container.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF sy-subrc EQ c_sy0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creating the ALV grid&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        CREATE OBJECT o_grid&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            i_parent          = o_custom_container&lt;/P&gt;&lt;P&gt;          EXCEPTIONS&lt;/P&gt;&lt;P&gt;            error_cntl_create = 1&lt;/P&gt;&lt;P&gt;            error_cntl_init   = 2&lt;/P&gt;&lt;P&gt;            error_cntl_link   = 3&lt;/P&gt;&lt;P&gt;            error_dp_create   = 4&lt;/P&gt;&lt;P&gt;            OTHERS            = 5.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creating an instance for the event handler&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT o_event_handler.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Register handler methods to handle ALV Grid events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SET HANDLER o_event_handler-&amp;gt;handle_hotspot_click FOR o_grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Register handler methods to handle ALV Grid events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SET HANDLER o_event_handler-&amp;gt;handle_double_click FOR o_grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Subroutine to prepare layout&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    PERFORM f_prepare_layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Calling the method o_grid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; to display the list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    *&lt;STRONG&gt;CALL METHOD o_grid-&amp;gt;set_table_for_first_display&lt;/STRONG&gt;*      EXPORTING&lt;/P&gt;&lt;P&gt;        i_save                        = c_save&lt;/P&gt;&lt;P&gt;        is_layout                     = l_layout&lt;/P&gt;&lt;P&gt;      CHANGING&lt;/P&gt;&lt;P&gt;        it_outtab                     = i_col_preq&lt;/P&gt;&lt;P&gt;        it_fieldcatalog               = i_fieldcat&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        invalid_parameter_combination = 1&lt;/P&gt;&lt;P&gt;        program_error                 = 2&lt;/P&gt;&lt;P&gt;        too_many_lines                = 3&lt;/P&gt;&lt;P&gt;        OTHERS                        = 4.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; c_sy0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   No Error Processing required.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Raise event TOOLBAR&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD o_grid-&amp;gt;set_toolbar_interactive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Refreshing the ALV display&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;STRONG&gt;CALL METHOD o_grid-&amp;gt;refresh_table_display&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        finished = 1&lt;/P&gt;&lt;P&gt;        OTHERS   = 2.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; c_sy0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   No Error Processing required.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this will help you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sriram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Srirama Murthy Maddirala on May 19, 2008 6:24 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 04:24:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-the-report/m-p/3838193#M922865</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T04:24:05Z</dc:date>
    </item>
  </channel>
</rss>

