📚 SAP Business One SDK Help

Landed Cost in Non-Continuous Inventory Systems
See Also
    Private Sub test_Continue_LandedCost() 
 
        'Continue System 
        Dim svrLandedCost As SAPbobsCOM.LandedCostsService = oCompany.GetCompanyService().GetBusinessService(ServiceTypes.LandedCostsService) 
        Dim oLandedCost As SAPbobsCOM.LandedCost = svrLandedCost.GetDataInterface(LandedCostsServiceDataInterfaces.lcsLandedCost) 
        Dim oLandedCostParams As SAPbobsCOM.LandedCostParams = svrLandedCost.GetDataInterface(LandedCostsServiceDataInterfaces.lcsLandedCostParams) 
        Dim oLandedCostsParams As SAPbobsCOM.LandedCostsParams = svrLandedCost.GetDataInterface(LandedCostsServiceDataInterfaces.lcsLandedCostsParams) 
 
 
        Dim itemline As LandedCost_ItemLine = oLandedCost.LandedCost_ItemLines.Add() 
 
        itemline.BaseDocumentType = LandedCostBaseDocumentTypeEnum.asGoodsReceiptPO 
        itemline.BaseEntry = 2 
        itemline.BaseLine = 0 
 
        Dim itemline2 As LandedCost_ItemLine = oLandedCost.LandedCost_ItemLines.Add() 
 
        itemline2.BaseDocumentType = LandedCostBaseDocumentTypeEnum.asGoodsReceiptPO 
        itemline2.BaseEntry = 2 
        itemline2.BaseLine = 1 
 
        Try 
            svrLandedCost.AddLandedCost(oLandedCost) 
        Catch ex As Exception 
            'exception process here 
        End Try 
 
        'Update  
        oLandedCostParams.LandedCostNumber = 2 
        oLandedCost = svrLandedCost.GetLandedCost(oLandedCostParams) 
        oLandedCost.Remarks = "Update remark" 
 
        Try 
            svrLandedCost.UpdateLandedCost(oLandedCost) 
        Catch ex As Exception 
            'exception process here 
        End Try 
 
        Try 
            oLandedCostsParams = svrLandedCost.GetLandedCostList() 
        Catch ex As Exception 
            'exception process here 
        End Try 
 
        'Cancel, Close not support in continue system 
 
    End Sub