SELECT A.SETID , A.INV_ITEM_ID , REQ.BUSINESS_UNIT , REQ.REQ_ID , REQ.LINE_NBR , REQ.VENDOR_SETID , REQ.VENDOR_ID FROM PS_REQ_LINE REQ ,PS_MASTER_ITEM_TBL A , PS_PV_PERF_VNDR_VW B , PS_PURCH_ITEM_ATTR F WHERE REQ.INV_ITEM_ID = A.INV_ITEM_ID AND REQ.ITM_SETID = A.SETID AND REQ.INV_ITEM_ID = B.INV_ITEM_ID AND REQ.ITM_SETID = B.SETID AND REQ.VENDOR_SETID = B.VENDOR_SETID AND REQ.VENDOR_ID = B.VENDOR_ID AND A.SETID = F.SETID AND A.INV_ITEM_ID = F.INV_ITEM_ID AND ((%CurrentDateIn >= F.PO_AVAIL_DT) AND (F.PO_UNAVAIL_DT > %CurrentDateIn )) AND A.INV_ITEM_ID NOT IN( SELECT INV_ITEM_ID FROM PS_MASTER_ITEM_TBL WHERE A.ITM_STAT_DT_FUTURE <= %CurrentDateIn AND A.ITM_STATUS_FUTURE <> '1') AND A.ITM_STATUS_CURRENT = '1'
|