Question / Problem:
This issue happens sporadically, is usually isolated to one or two documents, and to date we have not been able to recreate the scenario. We have seen the issue occur during when posting documents through Repetitor where the documents with the issue are not consecutive. So far, we have not seen any related dump in /ST22, no evidence of an issue in any application server logs or in /SM13, and no way to determine what error condition occurred in SAP to prevent the document from being created.
Answer / Solution:
As of this writing, there is no solution available. This issue is due to a failed update task on the SAP side. A connection is established with SAP that allows the PD document to post, but the SAP system fails when creating the SAP document. In many cases, application server logs can help determine the root cause.
SAP document creation is triggered "In Update task.” This means, when we trigger the BAPI call to create the SAP document, SAP will first perform all validations. If no issue is found, SAP allocates a number from the number range and returns a success message. This sounds like the sap document has been already created, but this is not what really happens.
SAP allocates the number from the number range, but the actual SAP document creation is queued and executed in the Update task. If there is a problem with SAP, the UPDATE task will fail, and SAP document creation will be aborted (even though the number has been allocated and already provided to PD).
PD is not aware of the fact that the Update task fails (as it already has a success message), and document in PD remains in "Posted" status with reference to an SAP document that was never created.
If you do not delete the entries in SM13 on a regular basis, you may be able to repeat the update process to assign the SAP document number. Go to transaction SM13 and check for update records found in error. Then repeat the update (see screenshot below).
There is a report (/cockpit/post_crash_status_upd (/se38)) that was first available with PD AP 7.6 that will find documents with failed update tasks. It allows you to select a Client ID, a Company Code range, a document number, a Document Date range, and/or a User range. This report presents a list of documents and allows you to update the document(s). If you click the button to "Update PD AP doc's," this will remove the link to the SAP invoice that does not exist and set the PD AP document to error status so you can then re-process the document.
|Process Director Accounts Payable||All||Troubleshooting|