<?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: select endselect in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3497335#M841213</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;Your understanding is almost right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The pair;&lt;/P&gt;&lt;P&gt;SELECT * FROM tvswz WHERE vstel = vbdkl-vstel.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;act like a loop, processing each record from the database table that satisfies the WHERE condition, one record at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM t001w WHERE werks = tvswz-werks.&lt;/P&gt;&lt;P&gt;then reads one row for the current row from the first table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Mar 2008 17:08:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-06T17:08:50Z</dc:date>
    <item>
      <title>select endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3497334#M841212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i wanted to know what exactly the below stmt does, i have an idea, but its vague, i am not sure about it. can some one tell me wat it does.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM tvswz WHERE vstel = vbdkl-vstel.&lt;/P&gt;&lt;P&gt;    SELECT SINGLE * FROM t001w WHERE werks = tvswz-werks.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think the first select stmt brings in all teh rows which satisfy the condition, the seconf select stmt brings in 1 row for each row selected above, but why is exit put there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why is there end select for first stmt, not for the second select stmt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and regards.&lt;/P&gt;&lt;P&gt;sanju&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 16:59:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3497334#M841212</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-06T16:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: select endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3497335#M841213</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;Your understanding is almost right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The pair;&lt;/P&gt;&lt;P&gt;SELECT * FROM tvswz WHERE vstel = vbdkl-vstel.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;act like a loop, processing each record from the database table that satisfies the WHERE condition, one record at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM t001w WHERE werks = tvswz-werks.&lt;/P&gt;&lt;P&gt;then reads one row for the current row from the first table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 17:08:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3497335#M841213</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-06T17:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: select endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3497336#M841214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The select... endselect &lt;EM&gt;begins&lt;/EM&gt; a loop through the rows of the table that satisfy the condition.  But the loop is only actually gone through once, because of the exit immediately after the select single.  You get the first record from TVSWZ that has VSTEL eq VBDKL-VSTEK, then you get the t001w record that matches the ZVSWT-WERKS.  Then the loop is exited - you don't go back into it and get the next record - that's what EXIT means.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the program has exactly the same effect as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE * FROM tvswz WHERE vstel = vbdkl-vstel.
SELECT SINGLE * FROM t001w WHERE werks = tvswz-werks.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 17:35:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3497336#M841214</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-03-06T17:35:16Z</dc:date>
    </item>
  </channel>
</rss>

