<?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: fetch the data from two tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902646#M936315</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;Use FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select * into table tvbrk from vbrk&lt;/P&gt;&lt;P&gt;                            where fkart in ('F2', 'F3', 'RE',&lt;/P&gt;&lt;P&gt;                                       'ZVEC' , 'ZVEM' , 'ZVED',&lt;/P&gt;&lt;P&gt;                                       'S1')&lt;/P&gt;&lt;P&gt;                            and erdat in so_erdat&lt;/P&gt;&lt;P&gt;                            and kunag in s_kunag.  &lt;/P&gt;&lt;P&gt;                                  erdat in so_erdat&lt;/P&gt;&lt;P&gt;                           and   fkart in ('F2', 'F3', 'RE',&lt;/P&gt;&lt;P&gt;                                             'ZVEC' , 'ZVEM').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not tvbrk is initial. &lt;/P&gt;&lt;P&gt;    select * into table t_zregion from zregion&lt;/P&gt;&lt;P&gt;                  for all entries in tvbrk&lt;/P&gt;&lt;P&gt;                   where country = tvbrk-land1&lt;/P&gt;&lt;P&gt;                   and   region = s_regio.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;sitaram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 May 2008 10:15:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-28T10:15:38Z</dc:date>
    <item>
      <title>fetch the data from two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902640#M936309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hell all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i want to fetch the data from two tables, one is from internal table and another one is data base table. what syntax i have to use either FOR ALL ENTRIES or INNER JOIN?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 10:02:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902640#M936309</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T10:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: fetch the data from two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902641#M936310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select * &lt;/P&gt;&lt;P&gt;  from (Standard Table)&lt;/P&gt;&lt;P&gt;   into table ITAB&lt;/P&gt;&lt;P&gt;where (conditions)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not ITAB is initial.&lt;/P&gt;&lt;P&gt;Select *&lt;/P&gt;&lt;P&gt;from (Standard table 2)&lt;/P&gt;&lt;P&gt;into table ITAB2&lt;/P&gt;&lt;P&gt; FOR ALL ENTRIES IN ITAB&lt;/P&gt;&lt;P&gt;where (Conditions eq itab-fields atleast one).&lt;/P&gt;&lt;P&gt;endif.&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;Kannaiah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 10:05:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902641#M936310</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T10:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: fetch the data from two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902642#M936311</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 not fetch data from internal table because its already there for temporary.&lt;/P&gt;&lt;P&gt;select queries are applied for data base fetch.&lt;/P&gt;&lt;P&gt;you can fetch data from database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can make use of your internal table data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i don know your requirement..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 10:07:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902642#M936311</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T10:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: fetch the data from two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902643#M936312</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;Use All Entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use this code&lt;/P&gt;&lt;P&gt; Select * from EKKO table into it_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IF it_EKKO[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT *  FROM  EKPO&lt;/P&gt;&lt;P&gt;           INTO TABLE it_EKPO&lt;/P&gt;&lt;P&gt;           FOR ALL ENTRIES IN it_EKKO&lt;/P&gt;&lt;P&gt;           WHERE vbeln = it_EKKO-vbeln.&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;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 10:09:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902643#M936312</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T10:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: fetch the data from two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902644#M936313</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 have to use for all entries only. Just have a glance with the following code. It will give you some sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : itab  like mara occurs 0 with header line,&lt;/P&gt;&lt;P&gt;         itab1 like mseg occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara into table itab where mtart = 'FERT'.&lt;/P&gt;&lt;P&gt;select * from mseg into corresponding fields of table itab1&lt;/P&gt;&lt;P&gt;   for all entries in itab where matnr = itab-matnr &lt;/P&gt;&lt;P&gt;                                and    bwart  = '131'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sankar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 10:11:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902644#M936313</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T10:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: fetch the data from two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902645#M936314</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;'FOR ALL ENTRIES' is used to improve ur system performance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its good practice to write code which use less db access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'FOR ALL ENTRIES' is used with internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) fetch data for single itab and use it with 'FOR ALL ENTRIES' &lt;/P&gt;&lt;P&gt;and populate the other tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sample code for the same:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select vbeln&lt;/P&gt;&lt;P&gt;posnr&lt;/P&gt;&lt;P&gt;matwa&lt;/P&gt;&lt;P&gt;matkl&lt;/P&gt;&lt;P&gt;from vbap into table vbap_it where vbeln in salesdoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select vbeln&lt;/P&gt;&lt;P&gt;erdat&lt;/P&gt;&lt;P&gt;ernam&lt;/P&gt;&lt;P&gt;from vbak into table vbap_it1 for all entries in vbap_it&lt;/P&gt;&lt;P&gt;where vbeln = vbap_it-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use inner in ur prog. and populate itab1&lt;/P&gt;&lt;P&gt;then use for all entries in next select query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;mano&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 10:14:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902645#M936314</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T10:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: fetch the data from two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902646#M936315</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;Use FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select * into table tvbrk from vbrk&lt;/P&gt;&lt;P&gt;                            where fkart in ('F2', 'F3', 'RE',&lt;/P&gt;&lt;P&gt;                                       'ZVEC' , 'ZVEM' , 'ZVED',&lt;/P&gt;&lt;P&gt;                                       'S1')&lt;/P&gt;&lt;P&gt;                            and erdat in so_erdat&lt;/P&gt;&lt;P&gt;                            and kunag in s_kunag.  &lt;/P&gt;&lt;P&gt;                                  erdat in so_erdat&lt;/P&gt;&lt;P&gt;                           and   fkart in ('F2', 'F3', 'RE',&lt;/P&gt;&lt;P&gt;                                             'ZVEC' , 'ZVEM').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not tvbrk is initial. &lt;/P&gt;&lt;P&gt;    select * into table t_zregion from zregion&lt;/P&gt;&lt;P&gt;                  for all entries in tvbrk&lt;/P&gt;&lt;P&gt;                   where country = tvbrk-land1&lt;/P&gt;&lt;P&gt;                   and   region = s_regio.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;sitaram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 10:15:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902646#M936315</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T10:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: fetch the data from two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902647#M936316</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;Use 'All Entries' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code : &lt;/P&gt;&lt;P&gt;Select * from TableA(Database Table) into itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF itab[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM TableA&lt;/P&gt;&lt;P&gt;INTO TABLE itab&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN itab&lt;/P&gt;&lt;P&gt;WHERE Field1(Database Table field) = itab-Field1.&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;Regards,&lt;/P&gt;&lt;P&gt;Biswanath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 10:22:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902647#M936316</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T10:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: fetch the data from two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902648#M936317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swamy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its not advisable to use INNER JOIN for than 3 tables.&lt;/P&gt;&lt;P&gt;Its better to use FOR ALL ENTRIES instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 10:30:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetch-the-data-from-two-tables/m-p/3902648#M936317</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T10:30:42Z</dc:date>
    </item>
  </channel>
</rss>

