Dear sir
.i have a problem.
how can i read data from excel file and update the data base using sap b1.
i want to update the table item master(OITM) and item price master(ITM1).
this is my code to use for this but there is problem at run time.
Please help me.If any code you have send me.
i use the code for this is
Public Sub insertitem()
Dim ds1 As DataSet = ReadExcel1()
Dim ds As DataSet = ReadExcelItem()
Dim i As Integer = 0
Dim j As Integer = 0
Dim oitem As SAPbobsCOM.BoObjectTypes
Dim vitems As SAPbobsCOM.Items
'Dim oUserFieldsMD As SAPbobsCOM.UserFields
Dim nErr As Long
Dim errMsg As String
Dim ItemCode As String
' vitems.ItemCode =
'oUserFieldsMD.TableName = "OITM"
RS = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
RS.DoQuery("SELECT ItemCode from OITM")
vitems = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)
For i = 0 To ds.Tables(0).Rows.Count - 1
If Not RS.EoF Then
If RS.Fields.Item(0).Value = ds.Tables(0).Rows(i).Item(2).ToString Then
'vitems.ItemCode = ""
vitems.ItemName = ds.Tables(0).Rows(i).Item(3).ToString
vitems.ItemsGroupCode = ds.Tables(0).Rows(i).Item(4).ToString
vitems.PurchaseItem = ds.Tables(0).Rows(i).Item(5).ToString
vitems.SalesItem = ds.Tables(0).Rows(i).Item(6).ToString
vitems.InventoryItem = ds.Tables(0).Rows(i).Item(7).ToString
vitems.SWW = ds.Tables(0).Rows(i).Item(8).ToString
''For j = 0 To ds1.Tables(0).Rows.Count - 1
'' vitems.PriceList.SetCurrentLine(j)
'' vitems.PriceList.Price = ds1.Tables(0).Rows(j).Item(5)
'' vitems.PriceList.Currency = ds1.Tables(0).Rows(j).Item(4).ToString
''Next
Call vitems.Update()
End If
End If
Next
'End If
Call oCompany.GetLastError(nErr, errMsg)
If (0 <> nErr) Then
MsgBox("Found error:" + Str(nErr) + "," + errMsg)
End If
End Sub