<?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: Unsort a SORTed table. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250167#M1829195</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anil.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can store the ITAB data in 1 more internal table ITAB2 and &lt;STRONG&gt;dont sort it.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When you are modifying the data in ITAB then read the record in itab2 and modify the desired field value in itab2 as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sudeesh Soni&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Apr 2014 10:55:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-04-24T10:55:47Z</dc:date>
    <item>
      <title>Unsort a SORTed table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250166#M1829194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do we have provision is SAP to unsort a sorted table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used SORT itab by f1 f2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now after few more changes and modifications on itab, I need the itab in same order before the sort statement but with modified values..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 10:41:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250166#M1829194</guid>
      <dc:creator>former_member202771</dc:creator>
      <dc:date>2014-04-24T10:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Unsort a SORTed table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250167#M1829195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anil.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can store the ITAB data in 1 more internal table ITAB2 and &lt;STRONG&gt;dont sort it.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When you are modifying the data in ITAB then read the record in itab2 and modify the desired field value in itab2 as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sudeesh Soni&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 10:55:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250167#M1829195</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-04-24T10:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Unsort a SORTed table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250168#M1829196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Anil,&lt;/P&gt;&lt;P&gt; Unsort option is not available in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; For this requirement, add the field(slno) in itab(Internal Table) and maintain values in ascending order(From 1 to n) before sorting itself.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Sorting before modifications&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; Sort itab by f1 f2.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; After the sorting and modifications done in itab, do the same sorting based on slno as shown below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Sorting after modifications - based on Serial Number&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; Sort itab by slno. &lt;/STRONG&gt;&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;Rajkumar Narasimman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 11:01:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250168#M1829196</guid>
      <dc:creator>rajkumarnarasimman</dc:creator>
      <dc:date>2014-04-24T11:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Unsort a SORTed table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250169#M1829197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something like that is not possible. How should it be achieved? The system would have to keep track of all sort operations in the background to enable the "unsort" your are asking for.&lt;/P&gt;&lt;P&gt;The question is, what are you really trying to achieve? There is certainly a way to implement you requirements without the magic "unsort" function....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Christian &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 11:02:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250169#M1829197</guid>
      <dc:creator>ceedee666</dc:creator>
      <dc:date>2014-04-24T11:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Unsort a SORTed table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250170#M1829198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thats good way of solving this. Extend the itab by one component&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;slno type sy-tabix&lt;/P&gt;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;To store the line index, before first sort add something like (or maybe you can include this in the routine where you are filling the itab)&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;field-symbols: &amp;lt;fs&amp;gt; like line of itab.&lt;/P&gt;
&lt;P&gt;loop at itab assigning &amp;lt;fs&amp;gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;fs&amp;gt;-slno = sy-tabix.&lt;/P&gt;
&lt;P&gt;endloop.&lt;/P&gt;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the case you can not extend itab directly, you need to create a copy of the itab table if&amp;nbsp; there is enough ram in the system = could be performance problem with big tables, or create some separated index internal table (little bit more complicated)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 12:43:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250170#M1829198</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-04-24T12:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Unsort a SORTed table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250171#M1829199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Narasimman &amp;amp; Riha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will work beautifully. I would use the solution you suggest, if I was coding in a custom report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is I want to do this operation in SAPLV03R and there are no enhancement options available at these positions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;SORT &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;output &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;BY &lt;/SPAN&gt;isort isort_et and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;SORT &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;output &lt;/SPAN&gt;STABLE &lt;SPAN class="L0S52"&gt;BY &lt;/SPAN&gt;matnr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; werks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; kunnr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vbeln&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; posnr&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other way in these situations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 14:41:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250171#M1829199</guid>
      <dc:creator>former_member202771</dc:creator>
      <dc:date>2014-04-24T14:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Unsort a SORTed table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250172#M1829200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe that in the user exits / enhancements it's better to create a local copy of the global table and then do whatever you need to do with a local copy. If you need to update the global table at the end then it'd probably need to be done in a LOOP. In an enhancement I would imagine there shouldn't be a very large number of records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no "unsort" feature, unfortunately, we can only re-sort using different fields. But can you share with us what are you trying to achieve exactly? Maybe there is no sorting needed to begin with...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 18:33:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250172#M1829200</guid>
      <dc:creator>Jelena_Perfiljeva</dc:creator>
      <dc:date>2014-04-24T18:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Unsort a SORTed table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250173#M1829201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can follow given logic:&lt;/P&gt;&lt;P&gt;1. Do not sort the Main table-Output&lt;/P&gt;&lt;P&gt;2. Create the new Internal table-Output1 of Output table type adding new field-Sequence.&lt;/P&gt;&lt;P&gt;3. Populate the Output1 table with Output table data and also populate the sequence field.&lt;/P&gt;&lt;P&gt;4. Sort the Output1 table based on required fields.&lt;/P&gt;&lt;P&gt;5. Modify the Output1 table record as per reqirement&lt;/P&gt;&lt;P&gt;6. Sort the Output1 table based on Sequence in ascending.&lt;/P&gt;&lt;P&gt;7. Refresh the Output table and populate it with Output1 table data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sudeesh Soni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2014 04:24:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250173#M1829201</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-04-25T04:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Unsort a SORTed table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250174#M1829202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2014 05:35:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unsort-a-sorted-table/m-p/10250174#M1829202</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-04-25T05:35:09Z</dc:date>
    </item>
  </channel>
</rss>

