IN_NWO_IPF_VW

(SQL View)
Index Back

Incorrect Pegged Flags

11/05/04 SR/ISC: Created

SELECT ID.BUSINESS_UNIT %Concat X.PEG_KEY_SEPARATOR %Concat ID.WO_ID , %NUMTOCHAR(ID.WO_TASK_ID) %Concat X.PEG_KEY_SEPARATOR %Concat %NUMTOCHAR(ID.RES_LN_NBR) , ID.PEG_STATUS , ID.DUE_DT , '115' , ID.BUSINESS_UNIT FROM PS_WM_WO_SCHED_PO ID , PS_INSTALLATION_IN X WHERE ( (ID.PEG_STATUS = '10' AND NOT EXISTS ( SELECT 'X' FROM PS_IN_PEGGING IP2 , PS_WM_WO_PO_HASH IDH2 WHERE IP2.DEMAND_HASH = IDH2.HASH_KEY AND IP2.DMD_ORDER_TYPE = '115' AND IP2.PEG_STATUS = '10' AND IDH2.BUSINESS_UNIT = ID.BUSINESS_UNIT AND IDH2.WO_ID = ID.WO_ID AND IDH2.WO_TASK_ID = ID.WO_TASK_ID AND IDH2.RES_LN_NBR = ID.RES_LN_NBR AND IDH2.RSRC_TYPE = ID.RSRC_TYPE )) OR (ID.PEG_STATUS = '40' AND EXISTS ( SELECT 'X' FROM PS_IN_PEGGING IP3 , PS_WM_WO_PO_HASH IDH3 WHERE IP3.DEMAND_HASH = IDH3.HASH_KEY AND IP3.DMD_ORDER_TYPE ='115' AND IDH3.BUSINESS_UNIT = ID.BUSINESS_UNIT AND IDH3.WO_ID = ID.WO_ID AND IDH3.WO_TASK_ID = ID.WO_TASK_ID AND IDH3.RES_LN_NBR = ID.RES_LN_NBR AND IDH3.RSRC_TYPE = ID.RSRC_TYPE)) OR (ID.PEG_STATUS = '20' AND NOT EXISTS ( SELECT 'X' FROM PS_IN_PEGGING IP3 , PS_WM_WO_PO_HASH IDH3 WHERE IP3.DEMAND_HASH = IDH3.HASH_KEY AND IP3.DMD_ORDER_TYPE = '115' AND IP3.PEG_STATUS = '20' AND IDH3.BUSINESS_UNIT = ID.BUSINESS_UNIT AND IDH3.WO_ID = ID.WO_ID AND IDH3.WO_TASK_ID = ID.WO_TASK_ID AND IDH3.RES_LN_NBR = ID.RES_LN_NBR AND IDH3.RSRC_TYPE = ID.RSRC_TYPE)) OR (ID.PEG_STATUS = '30' AND ((NOT EXISTS ( SELECT 'X' FROM PS_IN_PEGGING IP3 , PS_WM_WO_PO_HASH IDH3 WHERE IP3.DEMAND_HASH = IDH3.HASH_KEY AND IP3.DMD_ORDER_TYPE ='110' AND IP3.PEG_STATUS = '30' AND IDH3.BUSINESS_UNIT = ID.BUSINESS_UNIT AND IDH3.WO_ID = ID.WO_ID AND IDH3.WO_TASK_ID = ID.WO_TASK_ID AND IDH3.RES_LN_NBR = ID.RES_LN_NBR)) OR (EXISTS ( SELECT 'X' FROM PS_IN_PEGGING IP3 , PS_WM_WO_MAT_HASH IDH3 WHERE IP3.DEMAND_HASH = IDH3.HASH_KEY AND IP3.DMD_ORDER_TYPE = '110' AND IP3.PEG_STATUS <> '30' AND IDH3.BUSINESS_UNIT = ID.BUSINESS_UNIT AND IDH3.WO_ID = ID.WO_ID AND IDH3.WO_TASK_ID = ID.WO_TASK_ID AND IDH3.RES_LN_NBR = ID.RES_LN_NBR))) ))

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 DMD_ORDER_KEY Character(25) VARCHAR2(25) NOT NULL Used to store the various Order Number formats in 1 field
2 DMD_LINE_KEY Character(25) VARCHAR2(25) NOT NULL Used to Store the concatenation of Line, Demand, Sched, Kit, etc in 1 field.
3 PEG_STATUS Character(2) VARCHAR2(2) NOT NULL 07/21/04 EGS: Created
10=Open
20=Completed
30=Canceled
40=Not Pegged
4 SCHED_DATE Date(10) DATE Schedule Date
5 DMD_ORDER_TYPE Character(4) VARCHAR2(4) NOT NULL Used by Pegging Maintenance/Inquiry
030=Transfer Demand
070=Stock Request
090=Sales Order
110=Work Order Inventory
115=WO Non-Inventory
900=Work Order
6 BUSINESS_UNIT_DMD Character(5) VARCHAR2(5) NOT NULL 08/12/04 EGS: Created.