<?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: Validation for select-option in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-for-select-option/m-p/2812806#M657634</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;use select single *&lt;/P&gt;&lt;P&gt;it doesnt form loop incraeses performance&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;nagesh.paruchuri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Sep 2007 06:03:26 GMT</pubDate>
    <dc:creator>paruchuri_nagesh</dc:creator>
    <dc:date>2007-09-20T06:03:26Z</dc:date>
    <item>
      <title>Validation for select-option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-for-select-option/m-p/2812805#M657633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone tell me which one of the following select if appropriate for validating a select-options field....and why??&lt;/P&gt;&lt;P&gt;a)  Select single&lt;/P&gt;&lt;P&gt;b)  Select up to 1 row.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2007 05:59:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-for-select-option/m-p/2812805#M657633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-20T05:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Validation for select-option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-for-select-option/m-p/2812806#M657634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;use select single *&lt;/P&gt;&lt;P&gt;it doesnt form loop incraeses performance&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;nagesh.paruchuri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2007 06:03:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-for-select-option/m-p/2812806#M657634</guid>
      <dc:creator>paruchuri_nagesh</dc:creator>
      <dc:date>2007-09-20T06:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Validation for select-option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-for-select-option/m-p/2812807#M657635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;plz use below code for select-options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT COUNT(*)&lt;/P&gt;&lt;P&gt;         FROM mara&lt;/P&gt;&lt;P&gt;         WHERE matnr IN s_matnr.&lt;/P&gt;&lt;P&gt;  IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;    MESSAGE e001 WITH 'Invalid Material Numbers'(t02).&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;maheedhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2007 06:08:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-for-select-option/m-p/2812807#M657635</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-20T06:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Validation for select-option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-for-select-option/m-p/2812808#M657636</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;&amp;lt;b&amp;gt;SELECT UP TO 1 ROW&amp;lt;/b&amp;gt; is the appropriate for validating a select-options field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see this diffrence&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Difference Between Select Single and Select UpTo One Rows &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;Mainly: to read data from &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;Mainly: to check if entries exist. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward IF usefull&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2007 06:09:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-for-select-option/m-p/2812808#M657636</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-20T06:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Validation for select-option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-for-select-option/m-p/2812809#M657637</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 an option we use only when we know the full key of the table, not when we know that there will be only one record. So if you are selecting from MARA and your WHERE condition has MATNR in it, then you should use SELECT SINGLE. But if your WHERE condition has BISMT(old material number) and even if you know that it will result in one record only, you should not use SELECT SINGLE. It is not that it will give you an error but if you do an extended check, there it will show it as a warning saying that you didn't use the full key and that there is a possibility that there could be more than one record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT UP TO 1 ROWS is used when you are not passing the key field, but you know 1)there will be only one record or 2)all records will have the same value for the selected field. Let us say you are selecting from MARC and you are interested in the value of the field ABC indicator. You know, based on your business process, that this indicator will have the same value even though, it is extended to 10 plants. Then you can use SELECT ABCIN FROM MARC UP TO 1 ROWS WHERE MATNR = P_MATNR. ENDSELECT. Here, even though you are not supplying the second key field WERKS, since you know there will only be one value(even though there are multiple records fetched with this clause), you are using SELECT UP TO 1 ROWS. In the other example where you select from MARA using BISMT, there it might fetch you just one record and so you will still use SELECT UP TO 1 ROWS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT UP TO 1 ROWS introduces a loop to fetch one record from your database, where as SELECT SINGLE doesn't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward If Usefull&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2007 06:10:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-for-select-option/m-p/2812809#M657637</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-20T06:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Validation for select-option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-for-select-option/m-p/2812810#M657638</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;for validation of selection screen use at selection-screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exp-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At selection-screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single kunnr from kna1 into kna1 where kunnr = p_kunnr.&lt;/P&gt;&lt;P&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>Thu, 20 Sep 2007 06:12:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-for-select-option/m-p/2812810#M657638</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-20T06:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Validation for select-option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-for-select-option/m-p/2812811#M657639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Srini.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Select single" you can use if you know all key fields.dont use if u dont know all key fields.In this case you can "Select upto 1 rows".&lt;/P&gt;&lt;P&gt;(It is not onltt select option.Its uses for area requirement.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if its helpfull.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2007 06:13:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-for-select-option/m-p/2812811#M657639</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-20T06:13:00Z</dc:date>
    </item>
  </channel>
</rss>

