Information Systems:A/P Invoicing - Invoice Line Locked
Error number CF40206 (Order &1 line &2 is currently locked by &3) displayed by RPG program GCFR402(A/P invoice matching vs. goods rec trans).
This program calls GCFR434 (A/P inv matching - check goods reception line lock), which reads SROGRT (Goods reception transactions) for the PO number, and line number selected by invoice matching. If GWREFX (Reference number) is not either 0, or matching the A/P transaction in process, this error is issued.
A/P invoicing allocates a reference number for the invoice, puts it into the reference number field of all the goods reception transactions that are matched, then at the end, writes the transaction to the A/P file (SROLTA). If the process is interrupted, and the transaction is not written to SROLTA, GCFR434 will not allow the records in SROGRT to be selected again (they are locked).
The field GWREFX (labelled 'Ref no:') must be manually cleared, using Information Systems:DFU on file SR15GRT in library UP1480bfVA. (Press enter twice to get to the third page.)
An excerpt from Richard provides good background info regarding invoice matching:
When an A/P invoice is entered, and PO matching done the user is taken to a ‘matching screen’ where all the possible PO lines are displayed for matching to the supplier invoice. All the PO lines in the goods reception file SROGRT, that are displayed for matching are stamped with the reference number of the matching A/P invoice in the field GWREFX. The PO lines are effectively ‘locked’ from being matched by another user. If the user’s session ends before the batch is closed, then those lines remain locked. In Release 6 onwards a menu option was added called ‘Unlock all goods reception lines’. This clears out the values in GWREFX for all PO lines in the goods receptions file. SO it is best to make sure there are no open A/P invoices in a financial batch that are locking PO lines before this menu option is run.