‎2008 Jan 21 4:25 AM
Hi,
-
Material | Posting Date | Vendor | Mat.Doc.No | Bal.Qty |
-
ID0169164 | 07.08.2004 | IC-KIT | 412783 | 4.000 |
ID0169164 | 07.08.2004 | IC-KIT | 412784 | 8.000 |
ID0169164 | 16.08.2004 | IC-KIT | 413064 | 14.000 |
ID0169164 | 16.08.2004 | IC-KIT | 413065 | 34.000 |
ID0169164 | 19.08.2004 | IC-KIT | 413162 | 14.000 |
ID0169164 | 20.08.2004 | IC-KIT | 413171 | 24.000 |
ID0169164 | 20.08.2004 | IC-KIT | 413172 | 34.000 |
ID0169164 | 08.11.2004 | IC-KIT | 413761 | 80.000 |
ID0169167 | 16.08.2004 | IC-KIT | 413064 | 20.000 |
ID0169167 | 16.08.2004 | IC-KIT | 413065 | 60.000 |
ID0169167 | 19.08.2004 | IC-KIT | 413162 | 20.000 |
ID0169167 | 20.08.2004 | IC-KIT | 413171 | 40.000 |
ID0169167 | 20.08.2004 | IC-KIT | 413172 | 60.000 |
I want to sort the above one in such a way that when I delete the adjacent duplicates after sorting the internal table should contain only
ID0169164 | 08.11.2004 | IC-KIT | 413761 | 80.000 |
ID0169167 | 20.08.2004 | IC-KIT | 413172 | 60.000 |
ie.Material with the latest budat and mblnr and its corresponing bal quantity.
sort itab by matnr budat ascending.
delete adjacent duplicates from itab comparing lifnr matnr.
is not giving me the result.Can anyone here please let me where I am going wrong.
Thanks,
K.Kiran.
Edited by: Kiran K on Jan 21, 2008 5:39 AM
‎2008 Jan 21 4:42 AM
Hi kiran,
first sort the internal table as per
sort itab by matnr ascending budat descending.
then u delete the records as .
delete adjacent duplicates from itab comparing matnr.
regards,
Santosh thorat
‎2008 Jan 21 4:42 AM
Hi kiran,
first sort the internal table as per
sort itab by matnr ascending budat descending.
then u delete the records as .
delete adjacent duplicates from itab comparing matnr.
regards,
Santosh thorat
‎2008 Jan 21 4:51 AM
Santhosh,
Thanks,but it won't give me the latest balance quantity if there are two mblnrs on the same posting date.
As per yours it will result in this.
ID0169164 | 08.11.2004 | IC-KIT | 413761 | 80.000 |
ID0169167 | 20.08.2004 | IC-KIT | 413171 | 40.000 |
but what needed is this.
ID0169164 | 08.11.2004 | IC-KIT | 413761 | 80.000 |
ID0169167 | 20.08.2004 | IC-KIT | 413172 | 60.000 |
When there are two MBLNRS on the latest posting date then I should consider the latest MBLNR and its balance quantity.
Thanks,
K.Kiran.
‎2008 Jan 21 4:56 AM
Hi,
sort itab by matnr ascending budat descending XBLNR DESCENDING.
then u delete the records as .
delete adjacent duplicates from itab comparing matnr.
Regards,
Santosh Thorat
‎2008 Jan 21 4:42 AM
Hi Kiran,
Check it.
SORT it_itab BY matnr.
DELETE ADJACENT DUPLICATES FROM it_itab COMPARING matnr