I need to get completely rid of FI documents that somehow got corrupted and could not be rebuilt via SAP-supported utilities. There is an exact list of documents that are missing one or more item records in table BSEG. The financial aspect of this problem is dealt with accordingly, but now all table entries related to these corrupt documents must be removed from the database.
I was thinking of using a simple program that deletes all corresponding entries from BKPF, RFBLG and all the index tables (such as BSID, BSIK, BSIS and a bunch more). Trouble is that the database is huge and I'm afraid the not optimal access to these index tables via the usual document number, company code, fiscal year will take forever.
Any other thoughts about the best approach? I don't think using archiving would work because there are documents where we only have headers but no items, but index entries might still point to some non-existing items... a mess.
What other implications do I have to consider if I do the deletion like this?
Thanks for all ideas.