<?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: Data using Select Single Statement in the Internal Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595620#M267553</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi.&lt;/P&gt;&lt;P&gt;1.issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : itab type table of mara occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single * from mara into itab where ur_condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if subrc = 0.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;clear itab. " clear th header&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but to display all the datas&lt;/P&gt;&lt;P&gt;******************************&lt;/P&gt;&lt;P&gt;select  * from mara into &amp;lt;b&amp;gt;table&amp;lt;/b&amp;gt; itab where ur_condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;write : the required fileds.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. issue&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;rgds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anver&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if hkped mark points&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Sep 2006 06:45:22 GMT</pubDate>
    <dc:creator>anversha_s</dc:creator>
    <dc:date>2006-09-19T06:45:22Z</dc:date>
    <item>
      <title>Data using Select Single Statement in the Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595616#M267549</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;I am working with MARA Table, I would like to use select single statement, how can I use this to get the data into internal table and display it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also like to know the difference between select single statement and select upto 1 row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;P&gt;098 49 93 63 53.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 06:39:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595616#M267549</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-19T06:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Data using Select Single Statement in the Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595617#M267550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;Report Z_Difference 
Message-id 38 
Line-Size 80 
Line-Count 0 
No Standard Page Heading. 
* 
Start-Of-Selection. 

Data: w_Single type Posnr, 
t_Rows type standard table of Posnr 
initial size 0 
with header line. 
* 
Select single Posnr 
from zDifference 
into w_Single. 
* 
Select Posnr 
into table t_Rows 
from zDifference 
up to 1 rows 
order by Posnr descending. 
* 
Write :/ 'Select single:', w_Single. 
Skip 1. 
Write :/ 'Up to 1 rows :'. 
Loop at t_Rows. 
Write t_Rows. 
EndLoop.&lt;/CODE&gt;&lt;/PRE&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;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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 06:42:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595617#M267550</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-19T06:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Data using Select Single Statement in the Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595618#M267551</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 will select the first record that satisfies the condition(SUBRC value differs).. select upto one row will select any one record in random(SUBRC is alway 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syn:&lt;/P&gt;&lt;P&gt;select single * from mara into table t_mara&lt;/P&gt;&lt;P&gt;          where matnr = s_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara into table t_mara upto 1 row&lt;/P&gt;&lt;P&gt;          where matnr = s_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Divakar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 06:42:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595618#M267551</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-19T06:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Data using Select Single Statement in the Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595619#M267552</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;data: itab type standard table of mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM MARA&lt;/P&gt;&lt;P&gt;INTO TABLE itab&lt;/P&gt;&lt;P&gt;WHERE MATNR = '90909000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;SELECT SINGLE&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;The result of the selection should be a single entry. If it is not possible to identify a unique entry, the system uses the first line of the selection. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UP TO 1 ROWS.&lt;/P&gt;&lt;P&gt;Select a dataset form the database satisfying the query and returs the first row of this dataset.&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>Tue, 19 Sep 2006 06:43:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595619#M267552</guid>
      <dc:creator>dani_mn</dc:creator>
      <dc:date>2006-09-19T06:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Data using Select Single Statement in the Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595620#M267553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi.&lt;/P&gt;&lt;P&gt;1.issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : itab type table of mara occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single * from mara into itab where ur_condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if subrc = 0.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;clear itab. " clear th header&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but to display all the datas&lt;/P&gt;&lt;P&gt;******************************&lt;/P&gt;&lt;P&gt;select  * from mara into &amp;lt;b&amp;gt;table&amp;lt;/b&amp;gt; itab where ur_condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;write : the required fileds.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. issue&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;rgds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anver&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if hkped mark points&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 06:45:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595620#M267553</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-09-19T06:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Data using Select Single Statement in the Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595621#M267554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But is not select single having only on DB hit as compared to select up to 1 row which is having 2 DB hit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I guess if you are using the primary keys then you should use Select single otherwise you should use Select up to 1 row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Nishant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 06:46:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595621#M267554</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-19T06:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Data using Select Single Statement in the Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595622#M267555</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;The main diff b/w select single and select upto is &lt;/P&gt;&lt;P&gt;in select single you have to specify all the key fields in the where clause, in select upto one row we need not give all the key fields and it retrieves the first record from the set of records based on the where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My advice is don't use internal table in select single or select upto one rows,always use work area(performance issue).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Harsha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 06:48:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595622#M267555</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-19T06:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Data using Select Single Statement in the Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595623#M267556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;Difference is select upto 1 row will select all the records in that condition and then does some grouping or sorting and then outputs the record. Takes more time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But select single selects the forst row which meets that condition and gives the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more details check blogs there is an article.&lt;/P&gt;&lt;P&gt;Keyword Performance tuning.&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>Tue, 19 Sep 2006 06:51:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595623#M267556</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-19T06:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Data using Select Single Statement in the Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595624#M267557</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 simple program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables:mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;matnr like mara-matnr,&lt;/P&gt;&lt;P&gt;end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options:s_matnr for mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single matnr&lt;/P&gt;&lt;P&gt;from mara&lt;/P&gt;&lt;P&gt;into itab&lt;/P&gt;&lt;P&gt;where matnr in s_matnr.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;write:/ itab-matnr.&lt;/P&gt;&lt;P&gt;endloop.&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;&lt;/P&gt;&lt;P&gt;when you use &amp;lt;SINGLE&amp;gt; option in select stmt,it is mandatory to provide all the primary keys in the where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whereas in UP TO &amp;lt;n rows&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this option used generally to fetch the reqd. no. of records. you want to display.&lt;/P&gt;&lt;P&gt;there is no need to supply the keys specifically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sowjanya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 06:56:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595624#M267557</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-19T06:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Data using Select Single Statement in the Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595625#M267558</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;the above code is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;still u gave points!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kindly chk the code. it will not display anything at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;look at the bold part. this is the right code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables:mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;matnr like mara-matnr,&lt;/P&gt;&lt;P&gt;end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options:s_matnr for mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select matnr&lt;/P&gt;&lt;P&gt;from mara&lt;/P&gt;&lt;P&gt;into &amp;lt;b&amp;gt;table&amp;lt;/b&amp;gt; itab&lt;/P&gt;&lt;P&gt;where matnr in s_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;write:/ itab-matnr.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgsd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anver&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 07:05:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595625#M267558</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-09-19T07:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Data using Select Single Statement in the Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595626#M267559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sowjanya suggula ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thats gr8888!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u edited ur code.&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;&lt;/P&gt;&lt;P&gt;anver&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 08:48:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-using-select-single-statement-in-the-internal-table/m-p/1595626#M267559</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-09-19T08:48:00Z</dc:date>
    </item>
  </channel>
</rss>

