Just a small warning about this - the last check date field is exactly what it says - last CHECK date. If you paid your vendor with a credit card or cash after the last time you cut them a check, this date will not reflect the last payment, only the last check. So if you want the last payment date, regardless of the type of payment, and assuming you're only looking at posted payments, you could use the following code:
select VENDORID Vendor_ID, max(DOCDATE) Last_Payment
from (select VENDORID, DOCDATE
from PM30200 --historical trx
-- only look at payments and ignore voids
where DOCTYPE = 6 AND VOIDED = 0
union
select VENDORID, DOCDATE
from PM20000 --posted but open trx
-- only look at payments and ignore voids
where DOCTYPE = 6 AND VOIDED = 0) a
group by VENDORID