cancel
Showing results for 
Search instead for 
Did you mean: 

Tax data is missing ArrayOffset 12, srcLinNum 1, src GroupNum -1

0 Kudos

Hi experts!

I'm using tutorial from Maria Trinidad https://blogs.sap.com/2015/07/15/how-to-consume-service-layer-odata-services-from-net-via-wcf

When i'm trying to add Order i'm getting error "Tax data is missing ArrayOffset 12, srcLinNum 1, src GroupNum -1".

Via SAP B1 and postman evrything works fine. I other same threads i didn't find solution. I really need help.

Thank you!

benpoon_123
Explorer
0 Kudos

Hi ,

Have you fixed it ? I got the same error!

Accepted Solutions (0)

Answers (3)

Answers (3)

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Sofia,

Can you please activate the SL logs so we can see what is sent from WCF to SL?

Please check this blog for details how to configure logs in SL:
https://answers.sap.com/questions/12675367/service-layer-logging-requests-and-responses.html?childTo...

Hope it helps,
Trinidad.

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Sofia,

In your Postman request you specify the TaxDate, can you please try to specify it also in the .NET project?

Can you please also try to put exactly the same CardCode and ItemCode as in Postman (hardcoded in your .NET code for a test)?

What is the DocumentOwner field in Postman request? Can you please try without it in Postman?

If it works with Postman then should work the same with .NET if having the same database, no matter which localization.

Regards,
Trinidad.

0 Kudos

mariatrinidad.martinezgea

Hi! Iremoved from Postmn everurhing you said and it still works perfectly:

I did as you said and still same error. It's like a cruel joke:

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Sofia,

Via B1 and postman are you adding exactly the same order data? Same items and business partner?
Can you please share here a screen capture of your postman content as well as your order Document object filling via .NET WCF(please keep it as simple as possible with just BP and 1 line)? You are using the method "AddNewOrder" from the ServiceLayerService.cs, right?

I cannot see a reason why it should fail via .NET WCF if the data is the same.

Have you tried to manually fill the TaxCode property of the document lines to see if the error goes away? (just for testing)

Are you using the downloaded sample app directly from the blog sample?

Regards,
Trinidad.

0 Kudos

mariatrinidad.martinezgea , thank you for your reply!

About TaxCode - in our localization we don't use TaxCode - we use VatGroup and yes, I tried to insert it manually - it didn't help.

Yes, my .json file is the same in both ways. Here it is and response from Postman. Everything works perfectly.

And here is code from my Project:

//textFromFile - .json file data

JsonParse.SalesOrder.JSONOrder Order = JsonConvert.DeserializeObject<JsonParse.SalesOrder.JSONOrder>(textFromFile); ServiceReference1.SAPB1.Document salesOrder = new ServiceReference1.SAPB1.Document(); ServiceReference1.SAPB1.DocumentLine salesOrderLines = new ServiceReference1.SAPB1.DocumentLine();

salesOrder.DocType = Order.DocType;

salesOrder.DocDate = DateTime.Parse(Order.DocDate);

salesOrder.DocDueDate = DateTime.Parse(Order.DocDueDate);

salesOrder.CardCode = Order.CardCode;

for (int i = 0; i < Order.DocumentLines.Length; i++) {

salesOrderLines.ItemCode = Order.DocumentLines[i].ItemCode;

salesOrderLines.Quantity = Order.DocumentLines[i].Quantity;

salesOrderLines.UnitPrice = Order.DocumentLines[i].Price;

salesOrder.DocumentLines.Add(salesOrderLines); }

OrderCRUD SalesOrder = new OrderCRUD(serviceLayerAddress, "Orders");

SalesOrder.AddNewOrder(salesOrder); // the same method as in yours Sample Project.

And on this line in yours method : DataServiceResponse response = Program.ConComs.currentServiceContainer.SaveChanges();

I getting error: { "error" : { "code" : -10, "message" : { "lang" : "en-us", "value" : "Tax data is missing ArrayOffset 12, srcLineNum 1, srcGroupNum -1" } } }

Maybe, problem in Russian or Ukrainian localizations?

Thank you!