<?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: Sort Internal table based on another internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-based-on-another-internal-table/m-p/5031336#M1170329</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Beside the fact that this is just not possible, I'm trying to imagine why you would want to do this, but I can't think of anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So why this requirement? When sorting itab2 all business partner numbers will be randomly 'sorted' in this itab2 and you can't just randomly sort another internal table (itab1) based on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you can do is create another internal table itab3. Loop at itab2, read line from itab1 and append it to itab3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Jan 2009 14:50:01 GMT</pubDate>
    <dc:creator>Sm1tje</dc:creator>
    <dc:date>2009-01-07T14:50:01Z</dc:date>
    <item>
      <title>Sort Internal table based on another internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-based-on-another-internal-table/m-p/5031335#M1170328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Requirement is :&lt;/P&gt;&lt;P&gt;I have two internal tables itab1 and itab2. itab1 has partner_number along with some more fields/columns. Based on the partner_numbers of the itab1 i write a query to get the values for partner_last_name and central_block_flag from the table but000 and i fill these values into a new itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort itab2 by partner_last_name and central_block.&lt;/P&gt;&lt;P&gt;Now how do I sort itab1 based on the sorted itab2-partner_number. I need to have itab1 sorted similar to the order in the itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i do this?&lt;/P&gt;&lt;P&gt;Please let me know if you need more details.Looking forward for your support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Harish P M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 14:22:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-based-on-another-internal-table/m-p/5031335#M1170328</guid>
      <dc:creator>harish_padikkadmohananara</dc:creator>
      <dc:date>2009-01-07T14:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Internal table based on another internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-based-on-another-internal-table/m-p/5031336#M1170329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Beside the fact that this is just not possible, I'm trying to imagine why you would want to do this, but I can't think of anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So why this requirement? When sorting itab2 all business partner numbers will be randomly 'sorted' in this itab2 and you can't just randomly sort another internal table (itab1) based on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you can do is create another internal table itab3. Loop at itab2, read line from itab1 and append it to itab3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 14:50:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-based-on-another-internal-table/m-p/5031336#M1170329</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2009-01-07T14:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Internal table based on another internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-based-on-another-internal-table/m-p/5031337#M1170330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Micky,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your early reply. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this scenario wherein i need to sort a existing internal table itab1 of type 'bapibus1006_relations' based on the 'Partner last name ' and 'Inactive/Active Flag'. These two fields are not available in this itab1 and so i need to create itab2 after a query on table but000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorting itab2 is , first sort itab2 based on the 'Active flag' and then sort this itab2 again by 'Partner last name'(ascending order).&lt;/P&gt;&lt;P&gt;Finally when i get my sorted itab2 i would have to ensure that my objective of sorting itab1 is obtained.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess i sound better now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would be helpful if you could reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Harish P M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 15:04:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-based-on-another-internal-table/m-p/5031337#M1170330</guid>
      <dc:creator>harish_padikkadmohananara</dc:creator>
      <dc:date>2009-01-07T15:04:28Z</dc:date>
    </item>
  </channel>
</rss>

