<?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: how we join two internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-we-join-two-internal-table/m-p/3100262#M735657</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   You cannot use two internal tables in a select query. Instead move the records from the two tables into a single table and use this table in selecting data from the DB.&lt;/P&gt;&lt;P&gt;   Hope i got your query right!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Nov 2007 06:46:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-20T06:46:28Z</dc:date>
    <item>
      <title>how we join two internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-we-join-two-internal-table/m-p/3100261#M735656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;suppose both table have entries.&lt;/P&gt;&lt;P&gt;iist itab has 3 column ,2 contain 5 column&lt;/P&gt;&lt;P&gt;2 column are common&lt;/P&gt;&lt;P&gt;i want to pick up one column that is not prasent in second itab and 2 columns from 2nd itab  which are not present in ist itab&lt;/P&gt;&lt;P&gt;and two column athat are common i can also pick with these column.&lt;/P&gt;&lt;P&gt;now i have 5 columns based on this i want to fatch data form database how&lt;/P&gt;&lt;P&gt;suppose in 2nd itab have multiple enteries corresponding one record in 1st itab&lt;/P&gt;&lt;P&gt;how we procedd we cant use read becuase it always pick single record.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2007 05:00:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-we-join-two-internal-table/m-p/3100261#M735656</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-20T05:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: how we join two internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-we-join-two-internal-table/m-p/3100262#M735657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   You cannot use two internal tables in a select query. Instead move the records from the two tables into a single table and use this table in selecting data from the DB.&lt;/P&gt;&lt;P&gt;   Hope i got your query right!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2007 06:46:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-we-join-two-internal-table/m-p/3100262#M735657</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-20T06:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: how we join two internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-we-join-two-internal-table/m-p/3100263#M735658</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;You can use APPEND LINES OF itab1 TO itab2, when there is no condition and the structure of the 2 internal tables are the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have to join 2 internal tables upon some condition, then Loop is necessary.without looping it is not possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2007 08:12:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-we-join-two-internal-table/m-p/3100263#M735658</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-20T08:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: how we join two internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-we-join-two-internal-table/m-p/3100264#M735659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you have to program a nested loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
sort itab by ....
loop at itab1 into wa1.
  read itab2 into wa2
          with key ...binary search
    wa3-col1 = ...
    ....
    wa3-col5 =
    append wa3 to itab3.
endloop
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The new table itab3 is the join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2007 09:34:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-we-join-two-internal-table/m-p/3100264#M735659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-20T09:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: how we join two internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-we-join-two-internal-table/m-p/3100265#M735660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sort itab by ....&lt;/P&gt;&lt;P&gt;loop at itab1 into wa1.&lt;/P&gt;&lt;P&gt;  read itab2 into wa2&lt;/P&gt;&lt;P&gt;          with key ...binary search&lt;/P&gt;&lt;P&gt;    wa3-col1 = ...&lt;/P&gt;&lt;P&gt;    ....&lt;/P&gt;&lt;P&gt;    wa3-col5 =&lt;/P&gt;&lt;P&gt;    append wa3 to itab3.&lt;/P&gt;&lt;P&gt;endloop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in your answer  above where is loop on itab3 is it correct&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2007 15:24:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-we-join-two-internal-table/m-p/3100265#M735660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-27T15:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: how we join two internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-we-join-two-internal-table/m-p/3100266#M735661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
sort itab2 by ....
loop at itab1 into wa1.
  read itab2 into wa2
          with key ...  binary search
    if ( sy-subrc eq 0 ).   
       wa3-col1 = ...
       ....
        wa3-col5 =
       append wa3 to itab3.
   endif. 
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the resulting table itab3 in something like an inner join of itab1 and itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Outer joins would mean that itab3 has also lines which are only in one internal table and not in both. They are a bit more complicated, but I think you need the &lt;/P&gt;&lt;P&gt;inner join-type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no loop an itab3, it is built by the appends.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2007 16:24:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-we-join-two-internal-table/m-p/3100266#M735661</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-27T16:24:06Z</dc:date>
    </item>
  </channel>
</rss>

