<?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 Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011365#M711629</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 syntax Of Select with Order keyword..&lt;/P&gt;&lt;P&gt;Order by ur required field (date)&lt;/P&gt;&lt;P&gt;Can be  helpful..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Praveen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        praveen parasiya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Oct 2007 08:59:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-30T08:59:41Z</dc:date>
    <item>
      <title>select Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011364#M711628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement in which i have to select belnr field from EKBE table on basis of ebeln and ebelp,but there are multiple records in EKBE table.i have to select the latest belnr number on basis of date field.how can i do that?&lt;/P&gt;&lt;P&gt;For ex &lt;/P&gt;&lt;P&gt;ebeln ebelp belnr date&lt;/P&gt;&lt;P&gt;45     10      001   07/10/2007&lt;/P&gt;&lt;P&gt;45     10      002   09/10/2007&lt;/P&gt;&lt;P&gt;45      10     003   10/10/2007&lt;/P&gt;&lt;P&gt;i want the third record with belnr 003.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2007 08:55:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011364#M711628</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-30T08:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: select Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011365#M711629</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 syntax Of Select with Order keyword..&lt;/P&gt;&lt;P&gt;Order by ur required field (date)&lt;/P&gt;&lt;P&gt;Can be  helpful..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Praveen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        praveen parasiya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2007 08:59:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011365#M711629</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-30T08:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: select Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011366#M711630</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;   Just check belnr ebeln ebelp and lastly posting date budat.&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;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2007 09:00:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011366#M711630</guid>
      <dc:creator>former_member386202</dc:creator>
      <dc:date>2007-10-30T09:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: select Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011367#M711631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select belnr max( date ) from ekbe into rec...&lt;/P&gt;&lt;P&gt;         where ebeln = 45&lt;/P&gt;&lt;P&gt;             and ebelp = 10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2007 09:00:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011367#M711631</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2007-10-30T09:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: select Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011368#M711632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do it in 2 ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First.. get all records in to internal table. Sort the ITAB by date DESCENDING. Now reading the first record with that BELNR. It wil hav less burden on database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, you can get the data by using the &amp;lt;DATE field&amp;gt; DESCENDING in the SELECT statement. But as you are going for aggragate funstions the System will take more time to run this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e. SELECT ....&lt;/P&gt;&lt;P&gt;     ORDER BY &amp;lt;DATE FIELD&amp;gt; DESCENDING....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2007 09:01:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011368#M711632</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-30T09:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: select Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011369#M711633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;     Say IT_EKBE has the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort it_ekbe by date descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_ekbe with key ebeln = &amp;lt;&amp;lt;ur value&amp;gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward point if useful,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Niyaz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2007 09:01:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011369#M711633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-30T09:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: select Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011370#M711634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select &lt;/P&gt;&lt;P&gt;  ebeln &lt;/P&gt;&lt;P&gt;  ebelp &lt;/P&gt;&lt;P&gt;  belnr &lt;/P&gt;&lt;P&gt;  date&lt;/P&gt;&lt;P&gt;into (....)&lt;/P&gt;&lt;P&gt;from ekbe as o&lt;/P&gt;&lt;P&gt;where date = ( select max(date)&lt;/P&gt;&lt;P&gt;                          from ekbe&lt;/P&gt;&lt;P&gt;                        where o~ebeln = ebeln&lt;/P&gt;&lt;P&gt;                           and o~ebelp = ebelp&lt;/P&gt;&lt;P&gt;                           and o~belnr = belnr&lt;/P&gt;&lt;P&gt;                       ) .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2007 09:01:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011370#M711634</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2007-10-30T09:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: select Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011371#M711635</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;U can do it in two ways..either get all the data into internal table  and then u can use this ststemnt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by date descending..Now the latest reocrd will be the first record..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write a select query like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT single * FROM ekbe into wa_ekbe WHERE  ebeln = p_ebeln&lt;/P&gt;&lt;P&gt;and ebelp = p_ebelp&lt;/P&gt;&lt;P&gt;  ORDER BY date DESCENDING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now u will get only the latest  record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rewrad if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2007 09:02:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011371#M711635</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2007-10-30T09:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: select Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011372#M711636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;One way to do this would be to get all the records for a particular ebeln and ebelp and then sort the records based on the date field in descending order.&lt;/P&gt;&lt;P&gt;Once this is done you will have the latest record on top and then use delete adjacent duplicates to delete all the other records except the first one which is the latest one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it is useful.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sandeep.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2007 09:03:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-problem/m-p/3011372#M711636</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-30T09:03:27Z</dc:date>
    </item>
  </channel>
</rss>

