Skip to Content
0
Former Member
Aug 18, 2008 at 09:40 AM

two serialnumbers to oPurchaseDeliveryNotes : Error -2035

71 Views

Hello,

I'am trying to add two Items every with one Serial Number to a PurchaseDeliveryNote.

I'am using SAP 2007 A SP 0 PL 35.

If I add only the first part, it works. If I add only the 2nd Item it also works.

But both Items every with one Serialnumber I get the Error:

[PDN1.WhsCode][line: 0] , 'This entry already exists in the following tables (ODBC -2035)'

I'am using Company.StartTransaction() and EndTransaction to Rollback for the same situation.

The Serialnumbers are not in the OSRI.

Here is the part of the code.

SAPbobsCOM.Documents myDok = null;

SAPbobsCOM.Document_Lines myLines = null;

SAPbobsCOM.SerialNumbers mySerien = null;

myDok = ( (SAPbobsCOM.Documents)

(globals.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)) );

myDok.CardCode = "S18001";

myLines = myDok.Lines;

myLines.ItemCode = "X2991";

myLines.Quantity = 1.0;

myLines.BaseEntry = 1368;

myLines.BaseLine = 2;

myLines.BaseType = 22;

mySerien = myLines.SerialNumbers;

mySerien.ManufacturerSerialNumber = "Ser_X2991_Aug18b";

mySerien.BaseLineNumber = 0; // in DocLines

myLines.Add();

myLines.ItemCode = "X2992";

myLines.Quantity = 1.0;

myLines.BaseEntry = 1368;

myLines.BaseLine = 3;

myLines.BaseType = 22;

mySerien = myLines.SerialNumbers;

mySerien.ManufacturerSerialNumber = "Ser_X2992_Aug18b";

mySerien.BaseLineNumber = 1; // in DocLines

/*

// only 1. part works:

myLines.ItemCode = "X2991";

myLines.Quantity = 1.0;

myLines.BaseEntry = 1368;

myLines.BaseLine = 2;

myLines.BaseType = 22;

mySerien = myLines.SerialNumbers;

mySerien.ManufacturerSerialNumber = "Ser_X2991_Aug18b";

mySerien.BaseLineNumber = 0; // in DocLines

*/

/*

// only this modified 2nd part also works:

myLines.ItemCode = "X2992";

myLines.Quantity = 1.0;

myLines.BaseEntry = 1368;

myLines.BaseLine = 3;

myLines.BaseType = 22;

mySerien = myLines.SerialNumbers;

mySerien.ManufacturerSerialNumber = "Ser_X2992_Aug18b";

mySerien.BaseLineNumber = 0; // in DocLines

*/

What I'am doing wrong ?

It is also possible to add Items with serialnumbers in the SBO menu for a user.

Does SBO sets additional properties ? How can I know if its a problem of my source ?

Please give me some hints .