<?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 inner join inside a internal table loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-inside-a-internal-table-loop/m-p/2192350#M467503</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello to all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this internal table in which i have selected some records for particular coulms. For  the rest of the colums i need to join 3 tables for the data. I had in mind, of looping the internal table and then having a inner join query and  modifying the internal table(all inside the loop) Just wanted to know, whether its a qood practice performance wise ? IF not, what are the alternatives ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shehryar Dahar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Apr 2007 07:27:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-24T07:27:39Z</dc:date>
    <item>
      <title>inner join inside a internal table loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-inside-a-internal-table-loop/m-p/2192350#M467503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello to all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this internal table in which i have selected some records for particular coulms. For  the rest of the colums i need to join 3 tables for the data. I had in mind, of looping the internal table and then having a inner join query and  modifying the internal table(all inside the loop) Just wanted to know, whether its a qood practice performance wise ? IF not, what are the alternatives ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shehryar Dahar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2007 07:27:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-inside-a-internal-table-loop/m-p/2192350#M467503</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-24T07:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: inner join inside a internal table loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-inside-a-internal-table-loop/m-p/2192351#M467504</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;Doing joins on tables is not a good practice as it slow down ur program execution in the production server.Better u use internal tables for that.Their is no restriction as how many internal tables u are using for that.But before using loop at internal table always write&amp;lt;b&amp;gt; check not itab[] is initial.&amp;lt;/b&amp;gt; where &amp;lt;b&amp;gt;itab&amp;lt;/b&amp;gt; is ur internal table name upon which u want to loop at.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz reward points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chinmay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2007 07:32:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-inside-a-internal-table-loop/m-p/2192351#M467504</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-24T07:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: inner join inside a internal table loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-inside-a-internal-table-loop/m-p/2192352#M467505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shehryar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having a select query that too a join on three tables inside a loop is not a good idea at all. This way you will be querying your database as many times as you have rows in the internal table. This will be a big performance issue. To avoid this you can use a single select statement and use the addition FOR ALL ENTRIES IN &amp;lt;i&amp;gt;&amp;lt;internal table&amp;gt;.&amp;lt;/i&amp;gt; This way you will have only one query to the database. Also dont forget to check if your internal table contains any entries before doing the select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Saurabh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2007 07:51:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-inside-a-internal-table-loop/m-p/2192352#M467505</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-24T07:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: inner join inside a internal table loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-inside-a-internal-table-loop/m-p/2192353#M467506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i dont think there is any need to loop the internal table,if you want to join the internal tables than you can directly join those three tables using the JOIN statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2007 08:01:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-inside-a-internal-table-loop/m-p/2192353#M467506</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-24T08:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: inner join inside a internal table loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-inside-a-internal-table-loop/m-p/2192354#M467507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But then i will have to use 'SELECT SINGLE' and 'FOR ALL ENTRIES'  twice for retrieving data from 3 tables....right ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shehryar Dahar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2007 08:02:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-inside-a-internal-table-loop/m-p/2192354#M467507</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-24T08:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: inner join inside a internal table loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-inside-a-internal-table-loop/m-p/2192355#M467508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;    first use an single select stm for that particular column in the table after that use an inner join on the 3 table using for all enteries this wil solve ur prob i guess&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if helpful&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2007 08:04:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-inside-a-internal-table-loop/m-p/2192355#M467508</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-24T08:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: inner join inside a internal table loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-inside-a-internal-table-loop/m-p/2192356#M467509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;shehryar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  say You have internal table ITAB.Already some columns are updated in internal table.say A,B,C,D.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fill rest of the columns(E,F,G) you need inter join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; write the inner join of the table for all entries of itab where A eq itab-A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP ITAB.&lt;/P&gt;&lt;P&gt;    READ TABLE ITAB1  WITH KEY X = ITAB-X.&lt;/P&gt;&lt;P&gt;   IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;     move  ITAB record to I_FINAL.&lt;/P&gt;&lt;P&gt;     move itab1 records to i_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    append i_final.&lt;/P&gt;&lt;P&gt;   clear i_final.&lt;/P&gt;&lt;P&gt;    &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;Don't forget to reward if useful...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2007 08:11:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-inside-a-internal-table-loop/m-p/2192356#M467509</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-24T08:11:59Z</dc:date>
    </item>
  </channel>
</rss>

