<?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 vs READ statements in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762850#M330039</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bhaskar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both statements are used for reading one record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE -&amp;gt; DB Table&lt;/P&gt;&lt;P&gt;READ -&amp;gt; Internal Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE &amp;lt;FLD1&amp;gt; &amp;lt;FLD2&amp;gt; INTO (&amp;lt;WA&amp;gt;-FLD1, &amp;lt;WA&amp;gt;-FLD2)
              FROM (DBTABLE)
              WHERE &amp;lt;COND&amp;gt;.

READ &amp;lt;ITAB&amp;gt; INTO &amp;lt;WA&amp;gt; WITH KEY &amp;lt;FLD1&amp;gt; = ....
                                                          &amp;lt;FLD2&amp;gt; = ....&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more major difference is we can not use comparision operator other than EQUAL and NOT EQUAL with READ statements, whereas we can use the same with SELECT SINGLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Dec 2006 05:34:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-04T05:34:15Z</dc:date>
    <item>
      <title>Select SINGLE vs READ statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762843#M330032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how does the Select SINGLE statement works and How does the READ Statement works .. and please give the examples of each&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankyou&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 05:25:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762843#M330032</guid>
      <dc:creator>former_member577909</dc:creator>
      <dc:date>2006-12-04T05:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Select SINGLE vs READ statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762844#M330033</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 to fetch a single record from database table.Read is used to fetch a single record from internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 05:27:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762844#M330033</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2006-12-04T05:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Select SINGLE vs READ statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762845#M330034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello  Bhaskar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE statement is used to read one record from a database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The READ statement is used to read a record from an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 05:28:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762845#M330034</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-04T05:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Select SINGLE vs READ statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762846#M330035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For READ have a look at below link.&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&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. SELECT SINGLE returns the first matching row for the given condition and it may not be unique, if there are more matching rows for the given condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE field &lt;/P&gt;&lt;P&gt;  INTO w_field &lt;/P&gt;&lt;P&gt;  FROM table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Vibha &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 05:29:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762846#M330035</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-04T05:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Select SINGLE vs READ statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762847#M330036</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;This situation occurs mostly inside the loops.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose an internal table. ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Never use select statements inside loops.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. always use READ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;select single.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ex code

***********
Report Z_Difference 
Message-id 38 
Line-Size 80 
Line-Count 0 
No Standard Page Heading. 
* 
Start-Of-Selection. 
 
Data: w_Single type Posnr, 

* 
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.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;READ&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading records with keys&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading lines with Index&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3730358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3730358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&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;Anver&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 05:30:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762847#M330036</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-12-04T05:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Select SINGLE vs READ statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762848#M330037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select single starts searching from the row 1 and picks the 1st record that matches ur selection criteria.&lt;/P&gt;&lt;P&gt;e.g . Select single * from bkpf where bukrs = '0001'. &lt;/P&gt;&lt;P&gt;If there are 100 docs in BKPF table .. it will select the 1st record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read (I assume u are referring to read from Internal table) statement also reads the 1st record from ur internal table that matches the key specified in ur read statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab into wa with key bukrs = '0001'.&lt;/P&gt;&lt;P&gt;same as explained. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers. If there is something else.. feel free to come&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 05:31:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762848#M330037</guid>
      <dc:creator>former_member69765</dc:creator>
      <dc:date>2006-12-04T05:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select SINGLE vs READ statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762849#M330038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select single  - is used for extacting one record form SAP-Data base table .&lt;/P&gt;&lt;P&gt;Read is used only for extracting single record from  internal table with in ABAP program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex:-&lt;/P&gt;&lt;P&gt;tables : T001w.&lt;/P&gt;&lt;P&gt;Select single * from T001W where WERKS = 'A008'.&lt;/P&gt;&lt;P&gt;write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;  t001w-werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex read :- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : int_plants like t001w occurs 0 with  header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from T001W into table int_plants .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table int_plants with key werks = 'A008'.&lt;/P&gt;&lt;P&gt;If Sy-subrc eq 0 .&lt;/P&gt;&lt;P&gt;write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; int_plants-werks.&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;Ramvelu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 05:34:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762849#M330038</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-04T05:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Select SINGLE vs READ statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762850#M330039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bhaskar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both statements are used for reading one record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE -&amp;gt; DB Table&lt;/P&gt;&lt;P&gt;READ -&amp;gt; Internal Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE &amp;lt;FLD1&amp;gt; &amp;lt;FLD2&amp;gt; INTO (&amp;lt;WA&amp;gt;-FLD1, &amp;lt;WA&amp;gt;-FLD2)
              FROM (DBTABLE)
              WHERE &amp;lt;COND&amp;gt;.

READ &amp;lt;ITAB&amp;gt; INTO &amp;lt;WA&amp;gt; WITH KEY &amp;lt;FLD1&amp;gt; = ....
                                                          &amp;lt;FLD2&amp;gt; = ....&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more major difference is we can not use comparision operator other than EQUAL and NOT EQUAL with READ statements, whereas we can use the same with SELECT SINGLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 05:34:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762850#M330039</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-04T05:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Select SINGLE vs READ statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762851#M330040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SELECT SINGLE statement is used for accessing matching records (wen a conditon is specified) from the underlying database tables, one record at once...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whereas , the read statement is used to reference a record from an internal table..  Any specific record can be fetched using the INDEX addition AND/OR a matching codition ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The select single statement is more efficient than the select statement..and it fetches records (one by one) in sequence from the DB table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pankaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 05:40:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single-vs-read-statements/m-p/1762851#M330040</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-04T05:40:47Z</dc:date>
    </item>
  </channel>
</rss>

