Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Inventory Counting API Adding

Former Member
0 Likes
427
  • SAP Managed Tags

Hello

I am creating a program that adds an item to the inventory counting in SAP. I have based the code seen below on updating an item in SAP which works. However, the code below causes errors when initialising the SAP variables.

Dim oCS   As SAPbobsCOM.CompanyService
  Dim oICS  As SAPbobsCOM.InventoryCountingsService
  Dim oIC   As SAPbobsCOM.IInventoryCounting
  Dim oICL  As SAPbobsCOM.InventoryCountingLine
  Dim oICP  As SAPbobsCOM.InventoryCountingParams
  Dim oICLB As SAPbobsCOM.InventoryCountingBatchNumber
  Dim oICLS As SAPbobsCOM.InventoryCountingLines

  Set oCS  = oCompany.GetCompanyService()Set oICS = oCS.GetBusinessService(ServiceTypes.InventoryCountingsService)Set oICP = oICS.GetDataInterface(icsInventoryCountingParams)

  Err.Clear

  oICP.DocumentEntry = CLng(tmDOCO)Set oIC = oICS.Get(oICP)
  oIC.CountDate = Now()
  Err.ClearSet oICLS = oIC.InventoryCountingLines

  oICL = oICLS.Add
  oICL.ItemCode = tmItem
  oICL.WarehouseCode = tmWH
  oICL.CountedQuantity= CDbl(tmQTY)
  oICL.Counted = BoYesNoEnum.tYES
  oICP = oICS.Add(oIC)
  tmERRTEXT = Err.Description
  Err.Clear
0 REPLIES 0