IN_PO_DMD_IP_VW(SQL View) |
Index Back |
---|
SELECT A.BUSINESS_UNIT , A.PO_ID , A.LINE_NBR , A.SCHED_NBR , A.DISTRIB_LINE_NUM , C.BUSINESS_UNIT , C.DEMAND_SOURCE , C.SOURCE_BUS_UNIT , C.ORDER_NO , C.ORDER_INT_LINE_NO , C.SCHED_LINE_NBR , C.INV_ITEM_ID , C.DEMAND_LINE_NO , C.DESTIN_BU , C.BUSINESS_UNIT , D.HASH_KEY , E.DMD_ORDER_TYPE , C.SOURCE_BUS_UNIT %Concat X.PEG_KEY_SEPARATOR %Concat C.ORDER_NO , C.DEMAND_SOURCE %Concat X.PEG_KEY_SEPARATOR %Concat %NUMTOCHAR(C.ORDER_INT_LINE_NO) %Concat X.PEG_KEY_SEPARATOR %Concat %NUMTOCHAR(C.SCHED_LINE_NBR) %Concat X.PEG_KEY_SEPARATOR %Concat %NUMTOCHAR(C.DEMAND_LINE_NO) , C.QTY_REQUESTED_BASE - C.QTY_ALLOC_BASE - C.QTY_BACKORDER_BASE , SUM(E.QTY_PEGGED) , C.QTY_REQUESTED_BASE - C.QTY_ALLOC_BASE - C.QTY_BACKORDER_BASE , 'N' , %DatePart(C.SCHED_DTTM) , %TimePart(C.SCHED_DTTM) , C.SCHED_DTTM , 'N' , C.INTERUNIT_FLG FROM PS_PO_LINE_DISTRIB A , PS_PO_LINE L , PS_IN_DEMAND C , PS_IN_DEMAND_HASH D , PS_IN_PEGGING E , PS_INSTALLATION_IN X WHERE A.BUSINESS_UNIT = L.BUSINESS_UNIT AND A.PO_ID = L.PO_ID AND A.LINE_NBR = L.LINE_NBR AND A.DST_ACCT_TYPE = 'DST' AND NOT EXISTS ( SELECT 'X' FROM PS_PO_HASH PH , PS_IN_PEGGING IP WHERE PH.BUSINESS_UNIT = A.BUSINESS_UNIT AND PH.PO_ID = A.PO_ID AND PH.LINE_NBR = A.LINE_NBR AND PH.SCHED_NBR = A.SCHED_NBR AND PH.DISTRIB_LINE_NUM = A.DISTRIB_LINE_NUM AND IP.SUPPLY_HASH = PH.HASH_KEY AND IP.SUP_ORDER_TYPE = '010' AND IP.DEMAND_HASH = D.HASH_KEY AND IP.DMD_ORDER_TYPE IN ('030', '070', '090') AND IP.PEG_STATUS = '10') AND C.BUSINESS_UNIT = D.BUSINESS_UNIT AND C.DEMAND_SOURCE = D.DEMAND_SOURCE AND C.SOURCE_BUS_UNIT = D.SOURCE_BUS_UNIT AND C.ORDER_NO = D.ORDER_NO AND C.ORDER_INT_LINE_NO = D.ORDER_INT_LINE_NO AND C.SCHED_LINE_NBR = D.SCHED_LINE_NBR AND C.INV_ITEM_ID = D.INV_ITEM_ID AND C.DEMAND_LINE_NO = D.DEMAND_LINE_NO AND C.QTY_REQUESTED_BASE - C.QTY_ALLOC_BASE - C.QTY_BACKORDER_BASE > 0 AND C.IN_FULFILL_STATE = '20' AND A.BUSINESS_UNIT_IN = C.BUSINESS_UNIT AND L.INV_ITEM_ID = C.INV_ITEM_ID AND D.HASH_KEY = E.DEMAND_HASH AND E.DMD_ORDER_TYPE IN ('030', '070', '090') AND E.PEG_STATUS = '10' GROUP BY A.BUSINESS_UNIT, A.PO_ID, A.LINE_NBR, A.SCHED_NBR, A.DISTRIB_LINE_NUM, C.BUSINESS_UNIT, C.DEMAND_SOURCE, C.SOURCE_BUS_UNIT, C.ORDER_NO, C.ORDER_INT_LINE_NO, C.SCHED_LINE_NBR, C.INV_ITEM_ID, C.DEMAND_LINE_NO, C.DESTIN_BU, D.HASH_KEY, E.DMD_ORDER_TYPE, C.QTY_REQUESTED_BASE, C.QTY_ALLOC_BASE, C.QTY_BACKORDER_BASE, C.SCHED_DTTM, X.PEG_KEY_SEPARATOR, C.INTERUNIT_FLG |
# | PeopleSoft Field Name | PeopleSoft Field Type | Database Column Type | Description |
---|---|---|---|---|
1 | BUSINESS_UNIT_SUP | Character(5) | VARCHAR2(5) NOT NULL | 07/29/04 EGS: Created |
2 | PO_ID | Character(10) | VARCHAR2(10) NOT NULL | Purchase Order |
3 | LINE_NBR | Number(5,0) | INTEGER NOT NULL | Line Number: 11/24/08 - Added TARGET label [PC product] |
4 | SCHED_NBR | Number(3,0) | SMALLINT NOT NULL | Schedule Number |
5 | DISTRIB_LINE_NUM | Number(5,0) | INTEGER NOT NULL | Distribution Line |
6 | BUSINESS_UNIT | Character(5) | VARCHAR2(5) NOT NULL | Business Unit |
7 | DEMAND_SOURCE | Character(2) | VARCHAR2(2) NOT NULL |
Demand Source
IN=Material Request OM=Sales Order PL=Planning Requisition PO=Purchase Order PR=Purchasing Requisition RT=Material Return SF=Production Request WM=Work Order |
8 | SOURCE_BUS_UNIT | Character(5) | VARCHAR2(5) NOT NULL | Source Bus Unit |
9 | ORDER_NO | Character(10) | VARCHAR2(10) NOT NULL | Identifies a customer order number that appears as a reference on a receivables pending item. Date Initials Issue Description 022701 mv SP2 (F-CJORGENS-3) CSR Desktop |
10 | ORDER_INT_LINE_NO | Number(5,0) | INTEGER NOT NULL | Order Line |
11 | SCHED_LINE_NBR | Number(6,0) | INTEGER NOT NULL | Schedule Line Number |
12 | INV_ITEM_ID | Character(18) | VARCHAR2(18) NOT NULL | Item ID |
13 | DEMAND_LINE_NO | Number(4,0) | SMALLINT NOT NULL | Demand Line No |
14 | DESTIN_BU | Character(5) | VARCHAR2(5) NOT NULL | Destination Unit |
15 | BUSINESS_UNIT_IN | Character(5) | VARCHAR2(5) NOT NULL | Inventory Unit |
16 | PEG_HASH | Character(28) | VARCHAR2(28) NOT NULL | 07/29/04 EGS: Created |
17 | PEG_ORDER_TYPE | Character(4) | VARCHAR2(4) NOT NULL |
Used by Pegging Maintenance/Inquiry
010=Purchase 020=Production 030=Transfer Demand 035=Transfer Supply 070=Stock Request 090=Sales Order 100=Requisition 110=WO Inventory 115=WO Non-Inventory |
18 | PEG_ORDER_KEY | Character(30) | VARCHAR2(30) NOT NULL | Used to store the various Order Number formats in 1 field |
19 | PEG_LINE_KEY | Character(30) | VARCHAR2(30) NOT NULL | Used to Store the concatenation of Line, Demand, Sched, Kit, etc in 1 field. |
20 | QTY_AVAILABLE | Signed Number(17,4) | DECIMAL(15,4) NOT NULL | Qty Available |
21 | BAD_PEG_QTY | Signed Number(17,4) | DECIMAL(15,4) NOT NULL | Bad Pegged Quantity |
22 | QTY_ORDER | Signed Number(17,4) | DECIMAL(15,4) NOT NULL | 06/21/04 EGS: Created |
23 | PEG_FLAG | Character(1) | VARCHAR2(1) NOT NULL | 06/17/04 EGS: Created. |
24 | SCHED_DATE | Date(10) | DATE | Schedule Date |
25 | SCHED_TIME | Time(15) | TIMESTAMP | Schedule Time |
26 | SCHED_DTTM | DateTime(26) | TIMESTAMP | 08/16/01 JNW (CN#PL900-1.0): Added |
27 | HARD_PEG | Character(1) | VARCHAR2(1) NOT NULL | 09/01/04 EGS: Created |
28 | INTERUNIT_FLG | Character(1) | VARCHAR2(1) NOT NULL |
InterUnit
N=No Y=Yes |