on 08-18-2008 10:40 AM
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 .
We got it working
I was having the same issue, then I tried adding the document through SAP Client and noticed a system message confirming the batch during batch selection. For us the problem was we had lowercase BatchNumber in OIBT, and I was trying to receive it as the uppercase BatchNumber. Our solution was:
update ibt1 set BatchNum = UPPER(BatchNum)
update oibt set BatchNum = UPPER(BatchNum)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Henry,
Serial Numbers are unique - for each quantity you have only 1 serialnumber.
if you have more quantity witht the same "serie" you have to use Batches !
lg David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank You for Your Replies Petr and David.
Now I have tried the following:
For the purchase order I create a new Goods Receipt PO with Business One and the same Quantity. Then
I look for the DocEntry, use GetbyKey and save the Doc-structure as XML.
Then I have Deleted the records with SystemSerialNumber, change the SerialNumbers and tried to add it as new PurchaseDeliveryNote.
But I get also the same Error.
The Source of the XML comes from a correct PurchaseDeliveryNote, I look if I can drop some other Property-Lines to get a Document with myDok.Add() .
Hi David,
Thank You for this link.
I have compared with my version, used SetCurrentLine also in SerialNumbers, changed InternalSerialNumber to ManufacturerSerialNumber, substitute BaseLineNumber to my BaseDoc,
modified with and without Base-Doc-Entry but I can't Add my new PurchaseDeliveryNote .
Is there a new handling in 2007 ?
Hello David, hello Petr, Hello All
If I use the XML-File from an existing PurchaseDeliveryNote with dropped DocNum,Reference1,Systemserialnumbers
and substitute the ManufacturerSerialnumbers, then I also can´t Add this as new Document.
If I delete the Lines and Serialnumber for the 2nd Item in the XML-File, then add is possible for this part of the document. With the XML-Test fewer mistakes with Add(), = Serialnumbers or SetCurrentline possible.
I decide a difference, that Serialnumbers.BaseLineNumer expected as the Number of the Line from Document-Lines when I generate the structure for the document with only one item and one Serialnumber, in this case 0.
The Document_Lines.BaseLine is referred to the Line-Number in the Purchase Order, which can be greater than 0, if the delivered Item is in a higher line. But in the exported XML-File the Serialnumbers.BaseLineNumer is equal the Document_Lines.BaseLine and is so expected. But this may not the cause for the problem.
Does anybody have other hints ?
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.