<?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: ALV OOPs: Refresh Issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612008#M1439128</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi siemens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to use the optional parameters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;S_STABLE	TYPE LVC_S_STBL OPTIONAL
REFRESH_MODE	TYPE SALV_DE_CONSTANT  DEFAULT IF_SALV_C_REFRESH=&amp;gt;SOFT&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Feb 2010 13:37:45 GMT</pubDate>
    <dc:creator>Clemenss</dc:creator>
    <dc:date>2010-02-09T13:37:45Z</dc:date>
    <item>
      <title>ALV OOPs: Refresh Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612007#M1439127</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;Scenario:&lt;/P&gt;&lt;P&gt;I have implemented the ALV display using the methods of class CL_SALV_TABLE. I have a layout parameter and depending on the layout selected the result is displayed. Also there is a Refresh button on the grid for displaying the new data set.&lt;/P&gt;&lt;P&gt;For this I have used the refresh method of the CL_SALV_TABLE class.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  gr_grid-&amp;gt;refresh(  ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Issue:&lt;/P&gt;&lt;P&gt;When the data is displayed for the first time, it is as per the Layout selected. When I press the refresh button, the ordering of the rows is lost. I tried to debug but I am not able to figure out where the problem lies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly suggest.&lt;/P&gt;&lt;P&gt;Please do let me know in case the problem is not clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;s@k&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2010 10:15:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612007#M1439127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-09T10:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: ALV OOPs: Refresh Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612008#M1439128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi siemens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to use the optional parameters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;S_STABLE	TYPE LVC_S_STBL OPTIONAL
REFRESH_MODE	TYPE SALV_DE_CONSTANT  DEFAULT IF_SALV_C_REFRESH=&amp;gt;SOFT&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2010 13:37:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612008#M1439128</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2010-02-09T13:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: ALV OOPs: Refresh Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612009#M1439129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Clemens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried as per your suggestion still it does not work...:(&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly advice..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;s@k&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 03:12:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612009#M1439129</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-10T03:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: ALV OOPs: Refresh Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612010#M1439130</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;Any suggestion..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;s@k&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 07:19:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612010#M1439130</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-10T07:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: ALV OOPs: Refresh Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612011#M1439131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can I please see your code around creating the gr_grid object and calling the display and refresh methods?  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 07:27:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612011#M1439131</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2010-02-10T07:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: ALV OOPs: Refresh Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612012#M1439132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adding to the question, I have 3 ALVs which I am displaying on the same screen(by splitting the container ). I have provided Refresh button on each of the screen and for handling the events I have created a class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS cl_handle_events DEFINITION.
  PUBLIC SECTION.
    METHODS:
      on_user_command FOR EVENT added_function OF cl_salv_events
        IMPORTING e_salv_function sender.

ENDCLASS.                    "cl_handle_events DEFINITION
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ALVs are created by calling&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  TRY.
      cl_salv_table=&amp;gt;factory(
        EXPORTING
          r_container    = gr_container1
        IMPORTING
          r_salv_table   = gr_grid_1
        CHANGING
          t_table        = gt_table1
             ).
    CATCH cx_salv_msg INTO gr_error1.
  ENDTRY.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the same fashion i instantiate the other 2 ALVs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The requirement is that If the user presses the Refresh button on the First screen(split container), the other two ALVs should also be refreshed. So, on pressing the 'Refresh' button on the first screen, I do some modification to the three tables and then call the refresh() method for each instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  gr_grid_1-&amp;gt;refresh(  ).
  gr_grid_2-&amp;gt;refresh(  ).
  gr_grid_3-&amp;gt;refresh(  ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly suggest..&lt;/P&gt;&lt;P&gt;Please let me know if I am anyway unclear about the question...:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;s@k&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 09:19:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612012#M1439132</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-10T09:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: ALV OOPs: Refresh Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612013#M1439133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to debug the SAP delivered program: SALV_DEMO_TABLE_REFRESH. As my scenario was similar to this I selected the option 'Output as Grid' on the selection screen and the number of records as 5. On the result screen, I select the field 'Occupied' and sort this in Ascending order. Now I press the button 'Double Data Records and Select Rows'. (This will refresh the grid).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when you get the result back, the sort order is lost and the data is displayed as it was retrieved from the database table. It does not maintain the sort order which matches with my scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly provide your comments whether is this the desired behavior?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;s@k&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 11:04:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612013#M1439133</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-10T11:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: ALV OOPs: Refresh Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612014#M1439134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi siemens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as far as I know a REFRESH will always restore the initial table display, i.e. transport the values present in the internal table for display to the frontend. It will not change any layout set when the initial display was triggered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want sorting (and other settings) preserved, you could save a default layout or extract the respective column and layout objects and restore them when refreshing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 13:46:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612014#M1439134</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2010-02-10T13:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: ALV OOPs: Refresh Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612015#M1439135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Clemens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response..:)&lt;/P&gt;&lt;P&gt;But the thing is that in my previous post I have explained the case how the SAP delivered demo program behaves. This also does not save the sort order..:(&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For my case(when REFRESH button is pressed) I have tried to debug and found the following:&lt;/P&gt;&lt;P&gt;1. Method RAISE_ADDED_FUNCTION (of class CL_SALV_CONTROLLER_EVENTS) is called.&lt;/P&gt;&lt;P&gt;2. Method HANDLE_BEFORE_EVENT (of class CL_SALV_CONTROLLER_EVENTS) is called internally.&lt;/P&gt;&lt;P&gt;    In this method the metadata (sort, layout etc) is fetched.&lt;/P&gt;&lt;P&gt;3. Method RAISE_ADDED_FUNCTION of class CL_SALV_EVENTS is called and which triggers an event which is handled in my program.&lt;/P&gt;&lt;P&gt;4. Method HANDLE_AFTER_EVENT (of class CL_SALV_CONTROLLER_EVENTS) is called. In this the refresh method is called with the table for refresh stability(LVC_S_STBL). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly suggest..:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;s@k&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 04:47:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612015#M1439135</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-11T04:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: ALV OOPs: Refresh Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612016#M1439136</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;Any opinion regarding this..?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;s@k&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2010 03:00:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612016#M1439136</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-12T03:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: ALV OOPs: Refresh Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612017#M1439137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to all for the replies...:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The approach I followed is:&lt;/P&gt;&lt;P&gt;Before executing the 'user command' method, i have set the 'Sort' criteria using the: get_lvc_sort and set_lvc_sort methods of the class cl_salv_controller_metadata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sort order is retained after the Refresh button is pressed...&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;s@k&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2010 07:37:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops-refresh-issue/m-p/6612017#M1439137</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-17T07:37:22Z</dc:date>
    </item>
  </channel>
</rss>

