cancel
Showing results for 
Search instead for 
Did you mean: 

How Do i Assign a Warehouse in Production Order Rows(Lines)

Former Member
0 Kudos

Dear All,

I can successfully create ProductionOrder through SDK, but when i create a Production Order i need to assign in rows the warehouse for the child item. What is the syntax for it? has any one have the idea of how to set the warehouse for child item.

Here is my code but it doesn't work and doesn't assign the warehouses for that item. That item has the warehouse defined in the Item master but still doesn't set the one which i pass.

Dim sboProdOrder As SAPbobsCOM.ProductionOrders

sboProdOrder = MyCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductionOrders)

sboProdOrder.Lines.SetCurrentLine(0)

sboProdOrder.Lines.Warehouse = "FG_01"

Pls reply if you have any solution to this,

Thanks & Regards,

Murtaza.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

you only perform this after you have populated the first line:

If docctr > 0 Then

vPO.Lines.Add()

vPO.Lines.SetCurrentLine(docctr)

Else

vPO = oDiCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders)

vPO.Comments = GetDocNum(Tblname, InsDocentry)

vPO.DocDate = docdate

vPO.DocDueDate = docduedate

vPO.TaxDate = taxdate

vPO.CardCode = InsVendor

vPO.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items

If InsAddr <> "" Then

vPO.Address2 = InsAddr

dropshiptran = "Y"

Else

dropshiptran = "N"

End If

End If

vPO.Lines.ItemCode = InsItem

vPO.Lines.WarehouseCode = InsWhs

vPO.Lines.Quantity = InsQty

vPO.Lines.UnitPrice = InsCost

vPO.Lines.LineTotal = (InsQty * InsCost)

vPO.Lines.ShipDate = GetLeadTime(InsVendor, InsItem)

vPO.Lines.UserFields.Fields.Item("U_XX_BDoc").Value = InsDocnum

vPO.Lines.UserFields.Fields.Item("U_XX_BDe").Value = InsDocentry

vPO.Lines.UserFields.Fields.Item("U_XX_BOBJ").Value = Doc

vPO.Lines.UserFields.Fields.Item("U_XX_BLn").Value = InsLinenum

docctr += 1

Edited by: John O'Neill on Jan 30, 2008 12:19 PM

Answers (0)