on 2022 Mar 16 9:16 AM
body-supplier-invoice-with-reference-to-po-without.txtHi,
we are trying to create a supplier invoice with reference to a Purchase Order with multi account assignment via API. The Purchase Order has no GR based Invoice verification check. The error we are getting from Postman (when calling the API) is M8/416 (please see the attached documents, one with the error snapshot, another with the Body of the message to call the API to create the supplier invoice)
Would really appreciate your help, because we have only seen this error when the Purchase Order has check GR based Inv verification unflagged.
KR,
Jose
SOLUTION PROVIDED:
Hello,
I am a colleague of Jose Antonio Nestares and we have found a solution to the error.
First of all, SAP found a bug in the API due to the error that occurred when sending all the cost allocation information in the section "to_SupplierInvoiceItmAcctAssgmt". This fix will be available from Release 2208.
Alternatively, to be able to create an invoice from a purchase order that has a cost allocation in the items and also has Goods Receipt, simply not reporting the fields referring to the cost objects will post. I.e. the following fields in the section "to_SupplierInvoiceItmAcctAssgmt" would have to be sent empty:
<CostCenter/>
<ControllingArea/>
<ProfitCenter/>
<FunctionalArea/>
<GLAccount/>
<WBSElement/>
This works both for orders with a single account assignment (a single Cost Centre or WBS Element) and for orders with multiple account assignment (various assignment to Cost Centre or WBS Element).
If the purchase order does not have Goods Receipt, you would have to send the information in these fields. In these cases, the API does not give error.
I hope this helps.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good evening,
we have tried to remake the payload in accordance to your comments, and we get the same error. Please find attached the new payload.
Looking forward to your reply,
Jose
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jose,
I would recommend to create a ticket to see if you can get some more insight from development on the error. Could be something missing like reference doc or another field.
You can also make use of the "schedule an expert" feature that is now available in the support portal.
Would appreciate if you can reply back here with the ultimate solution.
Thank you
Jerry
Hi Jose,
I am unfortunately not an expert on this API - but looking at your payload, I think you have a structure problem.
You have two Supplier Invoice Items (1 and 2), but you do all the invoice item account assignments for 1 and 2 only under the node for invoice item 2.
Supplier Invoice 2 has a quantity of 2, however you nest the to_SupplierInvoiceItmAcctAssgmt node for both supplier invoice items under the node for supplier invoice item 2. In that node, there are account assignments for a total of 4 quantity. (even though you do specify the supplier invoice items 1 and 2).
Given the error is about the quantity/units not allowed, this may be the issue.
I would recommend to move the to_SupplierInvoiceItmAcctAssgmt node to the same level as the to_SuplrInvcItemPurOrdRef node, or create the acctassgmt for 1 under the ref for 1 and the acctassgmt for 2 under 2. I hope this makes sense.
"to_SuplrInvcItemPurOrdRef": {
"results": [
{
"SupplierInvoiceItem": "1",
"PurchaseOrder": "4500001646",
"PurchaseOrderItem": "10",
"Plant": "",
"ReferenceDocument": "",
"ReferenceDocumentFiscalYear": "",
"ReferenceDocumentItem": "",
"TaxCode": "3L",
"DocumentCurrency": "EUR",
"SupplierInvoiceItemAmount": "20",
"PurchaseOrderQuantityUnit": "PC",
"QuantityInPurchaseOrderUnit": "2",
"PurchaseOrderPriceUnit":"PC",
"QtyInPurchaseOrderPriceUnit": "2",
"SupplierInvoiceItemText": "",
"ServiceEntrySheet": "",
"ServiceEntrySheetItem": ""
},
{
"SupplierInvoiceItem": "2",
"PurchaseOrder": "4500001646",
"PurchaseOrderItem": "20",
"Plant": "",
"ReferenceDocument": "",
"ReferenceDocumentFiscalYear": "",
"ReferenceDocumentItem": "",
"TaxCode": "3L",
"DocumentCurrency": "EUR",
"SupplierInvoiceItemAmount": "20",
"PurchaseOrderQuantityUnit": "PC",
"QuantityInPurchaseOrderUnit": "2",
"PurchaseOrderPriceUnit":"PC",
"QtyInPurchaseOrderPriceUnit": "2",
"SupplierInvoiceItemText": "",
"ServiceEntrySheet": "",
"ServiceEntrySheetItem": "",
"to_SupplierInvoiceItmAcctAssgmt": {
"results": [
{
"SupplierInvoiceItem": "1",
"OrdinalNumber": "1",
"CostCenter": "ES41117102",
"ControllingArea": "A000",
...
Please let us know if this solves your issue. If not, and no one else comments, I would recommend to create a ticket.Thank youJerry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Indeed, if you check the help for the api, the structure diagram suggests to do the account assignment within the node for the item:
Hi Jose,
Could you let us know what you have already double checked?
For example, have you confirmed the unit of measure matches the pricing unit of measure?
Similar Community posts:
https://answers.sap.com/questions/10438909/bapiincominginvoicecreate-for-hes-error-units-of-m.html
https://answers.sap.com/questions/7519795/bapiincominginvoicecreate.html
thank you
Jerry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
105 | |
8 | |
6 | |
6 | |
6 | |
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.