<?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: Internal table question in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168401#M122443</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think i didn't explained myself correctly.&lt;/P&gt;&lt;P&gt;I wanted to select from the two tables into one internal table not into two of them.&lt;/P&gt;&lt;P&gt;Is this feasible in ABAP?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Xibi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Feb 2006 14:28:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-02-15T14:28:49Z</dc:date>
    <item>
      <title>Internal table question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168397#M122439</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 am writing some update routines for BW, and have an ABAP related question to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to pull data from two tables into that internal table. The problem is that those tables have one field in common however this field is not a key field on neither of them.&lt;/P&gt;&lt;P&gt;Can i use the statement "FOR all Entries" in this case?&lt;/P&gt;&lt;P&gt;What i mean is that i will first select from one table and then write a second select statement for the other table and use the "FOR ALL ENTRIES" statement to match between the records?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will this work? If not can you suggest some code that will do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Xibi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 14:17:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168397#M122439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-15T14:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168398#M122440</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;Would you like to do that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM &amp;lt;TABLE_1&amp;gt; INTO TABLE ITAB WHERE ....&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;SELECT * FROM &amp;lt;TABLE_2&amp;gt; INTO TABLE ITAB2&lt;/P&gt;&lt;P&gt;  FOR ALL ENTRIES IN ITAB WHERE FIELD = ITAB-FIELD. &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it's so, yes it works, but I don't understand your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 14:23:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168398#M122440</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-15T14:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168399#M122441</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 for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pseudo Code:&lt;/P&gt;&lt;P&gt;Select A B C from &amp;lt;TABLEA&amp;gt; into table ITAB1 where &lt;/P&gt;&lt;P&gt;                            TABLEA-FieldK  = K&lt;/P&gt;&lt;P&gt;                             ---&lt;/P&gt;&lt;P&gt;                             --- so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select D E F from &amp;lt; TableB&amp;gt; into itab2 for all entries in itab1&lt;/P&gt;&lt;P&gt;                       where TableB-FieldX = Itab1-fieldX&lt;/P&gt;&lt;P&gt;                       and   TableB-FieldY = Itab1-FieldY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this may help you.&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;Lanka&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 14:24:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168399#M122441</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-15T14:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168400#M122442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;this can be done...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select a
       b
       c
      from &amp;lt;db&amp;gt;
      into table itab.
if sy-subrc = 0.
select b
       d
       from &amp;lt;db2&amp;gt;
       into table itab1
       for all entries in itab
       where b = itab-b.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 14:27:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168400#M122442</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-15T14:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168401#M122443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think i didn't explained myself correctly.&lt;/P&gt;&lt;P&gt;I wanted to select from the two tables into one internal table not into two of them.&lt;/P&gt;&lt;P&gt;Is this feasible in ABAP?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Xibi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 14:28:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168401#M122443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-15T14:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168402#M122444</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 you can pull the data from 2 diff tables into one table.&amp;amp; FOR ALL ENTRIES CAN BE USED.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 14:55:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168402#M122444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-15T14:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168403#M122445</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;using for all entries, and combine the two tables and make it one table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 15:00:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168403#M122445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-15T15:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168404#M122446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xibi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can join the two data base tables during select statement and then you can us "appending the corresponding fields of &amp;lt;ITAB&amp;gt;".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lanka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 15:10:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168404#M122446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-15T15:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168405#M122447</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 the follow sentence:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To obtain data from first table&lt;/P&gt;&lt;P&gt;SELECT a b c INTO itab&lt;/P&gt;&lt;P&gt;FROM tab1&lt;/P&gt;&lt;P&gt;WHERE &amp;lt;cond&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then obtain data from second table, and storage in the same internal table with APPENDING TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT a b c APPENDING TABLE itab&lt;/P&gt;&lt;P&gt;FROM tab2&lt;/P&gt;&lt;P&gt;WHERE &amp;lt;cond&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if this is not what you need, you could make a loop from the first table and then make a read table from second table comparing the no key field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; read table itab2 with key (common not key field) field = itab-field&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;  move values from itab2 to itab 1.&lt;/P&gt;&lt;P&gt; endif. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; modify itab&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this help you.&lt;/P&gt;&lt;P&gt;Alejandro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 15:16:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168405#M122447</guid>
      <dc:creator>alejandro_lpez</dc:creator>
      <dc:date>2006-02-15T15:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168406#M122448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Xibi,&lt;/P&gt;&lt;P&gt; use &lt;/P&gt;&lt;P&gt;  select a&lt;SUB&gt;field1 a&lt;/SUB&gt;field2... &lt;/P&gt;&lt;P&gt;    from table1 as a&lt;/P&gt;&lt;P&gt;    into table itab&lt;/P&gt;&lt;P&gt;    inner join table2 as b&lt;/P&gt;&lt;P&gt;    on a&lt;SUB&gt;field = b&lt;/SUB&gt;field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think it works..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;satesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 15:30:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-question/m-p/1168406#M122448</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-15T15:30:54Z</dc:date>
    </item>
  </channel>
</rss>

