IN_PO_IPF_VW

(SQL View)
Index Back

Incorrect pegged Flags

10/05/04 SR/ISC: Created

SELECT ID.BUSINESS_UNIT %Concat X.PEG_KEY_SEPARATOR %Concat ID.PO_ID , %NUMTOCHAR(ID.LINE_NBR) %Concat X.PEG_KEY_SEPARATOR %Concat %NUMTOCHAR(ID.SCHED_NBR) %Concat X.PEG_KEY_SEPARATOR %Concat %NUMTOCHAR(ID.DISTRIB_LINE_NUM) , ID.PEG_STATUS , PLS.DUE_DT , ID.BUSINESS_UNIT_IN FROM PS_PO_LINE_DISTRIB ID , PS_INSTALLATION_IN X , PS_PO_LINE_SHIP PLS WHERE ID.BUSINESS_UNIT = PLS.BUSINESS_UNIT AND ID.PO_ID = PLS.PO_ID AND ID.LINE_NBR = PLS.LINE_NBR AND ID.SCHED_NBR = PLS.SCHED_NBR AND ( (ID.PEG_STATUS = '10' AND NOT EXISTS ( SELECT 'X' FROM PS_IN_PEGGING IP2 , PS_PO_HASH IDH2 WHERE IP2.SUPPLY_HASH = IDH2.HASH_KEY AND IP2.SUP_ORDER_TYPE ='010' AND IP2.PEG_STATUS = '10' AND IDH2.PO_ID = ID.PO_ID AND IDH2.BUSINESS_UNIT = ID.BUSINESS_UNIT AND IDH2.LINE_NBR = ID.LINE_NBR AND IDH2.SCHED_NBR = ID.SCHED_NBR AND IDH2.DISTRIB_LINE_NUM = ID.DISTRIB_LINE_NUM)) OR (ID.PEG_STATUS = '40' AND EXISTS ( SELECT 'X' FROM PS_IN_PEGGING IP3 , PS_PO_HASH IDH3 WHERE IP3.SUPPLY_HASH = IDH3.HASH_KEY AND IP3.SUP_ORDER_TYPE ='010' AND IDH3.PO_ID = ID.PO_ID AND IDH3.BUSINESS_UNIT = ID.BUSINESS_UNIT AND IDH3.LINE_NBR = ID.LINE_NBR AND IDH3.SCHED_NBR = ID.SCHED_NBR AND IDH3.DISTRIB_LINE_NUM = ID.DISTRIB_LINE_NUM)) OR (ID.PEG_STATUS = '20' AND NOT EXISTS ( SELECT 'X' FROM PS_IN_PEGGING IP3 , PS_PO_HASH IDH3 WHERE IP3.SUPPLY_HASH = IDH3.HASH_KEY AND IP3.SUP_ORDER_TYPE ='010' AND IP3.PEG_STATUS = '20' AND IDH3.PO_ID = ID.PO_ID AND IDH3.BUSINESS_UNIT = ID.BUSINESS_UNIT AND IDH3.LINE_NBR = ID.LINE_NBR AND IDH3.SCHED_NBR = ID.SCHED_NBR AND IDH3.DISTRIB_LINE_NUM = ID.DISTRIB_LINE_NUM)) OR (ID.PEG_STATUS = '30' AND ((NOT EXISTS ( SELECT 'X' FROM PS_IN_PEGGING IP3 , PS_PO_HASH IDH3 WHERE IP3.SUPPLY_HASH = IDH3.HASH_KEY AND IP3.SUP_ORDER_TYPE ='010' AND IP3.PEG_STATUS = '30'AND IDH3.PO_ID = ID.PO_ID AND IDH3.BUSINESS_UNIT = ID.BUSINESS_UNIT AND IDH3.LINE_NBR = ID.LINE_NBR AND IDH3.SCHED_NBR = ID.SCHED_NBR AND IDH3.DISTRIB_LINE_NUM = ID.DISTRIB_LINE_NUM)) OR (EXISTS ( SELECT 'X' FROM PS_IN_PEGGING IP3 , PS_PO_HASH IDH3 WHERE IP3.SUPPLY_HASH = IDH3.HASH_KEY AND IP3.SUP_ORDER_TYPE ='010' AND IP3.PEG_STATUS <> '30' AND IDH3.PO_ID = ID.PO_ID AND IDH3.BUSINESS_UNIT = ID.BUSINESS_UNIT AND IDH3.LINE_NBR = ID.LINE_NBR AND IDH3.SCHED_NBR = ID.SCHED_NBR AND IDH3.DISTRIB_LINE_NUM = ID.DISTRIB_LINE_NUM))) ))

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 SUP_ORDER_KEY Character(25) VARCHAR2(25) NOT NULL Used to store the various Order Number formats in 1 field
2 SUP_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 BUSINESS_UNIT_IN Character(5) VARCHAR2(5) NOT NULL Inventory Unit