cancel
Showing results for 
Search instead for 
Did you mean: 

oDeliveryNotes serial nbr error when using sales BoM with DI server

Former Member
0 Kudos

Hi all,

we're trying to create a delivery note with DI server for items managed by serial number and sales bom.

This is a sample xml:

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

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

<env:Header>

<SessionID>F6166595-C4E0-4B5E-B44C-85CB04FAA0C9</SessionID>

</env:Header>

<env:Body>

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

<BOM>

<BO>

<AdmInfo>

<Object>oDeliveryNotes</Object>

</AdmInfo>

<Documents>

<row>

<CardCode>C9999</CardCode>

</row>

</Documents>

<Document_Lines>

<row>

<ItemCode>S610STW-220</ItemCode>

<Quantity>220</Quantity>

</row>

</Document_Lines>

<SerialNumbers>

<row>

<InternalSerialNumber>AD00003</InternalSerialNumber>

<SystemSerialNumber>3</SystemSerialNumber>

<BaseLineNumber>1</BaseLineNumber>

</row>

</SerialNumbers>

</BO>

</BOM>

</dis:AddObject>

</env:Body>

</env:Envelope>

And this is the returned error: "You should use existing serial/batch numbers for this document type [(----) 29-51]"

Any idea why?

Thanks

Fabio

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

You specified 220 qty and only one serial number. This could be the error

By the way:

Check your serail number related settings in the General Settings of Admin Module \ System init\General settings -> Stock tab (inventory tab)

Select the Unique Serial number type you would like to use, and in the XML Fille provide only this attribute

Serial numbers can be

<InternalSerialNumber>AD00003</InternalSerialNumber>

or

<SystemSerialNumber>3</SystemSerialNumber>

or Manufacturer serial numbers.

regards,

J

Ps: If you search the forum, i have posted several good answers about DI API and serial numbers. DI Server is working similary... settings are the same

Former Member
0 Kudos

Thanks Janos,

unfortunately the problem is somewhere else.

220 qty is correct. We use sales bom to convert one unit of measure into another: it means that to sell 220 units of item A you need 1 unit of item B. It works fine using GUI

About serial number, our setting is "unique serial number by = serial number". That's why we use InternalSerialNumber and SystemSerialNumber; if you use only SystemSerialNumber it doesn't work at all

Regards

Fabio

Former Member
0 Kudos

Hello Fabio,

I have tested your problem with DI API, and I got the same error you have.

This is an uncovered system functionality or system limitation

Report this issue to SAP Support.

My DI API COde

Dim oDN As SAPbobsCOM.Documents = oCompany.GetBusinessObject(BoObjectTypes.oDeliveryNotes)
        oDN.CardCode = "1013"
        oDN.DocDate = Date.Today()
        oDN.DocDueDate = Date.Today()
        oDN.VatDate = Date.Today()
        oDN.TaxDate = Date.Today()

        oDN.Lines.SetCurrentLine(0)
        oDN.Lines.ItemCode = "TBOM"
        oDN.Lines.WarehouseCode = "2"
        'oDN.Lines.SetCurrentLine(2)

        oDN.Lines.SerialNumbers.SetCurrentLine(0)
        oDN.Lines.SerialNumbers.ManufacturerSerialNumber = "1"
        oDN.Lines.SerialNumbers.InternalSerialNumber = "1"
        oDN.Lines.SerialNumbers.SystemSerialNumber = "1"
        oDN.SaveXML("c:TEMPDNWITHBOOM.xml")
        If oDN.Add <> 0 Then
            sbo_application.MessageBox(oCompany.GetLastErrorDescription)
        End If

Where TBOM is a sales kit, for 12 peices, components TNM item no serial number 12 peice, TSN item using serial number 1 piece.

Sales Factor 1 for TBOM is 12 piece

This sample code results the same issue you hev reported.

Edited by: János Nagy on Apr 14, 2010 4:49 PM

Former Member
0 Kudos

Dim oDN As SAPbobsCOM.Documents = oCompany.GetBusinessObject(BoObjectTypes.oDeliveryNotes)

oDN.CardCode = "1013"

oDN.DocDate = Date.Today()

oDN.DocDueDate = Date.Today()

oDN.VatDate = Date.Today()

oDN.TaxDate = Date.Today()

oDN.Lines.SetCurrentLine(0)

oDN.Lines.ItemCode = "TBOM"

oDN.Lines.WarehouseCode = "2"

'oDN.Lines.SetCurrentLine(2)

oDN.Lines.SerialNumbers.SetCurrentLine(0)

oDN.Lines.SerialNumbers.ManufacturerSerialNumber = "1"

oDN.Lines.SerialNumbers.InternalSerialNumber = "1"

oDN.Lines.SerialNumbers.SystemSerialNumber = "1"

oDN.Lines.SerialNumbers.Add

oDN.SaveXML("c:\TEMP\DNWITHBOOM.xml")

If oDN.Add 0 Then

sbo_application.MessageBox(oCompany.GetLastErrorDescription)

End If