I’m trying to create the sales order status in BAQ. I also want to add the invoice number for each order line. As you all know, the invoice for the order line may be credited and another invoice may be created again. So if I have multiple invoices and I link the invoice number in the invoice head, it will create duplicate order lines equal to the invoice quantity.
So the way I was thinking was that only the highest invoice number for that order line would appear. Because our invoice number is an automatic sequence. When I do that, the latest invoice will appear.
But I don’t know how to create this SQL. Can someone please tell me how to create it?
Thanks in advance!