SELECT A.BUSINESS_UNIT , A.VOUCHER_ID , A.VOUCHER_LINE_NUM , C.BUSINESS_UNIT_PO , C.PO_ID , C.LINE_NBR , C.BUSINESS_UNIT_RECV , C.RECEIVER_ID , C.RECV_LN_NBR , A.MATCH_CNTRL_ID , A.MATCH_RULE_ID , C.BUYER_ID FROM PS_AP_MTCH_EXCPTN A , PS_AP_MTCH_RULES B , PS_VCHR_MTCH_DETLS C , PS_VOUCHER D WHERE A.MATCH_RULE_ID = B.MATCH_RULE_ID AND A.PROCESS_INSTANCE = C.PROCESS_INSTANCE AND A.BUSINESS_UNIT = C.BUSINESS_UNIT AND A.VOUCHER_ID = C.VOUCHER_ID AND A.VOUCHER_LINE_NUM = C.VOUCHER_LINE_NUM AND A.BUSINESS_UNIT = D.BUSINESS_UNIT AND A.VOUCHER_ID = D.VOUCHER_ID AND D.VCHR_SRC <> 'SSI' AND NOT EXISTS ( SELECT 'X' FROM PS_MTCH_VCHR_WL VCHR , PSWORKLIST WL WHERE WL.BUSPROCNAME = 'MATCHING_ERRORS' AND WL.ACTIVITYNAME = 'ANALYZE MATCHING ERRORS' AND WL.EVENTNAME = 'Route Matching Errors' AND WL.WORKLISTNAME = 'Matching Errors' AND WL.BUSPROCNAME = VCHR.BUSPROCNAME AND WL.ACTIVITYNAME = VCHR.ACTIVITYNAME AND WL.EVENTNAME =VCHR.EVENTNAME AND WL.WORKLISTNAME = VCHR.WORKLISTNAME AND WL.INSTANCEID = VCHR.INSTANCEID AND WL.TRANSACTIONID = VCHR.TRANSACTIONID AND WL.INSTSTATUS IN (0,1) AND VCHR.BUSINESS_UNIT = A.BUSINESS_UNIT AND VCHR.VOUCHER_ID = A.VOUCHER_ID AND VCHR.VOUCHER_LINE_NUM = A.VOUCHER_LINE_NUM AND VCHR.MATCH_RULE_ID = A.MATCH_RULE_ID) UNION SELECT A.BUSINESS_UNIT , A.VOUCHER_ID , A.VOUCHER_LINE_NUM , '' , '' , 0 , '' , '' , 0 , A.MATCH_CNTRL_ID , A.MATCH_RULE_ID , '' FROM PS_AP_MTCH_EXCPTN A , PS_AP_MTCH_RULES B , PS_VOUCHER D WHERE A.MATCH_RULE_ID = B.MATCH_RULE_ID AND B.MTCH_RULE_LEVEL = 'HS' AND A.BUSINESS_UNIT = D.BUSINESS_UNIT AND A.VOUCHER_ID = D.VOUCHER_ID AND D.VCHR_SRC <> 'SSI' AND NOT EXISTS ( SELECT 'X' FROM PS_MTCH_VCHR_WL VCHR , PSWORKLIST WL WHERE WL.BUSPROCNAME = 'MATCHING_ERRORS' AND WL.ACTIVITYNAME = 'ANALYZE MATCHING ERRORS' AND WL.EVENTNAME = 'Route Matching Errors' AND WL.WORKLISTNAME = 'Matching Errors' AND WL.BUSPROCNAME = VCHR.BUSPROCNAME AND WL.ACTIVITYNAME = VCHR.ACTIVITYNAME AND WL.EVENTNAME = VCHR.EVENTNAME AND WL.WORKLISTNAME = VCHR.WORKLISTNAME AND WL.INSTANCEID = VCHR.INSTANCEID AND WL.TRANSACTIONID = VCHR.TRANSACTIONID AND WL.INSTSTATUS IN (0, 1) AND VCHR.BUSINESS_UNIT = A.BUSINESS_UNIT AND VCHR.VOUCHER_ID = A.VOUCHER_ID AND VCHR.VOUCHER_LINE_NUM = A.VOUCHER_LINE_NUM AND VCHR.MATCH_RULE_ID = A.MATCH_RULE_ID)
|