on 03-30-2015 9:12 AM
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
Hi Ulfah,
your code is a liite mixed up :
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)
oIC = oICS.Get(oICP)
oICLS = oIC.InventoryCountingLines
oIC.Reference2 = refvariable
oIC.Remarks = remarksvariable
For i As Integer = 0 To grid.RowCount - 2
oICL.SetCurrentLine(i);
oICL.ItemCode = itemvar
oICL.ItemDescription = descvar
oICL.WarehouseCode = whsvar
oICL.CountedQuantity = countvar
.......
.......
Next
oICS.Update(oIC)
MsgBox("Document is successfully updated.", 64, "Information")
regards,
Maik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
7 | |
7 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.