As Mark said, you would start with tfacp200 as your 'driving' table and using the Document Type and Number as key, fetch the tdpur046 records based on that table's secondary key.
But the issue is that these set of records sometime (very rarely) break in strange ways. SO, you can have a tfacp200 record which satisfies let us say three purchase order receipts, but only two purchase order invoice records (tdpur046) are created. So it is not merely a matter of whether the tdpur046 record exists or not, but whether the SUM of amounts of tdpur046 match the amount of the tfacp200 record. Of course, when selecting records from tfacp200, you have to pick the records where the second document type and number are blank and zero, as the records in which the second document number, etc. is filled in represent those tfacp200 records related to say payments or adjustments and such.
For us at least, this was quite an expensive report to run unless properly constrained - so we had additional constraints like say analyze only one vendor at a time (since usually, the issue would have been raised by a particular vendor.) Once a year, we would run the complete report to 'repair' anything remaining.
Last edited by shah_bs : 13th February 2017 at 03:02.