<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Inventory Counting API Adding in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inventory-counting-api-adding/m-p/681376#M30357</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
  &lt;P&gt;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. &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;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&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 05 Nov 2018 15:20:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2018-11-05T15:20:30Z</dc:date>
    <item>
      <title>Inventory Counting API Adding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inventory-counting-api-adding/m-p/681376#M30357</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
  &lt;P&gt;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. &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;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&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Nov 2018 15:20:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inventory-counting-api-adding/m-p/681376#M30357</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-11-05T15:20:30Z</dc:date>
    </item>
  </channel>
</rss>

