<?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 single in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142657#M451529</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause or lack of, applies any aggregate, ordering or grouping functions to them and then returns the first record of the resultant result set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look for detail at Difference between select single and up to 1 row &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="2464771"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Apr 2007 05:42:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-17T05:42:35Z</dc:date>
    <item>
      <title>select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142652#M451524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi what is the difference between select single * and select up to 1 row?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 05:35:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142652#M451524</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T05:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142653#M451525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;chk this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/difference-between-select-single-and-select-upto-one-rows.htm" target="test_blank"&gt;http://www.sap-img.com/abap/difference-between-select-single-and-select-upto-one-rows.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 05:37:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142653#M451525</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T05:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142654#M451526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Balu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way to find out is through sql trace or runtime analysis. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mainly: to read data from &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mainly: to check if entries exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select Single &lt;/P&gt;&lt;P&gt;You need to mention all the key fields of the table. &lt;/P&gt;&lt;P&gt;No END SELECT required.&lt;/P&gt;&lt;P&gt;More performance compared to upto 1 row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where as UP to 1 row.&lt;/P&gt;&lt;P&gt;YOu can use if you do not have all the primiary key fields available. &lt;/P&gt;&lt;P&gt;END SELECT requeired.&lt;/P&gt;&lt;P&gt;Since all keys are not passing, possiblities of have other rows which satisfies the condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select Statement with EndSelect is a loop, which in a single run retrieves a single Record. This Record has to be stored in a Work Area and then appended into an Internal Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select Statements without EndSelect is not a loop and it retrieves the whole Record set matching the Criteria in a single shot and has to be Stored in an Internal Table Directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The most important thing to remember about the SELECT SINGLE is&lt;/P&gt;&lt;P&gt;There are several things to remember:&lt;/P&gt;&lt;P&gt;1) It retrieves only one row&lt;/P&gt;&lt;P&gt;2) It does not need an ENDSELECT statement&lt;/P&gt;&lt;P&gt;3) THE FULL KEY OF THE TABLE MUST BE INCLUDED IN &lt;/P&gt;&lt;P&gt;THE WHERE CLAUSE OF THE SELECT STATEMENT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this resolves your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all the helpful answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 05:39:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142654#M451526</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T05:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142655#M451527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Balu,&lt;/P&gt;&lt;P&gt;    Select Single fethces the data based upon primary keys. As soon as it gets the required record it stops searching and returns the value to the define WA.&lt;/P&gt;&lt;P&gt;    Select upto 1 row fetches all the records that match the condition and keep it at ABAP memory and from there it will get the first record into the defined WA.&lt;/P&gt;&lt;P&gt;  So select Single is better in Performance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shafi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 05:40:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142655#M451527</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T05:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142656#M451528</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 is used only when all the key fields are specified in the where clause.&lt;/P&gt;&lt;P&gt;i.e according to the given conditions only one record should exist in the db table.&lt;/P&gt;&lt;P&gt;where as select up to 1 rows is used to select only one record satisfying the given conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as per performance select single hits database only once where select up to 1 rows.......endselect hits two times.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 05:41:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142656#M451528</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T05:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142657#M451529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause or lack of, applies any aggregate, ordering or grouping functions to them and then returns the first record of the resultant result set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look for detail at Difference between select single and up to 1 row &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="2464771"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 05:42:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142657#M451529</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T05:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142658#M451530</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;Check this link in sdn&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/difference" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/difference&lt;/A&gt;&lt;EM&gt;between&lt;/EM&gt;select&lt;EM&gt;single&lt;/EM&gt;and&lt;EM&gt;select&lt;/EM&gt;upto.&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sonika&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 05:44:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142658#M451530</guid>
      <dc:creator>former_member632991</dc:creator>
      <dc:date>2007-04-17T05:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142659#M451531</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;If you are interested &amp;lt;b&amp;gt;if there exists at least one row&amp;lt;/b&amp;gt; of a database &lt;/P&gt;&lt;P&gt;table or view with a certain condition, use the &amp;lt;b&amp;gt;Select ... Up To 1 &lt;/P&gt;&lt;P&gt;Rows&amp;lt;/b&amp;gt; statement instead of a Select-Endselect-loop with an Exit. &lt;/P&gt;&lt;P&gt;If&amp;lt;b&amp;gt; all primary key fields&amp;lt;/b&amp;gt; are supplied in the Where condition you &lt;/P&gt;&lt;P&gt;can even use &amp;lt;b&amp;gt;Select Single&amp;lt;/b&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Select Single requires one communication with the database system, &lt;/P&gt;&lt;P&gt;whereas Select-Endselect needs two.&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 05:47:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142659#M451531</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T05:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142660#M451532</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: &lt;/P&gt;&lt;P&gt;1. Select single is based on PRIMARY KEY&lt;/P&gt;&lt;P&gt;2. It will take the first record directly without searching of all relevant records.(Though you have lot of records for given condition)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT UPTO 1 ROW : &lt;/P&gt;&lt;P&gt;It will check all records for given condition and take the first record .&lt;/P&gt;&lt;P&gt;It means in select single no searching, where as other searching.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore, select single more efficient than UPTO 1 ROW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give reward if helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 05:56:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2142660#M451532</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T05:56:28Z</dc:date>
    </item>
  </channel>
</rss>

