PO_ATTNTO_VW

(SQL View)
Index Back

PO Line Accounting Entries

PO Line Accounting Entries

SELECT A.BUSINESS_UNIT , A.PO_ID , A.LINE_NBR , A.SCHED_NBR , A.ATTN_TO FROM PS_PO_LINE_DISTRIB A WHERE A.DISTRIB_LINE_NUM = ( SELECT MIN(DISTRIB_LINE_NUM) FROM PS_PO_LINE_DISTRIB C WHERE DISTRIB_LN_STATUS <> 'X' AND A.BUSINESS_UNIT = C.BUSINESS_UNIT AND A.PO_ID = C.PO_ID AND A.LINE_NBR = C.LINE_NBR AND A.SCHED_NBR = C.SCHED_NBR ) AND NOT EXISTS ( SELECT 'X' FROM PS_PO_LINE_DISTRIB B WHERE A.BUSINESS_UNIT = B.BUSINESS_UNIT AND A.PO_ID = B.PO_ID AND A.LINE_NBR = B.LINE_NBR AND A.SCHED_NBR = B.SCHED_NBR AND A.ATTN_TO <> B.ATTN_TO AND B.DISTRIB_LINE_NUM > ( SELECT MIN(DISTRIB_LINE_NUM) FROM PS_PO_LINE_DISTRIB E WHERE E.DISTRIB_LN_STATUS<>'X' AND E.BUSINESS_UNIT = B.BUSINESS_UNIT AND E.PO_ID = B.PO_ID AND E.LINE_NBR = B.LINE_NBR AND E.SCHED_NBR = B.SCHED_NBR ) AND B.DISTRIB_LN_STATUS<>'X')

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 BUSINESS_UNIT Character(5) VARCHAR2(5) NOT NULL 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 ATTN_TO Character(30) VARCHAR2(30) NOT NULL Attention