Skip to Content
author's profile photo Former Member
Former Member

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

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 05:19 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.