<?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: SQL query with subquery of internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-with-subquery-of-internal-table/m-p/1866550#M365280</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming itab1 has a field OBJNR, and you want to get records from AUFK where the objnr is in itab1, the syntax is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select ...&lt;/P&gt;&lt;P&gt;from aufk&lt;/P&gt;&lt;P&gt;for all entries in itab1&lt;/P&gt;&lt;P&gt;where objnr = itab1-objnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jan 2007 03:42:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-10T03:42:40Z</dc:date>
    <item>
      <title>SQL query with subquery of internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-with-subquery-of-internal-table/m-p/1866548#M365278</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;Can i use internal table for subquery, like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select ... into table itab_list from aufk where&lt;/P&gt;&lt;P&gt;aufk~objnr in (select objnr from itab1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab1 is a internal table which contain the valid objnr list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i do that. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2007 01:51:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-with-subquery-of-internal-table/m-p/1866548#M365278</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-10T01:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query with subquery of internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-with-subquery-of-internal-table/m-p/1866549#M365279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FOR ALL ENTRIES is preferred rather than subqueries in terms of performance.&lt;/P&gt;&lt;P&gt;However you can check below link on how to use subqueries:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_erp2004/helpdata/en/dc/dc7614099b11d295320000e8353423/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_erp2004/helpdata/en/dc/dc7614099b11d295320000e8353423/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2007 01:57:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-with-subquery-of-internal-table/m-p/1866549#M365279</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-10T01:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query with subquery of internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-with-subquery-of-internal-table/m-p/1866550#M365280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming itab1 has a field OBJNR, and you want to get records from AUFK where the objnr is in itab1, the syntax is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select ...&lt;/P&gt;&lt;P&gt;from aufk&lt;/P&gt;&lt;P&gt;for all entries in itab1&lt;/P&gt;&lt;P&gt;where objnr = itab1-objnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2007 03:42:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-with-subquery-of-internal-table/m-p/1866550#M365280</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-10T03:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query with subquery of internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-with-subquery-of-internal-table/m-p/1866551#M365281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;select objnr from ztable into table itab1.


if not itab[] is initial.
select ... into table itab_list from aufk  FOR 
ALL ENTRIES in ITAB1 where aufk~objnr = itab-objnr.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2007 03:50:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-with-subquery-of-internal-table/m-p/1866551#M365281</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-10T03:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query with subquery of internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-with-subquery-of-internal-table/m-p/1866552#M365282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Portfolio,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   You can't use like below.Instead of that use for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex: Assume you have data in ITAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT  itab1  IS INITIAL.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    SELECT * FROM aufk into table ITAB2&lt;/P&gt;&lt;P&gt;   for all entries in itab1&lt;/P&gt;&lt;P&gt;    where objnr  eq  itab-objnr.    &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;   Pls. mark if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2007 03:50:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-with-subquery-of-internal-table/m-p/1866552#M365282</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-10T03:50:31Z</dc:date>
    </item>
  </channel>
</rss>

