‎2007 Jul 21 1:47 AM
Hi,
Purchase ord number Approve date (EBELN , BUDAT)
PO1 30/09/2006
PO1 25/10/2006
PO1 12/11/2006
PO1 22/11/2006
PO2 21/07/2006
PO2 30/10/2006
PO2 24/11/2006
PO3 12/09/2006
PO3 17/10/2006
i want oput put like this.
PO Latest approved date 2nd approved date
PO1 22/11/2006 12/11/2006
PO2 24/11/2006 30/10/2006
PO3 17/10/2006 21/10/2006
can any one write this code
Thanks in Advance.
‎2007 Jul 21 1:57 AM
Hi Sheethal,
SORT your table as
SORT itab by EBELN BUDAT DESCENDING.
Now you can delete the entires which are not required.
Regards,
Atish
‎2007 Jul 21 1:57 AM
Hi Sheethal,
SORT your table as
SORT itab by EBELN BUDAT DESCENDING.
Now you can delete the entires which are not required.
Regards,
Atish
‎2007 Jul 21 2:02 AM
Hi,
already i have done it but it is not getting exctly wat i want. so plz if it is possible could u write code for me.
Thanks in Advance,
‎2007 Jul 21 2:05 AM
Hi Sheethal,
Can you paste your code, I will modify it for you.
Regards,
Atish
‎2007 Jul 21 4:33 AM
take a itabfinal with po latest date 2nd latest date...
data : count type i.
sort itab by ebeln budat descending.
loop at itab.
at new ebeln.
count = 1.
endat.
if count le 2.
read table itabfinal with key ebeln = itab-ebeln.
if sy-subrc = 0.
itabfinal-2nddat = itab-budat.
modify itabfinal index sy-tabix.
else.
itabfinal-ebeln = itab-ebeln.
itabfinal-latestdat = itab-budat.
append itabfinal.
endif.
endif.
count = count + 1.
endloop.
sort itabfinal by ebeln.
regards
shiba dutta
‎2007 Jul 21 8:58 AM
try this ..i guess this may solve u r problem
first select the unique ponos into a itab.
then
DATA: wa_po TYPE table.
loop at itab.
select pono budat from table into wa_po upto 2 rows
where pono = itab-pono
order by budat descending.
endselect.
endloop.