Hi All,
I need your help about how to update document lines in inventory counting module using DI API.
I am using SAP 9.1 PL 05, and below is my code snip.
........
Dim oCS As CompanyService
Dim oICS As InventoryCountingsService
Dim oICP As InventoryCountingParams
Dim oIC As InventoryCounting
Dim oICLS As InventoryCountingLines
oCS = oCompany.GetCompanyService
oICS = oCS.GetBusinessService(ServiceTypes.InventoryCountingsService)
oICP = oICS.GetDataInterface(InventoryCountingsServiceDataInterfaces.icsInventoryCountingParams)
oIC = oICS.GetDataInterface(InventoryCountingsServiceDataInterfaces.icsInventoryCounting)
oICLS = oIC.InventoryCountingLines
oICP.DocumentEntry = dEntry
oIC = oICS.Get(oICP)
oIC.Reference2 = refvariable
oIC.Remarks = remarksvariable
For i As Integer = 0 To grid.RowCount - 2
oICL.ItemCode = itemvar
oICL.ItemDescription = descvar
oICL.WarehouseCode = whsvar
oICL.CountedQuantity = countvar
.......
.......
Next
oICS.Update(oIC)
MsgBox("Document is successfully updated.", 64, "Information")
This code work fine only for document header, but not effected for document lines.
Anyone have suggestion ? Thank you for helping
Best Regards,
Ulfah