SELECT A.BUSINESS_UNIT , A.INV_ITEM_ID , SUM(A.QTY_BASE) FROM PS_PHYSICAL_INV A , PS_STOR_LOC_INV B , PS_BUS_UNIT_TBL_IN C WHERE A.BUSINESS_UNIT = B.BUSINESS_UNIT AND A.STORAGE_AREA = B.STORAGE_AREA AND A.STOR_LEVEL_1 = B.STOR_LEVEL_1 AND A.STOR_LEVEL_2 = B.STOR_LEVEL_2 AND A.STOR_LEVEL_3 = B.STOR_LEVEL_3 AND A.STOR_LEVEL_4 = B.STOR_LEVEL_4 AND A.BUSINESS_UNIT = C.BUSINESS_UNIT AND B.WIP_LOC_FLG = 'Y' AND B.NETTABLE_FLG = 'Y' AND A.AVAIL_STATUS <> '4' AND (A.AVAIL_STATUS = '1' OR C.INCL_QUAR_AVAIL = 'Y') GROUP BY A.BUSINESS_UNIT, A.INV_ITEM_ID
|