<?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 statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467430#M833421</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes u can..but what i get from ur code is dat u only need to fetch a single record, so better option is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dis gives better performance...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz reward points if dis helps..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Mar 2008 08:31:11 GMT</pubDate>
    <dc:creator>former_member188827</dc:creator>
    <dc:date>2008-03-06T08:31:11Z</dc:date>
    <item>
      <title>select endselect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467428#M833419</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;should  we put any condition inside select endselect statement like below ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select var1 var2 from table1 into var3 var4 &lt;/P&gt;&lt;P&gt;        where var1=.. and var2= .... .&lt;/P&gt;&lt;P&gt;    counter=counter + 1.&lt;/P&gt;&lt;P&gt;    if counetr &amp;gt; 1.&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;       endif.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rohit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 08:26:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467428#M833419</guid>
      <dc:creator>rohit_goel</dc:creator>
      <dc:date>2008-03-06T08:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: select endselect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467429#M833420</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;u can keep the condition inside the select...endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 08:28:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467429#M833420</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-06T08:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: select endselect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467430#M833421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes u can..but what i get from ur code is dat u only need to fetch a single record, so better option is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dis gives better performance...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz reward points if dis helps..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 08:31:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467430#M833421</guid>
      <dc:creator>former_member188827</dc:creator>
      <dc:date>2008-03-06T08:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: select endselect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467431#M833422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no&lt;/P&gt;&lt;P&gt;i am checking on the number of rows returned..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if more than one row is returned i have to come out of the select endselect...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for that i am using a counter inside that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 08:35:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467431#M833422</guid>
      <dc:creator>rohit_goel</dc:creator>
      <dc:date>2008-03-06T08:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: select endselect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467432#M833423</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&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reads data from the database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT &amp;lt;result&amp;gt; &lt;/P&gt;&lt;P&gt;  INTO &amp;lt;target&amp;gt;&lt;/P&gt;&lt;P&gt;  FROM &amp;lt;source&amp;gt; &lt;/P&gt;&lt;P&gt;  [WHERE &amp;lt;condition&amp;gt;]&lt;/P&gt;&lt;P&gt;  [GROUP BY &amp;lt;fields&amp;gt;] &lt;/P&gt;&lt;P&gt;  [HAVING &amp;lt;cond&amp;gt;]&lt;/P&gt;&lt;P&gt;  [ORDER BY &amp;lt;fields&amp;gt;].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SELECT statement consists of a series of clauses, each of which fulfils a certain task: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defines the structure of the selection. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT [SINGLE]|[DISTINCT] &lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;| &amp;lt;si&amp;gt; [AS &amp;lt;a i&amp;gt;]... &amp;lt;agg&amp;gt;( [DISTINCT] &amp;lt;s j&amp;gt;) [AS &amp;lt;a j&amp;gt;]...&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The selection can be one line, SINGLE, or several lines. You can eliminate duplicate lines using the DISTINCT addition. To select the entire line, use *, otherwise, you can specify individual columns &amp;lt;si&amp;gt;. For individual columns, you can use aggregate functions &amp;lt;agg&amp;gt;, and assign alternative column names &amp;lt;a i&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INTO clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defines the target area into which the selection from the SELECT clause is written. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...  INTO [CORRESPONDING FIELDS OF] &amp;lt;wa&amp;gt;&lt;/P&gt;&lt;P&gt;   | INTO|APPENDING [CORRESPONDING FIELDS OF] TABLE &amp;lt;itab&amp;gt;&lt;/P&gt;&lt;P&gt;                                             [PACKAGE SIZE &amp;lt;n&amp;gt;]&lt;/P&gt;&lt;P&gt;   | INTO (&amp;lt;f1&amp;gt;, &amp;lt;f 2&amp;gt;,...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The target area can be a flat work area &amp;lt;wa&amp;gt;, an internal table &amp;lt;itab&amp;gt;, or a list of fields &amp;lt;fi&amp;gt;. If you use the CORRESPONDING FIELDS addition, data is only selected if there is an identically-named field in the target area. If you use APPENDING instead of INTO, the data is appended to an internal table instead of overwriting the existing contents. PACKAGE SIZE allows you to overwrite or extend the internal table in a series of packages.The data type of the target area must be appropriate for the selection in the SELECT clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The FROM clause determines the database tables from which the data specified in the SELECT clause is read. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... FROM [&amp;lt;tab&amp;gt; [INNER]|LEFT [OUTER] JOIN] &amp;lt;dbtab&amp;gt; [AS &amp;lt;alias&amp;gt;] &lt;/P&gt;&lt;P&gt;                               [ON &amp;lt;cond&amp;gt;]&lt;/P&gt;&lt;P&gt;         [CLIENT SPECIFIED] &lt;/P&gt;&lt;P&gt;         [BYPASSING BUFFER]&lt;/P&gt;&lt;P&gt;         [UP TO &amp;lt;n&amp;gt; ROWS]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can read both single fields and groups of fields. You link several tables using inner and outer joins to link tables with conditions &amp;lt;cond&amp;gt;, where &amp;lt;tab&amp;gt; is a single table or itself a join condition. The names of database tables may be specified statically or dynamically, and you can use alias names. You can bypass automatic client handling with the CLIENT SPECIFIED addition, and SAP buffering with BYPASSING BUFFER. You can also restrict the number of lines read from the table using the UP TO &amp;lt;n&amp;gt; ROWS addition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Restricts the number of lines selected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... [FOR ALL ENTRIES IN &amp;lt;itab&amp;gt;] WHERE &amp;lt;cond&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The condition &amp;lt;cond&amp;gt; may contain one or more comparisons, tests for belonging to intervals, value list checks, subqueries, selection table queries or null value checks, all linked with AND, OR, and NOT. If you use the FOR ALL ENTRIES addition, the condition &amp;lt;cond&amp;gt; is checked for each line of the internal table &amp;lt;itab&amp;gt; as long as &amp;lt;cond&amp;gt; contains a field of the internal table as an operand. For each line of the internal table, the system selects the lines from the database table that satisfy the condition. The result set is the union of the individual selections resulting from each line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GROUP BY clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Groups lines in the selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... GROUP BY &amp;lt;s1&amp;gt; &amp;lt;s 2&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Groups lines with the same contents in the specified columns. Uses aggregate functions for all other columns in each group. All columns of the SELECT clause that are not listed in the GROUP BY clause must be included in aggregate functions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HAVING clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Restricts the number of line groups selected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... HAVING &amp;lt;cond&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like the WHERE clause, but can only be used in conjunction with a GROUP BY clause. The HAVING clause uses conditions to restrict the number of groups selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ORDER BY clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorts the lines of the selection. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... ORDER BY PRIMARY KEY |... &amp;lt;si&amp;gt; [ASCENDING|DESCENDING]...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorts the selection in ascending or descending order according to the primary key or the contents of the fields listed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Priya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 08:39:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467432#M833423</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-06T08:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: select endselect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467433#M833424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in this case (only 1 entry)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;better use :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) select single&lt;/P&gt;&lt;P&gt;2) up to 1 rows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 08:39:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467433#M833424</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2008-03-06T08:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: select endselect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467434#M833425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rohit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You not initialized counter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I agree with that you are trying to fetch only single record and there is better options for this (like select single) than this coding. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;+ An&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 08:41:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467434#M833425</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-06T08:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: select endselect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467435#M833426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use select single..&lt;/P&gt;&lt;P&gt;it'll retreive only single record so no need to check and exit..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 08:41:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467435#M833426</guid>
      <dc:creator>former_member188827</dc:creator>
      <dc:date>2008-03-06T08:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: select endselect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467436#M833427</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;you can use this logic mention here.or just u just create an internal table an pass the rows to internal table and then check the rows in that internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select var1 var2 from table into corresponding fields of table itab.&lt;/P&gt;&lt;P&gt;data:n_lines(2) type n.&lt;/P&gt;&lt;P&gt;descibe table itab lines n_lines.&lt;/P&gt;&lt;P&gt;if n_lines &amp;gt; 1.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 08:43:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467436#M833427</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-06T08:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: select endselect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467437#M833428</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;&lt;/P&gt;&lt;P&gt;If ur requirement is to get singl erecord then go for the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Select single...&lt;/P&gt;&lt;P&gt;2. Upto 1 row..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;kavitha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 09:08:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467437#M833428</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-06T09:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: select endselect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467438#M833429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rohit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you should use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select v1 v2  from &amp;lt;tab&amp;gt; into itab&lt;/P&gt;&lt;P&gt;where &amp;lt;condition&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then count the no of lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;describe table itab line l_line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now in l_line u will get the no of line ,from where u can proceed accordingly,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 09:43:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect-statement/m-p/3467438#M833429</guid>
      <dc:creator>S0025444845</dc:creator>
      <dc:date>2008-03-06T09:43:50Z</dc:date>
    </item>
  </channel>
</rss>

