<?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: Reg: select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-statement/m-p/4373644#M1040633</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ramesh,&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;&lt;/P&gt;&lt;P&gt;Declare another internal table with the fields you want to select from database table, eg:, itab2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then select the fields from the database table say, dbtab, using for all entries from the first internal table eg: itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Select field1,
          field2,
          --
          fieldn
from &amp;lt;dbtab&amp;gt;
into table &amp;lt;itab2&amp;gt;
for all entries in &amp;lt;itab1&amp;gt;
where field1 = itab1-field1
         field2 = itab1-field2
         --
         fieldn = itab1-fieldn.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;Any queries, get back to me.&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;Chandra Sekhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 30 Aug 2008 04:18:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-30T04:18:27Z</dc:date>
    <item>
      <title>Reg: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-statement/m-p/4373643#M1040632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;               Iam getting a list of fields into internal table.&lt;/P&gt;&lt;P&gt; I have to fetch records from database using those fields, in where condition. How to put all those fields in where condition&lt;/P&gt;&lt;P&gt;from that internal table.&lt;/P&gt;&lt;P&gt;           Performance wise we must not put that select statement in loop, then whats the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankyou,&lt;/P&gt;&lt;P&gt;Ramesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Aug 2008 04:04:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-statement/m-p/4373643#M1040632</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-30T04:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-statement/m-p/4373644#M1040633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ramesh,&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;&lt;/P&gt;&lt;P&gt;Declare another internal table with the fields you want to select from database table, eg:, itab2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then select the fields from the database table say, dbtab, using for all entries from the first internal table eg: itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Select field1,
          field2,
          --
          fieldn
from &amp;lt;dbtab&amp;gt;
into table &amp;lt;itab2&amp;gt;
for all entries in &amp;lt;itab1&amp;gt;
where field1 = itab1-field1
         field2 = itab1-field2
         --
         fieldn = itab1-fieldn.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;Any queries, get back to me.&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;Chandra Sekhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Aug 2008 04:18:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-statement/m-p/4373644#M1040633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-30T04:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-statement/m-p/4373645#M1040634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi pagidala Ramesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get the all data from database into internal table.&lt;/P&gt;&lt;P&gt;Now loop the first internal table and read the second internal table by checking those fields. and populated the records in another table.&lt;/P&gt;&lt;P&gt;or delete the records if the condition is not met in the second internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fetching the data once from database is better then hitting the database several times. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;raam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Aug 2008 04:20:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-statement/m-p/4373645#M1040634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-30T04:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-statement/m-p/4373646#M1040635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Use FOR ALL ENTRIES in this kind of scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this type of select query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT carrid
       connid
       fldate
  FROM sflight
  INTO TABLE t_flight
  FOR ALL ENTRIES IN t_spfli
 WHERE carrid = t_spfli-carrid
   AND connid = t_spfli-connid.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhijeet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Aug 2008 04:21:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-select-statement/m-p/4373646#M1040635</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-30T04:21:39Z</dc:date>
    </item>
  </channel>
</rss>

