<?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: Selecting most recent record using UZEIT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-most-recent-record-using-uzeit/m-p/7426798#M1549959</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;You can try as :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

"Say your data is in is IT_FINAL with fileds ZPROD DATE TIME

SORT IT_FINAL BY ZPROD DATE TIME DESCENDING.
DELETE ADJECENT DUPLICATES FROM IT_FINAL COMPARING ZPROD DATE.

LOOP AT IT_FINAL INTO WA_FINAL.
"Write your logic here
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Faheem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Oct 2010 13:08:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-10-28T13:08:14Z</dc:date>
    <item>
      <title>Selecting most recent record using UZEIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-most-recent-record-using-uzeit/m-p/7426795#M1549956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a select statement that fetches multiple records for same combinations where only UZEIT (time) is different. I would like to pick up the most recent record for each combination. Please advise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example using 3 fields. This is the table to pick up the data from.&lt;/P&gt;&lt;P&gt;ZPROD1  11.11.2010   1:00 pm&lt;/P&gt;&lt;P&gt;ZPROD1  11.11.2010   2:00 pm&lt;/P&gt;&lt;P&gt;ZPROD1  11.11.2010   3:00 pm&lt;/P&gt;&lt;P&gt;ZPROD2  11.11.2010   1:00 pm&lt;/P&gt;&lt;P&gt;ZPROD2  11.11.2010   1:30 pm&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These are the records that should get picked up (so the ones with the latest time).&lt;/P&gt;&lt;P&gt;ZPROD1  11.11.2010   3:00 pm&lt;/P&gt;&lt;P&gt;ZPROD2  11.11.2010   1:30 pm&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>Thu, 28 Oct 2010 12:12:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-most-recent-record-using-uzeit/m-p/7426795#M1549956</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-28T12:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting most recent record using UZEIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-most-recent-record-using-uzeit/m-p/7426796#M1549957</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 can use &lt;STRONG&gt;MAX&lt;/STRONG&gt; keyword in your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select fld1 fld2 fld3 max(uziet) from .......
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else if you want the latest record, then make use of the result of the mensioned query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anmol.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Oct 2010 13:01:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-most-recent-record-using-uzeit/m-p/7426796#M1549957</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-28T13:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting most recent record using UZEIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-most-recent-record-using-uzeit/m-p/7426797#M1549958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anmol,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the response but i should clarify that the data is stored in the internal table. I can't use the MAX keyword at the time of dumping data into this internal table since using the FOR ALL ENTRIES statement there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To clarify, in my original post, the 1st set of contents are staged in an internal table and then I would like to get the max (or most recent in my case) time for each of those unique records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Oct 2010 13:05:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-most-recent-record-using-uzeit/m-p/7426797#M1549958</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-28T13:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting most recent record using UZEIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-most-recent-record-using-uzeit/m-p/7426798#M1549959</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;You can try as :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

"Say your data is in is IT_FINAL with fileds ZPROD DATE TIME

SORT IT_FINAL BY ZPROD DATE TIME DESCENDING.
DELETE ADJECENT DUPLICATES FROM IT_FINAL COMPARING ZPROD DATE.

LOOP AT IT_FINAL INTO WA_FINAL.
"Write your logic here
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Faheem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Oct 2010 13:08:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-most-recent-record-using-uzeit/m-p/7426798#M1549959</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-28T13:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting most recent record using UZEIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-most-recent-record-using-uzeit/m-p/7426799#M1549960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome. Thank you folks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Oct 2010 13:34:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-most-recent-record-using-uzeit/m-p/7426799#M1549960</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-28T13:34:49Z</dc:date>
    </item>
  </channel>
</rss>

