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

BAPI_INCOMINGINVOICE_CREATE

Former Member
0 Likes
2,116

Hi , Gurus ,

I have a prorgam that uses a bapi : BAPI_INCOMINGINVOICE_CREATE . Now ,this is being run in a loop for the same PO but different service entry sheets . THe problem occurs after the first pass. The BAPI is internally calling a function module : ME_READ_HISTORY_HEADER which maintaines a history internal table. On the first pass this table is empty , so the selection from ekbe and other tables work and the service entry sheet is validated against the PO .

On the second pass however , the history internal table within the function module ME_READ_HISTORY_HEADER is still storing the old values , and it does not allow to retrieve the new SES , as a result the PO and SES do not match and there is an error. How can I solve this.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,401

Hi

Pls refer to OSS note

Note 383895 - BAPI_INCOMINGINVOICE_CREATE: Error M8607

It may give some idea.

Pls take opinion from SAP / Basis before implementing the note

Regards

Madhan D

5 REPLIES 5
Read only

Former Member
0 Likes
1,401

Hi

Pls let me know, what is the error message you are getting in the return table

Regards

Madhan D

Read only

0 Likes
1,401

Hi

I get the following error message :

SE 22 (Entry sheet & does not belong to purchase order & &). So its a mesmatch between PO and entry sheet , because the entry sheet created after the first pass is not present the history internal table .

Read only

0 Likes
1,401

Hi Krish

I am facing exactly the same error because of the same cause. We transfer the shipment cost document for each freight invoice and this creates a new SES for the same PO. If run all the freight invoice IDOCs all at once, first IDOC gets posted successfully and all others fails with the Entry Sheet does not match the PO error. Were you able to solve it? It would be great if you could share us the solution.

FYI, the freight invoice IDOC FM is a custom one calling the BAPI_INCOMINGINVOICE_CREATE .

Thanks, Raj

Read only

Former Member
0 Likes
1,401

hi..

check whether u have clear/refreshed the tables.

CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
      EXPORTING
        headerdata       = is_header
      IMPORTING
        invoicedocnumber = is_output1-docno
        fiscalyear       = w_gjahr
      TABLES
        itemdata         = it_itemdata
        glaccountdata    = it_glaccountdata
        withtaxdata      = it_withtaxdata
        return           = it_return.

    IF is_output1-docno IS NOT INITIAL.

      CLEAR is_return.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = c_x.
    endif.

CLEAR is_header.
CLEAR w_item_no.
CLEAR w_tot_servtx.
CLEAR w_tot_ecess.
REFRESH it_itemdata.
REFRESH it_withtaxdata.
REFRESH it_glaccountdata.

regards,

Padma

Edited by: Padmashree RamMaghenthar on Nov 18, 2008 11:06 AM

Read only

Former Member
0 Likes
1,402

Hi

Pls refer to OSS note

Note 383895 - BAPI_INCOMINGINVOICE_CREATE: Error M8607

It may give some idea.

Pls take opinion from SAP / Basis before implementing the note

Regards

Madhan D