SELECT DPI.SOURCE_BUS_UNIT , DPI.ORDER_NO , DPI.ORDER_INT_LINE_NO , DPI.SCHED_LINE_NBR , DPI.BUSINESS_UNIT , DPI.INV_ITEM_ID , %Round(SUM(%DecDiv(DPI.QTY_PICKED,IND.QTY_PER)),4) FROM PS_IN_DEMAND IND , PS_DEMAND_PHYS_INV DPI WHERE IND.BUSINESS_UNIT = DPI.BUSINESS_UNIT AND IND.DEMAND_SOURCE = DPI.DEMAND_SOURCE AND IND.SOURCE_BUS_UNIT = DPI.SOURCE_BUS_UNIT AND IND.ORDER_NO = DPI.ORDER_NO AND IND.ORDER_INT_LINE_NO = DPI.ORDER_INT_LINE_NO AND IND.SCHED_LINE_NBR = DPI.SCHED_LINE_NBR AND IND.DEMAND_LINE_NO = DPI.DEMAND_LINE_NO AND IND.INV_ITEM_ID = DPI.INV_ITEM_ID AND DPI.DEMAND_SOURCE = 'OM' AND IND.QTY_PER > 0 AND IND.QTY_CODE = 'ASY' AND IND.OPTIONAL_SHIP = 'N' GROUP BY DPI.SOURCE_BUS_UNIT, DPI.ORDER_NO, DPI.ORDER_INT_LINE_NO, DPI.SCHED_LINE_NBR, DPI.BUSINESS_UNIT, DPI.INV_ITEM_ID
|