‎2009 Sep 22 12:21 PM
Hi all,
We are using an enhancement point in the include Mv45AF0B_BELEG_INITIALISIEREN to automatically create the billing document when the Sales Order is created. We are calling the BAPI_BILLINGDOC_CREATEFROMDATA within this.
The issue we have is that sometimes the billing document is created and sometimes it is not! It is very intermittent. We found out while debugging, the delay in the program exection results in more success than failure.
After allding error logging, we get a Document does not exist error, MEssage no. VF001
Diagnosis
The document does not exist. It was possibly not posted and therefore cannot be read from the database
Procedure
Repeat the transaction at a later time.
I would really appreciate if anyone can shed some light on why this happening and possible things we can do to resolve this.
Thanks & Regards,
Hesham
‎2009 Oct 12 11:04 AM
Hello,
Use the function module CALL FUNCTION 'AM_PING_AND_WAIT'
i.e.
CALL FUNCTION 'AM_PING_AND_WAIT'
EXPORTING
I_SECONDS = 2
IMPORTING
E_RETURN = v_retn.
This error that you have mentioned is system error and unable to commit due to the system response. my suggestion is not to use the BAPI to create the billing documents, this creates and unneccasary commit of all the dialog process in the update task instead use the
CALL FUNCTION 'RV_INVOICE_CREATE_BACKGROUND' IN UPDATE TASK
EXPORTING
i_refdoc = v_vbeln
i_reftype = v_vbtyp.
This is what is required to do in the system.
‎2009 Oct 21 2:55 PM
Thanks for the reply.
I'll forward your suggestion to the developers and will let you know the outcome!
Regards,
Hesham