hi expert all
if i put vehicle no is WBJHGTR or 678546 its working but when i put the value WB-123-234 it not working? please suggest me or advice me.....
If (pVal.ItemUID = "FBtn") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then
Dim oEdit As SAPbouiCOM.EditText
Dim strFind As String
Dim TEST As Boolean
oItem = oForm.Items.Item("vVal")
oEdit = oItem.Specific
strFind = Trim(oEdit.Value)
'Try
If strFind = "" Then
SBO_Application.MessageBox("PLEASE ENTER THE VEHICLE NO", MsgBoxStyle.Exclamation, )
Else
TEST = FIND(strFind)
If TEST = True Then
oForm.Items.Item("VtyVal").Specific.String = " OWN VEHICLE"
Else
oForm.Items.Item("VtyVal").Specific.String = "HIRE VEHICLE"
SBO_Application.MessageBox("23")
End If
End If
' RefreshForm()
'Catch ex As Exception
' SBO_Application.MessageBox(ex.Message)
' End Try
End If
Private Function FIND(ByVal Vehicleno As String) As Boolean
Dim RS As SAPbobsCOM.Recordset
Dim Bob As SAPbobsCOM.SBObob
' Dim z As String
Try
Bob = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge)
RS = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
RS.DoQuery("SELECT Name FROM [@VNO] WHERE Name ='" & Trim(Vehicleno) & "' ")
RS.MoveFirst()
Do While Not RS.EoF
Vehicleno = RS.Fields.Item("Name").Value
RS.MoveNext()
Return True
Loop
Catch ex As Exception
MessageBox.Show(ex.Message)
Return False
End Try
End Function