<?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 internal tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842920#M665840</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two internal tables t_tab1 and t_tab2 which are of different structures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.t_tab1has the following fields&lt;/P&gt;&lt;P&gt;A_tab1  B_tab1 C_tab1  D_tab1....etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.t_tab2 has the following fields,&lt;/P&gt;&lt;P&gt;A_tab2 B_tab2 C_tab2  D_tab2....etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.t_tab2 is sorted according to the field B_tab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Key btw the two table is A .(A_tab1 = A_tab2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_tab1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A_tab1                    B_tab1&lt;/P&gt;&lt;P&gt;01.01.2007              1&lt;/P&gt;&lt;P&gt;02.02.2007              2&lt;/P&gt;&lt;P&gt;03.03.2007              3&lt;/P&gt;&lt;P&gt;04.04.2007              4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_tab2   before sort&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A &lt;U&gt;tab2                      B&lt;/U&gt;tab2&lt;/P&gt;&lt;P&gt;01.01.2007              01.01.2007&lt;/P&gt;&lt;P&gt;02.02.2007              20.01.2007&lt;/P&gt;&lt;P&gt;03.03.2007              3.01.2007&lt;/P&gt;&lt;P&gt;04.04.2007              4.01.2007&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort t_tab2 by B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_tab2  after  sort&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A_tab2                    B_tab2&lt;/P&gt;&lt;P&gt;01.01.2007              01.01.2007&lt;/P&gt;&lt;P&gt;03.03.2007              3.01.2007&lt;/P&gt;&lt;P&gt;04.04.2007              4.01.2007&lt;/P&gt;&lt;P&gt;02.02.2007              20.01.2007&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to sort t_tab1 also in this order .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want t_tab1 in the following order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; A_tab1                   B_tab1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;01.01.2007              1&lt;/P&gt;&lt;P&gt;03.03.2007              3&lt;/P&gt;&lt;P&gt;04.04.2007              4&lt;/P&gt;&lt;P&gt;02.02.2007              2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to sort t_tab1 in the above order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points will be given for helpful answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Ramya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Sep 2007 11:09:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-25T11:09:35Z</dc:date>
    <item>
      <title>internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842920#M665840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two internal tables t_tab1 and t_tab2 which are of different structures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.t_tab1has the following fields&lt;/P&gt;&lt;P&gt;A_tab1  B_tab1 C_tab1  D_tab1....etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.t_tab2 has the following fields,&lt;/P&gt;&lt;P&gt;A_tab2 B_tab2 C_tab2  D_tab2....etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.t_tab2 is sorted according to the field B_tab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Key btw the two table is A .(A_tab1 = A_tab2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_tab1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A_tab1                    B_tab1&lt;/P&gt;&lt;P&gt;01.01.2007              1&lt;/P&gt;&lt;P&gt;02.02.2007              2&lt;/P&gt;&lt;P&gt;03.03.2007              3&lt;/P&gt;&lt;P&gt;04.04.2007              4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_tab2   before sort&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A &lt;U&gt;tab2                      B&lt;/U&gt;tab2&lt;/P&gt;&lt;P&gt;01.01.2007              01.01.2007&lt;/P&gt;&lt;P&gt;02.02.2007              20.01.2007&lt;/P&gt;&lt;P&gt;03.03.2007              3.01.2007&lt;/P&gt;&lt;P&gt;04.04.2007              4.01.2007&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort t_tab2 by B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_tab2  after  sort&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A_tab2                    B_tab2&lt;/P&gt;&lt;P&gt;01.01.2007              01.01.2007&lt;/P&gt;&lt;P&gt;03.03.2007              3.01.2007&lt;/P&gt;&lt;P&gt;04.04.2007              4.01.2007&lt;/P&gt;&lt;P&gt;02.02.2007              20.01.2007&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to sort t_tab1 also in this order .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want t_tab1 in the following order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; A_tab1                   B_tab1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;01.01.2007              1&lt;/P&gt;&lt;P&gt;03.03.2007              3&lt;/P&gt;&lt;P&gt;04.04.2007              4&lt;/P&gt;&lt;P&gt;02.02.2007              2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to sort t_tab1 in the above order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points will be given for helpful answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Ramya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 11:09:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842920#M665840</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T11:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842921#M665841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;declare itab3 same structure of itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab2&lt;/P&gt;&lt;P&gt;read table itab1 with key A_ita1 = A_itab2 binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;itab3 = itab1.&lt;/P&gt;&lt;P&gt;append itab1&lt;/P&gt;&lt;P&gt;clear ita1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refresh itab1.&lt;/P&gt;&lt;P&gt;itab1[] = itab3[].&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 11:18:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842921#M665841</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T11:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842922#M665842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;declare itab3 same structure of itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab2&lt;/P&gt;&lt;P&gt;read table itab1 with key A_ita1 = A_itab2 binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;itab3 = itab1.&lt;/P&gt;&lt;P&gt;append itab3&lt;/P&gt;&lt;P&gt;clear ita3.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refresh itab1.&lt;/P&gt;&lt;P&gt;itab1[] = itab3[].&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 11:19:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842922#M665842</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T11:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842923#M665843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;pass t__tab1 to a temp t_temp.&lt;/P&gt;&lt;P&gt;Loop at t_tab2.&lt;/P&gt;&lt;P&gt;read t_temp comparing t_tab2-a_tab and t_temp-a_tab.&lt;/P&gt;&lt;P&gt;pass to t_tab1.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bindu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 11:19:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842923#M665843</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T11:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842924#M665844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create another table itab3 of type itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then use this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab1 with key A = t_itab2-A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move-corresponding itab1 to itab3.&lt;/P&gt;&lt;P&gt;append itab3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 11:22:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842924#M665844</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T11:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842925#M665845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Ramya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you need another internal table like tab1 (let's call it tab1_copy)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*after sorting of tab2, you go through tab2:&lt;/P&gt;&lt;P&gt;LOOP AT tab2.&lt;/P&gt;&lt;P&gt;*look for the proper recors from tab1&lt;/P&gt;&lt;P&gt;READ TABLE tab1 WITH key a = tab2-a.&lt;/P&gt;&lt;P&gt;*append the record to tab1_copy&lt;/P&gt;&lt;P&gt;APPEND tab1 TO tab1_copy.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;afte this in tab1_copy you have the records sorted acc. to tab2 sorting. Of course you can do as well:&lt;/P&gt;&lt;P&gt;tab1[] = tab1_copy[].&lt;/P&gt;&lt;P&gt;Now you have the proper order in tab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;ec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 11:22:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842925#M665845</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2007-09-25T11:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842926#M665846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;define another table tab3 like tab1 and then you can sort data in tab1 like your requirement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;t_tab3 like table of t_tab1 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_tab2.&lt;/P&gt;&lt;P&gt;  read table t_tab1 with key A_tab1 = t_tab2-A_tab2.&lt;/P&gt;&lt;P&gt;  if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;    append t_tab1 to t_tab3.&lt;/P&gt;&lt;P&gt;    delete t_tab1.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append lines of t_tab1 to t_tab3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear: t_tab1,t_tab1[].&lt;/P&gt;&lt;P&gt;t_tab1[] = t_tab3[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now tab1 will hav sorted data as in tab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful, get back in case of query...&lt;/P&gt;&lt;P&gt;Cheers!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 11:24:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842926#M665846</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T11:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842927#M665847</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;This can be solved in the below mentioned way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. After sorting the second table. Read the second table with the condition that the A_tab2 = A_tab1. append that work area into a new internal table.After that you can refresh the first internal table and then t_tab1[] = new internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first internaltable will have the fields in the order similar to that of second internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mohit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 11:24:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/2842927#M665847</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T11:24:21Z</dc:date>
    </item>
  </channel>
</rss>

