<?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/2752794#M640369</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 * means it needs to get out all fields of a database table, INTO means it wants to transfer the selected data to a work area, but if the work area has a different structure you can use the option CORRESPONDING in order to transfer the data of the fields with the same name only:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF ITAB,
             BUKRS TYPE BUKRS,
             MY_FIELDS,
             BELNR TYPE BELNR,
           END   OF ITAB.

SELECT SINGLE * FROM BKPF INTO CORRESPONDING FIELDS OF ITAB..&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only the data in the fields BUKRS and BELNR of BKPF will be transfered in ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE means only one record will be extracted: so it should use all key fields in WHERE conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Sep 2007 07:20:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-05T07:20:56Z</dc:date>
    <item>
      <title>select single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752789#M640364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT SINGLE * INTO CORRESPONDING FIELDS OF ITAB &lt;/P&gt;&lt;P&gt;what is the meaning ... explain me pls.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;swathi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 07:11:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752789#M640364</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T07:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: select single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752790#M640365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;only one record fetch from database&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 07:12:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752790#M640365</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T07:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: select single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752791#M640366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;- lines &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;... { SINGLE [FOR UPDATE] } &lt;/P&gt;&lt;P&gt;  | { [DISTINCT] { }      }  ... . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatives: &lt;/P&gt;&lt;P&gt;1. ... SINGLE [FOR UPDATE] &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. ... [DISTINCT] { } &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The data in lines specifies that the resulting set has either multiple lines or a single line. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 1 &lt;/P&gt;&lt;P&gt;... SINGLE [FOR UPDATE] &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;Effect &lt;/P&gt;&lt;P&gt;If SINGLE is specified, the resulting set has a single line. If the remaining additions to the SELECT command select more than one line from the database, the first line that is found is entered into the resulting set. The data objects specified after INTO may not be internal tables, and the APPENDING addition may not be used. The addition ORDER BY can also not be used. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An exclusive lock can be set for this line using the FOR UPDATE addition when a single line is being read with SINGLE. The SELECT command is used in this case only if all primary key fields in logical expressions linked by AND are checked to make sure they are the same in the WHERE condition. Otherwise, the resulting set is empty and sy-subrc is set to 8. If the lock causes a deadlock, an exception occurs. If the FOR UPDATE addition is used, the SELECT command circumvents SAP buffering. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;When SINGLE is being specified, the lines to be read should be clearly specified in the WHERE condition, for the sake of efficiency. When the data is read from a database table, the system does this by specifying comparison values for the primary key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If accessing tables for which SAP buffering is planned for single records, the SAP buffer is bypassed if the addition SINGLE is not specified. This behavior depends on the current implementation of the database interface and may change in future releases. In particular, it should not be used to bypass the SAP buffer. You should use the explicit addition BYPASSING BUFFER for this instead. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The addition SINLGE is not permitted in a subquery. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 2 &lt;/P&gt;&lt;P&gt;... [DISTINCT] { } &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;Effect &lt;/P&gt;&lt;P&gt;If SINGLE is not specified and if columns does not contain only aggregate expressions, the resulting set has multiple lines. All database lines that are selected by the remaining additions of the SELECT command are included in the resulting list. If the ORDER BY addition is not used, the order of the lines in the resulting list is not defined and, if the same SELECT command is executed multiple times, the order may be different each time. A data object specified after INTO can be an internal table and the APPENDING addition can be used. If no internal table is specified after INTO or APPENDING, the SELECT command triggers a loop that has to be closed using ENDSELECT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If multiple lines are read without SINGLE, the DISTINCT addition can be used to exclude duplicate lines from the resulting list. If DISTINCT is used, the SELECT command circumvents SAP buffering. DISTINCT cannot be used in the following situations: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a column specified in columns has the type STRING, RAWSTRING, LCHAR or LRAW &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the system tries to access pool or cluster tables and single columns are specified in columns. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;When specifying DISTINCT, note that this requires the execution of sort operations in the database system, and the SELECT statement therefore bypasses the SAP buffer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 07:13:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752791#M640366</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T07:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: select single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752792#M640367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select SINGLE -&amp;gt; To fetch only a single records &lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF ITAB... -&amp;gt; ITAB will have several fields &amp;amp; all of them need not be same as the table from which you are retrieving data. So into corresponding automatically populates fields which are common in table &amp;amp; ITAB.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 07:14:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752792#M640367</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T07:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: select single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752793#M640368</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 statement fetches single record ( all fields in the table ) and those fetched fields from database table will be put into the appropriate fields in the Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards points if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vimal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 07:20:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752793#M640368</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T07:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: select single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752794#M640369</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 * means it needs to get out all fields of a database table, INTO means it wants to transfer the selected data to a work area, but if the work area has a different structure you can use the option CORRESPONDING in order to transfer the data of the fields with the same name only:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF ITAB,
             BUKRS TYPE BUKRS,
             MY_FIELDS,
             BELNR TYPE BELNR,
           END   OF ITAB.

SELECT SINGLE * FROM BKPF INTO CORRESPONDING FIELDS OF ITAB..&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only the data in the fields BUKRS and BELNR of BKPF will be transfered in ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE means only one record will be extracted: so it should use all key fields in WHERE conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 07:20:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752794#M640369</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T07:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: select single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752795#M640370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select single f1  command picks only a single record into a work area or a field string, adding corresponds extention to it would meen that only that component f1 of the work area specifield in the select single command would get populated. For our case it is f1, if at all this componenetexists in the work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rama Murthy.P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 07:22:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752795#M640370</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T07:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: select single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752796#M640371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swathi,&lt;/P&gt;&lt;P&gt;               If we want to fetch a single record from database then we use select single command.&lt;/P&gt;&lt;P&gt;Select Single * fetches single record with all fields.&lt;/P&gt;&lt;P&gt;But select single requires all key fields to be mensioned in where clause.&lt;/P&gt;&lt;P&gt;If we don't have all key fields , use select .................up to 1 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select matnr werks  lgort into corresponding fields of itab from mard &amp;lt;b&amp;gt;up to 1 rows&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;                                                             where matnr = '0000000000000012'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hemant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 07:30:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2752796#M640371</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T07:30:43Z</dc:date>
    </item>
  </channel>
</rss>

