cancel
Showing results for 
Search instead for 
Did you mean: 

5002 Tax group account is missing

Former Member
0 Kudos
133

I'm using the DI Server to add invoices, and I suddenly get "-5002 Tax group account is missing" whenever I try to make an invoice. What's strange, is that this occures only on one of my SAP-databases, whereas the others are ok. Luckily it's in a testbase. I'm pretty sure this database worked before, so I suspect someone has done something in the base. Does anyone know what generates this error, so that I can fix it?

Here is my code:

<?xml version="1.0" encoding="UTF-16"?>

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">

<env:Header>

<SessionID>8956830C-D03A-24EA-94A6-838A5E4EEA02</SessionID>

</env:Header>

<env:Body>

<dis:AddObject xmlns:dis="http://www.sap.com/SBO/DIS">

<BOM>

<BO>

<AdmInfo>

<Object>oInvoices</Object>

</AdmInfo>

<Documents>

<row>

<CardCode>K99999</CardCode>

<NumAtCard>11311A 14:00</NumAtCard>

<Comments>11311A 14:00</Comments>

<SalesPersonCode>126</SalesPersonCode>

<U_DepartmentId>15</U_DepartmentId>

<U_Nettbank>0</U_Nettbank>

</row>

</Documents>

<Document_Lines>

<row>

<ItemCode>100312</ItemCode>

<Quantity>1.0</Quantity>

<UnitPrice>0.8</UnitPrice>

<TaxCode>U1</TaxCode>

<CostingCode>15</CostingCode>

</row>

</Document_Lines>

</BO>

</BOM>

</dis:AddObject>

</env:Body>

</env:Envelope>

And the reply:

<?xml version="1.0"?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value><env:Subcode><env:Value>-5002</env:Value></env:Subcode></env:Code><env:Reason><env:Text xml:lang="en">Tax group account is missing </env:Text></env:Reason><env:Detail><Object>13</Object><ObjectIndex>1</ObjectIndex><Command>AddObject</Command><SessionID>8956830C-D03A-24EA-94A6-838A5E4EEA02</SessionID></env:Detail></env:Fault></env:Body></env:Envelope>

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Runar,

This error occurs because the last line you are trying to add to the Marketing Document is an empty line. The document object automatically comes with one document line. It is only for the second and subsequent lines of marketing documents that you require the method oDocument.Lines.Add

So, don't Add new line for the first item.

If Satisfied give me rewards points...

Regards

Yogesh

Former Member
0 Kudos

Well, as I said, I'm using the DI Server, not the DI Api, so the code for adding my orderline is this:

<Document_Lines>

<row>

<ItemCode>100312</ItemCode>

<Quantity>1.0</Quantity>

<UnitPrice>0.8</UnitPrice>

<TaxCode>U1</TaxCode>

<CostingCode>15</CostingCode>

</row>

</Document_Lines>

And there is no extra "add" there. And besides, as I mentioned, the same code worked in another database.

AdKerremans
Active Contributor
0 Kudos

Hi,

Have your tried to manually create the document, normally the same error occurs.

It looks like something is not defined correctly.

Regards

Ad

Former Member
0 Kudos

Yes, I tried to manually create the document in the SAP client, and there the document was created. No error. Strange

Former Member
0 Kudos

Very strangely, my error dissappeared by simply restarting the DI Server.

Don't ask me why. The DI Server is acting funny now and then... strange.