SCP_RPOSHP_V_FL

(SQL View)
Index Back

PO Line Ship View

Supplier PO Line Ship View

SELECT DISTINCT S.BUSINESS_UNIT , S.PO_ID , S.LINE_NBR , S.SCHED_NBR , H.PO_DT ,S.QTY_PO ,S.MERCHANDISE_AMT ,0 ,0 ,0 ,0 ,L.AMT_ONLY_FLG ,L.ITM_ID_VNDR , L.DESCR254_MIXED , L.UNIT_OF_MEASURE , H.PO_STATUS , H.VENDOR_ID , H.BUYER_ID , H.PYMNT_TERMS_CD , H.RECV_STATUS , H.BILL_LOCATION , H.CHNG_ORD_BATCH , H.VENDOR_SETID , H.VNDR_LOC , H.CURRENCY_CD , S.DUE_DT ,S.SHIPTO_ID ,%DateDiff(S.due_dt,%currentdatein) FROM PS_PO_HDR H , PS_PO_LINE L , PS_PO_LINE_SHIP S , PS_ITM_CAT_TBL C , PS_INSTALLATION_PO I , PS_PO_DISPATCHED D WHERE (H.PO_STATUS = 'D' OR (H.CHNG_ORD_BATCH > 0 AND H.PO_STATUS = 'D' )) AND H.BUDGET_HDR_STATUS NOT IN ('N', 'E') AND H.MID_ROLL_STATUS = 'N' AND H.BUSINESS_UNIT = D.BUSINESS_UNIT AND H.PO_ID = D.PO_ID AND H.vendor_id = D.vendor_id AND D.DATETIME_DISP = ( SELECT MAX(E.DATETIME_DISP) FROM PS_PO_DISPATCHED E WHERE H.PO_ID = E.PO_ID AND H.BUSINESS_UNIT = E.BUSINESS_UNIT) AND H.BUSINESS_UNIT = L.BUSINESS_UNIT AND H.PO_ID = L.PO_ID AND L.BUSINESS_UNIT = S.BUSINESS_UNIT AND L.PO_ID = S.PO_ID AND L.LINE_NBR = S.LINE_NBR AND L.CANCEL_STATUS = 'A' AND S.CANCEL_STATUS = 'A' AND S.SHIP_TO_CUST_ID = ' ' AND L.ITM_SETID = C.SETID AND L.CATEGORY_ID = C.CATEGORY_ID AND C.CATEGORY_TYPE = I.CATEGORY_TYPE AND L.RECV_REQ <> 'X' AND C.EFFDT = ( SELECT MAX(C2.EFFDT) FROM PS_ITM_CAT_TBL C2 WHERE C.SETID = C2.SETID AND C.CATEGORY_TYPE = C2.CATEGORY_TYPE AND C.CATEGORY_ID = C2.CATEGORY_ID AND C2.EFFDT <= %CurrentDateIn) AND ((L.AMT_ONLY_FLG = 'N' AND (S.QTY_PO > ( SELECT SUM(D.QTY_SH_NETRCV_VUOM) FROM PS_RECV_LN_SHIP D WHERE S.BUSINESS_UNIT = D.BUSINESS_UNIT_PO AND S.PO_ID = D.PO_ID AND S.LINE_NBR = D.LINE_NBR AND S.SCHED_NBR = D.SCHED_NBR AND D.RECV_SHIP_STATUS <> 'X'))) OR (L.AMT_ONLY_FLG = 'Y' AND (%Abs(S.MERCHANDISE_AMT) > ( SELECT %Abs(SUM(E.MERCHANDISE_AMT)) FROM PS_RECV_LN_SHIP E WHERE S.BUSINESS_UNIT = E.BUSINESS_UNIT_PO AND S.PO_ID = E.PO_ID AND S.LINE_NBR = E.LINE_NBR AND S.SCHED_NBR = E.SCHED_NBR AND E.RECV_SHIP_STATUS <> 'X'))) OR NOT EXISTS ( SELECT 'X'FROM PS_RECV_LN_SHIP D WHERE S.BUSINESS_UNIT = D.BUSINESS_UNIT_PO AND S.PO_ID = D.PO_ID AND S.LINE_NBR = D.LINE_NBR AND S.SCHED_NBR = D.SCHED_NBR AND D.RECV_SHIP_STATUS <> 'X')) AND NOT EXISTS ( SELECT 'X' FROM PS_PO_LN_SHIP_EXS IL WHERE S.BUSINESS_UNIT = IL.BUSINESS_UNIT AND S.PO_ID = IL.PO_ID AND S.LINE_NBR = IL.LINE_NBR AND S.SCHED_NBR = IL.SCHED_NBR AND IL.EXS_TAX_TXN_TYPE = 'DIMP')

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 BUSINESS_UNIT_PO Character(5) VARCHAR2(5) NOT NULL PO Business Unit
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 PO_DT Date(10) DATE Date
6 QTY_PO Number(16,4) DECIMAL(15,4) NOT NULL Purchase Order Quantity
7 MERCHANDISE_AMT Signed Number(28,3) DECIMAL(26,3) NOT NULL Merchandise Amt F_KDHIL_R87H8 062804 MLM: Added new Line Amount Received Label
8 MERCHANDISE_AMT_LN Signed Number(28,3) DECIMAL(26,3) NOT NULL Merchandise Amt
9 QTY_SH_NETRCV_VUOM Number(16,4) DECIMAL(15,4) NOT NULL Net Receipt Quantity
10 QTY_OPEN Number(16,4) DECIMAL(15,4) NOT NULL Open Quantity
11 AMT_OPEN Signed Number(28,3) DECIMAL(26,3) NOT NULL Open Amount
12 AMT_ONLY_FLG Character(1) VARCHAR2(1) NOT NULL Amount Only
N=No
Y=Yes
13 ITM_ID_VNDR Character(50) VARCHAR2(50) NOT NULL Vendor Item ID
14 DESCR254_MIXED Character(254) VARCHAR2(254) NOT NULL Description
15 UNIT_OF_MEASURE Character(3) VARCHAR2(3) NOT NULL Used on an approval rule set.
MHR=Muti Hourly
PER=Percentage
SQF=Square Footage
16 PO_STATUS Character(2) VARCHAR2(2) NOT NULL PO Status
A=Approved
C=Complete
D=Dispatched
DA=Denied
I=Initial
LD=Line Denied
O=Open
PA=Pending Approval/Approved
PX=Pending Cancel
X=Canceled
17 VENDOR_ID Character(10) VARCHAR2(10) NOT NULL Vendor Identifier
18 BUYER_ID Character(30) VARCHAR2(30) NOT NULL Buyer
19 PYMNT_TERMS_CD Character(5) VARCHAR2(5) NOT NULL Specifies how the payment due date and discount due date are calculated. A payment terms code is associated with various business units bill-to customers vendors as well as sales orders purchase orders and vouchers.
20 RECV_STATUS Character(1) VARCHAR2(1) NOT NULL Receipt Status
C=Closed Receipt
H=Hold Receipt
M=Moved to Destination
N=PO Not Received
O=Open
P=PO Partially Received
R=Fully Received
X=Canceled
21 BILL_LOCATION Character(10) VARCHAR2(10) NOT NULL Billing Location
22 CHNG_ORD_BATCH Number(3,0) SMALLINT NOT NULL Change Order Number
23 VENDOR_SETID Character(5) VARCHAR2(5) NOT NULL Vendor SetID
24 VNDR_LOC Character(10) VARCHAR2(10) NOT NULL Vendor Location
25 CURRENCY_CD Character(3) VARCHAR2(3) NOT NULL Currency Code
26 DUE_DT Date(10) DATE Specifies the date that a transaction is due. It is a generic field used in multiple PeopleSoft applications including Receivables Payables and Purchasing. For example it represents the date that payment is due for a voucher or the date that a scheduled shipment is due to be received.
27 SHIPTO_ID Character(10) VARCHAR2(10) NOT NULL Ship To Location

Prompt Table: SHIPTO_TBL
Set Control Field: BUSINESS_UNIT_PO

28 DAYS Number(6,0) INTEGER NOT NULL Days