<?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: Overwriting the ALV refresh method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/overwriting-the-alv-refresh-method/m-p/3801555#M914271</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ioan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To be honest I do not understand where your problem is. If you need to distinguish between unmodified and modified ALV list data simply use two internal tables, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.) Select data from DB table and fill GT_OUTTAB_PBO.&lt;/P&gt;&lt;P&gt;2.) Set: GT_OUTTAB_PAI = GT_OUTTAB_PBO.  The PAI itab is displayed on the editable ALV list&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.) User changes values of GT_OUTTAB_PAI and pushes SAVE button.&lt;/P&gt;&lt;P&gt;4.) Retrieve current PAI data using method go_grid-&amp;gt;check_changed_data.&lt;/P&gt;&lt;P&gt;5.) If GT_OUTTAB_PAI &amp;lt;&amp;gt; GT_OUTTAB_PBO then execute SAVE routine with DB update. Set GT_OUTTAB_PAI = GT_OUTTAB_PBO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6.) The SAVE routine is executed at PAI of your screen followed by PBO. Then the current GT_OUTTAB_PAI data are displayed which should be identical to the records in the DB table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 May 2008 08:07:36 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2008-05-14T08:07:36Z</dc:date>
    <item>
      <title>Overwriting the ALV refresh method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/overwriting-the-alv-refresh-method/m-p/3801552#M914268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gurus, i need to refresh my ALV after modifications in the database. Can i overwrite the refresh method ? because i have to refresh the internal table too.&lt;/P&gt;&lt;P&gt;The refresh button won`t work.&lt;/P&gt;&lt;P&gt;I will reward points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2008 07:46:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/overwriting-the-alv-refresh-method/m-p/3801552#M914268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-14T07:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Overwriting the ALV refresh method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/overwriting-the-alv-refresh-method/m-p/3801553#M914269</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;The following method call is used to refresh the data displayed within an ALV object grid:&lt;/P&gt;&lt;P&gt;CALL method gd_tree-&amp;gt;REFRESH_TABLE_DISPLAY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD gd_tree-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      is_layout       = gd_layout&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      it_fieldcatalog = gd_fieldcat&lt;/P&gt;&lt;P&gt;      it_sort         = it_sortcat&lt;/P&gt;&lt;P&gt;      it_outtab       = it_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL method gd_tree-&amp;gt;REFRESH_TABLE_DISPLAY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhaskar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2008 07:48:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/overwriting-the-alv-refresh-method/m-p/3801553#M914269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-14T07:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Overwriting the ALV refresh method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/overwriting-the-alv-refresh-method/m-p/3801554#M914270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Use below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : DATA ref1 TYPE REF TO cl_gui_alv_grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;e_grid = ref1.&lt;/P&gt;&lt;P&gt;CALL METHOD ref1-&amp;gt;check_changed_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD ref1-&amp;gt;refresh_&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OR&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do like this&lt;/P&gt;&lt;P&gt;data: o_alv type ref to CL_SALV_TABLE.&lt;/P&gt;&lt;P&gt;then use the method&lt;/P&gt;&lt;P&gt;CALL METHOD o_alv-&amp;gt;refresh&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;refresh_mode = if_salv_c_refresh=&amp;gt;soft.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another method:&lt;/P&gt;&lt;P&gt;If you are using the function module ALV, you need to set the REFRESH flag in the USER_COMMAND routine. HEre is an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call ABAP List Viewer (ALV) &lt;/P&gt;&lt;P&gt;call function 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;i_callback_program = repid&lt;/P&gt;&lt;P&gt;i_callback_user_command = 'HANDLE_USER_COMMAND'&lt;/P&gt;&lt;P&gt;it_fieldcat = ifc&lt;/P&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;t_outtab = itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM handle_User_Command * &lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;P&gt;form handle_user_command using r_ucomm like sy-ucomm&lt;/P&gt;&lt;P&gt;rs_selfield type slis_selfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case r_ucomm.&lt;/P&gt;&lt;P&gt;when '&amp;amp;IC1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO Something &lt;/P&gt;&lt;P&gt;rs_selfield-refresh = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&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;Shiva K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2008 07:51:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/overwriting-the-alv-refresh-method/m-p/3801554#M914270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-14T07:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Overwriting the ALV refresh method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/overwriting-the-alv-refresh-method/m-p/3801555#M914271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ioan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To be honest I do not understand where your problem is. If you need to distinguish between unmodified and modified ALV list data simply use two internal tables, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.) Select data from DB table and fill GT_OUTTAB_PBO.&lt;/P&gt;&lt;P&gt;2.) Set: GT_OUTTAB_PAI = GT_OUTTAB_PBO.  The PAI itab is displayed on the editable ALV list&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.) User changes values of GT_OUTTAB_PAI and pushes SAVE button.&lt;/P&gt;&lt;P&gt;4.) Retrieve current PAI data using method go_grid-&amp;gt;check_changed_data.&lt;/P&gt;&lt;P&gt;5.) If GT_OUTTAB_PAI &amp;lt;&amp;gt; GT_OUTTAB_PBO then execute SAVE routine with DB update. Set GT_OUTTAB_PAI = GT_OUTTAB_PBO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6.) The SAVE routine is executed at PAI of your screen followed by PBO. Then the current GT_OUTTAB_PAI data are displayed which should be identical to the records in the DB table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2008 08:07:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/overwriting-the-alv-refresh-method/m-p/3801555#M914271</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-05-14T08:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Overwriting the ALV refresh method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/overwriting-the-alv-refresh-method/m-p/3801556#M914272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two transactions: one for displaying (using ALV) and one for editing (using ALV), a DB table.&lt;/P&gt;&lt;P&gt;They are running both at the same time in two different sessions. After the user alters the DB table in the edit sessions / transaction, i must refresh the display ALV in the display session so i can see the new DB table.&lt;/P&gt;&lt;P&gt;The problem is that if i press the refresh button i won`t refresh with the new DB table. I have tried to write something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS lcl_event_receiver DEFINITION.
  
PUBLIC SECTION.

    METHODS:
    on_data_changed for event data_changed of cl_gui_alv_grid
       importing er_data_changed.

    METHODS:
    toolbar_handler FOR EVENT toolbar OF cl_gui_alv_grid
    importing
      E_OBJECT
      E_INTERACTIVE.

ENDCLASS. 
......
CLASS lcl_event_receiver IMPLEMENTATION.
.....
  method toolbar_handler.
    SELECT * FROM zianexe into TABLE itab. " Refresh the itab with the new DB data
  endmethod.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When i press the refresh button the "toolbar" event is triggered and the "toolbar_handler" method called.&lt;/P&gt;&lt;P&gt;Now my problem is that i have to press two times the refresh button for my ALV to be displayed with the new DB table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope its clear. &lt;/P&gt;&lt;P&gt;Thank you for the interest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2008 11:56:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/overwriting-the-alv-refresh-method/m-p/3801556#M914272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-14T11:56:37Z</dc:date>
    </item>
  </channel>
</rss>

