SELECT DISTINCT H.setid , H.VENDOR_SETID , H.vendor_id , V.vendor_name_short FROM PS_CS_DOC_HDR A , PS_CS_DOC_PO_KEYS B , PS_CNTRCT_HDR H , PS_VENDOR V WHERE A.CS_SOURCE_TRANS = '02' AND A.CS_IMPORT_CODE = '1' AND A.CS_DOC_BLD_STATUS = '1' AND B.CS_DOC_ID = A.CS_DOC_ID AND H.SETID = B.SETID AND H.CNTRCT_ID = B.CNTRCT_ID AND V.SETID = H.VENDOR_SETID AND V.VENDOR_ID = H.VENDOR_ID AND V.VENDOR_STATUS = 'A' AND V.VENDOR_PERSISTENCE <> 'S' AND EXISTS( SELECT 'X' FROM PS_CS_DOC_FILES F WHERE F.CS_DOC_ID = A.CS_DOC_ID AND F.CS_DOC_TYPE = '001')
|