IN_REQ_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.REQ_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 , ID.BUDGET_DT , ID.BUSINESS_UNIT_IN FROM PS_INSTALLATION_IN X , PS_REQ_LN_DISTRIB ID WHERE ( (ID.PEG_STATUS = '10' AND NOT EXISTS ( SELECT 'X' FROM PS_IN_PEGGING IP2 , PS_REQ_HASH IDH2 WHERE IP2.SUPPLY_HASH = IDH2.HASH_KEY AND IP2.SUP_ORDER_TYPE = '100' AND IP2.PEG_STATUS = '10' AND IDH2.BUSINESS_UNIT = ID.BUSINESS_UNIT AND IDH2.REQ_ID = ID.REQ_ID 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 IP2 , PS_REQ_HASH IDH2 WHERE IP2.SUPPLY_HASH = IDH2.HASH_KEY AND IP2.SUP_ORDER_TYPE = '100' AND IDH2.BUSINESS_UNIT = ID.BUSINESS_UNIT AND IDH2.REQ_ID = ID.REQ_ID 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 = '20' AND NOT EXISTS ( SELECT 'X' FROM PS_IN_PEGGING IP2 , PS_REQ_HASH IDH2 WHERE IP2.SUPPLY_HASH = IDH2.HASH_KEY AND IP2.SUP_ORDER_TYPE = '100' AND IP2.PEG_STATUS = '20' AND IDH2.BUSINESS_UNIT = ID.BUSINESS_UNIT AND IDH2.REQ_ID = ID.REQ_ID 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 = '30' AND ((NOT EXISTS ( SELECT 'X' FROM PS_IN_PEGGING IP2 , PS_REQ_HASH IDH2 WHERE IP2.SUPPLY_HASH = IDH2.HASH_KEY AND IP2.SUP_ORDER_TYPE = '100' AND IP2.PEG_STATUS = '30' AND IDH2.BUSINESS_UNIT = ID.BUSINESS_UNIT AND IDH2.REQ_ID = ID.REQ_ID AND IDH2.LINE_NBR = ID.LINE_NBR AND IDH2.SCHED_NBR = ID.SCHED_NBR AND IDH2.DISTRIB_LINE_NUM = ID.DISTRIB_LINE_NUM)) OR (EXISTS ( SELECT 'X' FROM PS_IN_PEGGING IP2 , PS_REQ_HASH IDH2 WHERE IP2.SUPPLY_HASH = IDH2.HASH_KEY AND IP2.SUP_ORDER_TYPE = '100' AND IP2.PEG_STATUS <> '30' AND IDH2.BUSINESS_UNIT = ID.BUSINESS_UNIT AND IDH2.REQ_ID = ID.REQ_ID AND IDH2.LINE_NBR = ID.LINE_NBR AND IDH2.SCHED_NBR = ID.SCHED_NBR AND IDH2.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