cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in Delete Row

Former Member
0 Kudos

Hai To All,

Iam using PL 05 i have enable DeleteRow option. If i click the deleterow the row is deleted but after saving the entry there is null value in database. for example if i have 2 row in the matrix if i delete last row the content is deleted after that iam saving the matrix. In the database i have 2 rows one with content and other with null value..

Whts the soultion of this....

Does anyone have idea reply me....

Regards,

Anitha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anitha,

For the delete option, you need to right a small function if its going to be ur own form.

Try using the following code...

Private Sub DeleteRow()

Dim oDBDSource As SAPbouiCOM.DBDataSource

Dim Count As Integer

Dim oMatrix As SAPbouiCOM.Matrix

Try

oDBDSource = objForm.DataSources.DBDataSources.Item("@TableName")

oMatrix = objForm.Items.Item("3").Specific

oMatrix.FlushToDataSource()

oMatrix.DeleteRow(strRow)

objForm.Update()

'objForm.DataSources.DBDataSources.Item("@TableName").RemoveRecord(strRow - 1)

oDBDSource.Clear()

oMatrix.FlushToDataSource()

oMatrix.LoadFromDataSource()

For Count = 1 To oDBDSource.Size - 1

oDBDSource.SetValue("Code", Count - 1, Count)

Next

Catch ex As Exception

MsgBox(ex.Message)

End Try

End Sub

Hope this helps.

Satish.

Answers (0)