‎2008 Nov 17 7:56 PM
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.
‎2008 Nov 18 5:40 AM
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
‎2008 Nov 18 5:24 AM
Hi
Pls let me know, what is the error message you are getting in the return table
Regards
Madhan D
‎2008 Nov 18 4:18 PM
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 .
‎2012 Jan 28 12:41 PM
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
‎2008 Nov 18 5:35 AM
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
‎2008 Nov 18 5:40 AM
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