‎2007 Sep 13 3:34 AM
Hi Experts ,
Im having some data in Database tablle like this .
vbeln edatu meng
123454 05.12.2006 2
123454 25.05.2007 5
123454 10.09.2007 9---> Recent data
Here sales doc no is primary Key .
i want Logic how to fetch most Recent data ?
Thanx in advance
regs
Murthy
‎2007 Sep 13 3:39 AM
Write this code, you will get the recent data into itab.
sort itab by vbeln ascending
edatu meng descending.
delete adjacent duplicates from itab comparing vbeln edatu meng.Regards
Gopi
‎2007 Sep 13 3:57 AM
Im too lazy to write the entire code
but do these steps
select distinct sales doc into table itab
loop at the table and select max( date ) for each sales doc
select remaining fields based on sales doc and date
modify table
endloop
‎2007 Sep 13 4:20 AM
try this it may work...
first of all declare an int table with three fields vbeln edatu and menge like database table...
then
select vbeln max( edatu ) menge into table itab from dbtab where <condition> group by vbeln menge.
regards
shiba dutta