<?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: Query on Select Statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-on-select-statement/m-p/3505229#M843110</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;     That depends on the statement u use. If u use, 'SELECT' statment, u can retrieve &lt;STRONG&gt;all the records&lt;/STRONG&gt; which are identical with one or few fields. For that, u need to put the output INTO A TABLE.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Ex. 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : int_ekko type table of ekko with header line,&lt;/P&gt;&lt;P&gt;         fs_ekko type ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select&lt;/STRONG&gt; * from ekko &lt;STRONG&gt;into table&lt;/STRONG&gt; int_ekko where ebeln = '6361003191'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, int_ekko is an internal table contains all records whose EBELN = 63610003191.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)  If u use &lt;STRONG&gt;'SELECT  SINGLE'&lt;/STRONG&gt;, then it will retrieve &lt;STRONG&gt;only the first record&lt;/STRONG&gt; out of all the records who satisfy the condition EBELN = 6361003191.&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;STRONG&gt;Ex 2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select single&lt;/STRONG&gt; * from ekko into &lt;STRONG&gt;fs&lt;/STRONG&gt; where ebeln = '63610003191'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'fs' is &lt;STRONG&gt;not a table&lt;/STRONG&gt;, just of type structure. so contains &lt;STRONG&gt;only one record&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it help u..&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;&lt;STRONG&gt;Kindly reward points if hepful&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shanthi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Shanthi on Mar 4, 2008 8:17 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Mar 2008 07:16:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-04T07:16:34Z</dc:date>
    <item>
      <title>Query on Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-on-select-statement/m-p/3505224#M843105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        I have a small query on the Select Statement. If there are 2 identical rows and if i am retrieving them using the Select Statement, then will the select statement retrieves both the rows which are identical or only the first possible occurence? Pls help me out in this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sirisha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Mar 2008 07:04:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-on-select-statement/m-p/3505224#M843105</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-04T07:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Query on Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-on-select-statement/m-p/3505225#M843106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Sirisha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        that depends on ur select query. If u put SELECT SINGLE it retrieves first one only.  IF u put SELECT * it retrieves all the data.&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;&lt;/P&gt;&lt;P&gt;Ajay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Mar 2008 07:09:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-on-select-statement/m-p/3505225#M843106</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-04T07:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Query on Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-on-select-statement/m-p/3505226#M843107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;when u rare using select single it is going to select single records&lt;/P&gt;&lt;P&gt;if with normal select then all the records will be selected&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Mar 2008 07:10:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-on-select-statement/m-p/3505226#M843107</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-04T07:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Query on Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-on-select-statement/m-p/3505227#M843108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It depends on the where condition u mention.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to retirve MATNR 10002 from MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you write&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM MARA
                INTO TABLE itab
                WHERE matnr = '0000010002'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will retrieve suppose if MATNR has two rows also. As it is a key firkld it wont have two rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specify the table structure explain with a sample so that I can help you out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Mar 2008 07:11:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-on-select-statement/m-p/3505227#M843108</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-04T07:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Query on Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-on-select-statement/m-p/3505228#M843109</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;Only the first Occurrence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dhruv Shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Mar 2008 07:13:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-on-select-statement/m-p/3505228#M843109</guid>
      <dc:creator>dhruv_shah3</dc:creator>
      <dc:date>2008-03-04T07:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Query on Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-on-select-statement/m-p/3505229#M843110</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;     That depends on the statement u use. If u use, 'SELECT' statment, u can retrieve &lt;STRONG&gt;all the records&lt;/STRONG&gt; which are identical with one or few fields. For that, u need to put the output INTO A TABLE.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Ex. 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : int_ekko type table of ekko with header line,&lt;/P&gt;&lt;P&gt;         fs_ekko type ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select&lt;/STRONG&gt; * from ekko &lt;STRONG&gt;into table&lt;/STRONG&gt; int_ekko where ebeln = '6361003191'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, int_ekko is an internal table contains all records whose EBELN = 63610003191.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)  If u use &lt;STRONG&gt;'SELECT  SINGLE'&lt;/STRONG&gt;, then it will retrieve &lt;STRONG&gt;only the first record&lt;/STRONG&gt; out of all the records who satisfy the condition EBELN = 6361003191.&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;STRONG&gt;Ex 2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select single&lt;/STRONG&gt; * from ekko into &lt;STRONG&gt;fs&lt;/STRONG&gt; where ebeln = '63610003191'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'fs' is &lt;STRONG&gt;not a table&lt;/STRONG&gt;, just of type structure. so contains &lt;STRONG&gt;only one record&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it help u..&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;&lt;STRONG&gt;Kindly reward points if hepful&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shanthi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Shanthi on Mar 4, 2008 8:17 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Mar 2008 07:16:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-on-select-statement/m-p/3505229#M843110</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-04T07:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: Query on Select Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-on-select-statement/m-p/3505230#M843111</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;If you use SELECT SINGLE it will select only one row and that too the first row,pertaining to the condition given in WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise it will fetch all the duplicate row entries as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what you can do is, use&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES FROM itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where itab is the internal table into which the data is fetched thru the SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&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, 04 Mar 2008 07:17:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-on-select-statement/m-p/3505230#M843111</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-04T07:17:34Z</dc:date>
    </item>
  </channel>
</rss>

