cancel
Showing results for 
Search instead for 
Did you mean: 

Validation in rows

Former Member
0 Kudos
107

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..

Thanks,

Marudu.

View Entire Topic
Former Member
0 Kudos

Hi

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

Regards

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

Else

BubbleEvent = False

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

objForm.Freeze(False)

Exit Sub

End If

End If

Next

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

Try

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

Next

Catch ex As Exception

App1.MessageBox(ex.Message)

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,.