on 09-12-2008 5:58 AM
Hi,
Can you please share a valid XML call to DIServer for creating and updating a batch for oOrders?
The only example I was able to find is in the docs, which is for oDeliveryNotes:
<?xml version="1.0" encoding="UTF-16"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<SessionID>F46EDCE6-3F79-1F9F-1D1E-DC6226D04FA7</SessionID>
</env:Header>
<env:Body>
<dis:AddObject xmlns:dis="http://www.sap.com/SBO/DIS">
<BOM>
<BO>
<AdmInfo>
<Object>oDeliveryNotes</Object>
</AdmInfo>
<Documents>
<row>
<CardCode>BPForBatch</CardCode>
</row>
</Documents>
<Document_Lines>
<row>
<ItemCode>ItemToBatch1</ItemCode>
<Quantity>10</Quantity>
<Price>10</Price>
<TaxCode>My Tax</TaxCode>
</row>
<row>
<ItemCode>ItemToBatch2</ItemCode>
<Quantity>8</Quantity>
<Price>10</Price>
<TaxCode>My Tax</TaxCode>
</row>
</Document_Lines>
<BatchNumbers>
<row>
<BatchNumber>AA</BatchNumber>
<Quantity>5</Quantity>
<BaseLineNumber>0</BaseLineNumber>
</row>
<row>
<BatchNumber>AA</BatchNumber>
<Quantity>5</Quantity>
<BaseLineNumber>0</BaseLineNumber>
</row>
<row>
<BatchNumber>AB</BatchNumber>
<Quantity>5</Quantity>
<BaseLineNumber>1</BaseLineNumber>
</row>
<row>
<BatchNumber>AB</BatchNumber>
<Quantity>3</Quantity>
<BaseLineNumber>1</BaseLineNumber>
</row>
</BatchNumbers>
</BO>
</BOM>
</dis:AddObject>
</env:Body>
</env:Envelope>
Thank you very much,
Mike
Thank you very much for your help.
If it is not possible to add or update batches with DIServer, then we can't use it.
Looks like we have to write our own DIServer.
If any news comes about batch processing, please let me know.
Cheers,
Mike
Cygnusoft
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am trying this XML code which isn't working. Do you have any thoughts about how we can make this work?
<?xml version="1.0" encoding="UTF-16"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<SessionID>1CC7DCFD-5A22-4211-8B6C-906E8A36170F</SessionID>
</env:Header>
<env:Body>
<dis:AddObject xmlns:dis="http://www.sap.com/SBO/DIS">
<BOM>
<BO>
<AdmInfo>
<Object>oOrders</Object>
</AdmInfo>
<Documents>
<row>
<CardCode>PAG</CardCode>
</row>
</Documents>
<BatchNumbers>
<row>
<BatchNumber>28286</BatchNumber>
<Quantity>1</Quantity>
<BaseLineNumber>0</BaseLineNumber>
</row>
</BatchNumbers>
</BO>
</BOM>
</dis:AddObject>
</env:Body>
</env:Envelope>
And DIServer returns this error code:
<?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>-1</env:Value>
</env:Subcode>
</env:Code>
<env:Reason>
<env:Text xml:lang="en">General Error</env:Text>
</env:Reason>
<env:Detail>
<Command>AddObject</Command>
<SessionID>1CC7DCFD-5A22-4211-8B6C906E8A36170F</SessionID>
</env:Detail>
</env:Fault>
</env:Body>
</env:Envelope>
Thank you,
Mike
Edited by: Michael Gurevich on Sep 12, 2008 9:05 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
The following example is adding an order with the DI server with batch numbers:
In your file, you had no "DocumentLines" section - these are the rows of the document and where you enter the items.
Additionally, in the "Rows" section of the serial numbers, you were using "BaseLineNumbers" which are only relevant when basing one document on another.
Before adding this document I created a batch called batch1 in the application.
<?xml version="1.0" encoding="utf-16"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
<SessionID>B9904156-051A-4EFB-8462-97C42FF4F342</SessionID>
</env:Header>
<env:Body>
<dis:AddObject xmlns:dis="http://www.sap.com/SBO/DIS" CommandID="Add Item">
<BOM>
<BO>
<AdmInfo>
<Object>oOrders</Object>
</AdmInfo>
<Documents>
<row>
<CardCode>C1000</CardCode>
<DocDate>20070808</DocDate>
<DocDueDate>20070909</DocDueDate>
</row>
</Documents>
<Document_Lines>
<row>
<ItemCode>diserver</ItemCode>
</row>
</Document_Lines>
<BatchNumbers>
<row>
<BatchNumber>batch1</BatchNumber>
<Quantity>1</Quantity>
</row>
</BatchNumbers>
</BO>
</BOM>
</dis:AddObject>
</env:Body>
</env:Envelope>
I hope this helps,
Regards,
NIall
SAP Business One Forums
Hi Niall,
Thank you very much for helping, and unfortunately this XML:
<?xml version="1.0" encoding="utf-16"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
<SessionID>DD54C201-4A8C-4CE0-A6A2-F33F0C0D4604</SessionID>
</env:Header>
<env:Body>
<dis:AddObject xmlns:dis="http://www.sap.com/SBO/DIS" CommandID="Add Item">
<BOM>
<BO>
<AdmInfo>
<Object>oOrders</Object>
</AdmInfo>
<Documents>
<row>
<CardCode>PAG</CardCode>
<DocDate>20080808</DocDate>
<DocDueDate>20080909</DocDueDate>
</row>
</Documents>
<Document_Lines>
<row>
<ItemCode>diserver</ItemCode>
</row>
</Document_Lines>
<BatchNumbers>
<row>
<BatchNumber>27718</BatchNumber>
<Quantity>1</Quantity>
</row>
</BatchNumbers>
</BO>
</BOM>
</dis:AddObject>
</env:Body>
</env:Envelope>
causes this error:
<?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>-5009</env:Value>
</env:Subcode>
</env:Code>
<env:Reason>
<env:Text xml:lang="en">Item no. is missing</env:Text>
</env:Reason>
<env:Detail>
<Object>17</Object>
<ObjectIndex>1</ObjectIndex>
<Command>AddObject</Command>
<CommandID>Add Item</CommandID>
<SessionID>DD54C201-4A8C-4CE0-A6A2-F33F0C0D4604</SessionID>
</env:Detail>
</env:Fault>
</env:Body>
</env:Envelope>
I'm not sure what "Item no. is missing" is missing means. I don't seen an "ItemNo" in the database as a field, or in the XML template SAP gives me. Can you please help me better understand this?
Also, do you happen to know how we can add, update and remove just the batch information, without having to add an order?
I appreciate your help, thank you!
Cheers,
Mike
Hi,
the ItemNo usually means that field:
<ItemCode>diserver</ItemCode>
but when the item "diserver" exist i can't tell you why you get this error...
i have only a sbo 2005 at the moment and there's a update of batch not possible -> no DIAPI object.
mabye i can have a look at 2007 later.
lg David
HI Michael,
The error message ItemNo missing would point towards there being no item in you database called "diserver". I had created a test item in my system for this example. Although it says Item No. it means item code. If you change it to the Item Code of an item in you database it should work.
As far as I understand, it is not possible to add, update or remove batch or serial numbers without doing so through a document using the DI API in the way you described.
Kind Regards,
Niall
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.