on 08-15-2015 12:59 PM
Hi all,
I received the following error trying to post an invoice for return delivery using BAPI_INCOMINGINVOICE_CREATE1 and Goods-Receipt based Invoice Verification is activated.
M8 376 Enter goods receipt data only when working with GR-based IV
M8 375 Fill in mandatory field REF_DOC, REF_DOC_YEAR, REF_DOC_IT (table parameter ITEMDATA, row 000001)
I know to fix the error is to populate
ITEMDATA-REF_DOC,
ITEMDATA-REF_DOC_YEAR,
ITEMDATA-REF_DOC_IT
with material document that was used to post goods receipt
My question is following:
1. I'm not sure which material document to choose. I have two GR entries available, one is with movement type 101 and the other one is with movement type 122.
2. If there were multiple Goods Receipts, how do I submit them to the bapi ?
Do I need to submit two records in ITEMDATA parameter for the same PO line with different Goods-Receipt reference?
3. If there were multiple Goods Receipts, how do I know if an vendor credit invoice has been created for the Goods Receipt document in the past?
I have attached how the PO looks like in this posting.
Anyhelp would be appreciated.
As per your PO history , why an invoice should be posted ? You have posted goods receipt first , then invoice for this receipt , then you have posted a return delivery (system allowed that because of your configuration). Now you may need cancel the invoice as per standard business process.
May I know why you wanna post another invoice ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dibyendu,
Sorry if I haven't used the correct term because I'm not familiar with FI area.
I'm trying to post credit vendor invoice for return scenario. Maybe I should say I'm trying to post credit memo
Here is reference to what I want to do.
This is my code:
...
CLEAR: headerdata-INVOICE_IND. " Post Credit Memo
headerdata-doc_type = 'RE'. " doc type
headerdata-REF_DOC_NO = it13_vbrp-vbeln. " reference (inv num)
...
CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE1'
EXPORTING
HEADERDATA = headerdata
* ADDRESSDATA =
* INVOICESTATUS = '5'
IMPORTING
INVOICEDOCNUMBER = lv_invoicedocnumber
FISCALYEAR = lv_fiscalyear
TABLES
ITEMDATA = t_itemdata
ACCOUNTINGDATA = t_accountingdata
GLACCOUNTDATA = t_glaccountdata
MATERIALDATA = t_materialdata
TAXDATA = t_taxdata
WITHTAXDATA = t_withtaxdata
VENDORITEMSPLITDATA = t_vendoritemsplitdata
RETURN = t_return
EXTENSIONIN = t_extensionin
EXTENSIONOUT = t_extensionout
TM_ITEMDATA = t_tm_itemdata.
What you are passing in Invoice indicator ?
1. I'm not sure which material document to choose. I have two GR entries available, one is with movement type 101 and the other one is with movement type 122.
I think only use 122 when Invoice is not posted. You post credit memo for movement type 161 which with reference to return po created separately.
If you still want to post credit memo Invoice_Ind = 2.
But what you will do the material document that have 102 in it ?-- that is cancellation of 101 document ?
101- You can post invoice with Invoice_ind=1
2. If there were multiple Goods Receipts, how do I submit them to the bapi ?
Do I need to submit two records in ITEMDATA parameter for the same PO line with different Goods-Receipt reference?
Do you have GR-IR Indicator checked in the PO - then I would recommend one document at a time..
Do you try to post multiple even you do not have GR-IR indicator checked. This will make easy to trouble shoot and document mapping.
3. If there were multiple Goods Receipts, how do I know if an vendor credit invoice has been created for the Goods Receipt document in the past?
You can check PO history table EKBE. It have various You have to pass indicator as 2- Invoice receipt. When you validate indicator -SHKZG= H .. means that number is credit memo .. in RSEG table of invoice number you find material document number -LFBNR and LFGJA as well as LFPOS
1. I will try to post credit memo with reference to movement type 122
1.1. I think you mean INV_TRAN
For creating credit memo, INVOICE_IND should be blank.
headerdata-INV_TRAN = '2'. " Transaction: Credit Memo
2. GR-Bsd IV is set. Ok, I will speak to the business if they want multiple Goods Receipts to be separated or not.
3. I think this is what I'm looking for.
Thanks for making the effort to answer all my questions and we need more people like you on scn. I appreciate it.
Hi Steve,
As per my understanding with your purchase order's scenario, a goods receipt(movement type 101) and invoice was posted first before the return delivery(movement type 122). Since you are suppose to create a Credit Memo(CM) with respect to your return delivery , kindly check your parameter if you are referring to the correct document type in your Invoice.
Regards,
Harvey
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Harvey,
What document type should I use ?
This is part of upgrade from 4.7 to ECC6 and I'm trying to replace bdc for transaction MRHG with BAPI_INCOMINGINVOICE_CREATE1.
The BDC is populated with document type 'RE'.
This is the current code.
...
CLEAR: headerdata-INVOICE_IND. " Post Credit Memo
headerdata-doc_type = 'RE'. " doc type
headerdata-REF_DOC_NO = it13_vbrp-vbeln. " reference (inv num)
...
CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE1'
EXPORTING
HEADERDATA = headerdata
* ADDRESSDATA =
* INVOICESTATUS = '5'
IMPORTING
INVOICEDOCNUMBER = lv_invoicedocnumber
FISCALYEAR = lv_fiscalyear
TABLES
ITEMDATA = t_itemdata
ACCOUNTINGDATA = t_accountingdata
GLACCOUNTDATA = t_glaccountdata
MATERIALDATA = t_materialdata
TAXDATA = t_taxdata
WITHTAXDATA = t_withtaxdata
VENDORITEMSPLITDATA = t_vendoritemsplitdata
RETURN = t_return
EXTENSIONIN = t_extensionin
EXTENSIONOUT = t_extensionout
TM_ITEMDATA = t_tm_itemdata.
The old BDC code:
* Screen 1. Enter invoice: initial screen
ecs_bdc_begin 'SAPMM08R' '0100'.
...
ecs_bdc_field 'BKPF-BLART' " doc type
'RE'.
CALL TRANSACTION 'MRHG'...
I think that what you want to do is to cancel de invoice that was already posted.
If that is the case, then check BAPI BAPI_BILLINGDOC_CANCEL1
regards. Mauro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
10 | |
9 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.