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: 

Invoice Posting - Document not created

former_member223133
Active Participant
0 Kudos
1,331

Hi,

I'm using BAPI_INCOMINGINVOICE_CREATE to create an invoice with reference to Purchase Order. We are facing below 2 issues.

  • When trying to create an invoice through SE37, Invoice created but document not found in the database.
  • When trying to create through program using above BAPI, it is returning PO does not exist.

Code:

* Header
headerdata-invoice_ind = 'X'.
headerdata-doc_date    = '11.02.2014'.
headerdata-pstng_date  = '11.02.2014'.
headerdata-comp_code  = '1000'.
headerdata-currency = 'USD'.
headerdata-gross_amount = '50.0000'.

* Item
ls_itemdata-invoice_doc_item = '000001'.
ls_itemdata-po_number        = '10000001'.
ls_itemdata-po_item          = '00010'.
ls_itemdata-tax_code = 'V0'.
ls_itemdata-item_amount = '50.0000'.
ls_itemdata-quantity = '15.000'.
ls_itemdata-po_unit = 'EA'.
APPEND ls_itemdata TO itemdata.


CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
   EXPORTING
     headerdata          = headerdata
*   ADDRESSDATA         =
   IMPORTING
     invoicedocnumber    = invoicedocnumber
     fiscalyear          = fiscalyear
   TABLES
     itemdata            = itemdata
*   ACCOUNTINGDATA      =
*   GLACCOUNTDATA       =
*   MATERIALDATA        =
*   TAXDATA             =
*   WITHTAXDATA         =
*   VENDORITEMSPLITDATA =
     return              = return.
*   EXTENSIONIN         =
*   TM_ITEMDATA         =
*   NFMETALLITMS        =

Please help us to resolve these issues.

Thanks

Gangadhar

7 REPLIES 7

venkat_aileni
Contributor
0 Kudos
791

Hi-

1. You are not able to find Created Invoice in DB because you need to call BAPI 'BAPI_TRANSACTION_COMMIT' explicitly.

2. PO does not exist: Have you checked your PO via ME22N/ME23N? If it's not available provide a valid PO. Else in your code use Conversion Exit for 'EBELN' (CONVERSION_EXIT_ALPHA_INPUT) and pass this value to BAPI.

Thanks,

Venkat

0 Kudos
791

Hi Venkat,

Thanks for your reply.


1. You are not able to find Created Invoice in DB because you need to call BAPI 'BAPI_TRANSACTION_COMMIT' explicitly.

Yes. I have used BAPI_TRANSACTION_COMMIT for commit.


2. PO does not exist: Have you checked your PO via ME22N/ME23N? If it's not available provide a valid PO. Else in your code use Conversion Exit for 'EBELN' (CONVERSION_EXIT_ALPHA_INPUT) and pass this value to BAPI.

Yes. PO is valid.

Thanks

Gangadhar

0 Kudos
791

In your code have you used 'CONVERSION_EXIT_ALPHA_INPUT' for PO?

0 Kudos
791

Hi Venkat,

As suggested, I have used CONVERSION_EXIT_ALPHA_INPUT. No second issue resolved.


Thanks

Gangadhar

Former Member
0 Kudos
791

Hi Gangadhar!!!

Through BAPI though the document get generated, it wont appear in the database.

Coming to the next issue, please check the PO exist or not and whether it is deleted or locked.

Regards,

PS

Former Member
0 Kudos
791

Hi Gangadhar,

Did you check the update log in SM13. Sometimes update gets deactivated in SM14 due to too many requests in update queue ( very rarely ). Also check SM21 and ST22.

Regards,

DPM

former_member223133
Active Participant
0 Kudos
791

Hi,

There is an issue with the passing of mandatory parameters. Now issue is resolved.

Thank you all for your inputs.

Regards

Gangadhar