Finding end assembly of a planned order using SQL query
We have run ASCP (unconstrained) plan. System has pegged demands with supplies.
For a personalization, we need to find out the particular demand for which a planned order was created.
So far, we are using msc_full_pegging. The idea is to use pegging_id to reach the end assembly (the finished good against which a semi-finished production batch was suggested).
We have traced end_pegging_id and inventory_item_id through pegging_id. We selected the pegging_id by matching its supply_quantity with the Production Batch quantity in the pegging tree.
The problem is that there are multiple suggestions of production batches with same quantity and product... and for a particular suggestion we cannot verify pegging_id from ASCP Demand/Supply window. We are unable to validate that the pegging_id we are using actually belongs to the selected planned order.