<?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 SELECT statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652316#M289716</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have a code as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT XYZ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE Field1 INTO temp_field1 FROM table1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE field2 field3 INTO (temp_field2,temp_field3) FROM table2&lt;/P&gt;&lt;P&gt;WHERE field4 = temp_field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does both the SELECT statements retrieve 1 record for each loop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Nov 2006 14:56:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-03T14:56:28Z</dc:date>
    <item>
      <title>SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652316#M289716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have a code as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT XYZ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE Field1 INTO temp_field1 FROM table1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE field2 field3 INTO (temp_field2,temp_field3) FROM table2&lt;/P&gt;&lt;P&gt;WHERE field4 = temp_field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does both the SELECT statements retrieve 1 record for each loop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 14:56:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652316#M289716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-03T14:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652317#M289717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, each select statement would retrieve one (or zero) record per loop pass.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 14:59:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652317#M289717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-03T14:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652318#M289718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sachin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Ya, it will work. But in this you are not using XYZ table anywhere. Why you put that one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Chandra.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 14:59:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652318#M289718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-03T14:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652319#M289719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Sachin,&lt;/P&gt;&lt;P&gt; Yes it retrieves only i record in each loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 15:02:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652319#M289719</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-03T15:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652320#M289720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE is U r WHERE condition ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sunanda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 15:03:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652320#M289720</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-03T15:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652321#M289721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guptha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes it will retrieve only one record for each loop.&lt;/P&gt;&lt;P&gt;First thing dont write select statement in the loop.avoide select statement in the loop. try to read the internal table but dont select the internal table in the loop.its a performance issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vikranth Khimavath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 15:10:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652321#M289721</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-03T15:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652322#M289722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The first SELECT statment does not have a WHERE condition. Supposing you do, then you may have to use a IF SY-SUBRC = 0 to perform the second SELECT statment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is a common field in both tables, there is another way of doing the same is....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE t1&lt;SUB&gt;Field1 t2&lt;/SUB&gt;field2 t2~field3 &lt;/P&gt;&lt;P&gt;FROM table1 AS t1 LEFT JOIN table2 AS t2&lt;/P&gt;&lt;P&gt;ON t1&lt;SUB&gt;Field1 = t2&lt;/SUB&gt;field4 &amp;lt;AND t2~fieldx = xxx&amp;gt;&lt;/P&gt;&lt;P&gt;INTO (temp_field1,temp_field2,temp_field3)&lt;/P&gt;&lt;P&gt;&amp;lt;WHERE t1~fieldX = XXX&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 15:21:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652322#M289722</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-03T15:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652323#M289723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Sachin,&lt;/P&gt;&lt;P&gt;say for instance you XYZ internal table has a field say XYZ-f1,&lt;/P&gt;&lt;P&gt;then there is point in looping XYZ, so code would look like this :&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;LOOP AT XYZ.&lt;/P&gt;&lt;P&gt;SELECT SINGLE Field1 INTO temp_field1 FROM table1&lt;/P&gt;&lt;P&gt;where &amp;lt;table-field&amp;gt; = XYZ-f1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE field2 field3 INTO (temp_field2,temp_field3) FROM table2&lt;/P&gt;&lt;P&gt;WHERE field4 = temp_field1.&lt;/P&gt;&lt;P&gt;CLEAR temp_field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;code could change if you could explain the complete requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers anyways,&lt;/P&gt;&lt;P&gt;Aditya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 16:10:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1652323#M289723</guid>
      <dc:creator>former_member184495</dc:creator>
      <dc:date>2006-11-03T16:10:01Z</dc:date>
    </item>
  </channel>
</rss>

