<?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: same field from INNER JOIN tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089128#M1813716</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, if I understood your query correctly, try using "LEFT OUTER JOIN". More info on select queries:&lt;A href="http://help.sap.com/abapdocu_702/en/abapselect_join.htm" title="http://help.sap.com/abapdocu_702/en/abapselect_join.htm"&gt;ABAP Keyword Documentation&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Feb 2014 10:28:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-02-10T10:28:23Z</dc:date>
    <item>
      <title>same field from INNER JOIN tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089127#M1813715</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;I have to tables T1 and T2. Field F1 exists in both tables with the same name. I use the following statement to populate internal table. Some data is from T1 and the rest comes from T2. As to filed F1, sometimes T2-F1 is initial and T1-F1 is always filled. F1 of the internal table should come from T1. How can I optimize my code to retrieve the correct data rather than list every fields after SELECT? There are so many fields to populate so I want to use SELECT * rather than to list each of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO CORRESPONDING TABLE OF lt_tab&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; FROM T1 INNER JOIN T2 ON ... .&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;ts&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 10:07:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089127#M1813715</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-10T10:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: same field from INNER JOIN tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089128#M1813716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, if I understood your query correctly, try using "LEFT OUTER JOIN". More info on select queries:&lt;A href="http://help.sap.com/abapdocu_702/en/abapselect_join.htm" title="http://help.sap.com/abapdocu_702/en/abapselect_join.htm"&gt;ABAP Keyword Documentation&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 10:28:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089128#M1813716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-10T10:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: same field from INNER JOIN tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089129#M1813717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to use outer join, not inner join, if you want the values in T1 even if F1 is initial in T2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * into corresponding fields of table lt_tab from T1 &lt;STRONG&gt;left outer join&lt;/STRONG&gt; T2 on.. "condition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding using *, make sure that all the required field are there in the target table lt_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are looking for performance, its always better to list the fields instead of writing '*' when you are using into corresponding fields of table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 10:37:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089129#M1813717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-10T10:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: same field from INNER JOIN tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089130#M1813718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had a similar issue with EKKO-AEDAT and EKPO-AEDAT, to name a specific example.&lt;/P&gt;&lt;P&gt;By my observation, the values from the table that appears later in the join statement will make it into the result set, so try switching T1 and T2 around and see if there is an improvement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I don't know how robust this is, means whether this logic would always be valid for all database systems. You can certainly not go wrong by listing the single columns e.g. EKKO~AEDAT, although you said you have a lot of them.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 10:37:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089130#M1813718</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2014-02-10T10:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: same field from INNER JOIN tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089131#M1813719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, there is no performance difference:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="33976" __jive_macro_name="document" class="jive_macro_document jive_macro" data-orig-content="Why &amp;quot;INTO CORRESPONDING&amp;quot; is much better than its reputation" href="https://community.sap.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 10:38:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089131#M1813719</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2014-02-10T10:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: same field from INNER JOIN tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089132#M1813720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Susmitha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply but the left outer doesn't work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 03:07:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089132#M1813720</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-11T03:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: same field from INNER JOIN tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089133#M1813721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Maju,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply but the LEFT OUTER JOIN doesn't work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 03:19:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089133#M1813721</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-11T03:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: same field from INNER JOIN tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089134#M1813722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So did switching the position of the tables in the join statement work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 07:27:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089134#M1813722</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2014-02-11T07:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: same field from INNER JOIN tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089135#M1813723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Try below sample code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select t1~f1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f3...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from &amp;lt;Table1&amp;gt; as t1 join &amp;lt;table2&amp;gt; as t2 on t1~f1 = t2~f1&amp;nbsp; into corresponding fields of table&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;lt;internal table&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where &amp;lt;condition&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t1--&amp;gt;alias name for table1.&lt;/P&gt;&lt;P&gt;t2--&amp;gt;alias name for table2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Rajkumar Parthipan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 07:36:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089135#M1813723</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-11T07:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: same field from INNER JOIN tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089136#M1813724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, thanks. It works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2014 04:05:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/same-field-from-inner-join-tables/m-p/10089136#M1813724</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-12T04:05:37Z</dc:date>
    </item>
  </channel>
</rss>

