on 2007 Sep 18 1:28 PM
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>
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
93 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.