Showing results for 
Search instead for 
Did you mean: 

Validation in rows

Former Member
0 Kudos

Dear All !!

Kindly let me know how can the validation be done for rows in a form. like,

a form got developed with header and row area. I have put validation for the headers like if the field's value is empty.

But when it is in rows i think we cant take any row value.

How to validate via codings?Plz help..



View Entire Topic
Former Member
0 Kudos


What sort of validations you want on can put your validation per row by catching pval.row on item event to get the row number.


Former Member
0 Kudos

Hi !

Yes need validation in rows, like when i am about to add the document no rows shud be empty. at least one row must be entered.

I worry that how could the row be linked with header validation.

i am new to this coding.

how can it be achieved?

Thanks in Advance,

Former Member
0 Kudos

Hi ,

in pval before action true write this code

If pVal.ItemUID = "1" And (pVal.FormMode = 2 Or pVal.FormMode = 3) Then

For intloop1 As Integer = 1 To objMatrix.VisualRowCount

If objMatrix.Columns.Item("V_0").Cells.Item(intloop1).Specific.String = "" Then

If intloop1 = objMatrix.VisualRowCount Then


BubbleEvent = False

objMain.objApplication.SetStatusBarMessage("Invalid ItemCode [Message 131-75]", SAPbouiCOM.BoMessageTime.bmt_Short, True)


Exit Sub

End If

End If


End If

end if

Former Member
0 Kudos

Dear Micheal,

I have written like below with help of yours,

If pVal.FormUID = "Form1" And pVal.ItemUID = "1" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And (pVal.FormMode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Or pVal.FormMode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE) And pVal.Before_Action = True Then


Dim str As String

Dim oForm As SAPbouiCOM.Form

oForm = App1.Forms.Item("Form1")

Dim iCnt As Integer

For iCnt = 1 To App1Matrix.VisualRowCount

App1Matrix = oForm.Items.Item("Form1sMat").Specific

str = App1Matrix.Columns.Item("ICode").Cells.Item(iCnt).Specific.value

If str = "" Then

BubbleEvent = False

App1.SetStatusBarMessage("No Rows!! ")

End If


Catch ex As Exception


End Try

End If

But it seems not working, because it is not executed during execution.

Please can you help me whether the code gone wrong any where?

Thank you very much,.