Skip to Content
author's profile photo Former Member
Former Member

Problem in Delete Row

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 07:21 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.