Skip to Content
0
Former Member
Apr 14, 2010 at 01:39 PM

How to Delete a Specific Cell in a Matrix + plz Give sample code for Lost F

57 Views

hello there !!!!

i m in Great Trouble please help me out..

i have to search for a specific Column n then i have to validate that portion, similarly after validating i have to add update delete all the fuction apply... so please help me i m very upset.

Public Sub HandleEventts_Allowance(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByRef BubbleEvent As Boolean)

Try

Dim Count As Int32

If FormUID.Equals("Allowance") Then

If (pVal.BeforeAction = True) And (pVal.ItemUID = "1") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) Then

If pVal.Row = 0 Then

'BubbleEvent = False

End If

o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific

Count = o_Matrix.RowCount()

SBO_Application1.MessageBox("Matrix Count is " & o_Matrix.RowCount)

Validate(pVal, EventEnum, FormUID, BubbleEvent)

End If

End If

Catch ex As Exception

SBO_Application1.MessageBox(ex.Message)

End Try

End Sub

Public Sub Validate(ByRef pval As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByVal FormUID As String, ByRef BubbleEvent As Boolean)

Dim Row, ii As Integer

o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific

o_Matrix.FlushToDataSource()

Try

For Row = 2 To o_Matrix.RowCount

StrName = Convert.ToString(DBtable.GetValue("CardCode", Row - 1)).Trim()''' i got Error over there n rest of my code is also not working pls...

StrUId = Convert.ToString(DBtable.GetValue("U_AlwID", Row - 1)).Trim()

StrEnter = Convert.ToString(DBtable.GetValue("U_SupEnter", Row - 1)).Trim()

StrExist = Convert.ToString(DBtable.GetValue("U_SupExist", Row - 1)).Trim()

If Row - 1 < DBtable.Rows.Count - 1 Or (Not (StrName.Equals(String.Empty) And StrUId.Equals(String.Empty) And (StrEnter.Equals(String.Empty) Or StrExist.Equals(String.Empty))) And (Row - 1 = DBtable.Rows.Count - 1)) Then

If (Not StrName.Equals(String.Empty)) And ((StrUId.Equals(String.Empty) Or StrEnter.Equals(String.Empty)) Or StrExist.Trim.Equals(String.Empty)) Then

SBO_Application1.StatusBar.SetText("Invalid values provided!Blank values not vllowed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)

BubbleEvent = False

Exit Sub

End If

For ii = Row To DBtable.Rows.Count - 1

If Convert.ToString(DBtable.GetValue("ColName", ii)).Trim().Equals(StrName.Trim()) Then

SBO_Application1.StatusBar.SetText("Invalid Allowance ID: Duplication Not Allowed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)

oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE

BubbleEvent = False

Exit Sub

End If

Next

If CDbl(StrName) < 0 Then

SBO_Application1.StatusBar.SetText("Invalid values provided!Blank values not vllowed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)

BubbleEvent = False

Exit Sub

End If

End If

Next Row

Catch ex As Exception

SBO_Application1.MessageBox(ex.Message)

End Try

End Sub