IN_ITEM_PEG_VW

(SQL View)
Index Back

Open Peg Qty by Item

11/16/06 EGS: Created.

SELECT A.BUSINESS_UNIT , A.INV_ITEM_ID , SUM(B.QTY_PEGGED - B.QTY_COMPLETE) FROM PS_BU_ITEMS_INV A , PS_IN_PEGGING B WHERE B.PEG_STATUS = '10' AND ((B.DMD_ORDER_TYPE = '070' OR B.DMD_ORDER_TYPE = '090' OR B.DMD_ORDER_TYPE = '030') AND EXISTS ( SELECT 'X' FROM PS_IN_DEMAND_HASH IDH WHERE IDH.HASH_KEY = B.DEMAND_HASH AND IDH.BUSINESS_UNIT = A.BUSINESS_UNIT AND IDH.INV_ITEM_ID = A.INV_ITEM_ID) OR (B.DMD_ORDER_TYPE = '110' AND EXISTS ( SELECT 'X' FROM PS_WM_WO_MAT_HASH WWMH , PS_WM_WO_SCHED_MAT WWSM WHERE WWMH.HASH_KEY = B.DEMAND_HASH AND WWSM.BUSINESS_UNIT = WWMH.BUSINESS_UNIT AND WWSM.WO_ID = WWMH.WO_ID AND WWSM.WO_TASK_ID = WWMH.WO_TASK_ID AND WWSM.RES_LN_NBR = WWMH.RES_LN_NBR AND WWSM.BUSINESS_UNIT_IN = A.BUSINESS_UNIT AND WWSM.INV_ITEM_ID = A.INV_ITEM_ID))) GROUP BY A.BUSINESS_UNIT, A.INV_ITEM_ID

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 BUSINESS_UNIT Character(5) VARCHAR2(5) NOT NULL Business Unit
2 INV_ITEM_ID Character(18) VARCHAR2(18) NOT NULL Item ID
3 QTY_PEGGED Signed Number(17,4) DECIMAL(15,4) NOT NULL 06/16/04 EGS: Created.