Fixing Stock Accounting Interface Errors for Deleted Stock Transactions

2 minute read time.
In the Anglo-Saxon accounting environment, parameter STO/ACC/ACCIFA (Accounting Interface) should never be set to Yes (2); if we are using stock accounting, it should be set to Yes (auto deletion) (3).
If we set this parameter to Yes, we will get errors when running the stock accounting interface and errors will not be cleared. To clear these errors, we have used below options, please contribute to this blog if you have any other suggestions:
For example, we need to process the validated/ deleted shipment due to errors in stock posting: Error: "STKSD Line4: AMT Error in Field Evaluation" , the only way to resolve the customers current state is to do:
  1. A manual journal entries for the deleted entries.
  2. When the customer manually creates journal entries, they will need to manually update AGGIFAFLG to 2 for these shipments in the STOJOU table. This indicates that the record has been accounted for in a Journal and will keep it clear from being picked up by future accounting interface runs.
  3. We would also recommend that you update GTE and NUMVCR. GTE is the journal that is affected and NUMVCR is the journal entry number. These are not required to keep from trying to be re-posted, but their presence will make it easier in the future to find where they accounted for the deletion and if it is blank, it could have an adverse effect on V12 PIT updates later.
For the future the customer will need to change the setting to Yes(Auto Deletion) if not this has the effect of making the stock accounting posting during the deletion process, both for the reversing movement, and for the original movement if not already posted. This posting takes place before the record deletion is committed, and therefore the auto-journal can still read fields of the Document line and CPTANALIN.

With set to just YES the deletion will take place, then at a later stage the original movement is processed via the accounting interface and the deleted records are no longer available. It does not affect “normal” movements – they will be posted in the next run of the Stock Accounting Interface.

By Document line, we are referring here to SMVTD (Misc movements), PRECEIPTD, PRETURND, SDELIVERYD, SRETURND, SINVOICED (direct invoice with stock movement)

Additional Notes:

This does not apply to Manufacturing (Parameter GPA/ACC/OPEIFA), because all tracking writes to the WIPCOST table as well as to STOJOU. In the WIP auto-journal, WIPCOST takes the place of the Document line or CPTANALIN. When a WIP transaction is deleted, a reversing entry is made in WIPCOST as well as STOJOU, and therefore these can post normally after the deletion.

Warning: Backup the Database and test the solution before applying to LIVE.