on 09-17-2008 12:13 PM
hello everyone,
Using DI api, I'm updating a previously created Draft of oStockTransfer type by adding a couple of more lines.
I get no errors, but the new lines look different from those added when the document was created.
The numeric values for example, whose default is 0.00, are NULL, and so are other field like unitMsr, Currency, etc.
I can not understand why, when I'm creating a new document, it is sufficient to assign the MyDoc.Lines.ItemCode = "XYZ" in order to DI api take care of the default values of the Items and fill in the right fields (ItemDescription, MeasureUnit, etc. of the table DRF1 ), WHEREAS when I'm in updating mode of a document, all this doesn't happen.
This is the code I use when I create a new Draft :
oDoc1 = oCompany.GetBusinessObject(BoObjectTypes.oDrafts)
oDoc1.DocObjectCodeEx = BoObjectTypes.oStockTransfer
oDoc1.DocDueDate = Date.Today
oDoc1.DocDate = Date.Today
(. . .)
oDoc1.Lines.ItemCode = "XYZ"
oDoc1.Lines.WarehouseCode = "01"
oDoc1.Lines.Quantity = 10
This is the code I use when I update the previously created Draft:
(before I get TheRightKey with a query)
oDoc1 = oCompany.GetBusinessObject(BoObjectTypes.oDrafts)
oDoc1.DocObjectCodeEx = BoObjectTypes.oStockTransfer
oDoc1.GetByKey(TheRightKey)
(. . .)
oDoc1.Lines.Add()
oDoc1.Lines.SetCurrentLine(oDoc1.Lines.Count - 1)
oDoc1.Lines.ItemCode = "XYZ"
' if I don't fill explicitly the field ItemDescription, it stays NULL!!
oDoc1.Lines.ItemDescription = "Bla-bla-bla"
oDoc1.Lines.WarehouseCode = "01"
oDoc1.Lines.Quantity = 10
' and, as the MeasureUnit is a read-only field, I can't even write
' on it, and it remains NULL !!
My version is SAP 2007A SP0 PL38
thank you in advance for any help.
GB
Edited by: Giorgio Bindelli on Sep 17, 2008 1:14 PM
Giorgio,
i checked it and it seems to be bug in DI API for draft object. There isnt working correctly updating of draft, works only for adding new. Solution for you should be to create another one draft with adding lines from existing and new one or report this bug to SAP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
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.