<?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: avoiding endselect in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771734#M333248</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of itab occurs 0,
        v_number like ztable-number,
        v_date   like ztable-date,
        v_time   like ztable-time,
      end of itab.

SELECT number date time
  INTO table itab
  FROM ztable
  UP TO 1 ROWS
  WHERE zpro = sy-repid AND
        werks IN r_plant
        ORDER BY number descending.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Dec 2006 16:49:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-15T16:49:03Z</dc:date>
    <item>
      <title>avoiding endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771730#M333244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt; i'm doing a select on a table and i want to avoid the endselect . is there anyway to code this in order to avoid the select...endselect.&lt;/P&gt;&lt;P&gt; your help will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT number date time&lt;/P&gt;&lt;P&gt;      INTO (v_number, v_date, v_time)&lt;/P&gt;&lt;P&gt;      FROM ztable&lt;/P&gt;&lt;P&gt;      UP TO 1 ROWS&lt;/P&gt;&lt;P&gt;      WHERE zpro = sy-repid  AND&lt;/P&gt;&lt;P&gt;            werks IN r_plant&lt;/P&gt;&lt;P&gt;     ORDER BY number descending.&lt;/P&gt;&lt;P&gt;  ENDSELECT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 16:43:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771730#M333244</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T16:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: avoiding endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771731#M333245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;write as select single...&lt;/P&gt;&lt;P&gt;SELECT single number date time&lt;/P&gt;&lt;P&gt;INTO (v_number, v_date, v_time)&lt;/P&gt;&lt;P&gt;FROM ztable&lt;/P&gt;&lt;P&gt;WHERE zpro = sy-repid AND&lt;/P&gt;&lt;P&gt;werks IN r_plant&lt;/P&gt;&lt;P&gt;ORDER BY number descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;up to 1 rows also is not a problem (select...endselect) as it will fetch only 1 record and it wont hit the database too much...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Ramesh Babu Chirumamilla&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 16:46:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771731#M333245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T16:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: avoiding endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771732#M333246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are the key fields in ZTABLE and why do you want to get rid of endselect?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 16:46:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771732#M333246</guid>
      <dc:creator>alison_lloyd</dc:creator>
      <dc:date>2006-12-15T16:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: avoiding endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771733#M333247</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;SELECT single number date time&lt;/P&gt;&lt;P&gt;INTO (v_number, v_date, v_time)&lt;/P&gt;&lt;P&gt;FROM ztable&lt;/P&gt;&lt;P&gt;UP TO 1 ROWS&lt;/P&gt;&lt;P&gt;WHERE zpro = sy-repid AND&lt;/P&gt;&lt;P&gt;werks IN r_plant&lt;/P&gt;&lt;P&gt;ORDER BY number descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work.&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;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 16:46:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771733#M333247</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T16:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: avoiding endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771734#M333248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of itab occurs 0,
        v_number like ztable-number,
        v_date   like ztable-date,
        v_time   like ztable-time,
      end of itab.

SELECT number date time
  INTO table itab
  FROM ztable
  UP TO 1 ROWS
  WHERE zpro = sy-repid AND
        werks IN r_plant
        ORDER BY number descending.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 16:49:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771734#M333248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T16:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: avoiding endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771735#M333249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ramesh,&lt;/P&gt;&lt;P&gt; im getting incorrect spelling or comma error. even thing seems to be perfect but i dont understand why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 17:00:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771735#M333249</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T17:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: avoiding endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771736#M333250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's because of the error in your original statment. If you put the data directly into the table or work area, you will avoid the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 17:09:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771736#M333250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T17:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: avoiding endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771737#M333251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fine ur answer...&lt;/P&gt;&lt;P&gt;But before we going to use Select Single we must be knw  the filed/fields wch r in where condition is key field or not...if it is key field it is better suppose it is not key filed "Up to 1 rows" is only better thing...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anyhow for select single no need endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for up to 1 rows alos we can avoid endselect by using TABLE key word..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2006 04:58:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-endselect/m-p/1771737#M333251</guid>
      <dc:creator>suresh_s9</dc:creator>
      <dc:date>2006-12-19T04:58:57Z</dc:date>
    </item>
  </channel>
</rss>

