cancel
Showing results for 
Search instead for 
Did you mean: 

AddRow on Matrix does not Save

Former Member
0 Kudos

Hello,

I am having a problem saving Rows from a Matrix with a User Defined Object. The following is the code I am using.

Private Sub applic_ItemEvent(ByVal FormID_Sap As_

String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef_ BubbleEvent As Boolean) Handles applic.ItemEvent

Dim FormUID1 As String

FormUID1 = FormID_Sap

If ((formuid1 = "MyForm") And (pVal.ItemUID = "AddRow")_

And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK)_

And (pVal.Before_Action = False)) Then

Dim oMatrix1 As SAPbouiCOM.Matrix

Dim SBOForm1 As SAPbouiCOM.Form

SBOForm1 = pApp.Forms.Item(formuid1)

oMatrix1 = SBOForm1.Items.Item("20").Specific

oMatrix1.AddRow()

End If

I know AddRow has 2 parameters I can send it, but they all seem to give me the same result in trying the following.

.AddRow(1)

.AddRow(1,2)

Row 1 is being duplicated to Row 2 when I click on the button. It also does not save the data from Row 2.

BTW: I did try the Sample UDO Code for the MealOrder Sample and it gave me the same problem.

Thank you in Advance for any help.

Paul

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Paul,

You must bind the matrix into a UserDataSource. Then Supply first the needed values in the UserDataSource before calling the function AddRow of the matrix so it will not duplicate the row above it. Hope this helps.

Answers (0)