SELECT D.OPRID , %Substring(C.DESCR254_MIXED , 1 , 30) , A.VENDOR_SETID , B.VENDOR_ID , A.BUSINESS_UNIT , BL.LANGUAGE_CD , C.INV_ITEM_ID , B.NAME1 FROM PS_PO_HDR_FS A , PS_VENDOR B , PS_PO_LINE_FS C , PS_VENDOR_USER D , PS_PO_LINE_SHIP_FS E , PS_VENDOR_LANG BL WHERE A.VENDOR_SETID = B.SETID AND A.VENDOR_ID = B.VENDOR_ID AND ((A.PO_STATUS IN ('D','X')) OR ((A.CHNG_ORD_BATCH > 0) AND (A.PO_STATUS IN ('A','PA','O'))) OR ((A.PO_STATUS = 'C') AND (A.MATCH_ACTION = 'N'))) AND A.ERS_ACTION = 'N' AND A.MATCH_STATUS_PO IN ('T','P','N') AND A.IN_PROCESS_FLG = 'N' AND A.MID_ROLL_STATUS = 'N' AND A.BUSINESS_UNIT = C.BUSINESS_UNIT AND A.PO_ID = C.PO_ID AND D.SETID = A.VENDOR_SETID AND D.VENDOR_ID = A.VENDOR_ID AND E.BUSINESS_UNIT = C.BUSINESS_UNIT AND E.PO_ID = C.PO_ID AND E.LINE_NBR = C.LINE_NBR AND E.MATCH_STATUS_LN_PO IN ('N', 'P') AND E.CANCEL_STATUS <> 'X' AND BL.SETID = B.SETID AND BL.VENDOR_ID = B.VENDOR_ID GROUP BY D.OPRID, C.DESCR254_MIXED, A.VENDOR_SETID, B.VENDOR_ID, C.INV_ITEM_ID, B.NAME1, A.BUSINESS_UNIT, BL.LANGUAGE_CD, A.CURRENCY_CD
|