SELECT DISTINCT BU.BUSINESS_UNIT , VE.OPRID , BU.DESCR , BU.DESCRSHORT FROM PS_BUS_UNIT_TBL_FS BU , PS_VENDOR_USER VE WHERE EXISTS ( SELECT 'X' FROM PS_VCHR_HDR_QV QV , PS_SET_CNTRL_REC ST , PS_EM_AGREEMENT AG WHERE (AG.SETID = ST.SETID OR AG.SETID = ST.SETCNTRLVALUE) AND ST.RECNAME = 'EM_AGREEMENT' AND AG.EM_AGREE_BUYER = 'Y' AND AG.EM_AGREE_SELLER = 'Y' AND QV.BUSINESS_UNIT = ST.SETCNTRLVALUE AND QV.BUSINESS_UNIT = BU.BUSINESS_UNIT AND (AG.VENDOR_SETID = QV.VENDOR_SETID OR QV.VENDOR_SETID = ' ') AND AG.VENDOR_ID = QV.VENDOR_ID AND AG.VNDR_LOC = QV.VNDR_LOC AND QV.VCHR_SRC IN ('XML','SSI','DCM','EXL') AND AG.VENDOR_SETID = VE.SETID AND AG.VENDOR_ID = VE.VENDOR_ID)
|