I have the following code and encounter the error message "Not a valid open sales order [OWOR.OriginAbs]
Dim oWO, oWo2 As SAPbobsCOM.ProductionOrders
Dim xmlDoc As New System.Xml.XmlDocument
oWO = DirectCast(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductionOrders), SAPbobsCOM.ProductionOrders)
oWo2 = DirectCast(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductionOrders), SAPbobsCOM.ProductionOrders)
Dim s As String = "c:\2334.xml"
If (oWO.GetByKey(34)) Then
oWO.SaveXML(s)
oWO = Nothing
oWo2 = oCompany.GetBusinessObjectFromXML(s, 0)
Dim i As Integer = 0
i = oWo2.Update()
If (i <> 0) Then
MsgBox(oCompany.GetLastErrorDescription)
End If
End If
Does anyone have any idea why does this so?
Thanks