I have a requirement where depending on the plant from which the product is shipped, we need to assign a unique forwarding agent. For example, if the product is shipped from Plant 1000 - assign UPS as forwarding agent (FA), and if product is shipped from Plant 2000- assign Fedex as forwarding agent. The partner function will the same but partner number will be different (ZZ- Partner function; Partner number ABC123 for UPS and XYZ123 for FedEx). The plant determination happens upstream on the ecommerce website. We have a logic in the BAPI which assigns the FA for orders shipping solely from plant 1000 or plant 2000. However in some unique scenario's an order could have multiple lines, and shipped from both plants (Mixed order), in which case the BAPI cannot determine the FA. The FA value is needed as once the product is shipped, we pass some info back to the website with tracking number.
We are exploring options if the FA should be determined on the sales order or delivery since the delivery split logic would create 2 deliveries for a mixed order. Could someone help with User exit updating the FA on delivery when the FA on Sales order is different or missing. We could also update the FA using Idoc 945 when the system PGI's the order as we use third party logistics for shipping. This idoc has a segment that updates the tracking number and FA.