2008 Jul 17 5:38 PM
How can i keep the records with latest date for every order number in an itab that looks like this.
WADAT_IST VBELN
20060519 |0000268071
20060519 |0000268071
20060524 |0000268071
20060519 |0000268071
Thanks
2008 Jul 17 5:42 PM
Sort the itab with order and date field...
Sort itab by order date descending.
Regards,
JOy.
Edited by: Joyjit Ghosh on Jul 17, 2008 6:44 PM
2008 Jul 17 5:40 PM
SORT ITAB BY VBELN ASCENDING WADAT_IST DESCENDING.
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING VBELN WADAT_IST.
Hope this helps.
RK.
2008 Jul 17 5:47 PM
Thanks for the help.
But i would like to have only the latest date and this method just deletes same dates and keeps the table with a few dates (different dates) for one vbeln
2008 Jul 17 6:01 PM
SORT ITAB BY VBELN ASCENDING WADAT_IST DESCENDING.
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING VBELN.
Now this eliminates all the records except the one order with the latest date.
~RK
2008 Jul 17 5:42 PM
Sort the itab with order and date field...
Sort itab by order date descending.
Regards,
JOy.
Edited by: Joyjit Ghosh on Jul 17, 2008 6:44 PM
2008 Jul 17 5:56 PM
To keep the latest record by date try this:
Sort itab by order date descending.
Delete adjacent duplicates from itab comparing order.
Regards,
JOy.
2008 Jul 17 5:59 PM
2008 Jul 17 5:53 PM
Hi,
Please refer the code below:
sort itab by WADAT_IST descending.
delete adjacent duplicates from itab comparing WADAT_IST.
Thanks,
Sriram POnna.