PV_RECV_REQ_VW(SQL View) |
Index Back |
---|
SELECT A.REQ_ID ,A.BUSINESS_UNIT , A.REQUESTOR_ID , A.OPRID_ENTERED_BY , A.REQ_STATUS FROM PS_REQ_HDR A WHERE A.REQ_STATUS = 'A' AND EXISTS ( SELECT 'X' FROM PS_PO_LINE_DISTRIB D ,PS_PO_HDR PO WHERE A.BUSINESS_UNIT = D.BUSINESS_UNIT_REQ AND A.REQ_ID = D.REQ_ID AND D.BUSINESS_UNIT_REQ = A.BUSINESS_UNIT AND D.BUSINESS_UNIT = PO.BUSINESS_UNIT AND D.PO_ID = PO.PO_ID AND (PO.PO_STATUS = 'D' OR (PO.CHNG_ORD_BATCH > 0 AND PO.PO_STATUS = 'A')) AND PO.RECV_STATUS <> 'R' AND (EXISTS ( SELECT 'X' FROM PS_PO_LINE POLINE WHERE POLINE.BUSINESS_UNIT = D.BUSINESS_UNIT AND POLINE.PO_ID = D.PO_ID AND POLINE.LINE_NBR = D.LINE_NBR AND POLINE.CANCEL_STATUS <> 'X')) AND ( EXISTS ( SELECT 'X' FROM PS_PV_RECV_REMAIN RMN WHERE RMN.BUSINESS_UNIT_PO = D.BUSINESS_UNIT AND RMN.PO_ID = D.PO_ID AND RMN.LINE_NBR = D.LINE_NBR AND RMN.SCHED_NBR = D.SCHED_NBR AND RMN.REMAIN_RCPT_QTY > 0) OR D.QTY_PO > ( SELECT SUM(QTY_SH_NETRCV_VUOM) FROM PS_RECV_LN_SHIP R WHERE R.BUSINESS_UNIT_PO = D.BUSINESS_UNIT AND R.PO_ID = D.PO_ID AND R.LINE_NBR = D.LINE_NBR AND R.SCHED_NBR = D.SCHED_NBR AND R.RECV_SHIP_STATUS <> 'X' AND EXISTS ( SELECT 'X' FROM PS_PO_LINE LN WHERE LN.BUSINESS_UNIT = D.BUSINESS_UNIT AND LN.PO_ID = D.PO_ID AND LN.LINE_NBR = D.LINE_NBR AND LN.AMT_ONLY_FLG <> 'Y' AND LN.CANCEL_STATUS <> 'X') ) OR EXISTS ( SELECT 'X' FROM PS_REQ_LINE LN WHERE LN.BUSINESS_UNIT = D.BUSINESS_UNIT_REQ AND LN.REQ_ID = D.REQ_ID AND LN.LINE_NBR = D.REQ_LINE_NBR AND LN.MERCHANDISE_AMT > ( SELECT SUM(PRICE_PO) FROM PS_RECV_LN_SHIP R WHERE R.BUSINESS_UNIT_PO = D.BUSINESS_UNIT AND R.PO_ID = D.PO_ID AND R.LINE_NBR = D.LINE_NBR AND R.SCHED_NBR = D.SCHED_NBR AND R.RECV_SHIP_STATUS <> 'X' AND EXISTS ( SELECT 'X' FROM PS_PO_LINE LN WHERE LN.BUSINESS_UNIT = D.BUSINESS_UNIT AND LN.PO_ID = D.PO_ID AND LN.LINE_NBR = D.LINE_NBR AND LN.AMT_ONLY_FLG = 'Y' AND LN.CANCEL_STATUS <> 'X') ) ) OR NOT EXISTS ( SELECT 'X' FROM PS_RECV_LN_SHIP R WHERE R.BUSINESS_UNIT_PO = D.BUSINESS_UNIT AND R.PO_ID = D.PO_ID AND R.LINE_NBR = D.LINE_NBR AND R.SCHED_NBR = D.SCHED_NBR AND R.RECV_SHIP_STATUS <> 'X' ) ) ) |
# | PeopleSoft Field Name | PeopleSoft Field Type | Database Column Type | Description |
---|---|---|---|---|
1 | REQ_ID | Character(10) | VARCHAR2(10) NOT NULL |
Requisition ID
Default Value: NEXT |
2 | BUSINESS_UNIT | Character(5) | VARCHAR2(5) NOT NULL | Business Unit |
3 | REQUESTOR_ID | Character(30) | VARCHAR2(30) NOT NULL |
Requestor id
Default Value: OPR_DEF_TBL_PM.REQUESTOR_ID Prompt Table: %EDITTABLE16 |
4 | OPRID_ENTERED_BY | Character(30) | VARCHAR2(30) NOT NULL | Entered By 07/25/2011 MRAD 12383033 :Ensured that OPRID_ENTERED_BY is set with format type of MixedCase. 03/22/2013 GL 16482301: Switched OPRID_ENTERED_BY back to MixedCase again. Please don't change it to UpperCase!!! FYI - The alternatives to use a User ID as uppercase: 1) Create your own User ID, add comments in the Field Properties, and fill out the Owner ID 2) Use %Upper meta-SQL in SQL statements 3) Use Upper function in peoplecodes |
5 | REQ_STATUS | Character(4) | VARCHAR2(4) NOT NULL |
Req status
A=Approved C=Complete D=Denied I=Initial LA=Line Approved O=Open P=Pending Approval V=Preview X=Canceled |