SELECT A.BUSINESS_UNIT , A.VOUCHER_ID , VL.LANGUAGE_CD , VL.VENDOR_NAME_SHORT , OPL.OPRDEFNDESC FROM %Table(APOP_VCHRDI2_VW) A , %Table(VENDOR_LANG) VL , %Table(PSOPRDEFN_LANG) OPL WHERE VL.SETID = A.VENDOR_SETID AND VL.VENDOR_ID = A.VENDOR_ID AND OPL.OPRID = A.OPRID AND VL.LANGUAGE_CD = OPL.LANGUAGE_CD UNION SELECT A.BUSINESS_UNIT , A.VOUCHER_ID , VL.LANGUAGE_CD , VL.VENDOR_NAME_SHORT , OP.OPRDEFNDESC FROM %Table(APOP_VCHRDI2_VW) A , %Table(VENDOR_LANG) VL , %Table(OPRID_VW) OP WHERE VL.SETID = A.VENDOR_SETID AND VL.VENDOR_ID = A.VENDOR_ID AND OP.OPRID = A.OPRID AND NOT EXISTS ( SELECT 'X' FROM %Table(PSOPRDEFN_LANG) OPL WHERE OPL.OPRID = A.OPRID AND OPL.LANGUAGE_CD = VL.LANGUAGE_CD ) UNION SELECT A.BUSINESS_UNIT , A.VOUCHER_ID , OPL.LANGUAGE_CD , V.VENDOR_NAME_SHORT , OPL.OPRDEFNDESC FROM %Table(APOP_VCHRDI2_VW) A , %Table(VENDOR) V , %Table(PSOPRDEFN_LANG) OPL WHERE V.SETID = A.VENDOR_SETID AND V.VENDOR_ID = A.VENDOR_ID AND OPL.OPRID = A.OPRID AND NOT EXISTS ( SELECT 'X' FROM %Table(VENDOR_LANG) VL WHERE VL.SETID = A.VENDOR_SETID AND VL.VENDOR_ID = A.VENDOR_ID AND VL.LANGUAGE_CD = OPL.LANGUAGE_CD )
|