<?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: Latest Date Logic in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872625#M1139087</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;P:&lt;/P&gt;&lt;P&gt;With this method, i have 4 record with duplicate Material no, different date and materia no., result is zero.It deleted all the record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;111 1/2/2008 123&lt;/P&gt;&lt;P&gt;111 1/3/2008 132&lt;/P&gt;&lt;P&gt;111 2/3/2008 134&lt;/P&gt;&lt;P&gt;111 12/01/2008 135&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want only&lt;/P&gt;&lt;P&gt;111 12/01/2008 135&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rest all needs to be delete in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Dec 2008 09:05:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-03T09:05:19Z</dc:date>
    <item>
      <title>Latest Date Logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872616#M1139078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an Internal table, with columns Date, Material no(duplicates), Material Document No(unique).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to pick only latest date record with material no, material document, then delete rest for the material no in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Suggestion or logic using Internal table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Praba KN on Dec 3, 2008 9:37 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 08:37:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872616#M1139078</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T08:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Latest Date Logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872617#M1139079</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;PRE&gt;&lt;CODE&gt;First sort your internal table on date field and then select the required fields.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 08:39:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872617#M1139079</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T08:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Latest Date Logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872618#M1139080</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;Sort your internal table in descending order by date,and the rest of the fields, in this way you would get the latest date, and delete the remaining record,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 08:40:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872618#M1139080</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T08:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Latest Date Logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872619#M1139081</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;Sort the internal table with descending date and read the first recrod.&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SORT IT_TAB1 by DATS DESCENDING.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Read table it_tab1 index 1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nitin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 08:41:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872619#M1139081</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T08:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Latest Date Logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872620#M1139082</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;sort the internal table with material number , date and material doc then  u can have to use control levels .. pick the last record and place in new internal table ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do the same process to all the material once you completed then you can procedd with new internal table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope Helpfull&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Raghunath.S&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 08:41:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872620#M1139082</guid>
      <dc:creator>former_member632729</dc:creator>
      <dc:date>2008-12-03T08:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Latest Date Logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872621#M1139083</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;PRE&gt;&lt;CODE&gt;SORT itab BY datecolumn DESCENDING.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 08:41:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872621#M1139083</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T08:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Latest Date Logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872622#M1139084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Sort the internal table on date in decending order and then read the table index 1. this will give you the latest record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 08:41:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872622#M1139084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T08:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Latest Date Logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872623#M1139085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to use the control levels?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 08:44:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872623#M1139085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T08:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Latest Date Logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872624#M1139086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here it is important column order. Use this like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of it occurs 0,
          material type...
          date type d,
          doc type ...
        end of it.
...
sort it by material date doc.

loop at it.
   at new material.   "gets the lates record from material
       continue.         "continue loop leaving this entry
   endat.

   delete it index sy-tabix.   "delete all the others
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 08:46:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872624#M1139086</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2008-12-03T08:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Latest Date Logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872625#M1139087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;P:&lt;/P&gt;&lt;P&gt;With this method, i have 4 record with duplicate Material no, different date and materia no., result is zero.It deleted all the record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;111 1/2/2008 123&lt;/P&gt;&lt;P&gt;111 1/3/2008 132&lt;/P&gt;&lt;P&gt;111 2/3/2008 134&lt;/P&gt;&lt;P&gt;111 12/01/2008 135&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want only&lt;/P&gt;&lt;P&gt;111 12/01/2008 135&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rest all needs to be delete in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 09:05:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872625#M1139087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T09:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Latest Date Logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872626#M1139088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of it occurs 0,
          material type...
          date type d,
          doc type ...
        end of it.
...
sort it by material date doc.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;after these steps using &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DELETE ADJACENT DUPLICATES FROM it COMPARING material .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;will be better than&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
loop at it.
   at new material.   
       continue.        
   endat.
 
   delete it index sy-tabix.  
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 09:10:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872626#M1139088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T09:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Latest Date Logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872627#M1139089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I think it was due to wrong sorting condition. This code works fine (I checked). Only apply this logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of it occurs 0,
          m type c,
          d type d,
          doc type i,
        end of it.

it-m = 1.
it-d = '20080101'.
it-doc = 123.
append it.

it-m = 1.
it-d = '20080201'.
it-doc = 132.
append it.

it-m = 1.
it-d = '20080301'.
it-doc = 145.
append it.

sort it by m d DESCENDING doc .

loop at it.
   at new m.   "gets the lates record from material
       continue.         "continue loop leaving this entry
   endat.

   delete it index sy-tabix.   "delete all the others
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 09:14:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872627#M1139089</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2008-12-03T09:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: Latest Date Logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872628#M1139090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Pat, Pathak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 09:19:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date-logic/m-p/4872628#M1139090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T09:19:22Z</dc:date>
    </item>
  </channel>
</rss>

