BAPI_INCOMINGINVOICE_CREATE Does Not Work Properly

Hello everyone… I am currently developing a bot to record invoices in SAP similar to those that would be recorded with the MIRO transaction. I am generating 3 data tables: HeaderData, ItemData, TaxData. I make the BAPI_INCOMINGINVOICE_CREATE call and pass the 3 data tables as parameters, the BAPI returns the fiscal year and the SAP document number, but it does not generate any record in the SAP Database. I have tried to query through the BAPI_INCOMINGINVOICE_GETLIST, also through the BAPI_INCOMINGINVOICE_GETDETAIL and also through the SAP MIRO transaction and I do not get any records… Thank you very much for any help you can give me.

Hey @boa, welcome to community,

The BAPI_INCOMINGINVOICE_CREATE successfully validates and creates a temporary invoice, which is why it returns a document number. However, it doesn’t save the record to the database. To finalize and persist the invoice, you must call the BAPI_TRANSACTION_COMMIT function module immediately after the creation BAPI. This separate call is essential for the transaction to be committed to the SAP database, making the invoice visible in MIRO and other related transactions. Without the COMMIT BAPI, the temporary document is discarded, and no record is generated.

Hope this will help

Thanks @Mir.Jasimuddin, yes, after the call to BAPI_INCOMINGINVOICE_CREATE1, within the same SAP SCOPE, immediately below, I call BAPI_TRANSACTION_COMMIT, however, although BAPI CREATE returns the fiscal year and the SAP number, I do not obtain the records from the SAP database… I have consulted with the MIRO transaction, with BAPI_INCOMINGINVOICE_GETLIST and with BAPI_INCOMINGINVOICE_GETDETAIL and I do not obtain results.

Maybe this error is made by UiPath development team :sweat_smile:
I tried to find a solution on the internet but failed. Coincidentally, I captured the discrepancy between local panel and property panel as below.
When I set the StatefulConnection to True, SAP shows the posted records.