<?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: CL_SALV_TABLE sort issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275340#M1915721</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The index was the same, but at that index, in the sorted (displayed) table contents another row than the unsorted table in memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I posted the solution, I had two itabs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Sep 2015 06:12:48 GMT</pubDate>
    <dc:creator>ralf_wenzel_heuristika</dc:creator>
    <dc:date>2015-09-08T06:12:48Z</dc:date>
    <item>
      <title>CL_SALV_TABLE sort issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275333#M1915714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using a CL_SALV_TABLE in fullscreen mode. The ALV is displayed fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But:&lt;/P&gt;&lt;P&gt;* I mark a column and the standard sort button of CL_SALV_TABLE, the row order changes&lt;/P&gt;&lt;P&gt;* I press a custom button&lt;/P&gt;&lt;P&gt;* In the eventhandler method for added_function, the table (the ALV is based on) has NOT been sorted&lt;/P&gt;&lt;P&gt;* After coming back to the ALV, the list is UNsorted again, but the column shows the red indicator for "sorted by this column"&lt;/P&gt;&lt;P&gt;&amp;nbsp; (the ALV seems to be thinking, that the table has been sorted, but it isn't)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, that I don't know which row the user has marked. If he marks the third row after sorting the grid, the read table ... index ... finds the row, which was the third BEFORE sorting (which is another row). The displayed ALV has another order than the itab, the third row in ALV is NOT the third row in the itab, the ALV is based on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried anything:&lt;/P&gt;&lt;P&gt;* GET_GLOBALS_FROM_SLVC_FULLSCR with check_changed_data&lt;/P&gt;&lt;P&gt;* refresh( refresh_mode = if_salv_c_refresh=&amp;gt;full )&lt;/P&gt;&lt;P&gt;* get_metadata( )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nothing helped&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&lt;/P&gt;&lt;P&gt;200&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&lt;/P&gt;&lt;P&gt;300&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 300&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 300&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A shows the ALV after method 'display', B shows the sorted ALV list, C shows the itab. Of course, the user only can see B and want to mark the second row ('200'). In the event handler method for added_function I can see, that the second row has been marked - but based on the unsorted list (which means, I operate with '100' instead of '200')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can I do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2015 18:10:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275333#M1915714</guid>
      <dc:creator>ralf_wenzel_heuristika</dc:creator>
      <dc:date>2015-09-07T18:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: CL_SALV_TABLE sort issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275334#M1915715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo Ralf,&lt;/P&gt;&lt;P&gt;as you mentioned, &lt;SPAN style="color: #333333; font-size: 12px;"&gt; B is sorted table, when sort the table, the backend and the frontend will be changed, so in this metod, we have changing paramter, because the table will be changed. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you have ITAB, lt_ITAB,&lt;/P&gt;&lt;P&gt;you can assign the global table to you ITAB,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lt_ITAB = gt_conn.&lt;/P&gt;&lt;P&gt;then you will get the sorted table ( B ) &lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;CALL &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;METHOD &lt;/SPAN&gt;cl_salv_table&lt;SPAN class="L0S70"&gt;=&amp;gt;&lt;/SPAN&gt;factory&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IMPORTING&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r_salv_table &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;r_alv_table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CHANGING&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t_table&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;gt_conn&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;Try this demo &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;SALV_DEMO_TABLE_SELECTIONS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;Ibr&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2015 21:53:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275334#M1915715</guid>
      <dc:creator>former_member184158</dc:creator>
      <dc:date>2015-09-07T21:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: CL_SALV_TABLE sort issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275335#M1915716</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;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Make sure that you do not recreate the cl_salv_table on each PBO.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in SALV_DEMO_TABLE_SELECTIONS you can see that all the code is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;conditioned by &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;if gr_container is not bound&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 02:27:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275335#M1915716</guid>
      <dc:creator>rosenberg_eitan</dc:creator>
      <dc:date>2015-09-08T02:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: CL_SALV_TABLE sort issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275336#M1915717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fullscreen -&amp;gt; no container&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 04:53:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275336#M1915717</guid>
      <dc:creator>ralf_wenzel_heuristika</dc:creator>
      <dc:date>2015-09-08T04:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: CL_SALV_TABLE sort issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275337#M1915718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do not have a local itab. There is just one itab and this is global.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: I was wrong. I used a sorted itab in the whole program and copied it into a standard itab (because SALV does not work with sorted itabs). I always looked into the sorted itab (and of course, a sorted itab can not be sorted).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Ralf Wenzel for providing the solution&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 04:54:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275337#M1915718</guid>
      <dc:creator>ralf_wenzel_heuristika</dc:creator>
      <dc:date>2015-09-08T04:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: CL_SALV_TABLE sort issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275338#M1915719</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;SALV_DEMO_TABLE_SELECTIONS have also form display_fullscreen .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check it out .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 05:03:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275338#M1915719</guid>
      <dc:creator>rosenberg_eitan</dc:creator>
      <dc:date>2015-09-08T05:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: CL_SALV_TABLE sort issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275339#M1915720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ralf, &lt;/P&gt;&lt;P&gt;could you assign this table to a ref data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;data &lt;/SPAN&gt;lr_data_Tab &lt;SPAN class="L0S52"&gt;type &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;ref &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;to &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;data&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;FIELD-SYMBOLS&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;lt_data&amp;gt; &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;STANDARD &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ls_data&amp;gt; &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;ANY&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;GET &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;REFERENCE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;OF &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;ITAB&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;lr_data_tab&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ASSIGN &lt;/SPAN&gt;lr_data_tab&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;* &lt;SPAN class="L0S52"&gt;TO &lt;/SPAN&gt;&amp;lt;lt_data&amp;gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ps: I have tried in my test program but I can not get you problem, I get them with same index, before sorting and after sorting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ibrahim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 05:59:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275339#M1915720</guid>
      <dc:creator>former_member184158</dc:creator>
      <dc:date>2015-09-08T05:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: CL_SALV_TABLE sort issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275340#M1915721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The index was the same, but at that index, in the sorted (displayed) table contents another row than the unsorted table in memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I posted the solution, I had two itabs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 06:12:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-table-sort-issue/m-p/11275340#M1915721</guid>
      <dc:creator>ralf_wenzel_heuristika</dc:creator>
      <dc:date>2015-09-08T06:12:48Z</dc:date>
    </item>
  </channel>
</rss>

