cancel
Showing results for 
Search instead for 
Did you mean: 

duplicate value?

Former Member
0 Kudos

i have field like dd no and value is 1124 once we enter the value (1124)in data base next time when i enter the same ddno some duplicate message will show...

p do u have any function or code?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

On which document will be the field dd?

If it will be on SAP documents, you can use transaction notification stored procedure for this blocking. When it is on your form, in event of adding document you must check the existing values in table and in case that the value is there already, block the event of adding document.

Former Member
0 Kudos

When it is on my form, in event of adding document how can i check the existing values in table ...

please help with code..

Former Member
0 Kudos

Private Function test_con(ByVal congNo As String) As Boolean

Dim RS As SAPbobsCOM.Recordset

Dim Bob As SAPbobsCOM.SBObob

Try

Bob = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge)

RS = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

RS.DoQuery("SELECT U_csNo FROM [@SM_OTPR] WHERE U_csNo ='" & congNo & "' ")

RS.MoveFirst()

Do While Not RS.EoF

congNo = RS.Fields.Item("U_csNo").Value

Return True

Loop

Catch ex As Exception

MessageBox.Show(ex.Message)

Return False

End Try

End Function

If (pVal.ItemUID = "CSno") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_LOST_FOCUS) Then

Dim csno11 As String

Dim test As String

csno11 = oForm.Items.Item("ChlnVal").Specific.value

test = test_con(csno11)

If test = True Then

SBO_Application.MessageBox("21")

Else

SBO_Application.MessageBox("22")

End If

End If

End Sub

but when it is true SBO_Application.MessageBox("21")

is not showing........ anything wrong my code...

Former Member
0 Kudos

sorry its working....... i chose wrong unique id

csno11 = oForm.Items.Item("ChlnVal").Specific.value

it was wrong code here

Edited by: Animesh Sinha on Sep 23, 2008 8:54 AM