<?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 in ALV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv/m-p/3292006#M787702</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;In ALV, to refresh the table you have to call the method "refresh_table_display".  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It has the syntax very similar to creating the table.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It has two parameters. In the first one, you can mention if you want to refresh only the data (the icons are not refreshed)  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want to refresh only the icons around the grid (the data is not refreshed - this option is mostly not used in day to day applications). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the synatx is :- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
call method grid (name of grid )-&amp;gt;refresh_table_display 

exporting 

IS_STABLE = &amp;lt;STRUCT OF TYPE LVC_S_STBL&amp;gt; (THIS IS FOR DATA REFRESHING) 

I_SOFT_REFRESH = &amp;lt;VARIABLE OF CHAR 01&amp;gt;  (THIS IS FOR ICON REFRESHING). 


Check this sample report
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
*************** END OF PROGRAM Z_ALV_AUTO_REFRESH *********************
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this linkl&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="4017"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Formatted by: Alvaro Tejada Galindo on Jan 11, 2008 4:17 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Jan 2008 13:34:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-11T13:34:31Z</dc:date>
    <item>
      <title>Refresh in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv/m-p/3292004#M787700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;how to REFRESH IN ALV'S&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Title Edited by: Alvaro Tejada Galindo on Jan 11, 2008 4:16 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2008 13:17:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv/m-p/3292004#M787700</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-11T13:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv/m-p/3292005#M787701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i_callback_user_command = 'USER_COMMAND'&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.&lt;/P&gt;&lt;P&gt;case UCOMM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when '&amp;amp;IC1'. "this is for double click.&lt;/P&gt;&lt;P&gt;READ TABLE it_idoc INDEX selfield-tabindex.&lt;/P&gt;&lt;P&gt;SET PARAMETER ID 'DCN' FIELD it_idoc-docnum.&lt;/P&gt;&lt;P&gt;SUBMIT RSEIDOC2 WITH DOCNUM = it_idoc-docnum&lt;/P&gt;&lt;P&gt;WITH CREDAT = It_idoc-credat AND RETURN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selfield-refresh = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2008 13:34:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv/m-p/3292005#M787701</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-11T13:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv/m-p/3292006#M787702</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;In ALV, to refresh the table you have to call the method "refresh_table_display".  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It has the syntax very similar to creating the table.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It has two parameters. In the first one, you can mention if you want to refresh only the data (the icons are not refreshed)  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want to refresh only the icons around the grid (the data is not refreshed - this option is mostly not used in day to day applications). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the synatx is :- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
call method grid (name of grid )-&amp;gt;refresh_table_display 

exporting 

IS_STABLE = &amp;lt;STRUCT OF TYPE LVC_S_STBL&amp;gt; (THIS IS FOR DATA REFRESHING) 

I_SOFT_REFRESH = &amp;lt;VARIABLE OF CHAR 01&amp;gt;  (THIS IS FOR ICON REFRESHING). 


Check this sample report
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
*************** END OF PROGRAM Z_ALV_AUTO_REFRESH *********************
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this linkl&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="4017"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Formatted by: Alvaro Tejada Galindo on Jan 11, 2008 4:17 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2008 13:34:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv/m-p/3292006#M787702</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-11T13:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv/m-p/3292007#M787703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In ALV,  to refresh the table you have to call the method my_grid -&amp;gt;"refresh_table_display".  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It has the syntax very similar to creating the table.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It has two parameters. In the first one, you can mention if you want to refresh only the data (the icons are not refreshed)  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want to refresh only the icons around the grid (the data is not refreshed - this option is mostly not used in day to day applications). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the synatx is :- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method grid (name of grid )-&amp;gt;refresh_table_display &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exporting &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IS_STABLE = &amp;lt;STRUCT OF TYPE LVC_S_STBL&amp;gt; (THIS IS FOR DATA REFRESHING) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I_SOFT_REFRESH = &amp;lt;VARIABLE OF CHAR 01&amp;gt;  (THIS IS FOR ICON REFRESHING). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Regard's,&lt;/P&gt;&lt;P&gt;Raj Kamal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2008 13:45:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv/m-p/3292007#M787703</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-11T13:45:21Z</dc:date>
    </item>
  </channel>
</rss>

