2013 Nov 12 2:13 PM
Hi,
I have an issue in which a custom report is not pulling the sales order/delivery no for multiple line items correctly.
For a particular custom deeclation, there are many sales order/delivery no. But in this case, the sales order/delivery are getting fetched incorrectly.
I have given an example as shown below--
( Sales order/delivery no. are replicating here )
custom declaration sales order delivery order
a p
a p
a p
a p
x a p
b q
b q
b q
b q
The sales order/delivery no should appear like this--
custom declaration sales order delivery order
a p
b q
c r
d s
e t
x f u
g v
h w
i y
what can i do in this case?
2013 Nov 12 2:26 PM
Hi,
Please update your final internal table using below.
Loop at itab.
At end of delivery order.
final-salesorder = itab-salesorder.
final-deliveryorder = itab-deliveryorder.
append final.
endat.
Endloop.
Your final internal table will get output like above.
Arivazhagan S
2013 Nov 13 6:41 AM
HI meenakshi,
I guess that you would have maintained a internal table with all the values.
I have just written the logic , try with your own variable
loop at l_itab into x_itab where customerno = lv_cust . " looping for a particular customer declaration
x_new-customer = x_itab-customer.
x_new-salesorder = x_itab-salesorder.
x_new-deliverynote = x_itab-deliverynote.
append x_new to l_new .
clear x_new.
endloop.
Now this l_new internal table will hold the correct values without dupicating .
Regards,
Sivaganesh
2013 Nov 13 6:44 AM
Share your code. Also, sort your internal table and use "DELETE ADJACENT DUPLICATES".
Regards
2013 Nov 13 7:04 AM
Lets say IT_FINAL is having this data.
Sort it_final by custom,order,deliver.
delete adjacenet duplicates from it_final comparing custom order delivery