<?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 and select in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-select/m-p/1483507#M225987</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"select single vbeln" will extract one and only one sales order number from the DB (based on the conditions in the WHERE clause).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"select vbeln"  requires the addition of ENDSELECT and creates a 'selection loop'.  This loop will select ALL sales order numbers from the DB (based on the conditions in the WHERE clause).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you KNOW that need one and only record, SELECT SINGLE is faster of the two... it makes only one trip to the DB.  The SELECT... ENDSELECT must make multiple trips to the DB... even if only 1 record exists... this method must make 2 trips to the DB to complete it's execution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Aug 2006 18:51:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-22T18:51:57Z</dc:date>
    <item>
      <title>select single and select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-select/m-p/1483505#M225985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi everybody&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is the exact difference between select single vbeln  and select vbeln&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In what situations i should use these select single vbeln or select vbeln&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;hridhayanjili.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 18:33:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-select/m-p/1483505#M225985</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-22T18:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: select single and select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-select/m-p/1483506#M225986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;select single is for fetching single record from the database based on the unique keys.&lt;/P&gt;&lt;P&gt;select &amp;lt;field name&amp;gt; is used for selecting a particular field from a table.here your select clause may fetch multiple records but select single will fetch only one record.&lt;/P&gt;&lt;P&gt;i would advice you to read the OPEN SQL document under&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com" target="test_blank"&gt;http://help.sap.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Abdul Hakim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mark all useful answers..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 18:40:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-select/m-p/1483506#M225986</guid>
      <dc:creator>abdul_hakim</dc:creator>
      <dc:date>2006-08-22T18:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: select single and select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-select/m-p/1483507#M225987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"select single vbeln" will extract one and only one sales order number from the DB (based on the conditions in the WHERE clause).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"select vbeln"  requires the addition of ENDSELECT and creates a 'selection loop'.  This loop will select ALL sales order numbers from the DB (based on the conditions in the WHERE clause).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you KNOW that need one and only record, SELECT SINGLE is faster of the two... it makes only one trip to the DB.  The SELECT... ENDSELECT must make multiple trips to the DB... even if only 1 record exists... this method must make 2 trips to the DB to complete it's execution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 18:51:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-select/m-p/1483507#M225987</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-22T18:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: select single and select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-select/m-p/1483508#M225988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hrid,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have your questions been answered?  If so, please reward points accordingly and close the thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not, provide more details of your question(s).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 19:05:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-select/m-p/1483508#M225988</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-22T19:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: select single and select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-select/m-p/1483509#M225989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go through the following Document &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 &lt;/P&gt;&lt;P&gt;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, &lt;/P&gt;&lt;P&gt;it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key &lt;/P&gt;&lt;P&gt;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) &lt;/P&gt;&lt;P&gt;you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns &lt;/P&gt;&lt;P&gt;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;You can refer to the below link..&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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sreeni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 19:08:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-and-select/m-p/1483509#M225989</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-22T19:08:38Z</dc:date>
    </item>
  </channel>
</rss>

