<?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 Statement Doubt in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860798#M1136573</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 want single record you can use below statement but i think performance wise not good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select EDOKN&lt;/P&gt;&lt;P&gt;FGNAM&lt;/P&gt;&lt;P&gt;FGDAT&lt;/P&gt;&lt;P&gt;REVNO&lt;/P&gt;&lt;P&gt;from EREV into ls_erev upto 1 rows order by revno descending &lt;/P&gt;&lt;P&gt;where edokn eq p_edokn &lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;other wise select the all records into one internal table.&lt;/P&gt;&lt;P&gt;sort internal table by version in descending order.&lt;/P&gt;&lt;P&gt;delete all other versions using delete adjacent duplicates statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suresh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Dec 2008 06:01:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-03T06:01:33Z</dc:date>
    <item>
      <title>Select Statement Doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860793#M1136568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message: Please use meaningful subject in future&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've a requirement that I need to get a record from EREV table for a Purchase Requisition no. based on Latest Version No. (REVNO. ) at a single shot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hav used the following code but i dint get desired values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select EDOKN&lt;/P&gt;&lt;P&gt;          FGNAM&lt;/P&gt;&lt;P&gt;          FGDAT&lt;/P&gt;&lt;P&gt;          REVNO&lt;/P&gt;&lt;P&gt;       from EREV into ls_erev&lt;/P&gt;&lt;P&gt;       where edokn eq p_edokn and&lt;/P&gt;&lt;P&gt;                 revno eq (select Max(revno) from erev)).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any body pl help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rajiv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vaddepati on Dec 3, 2008 11:01 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Dec 3, 2008 10:03 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 05:30:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860793#M1136568</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T05:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860794#M1136569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please send ur code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 05:36:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860794#M1136569</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T05:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860795#M1136570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Better do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;take all versions into one internal table and sort in descending. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the READ TABLE ITAB index 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so u will get higher version into work area .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now use that in ur select query.&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>Wed, 03 Dec 2008 05:38:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860795#M1136570</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T05:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860796#M1136571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;i think you want to get the highest of the version ...&lt;/P&gt;&lt;P&gt;if its so just sort it in order so that you can arrange it in order ..........&lt;/P&gt;&lt;P&gt;or if you want to get latest,,,&lt;/P&gt;&lt;P&gt;you can use read table...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 05:41:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860796#M1136571</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T05:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860797#M1136572</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 the below code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Select EDOKN
FGNAM
FGDAT
max( REVNO ) 
from EREV into ls_erev
where edokn eq p_edokn.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kumar M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 05:59:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860797#M1136572</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T05:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860798#M1136573</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 want single record you can use below statement but i think performance wise not good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select EDOKN&lt;/P&gt;&lt;P&gt;FGNAM&lt;/P&gt;&lt;P&gt;FGDAT&lt;/P&gt;&lt;P&gt;REVNO&lt;/P&gt;&lt;P&gt;from EREV into ls_erev upto 1 rows order by revno descending &lt;/P&gt;&lt;P&gt;where edokn eq p_edokn &lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;other wise select the all records into one internal table.&lt;/P&gt;&lt;P&gt;sort internal table by version in descending order.&lt;/P&gt;&lt;P&gt;delete all other versions using delete adjacent duplicates statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suresh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 06:01:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860798#M1136573</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T06:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860799#M1136574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, &lt;/P&gt;&lt;P&gt;if you want to select record into a work area&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select * from table_name into wa.
endselect.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;if you want to select records into a internal table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select * from table_name into table internal_table_name." key word ---table--- should not be omitted
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;so  according to your code,  ls_erev is a work area&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have to enclosing it with &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;endselect&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: David,Liu on Dec 3, 2008 9:42 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 08:41:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860799#M1136574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T08:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Select Statement Doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860800#M1136575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Hi veddapati,&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your sequence of using the fields in Select statement is wrong...thats why, you are not getting the required output..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should select revno in the select statement before FGNAM as it is present in the table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please modify your select statement like this..... ::&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select EDOKN&lt;/P&gt;&lt;P&gt;REVNO&lt;/P&gt;&lt;P&gt;FGNAM&lt;/P&gt;&lt;P&gt;FGDAT&lt;/P&gt;&lt;P&gt;from EREV into ls_erev&lt;/P&gt;&lt;P&gt;where edokn eq p_edokn and&lt;/P&gt;&lt;P&gt;revno eq (select Max(revno) from erev)).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it will solve your problem&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;Nikita&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Nikita Jain on Dec 3, 2008 2:29 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 08:50:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-doubt/m-p/4860800#M1136575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T08:50:49Z</dc:date>
    </item>
  </channel>
</rss>

