cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot create Invetory Transfer through DI Server

Former Member
0 Kudos

I'm trying to create an Inventory Transfer through the DI Server, but no matter what I try I keep getting -5002 Not enough data.

I've tried through the DTW sending just DocDate and FromWarehouse for the document and ItemCode, WarehouseCode and Quantity for the row and it worked. DTW template only specifies CardCode as mandatory, but this is wrong (works fine without) and DI Server still returns -5002 even with CardCode.

SDK documentation for DI API for the Add method of the StockTransfer object only states "You must values for the mandatory properties, and then call the Add method.", but stops well short of specifying which properties are mandatory. So typical!

Using v8.81.315 PL07. Not using serial numbers or batches. XML stream follow. Thanks for your help!

05/04/2012  17:44:22  Request

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

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

    <env:Header>

        <SessionID>1785BB1E-F1E1-4F12-B9B3-25154F4B4F4F</SessionID>

    </env:Header>

    <env:Body>

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

        <BOM>

            <BO>

                <AdmInfo>

                    <Object>oStockTransfer</Object>

                </AdmInfo>

                    <Documents>

                        <row>

                            <FromWarehouse>03</FromWarehouse>

                            <DocDate>20120405</DocDate>

                        </row>

                    </Documents>

                    <Document_Lines>

                        <row>

                            <ItemCode>9Y7212</ItemCode>

                            <WarehouseCode>01</WarehouseCode>

                            <Quantity>2</Quantity>

                        </row>

                    </Document_Lines>

                </BO>

            </BOM>

        </dis:AddObject>

    </env:Body>

</env:Envelope>

05/04/2012  17:44:22  Response (Fault)

<?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">Not enough data </env:Text>

            </env:Reason>

            <env:Detail>

                <Object>67</Object>

                <ObjectIndex>1</ObjectIndex>

                <Command>AddObject</Command>

                <SessionID>1785BB1E-F1E1-4F12-B9B3-25154F4B4F4F</SessionID>

            </env:Detail>

        </env:Fault>

    </env:Body>

</env:Envelope>

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi, you should save it as draft first.

Dim draft As SAPbobsCOM.IStockTransfer

draft = oCompany.GetBusinessObject(BoObjectTypes.oStockTransferDraft)

' Draft details

draft.CardCode = "Code1"

draft.Add()

And then convert draft to stock transfer

Dim draft As SAPbobsCOM.IStockTransfer

'Convert a draft of stock transfer to a stock transfer
draft = oCompany.GetBusinessObject(BoObjectTypes.oStockTransferDraft)
draft.GetByKey(1)
draft.SaveToFile("C:\Draft.xml")

'********** Manual Action Required: Modify the ObjectCode from 1179 to 65 in "C:\Draft.xml"

Dim oStockTransfer As SAPbobsCOM.StockTransfer
oStockTransfer = oCompany.GetBusinessObject(BoObjectTypes.oStockTransfer)
oStockTransfer.Browser.ReadXml("C:\Draft.xml", 0)
oStockTransfer.Add()

Then add your StockTransfer_Lines.

Hope it helps you.

Former Member
0 Kudos

Thanks for your input, however I'm trying to do this via the DI server, not DI API. Also, why do you think it is necessary to create a draft first? Does the documentation suggest that? It is certainly not required for any other type of document (e.g. goods issue) which I have created successfully via the DI server.

Former Member
0 Kudos

Ok