Dear All,
In my scenario am using stock transfer when am click ADD Button In the below code the bolded item shows an error but the error msg will not be displayed on the screen ,
If (pVal.FormUID = "FormEditor") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) And (pVal.ItemUID = "1") And pVal.Before_Action = True Then
Try
Dim oStockTransfer As SAPbobsCOM.StockTransfer
Dim return_value As Integer
Dim SerrorMsg As String
Dim ItemNo As String
Dim Fwh As String
Dim ItemDes As String
Dim ToWh As String
Dim Qua As String
Dim itemCost As String
For i As Integer = 1 To oMatrix.RowCount
ItemNo = oMatrix.Columns.Item("V_2").Cells.Item(i).Specific.Value()
ItemDes = oMatrix.Columns.Item("V_1").Cells.Item(i).Specific.Value()
Fwh = oMatrix.Columns.Item("V_9").Cells.Item(i).Specific.Value()
ToWh = oForm.Items.Item("27").Specific.Value
Qua = oMatrix.Columns.Item("V_7").Cells.Item(i).Specific.Value()
itemCost = oMatrix.Columns.Item("V_11").Cells.Item(i).Specific.Value()
oStockTransfer = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer)
oStockTransfer.FromWarehouse = Fwh
oStockTransfer.Lines.ItemCode = ItemNo
oStockTransfer.Lines.ItemDescription = ItemDes
oStockTransfer.Lines.WarehouseCode = ToWh
oStockTransfer.Lines.Quantity = Qua
oStockTransfer.Lines.Rate = itemCost
oStockTransfer.Lines.Add()
Next
return_value = oStockTransfer.Add
If return_value = 0 Then
ocompany.GetLastError(return_value, SerrorMsg)
oForm.StatusBar.SetText(SerrorMsg, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
Else
oForm.StatusBar.SetText(SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success)
End If
Catch ex As Exception
oForm.StatusBar.SetText(ex.Message)
End Try
End If
Can Anyone tell me the exact error in the above Code
Regards,
Guru