I have seen this error message when it pertains to missing Header or Detail records for the Transactions that are in the batch.
Could you try to print the Batch Edit List from the Inventory Batch Entry Window? I suspect that there are incomplete records. You will need to take note of the Items on this list. You will be running an Inventory Reconcile on these Items after you remove the records from the IV10000, IV10001, and SY00500.
Here are the steps that you can follow to resolve the issue:
1. Make a backup of the Company database.
2. Run the following SQL scripts in Query Analyzer against the Company database:
SELECT * from IV10000 where BACHNUMB = 'XXX'
SELECT * from IV10001 where IVDOCNBR in (SELECT IVDOCNBR from IV10000 where BACHNUMB = 'XXX')
The IV10000 (Inventory Transaction Work) table holds the header information of the IV transaction while the IV10001 (Inventory Transaction Amounts Work) holds the line item information.
If you can see that this is the transaction information that you would like to delete, then please run these DELETE statements:
DELETE IV10001 where IVDOCNBR in (SELECT IVDOCNBR from IV10000 where BACHNUMB = 'XXX')
DELETE IV10000 where BACHNUMB = 'XXX'
3. To query on the batch record in SY00500 (Batch Header), please run this script :
SELECT * from SY00500 where BACHNUMB = 'XXX'
Is this the Batch ID record that you would like to delete? If yes, then run this DELETE statement:
DELETE SY00500 where BACHNUMB = 'XXX' and DEX_ROW_ID=XXX
Note: Please substitute in XXX with the correct DEX_ROW_ID value of this batch in SY00500 table.
4. Pull up the Inventory Batch Entry window to see if the Batch was removed.
5. Run Inventory Reconcile by going to MDGP | Tools | Utilities | Inventory | Reconcile and select the range of items found on the transactions in the batch in question to correct their allocation.