2014 Feb 11 8:07 AM
Hi,
I'm using BAPI_INCOMINGINVOICE_CREATE to create an invoice with reference to Purchase Order. We are facing below 2 issues.
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
2014 Feb 11 8:23 AM
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
2014 Feb 11 8:28 AM
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
2014 Feb 11 8:31 AM
In your code have you used 'CONVERSION_EXIT_ALPHA_INPUT' for PO?
2014 Feb 11 8:53 AM
Hi Venkat,
As suggested, I have used CONVERSION_EXIT_ALPHA_INPUT. No second issue resolved.
Thanks
Gangadhar
2014 Feb 11 8:38 AM
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
2014 Feb 11 8:53 AM
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
2014 Feb 11 9:02 AM
Hi,
There is an issue with the passing of mandatory parameters. Now issue is resolved.
Thank you all for your inputs.
Regards
Gangadhar