on 2021 Nov 12 6:06 AM
Hello SAP experts,
I'm using BAPI_INCOMINGINVOICE_CREATE to create an invoice with reference to Purchase Order. We are facing below issues.
When trying to create an invoice with below code, There is no error but invoice number is not getting generated.
Code:
* Header
WA_HEADER-INVOICE_IND = 'X'.
WA_HEADER-DOC_TYPE = 'RE'.
WA_HEADER-DOC_DATE = SY-DATUM. "Document date
WA_HEADER-PSTNG_DATE = SY-DATUM. "Posting date
WA_HEADER-REF_DOC_NO = 'Test'. "Ref doc. No.
WA_HEADER-COMP_CODE = '1000'. "Company Code
WA_HEADER-GROSS_AMOUNT = '5000'. "Gross amount(aft. tax) for the invoice
WA_HEADER-CURRENCY = 'INR'. "Currency Field
WA_HEADER-INV_REC_DATE = SY-DATUM.
WA_HEADER-PMNTTRMS = 'Z005'.
WA_HEADER-BUS_AREA = 'B401'.
WA_HEADER-DIFF_INV = '0000100816'.
WA_HEADER-BUSINESS_PLACE = 'S004'.
* Item
WA_ITEM-INVOICE_DOC_ITEM = '000001'.
WA_ITEM-PO_NUMBER = '4700057078'. "PO number
WA_ITEM-PO_ITEM = '00010'. "PO item number
WA_ITEM-REF_DOC = '5000720172'. "GR number
WA_ITEM-REF_DOC_YEAR = '2021'. "GR fiscal year
WA_ITEM-REF_DOC_IT = '0001'. "GR item number
WA_ITEM-TAX_CODE = 'II'. "Tax code applicable
WA_ITEM-ITEM_AMOUNT = '5000'. "Item amount
WA_ITEM-QUANTITY = '50'. "Invoice quantity
WA_ITEM-PO_UNIT = 'KG'. "UoM
WA_ITEM-PO_UNIT_ISO = 'KGM'. "UoM
WA_ITEM-PO_PR_QNT = '50'. "UoM
WA_ITEM-PO_PR_UOM = 'KG'. "UoM
APPEND WA_ITEM TO IT_ITEM.
***Tax data
WA_TAX-TAX_CODE = 'II'.
APPEND WA_TAX TO TAXDATA.
CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
EXPORTING
HEADERDATA = WA_HEADER
IMPORTING
INVOICEDOCNUMBER = G_INVNO
FISCALYEAR = G_FYEAR
TABLES
ITEMDATA = IT_ITEM
TAXDATA = TAXDATA
RETURN = IT_RET.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = IT_RET.
Please help us to resolve these issues.
Regards,
Hello Aroon
You could try to execute BAPI_INCOMINGINVOICE_CREATE first in test-mode with your data.
Just use SE37 and "test/execute" BAPI_INCOMINGINVOICE_CREATE.
After that enter your test data and execute. (You can also save your testdata, so you dont have to enter the data every time).
If the data is correct and also corresponding with your customizing-settings (company-code, supplier,...) and invoice should be created.
I would test the data beforehands in MIRO to verify that the data you enter is ok.
If you dont get the expected result, you should ask an ABAP-developer to debug the BAPI.
BG Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
8 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.