Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BABI_BILLINGDOC_CREATEFROMDATA: Document does not exist Error

Former Member
0 Likes
1,210

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

2 REPLIES 2
Read only

Former Member
0 Likes
765

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.

Read only

0 Likes
765

Thanks for the reply.

I'll forward your suggestion to the developers and will let you know the outcome!

Regards,

Hesham