Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to duplicate the data in matrix single column........

hi all,

In my addon-form i have a matrix,in the matrix i have data for 5 that 3rd column when i enter any number & press tab key....the remaining 5 rows(downwards only) for that 3rd column only should be get updated with that number...can anybody suggest me some ideas????


custcode custname days

======= ======= ===

10001 John 3

10002 Peter 8

10003 David 5 -

>here when i type 5 & press tab remining rows for that column should get updated with no:5

10004 Kris

10005 Corter

10006 Albert




You need to get value of the cell where are you press TAB key (only if pVal.ColUID = "col_3" , only if cursor is in the 3"d column) and set value to other, next rows, 3"d columns. You need to do all in the ItemEvent.

1 row 3.0

2 row 4.9

3 row 6.8

4 row 6.0 --> here your press TAB. so when you handle:

5 row ..

6 row ..

7 row ..

... ItemEvent Handler
  If pVal.EventType = et_KEY_DOWN  _
   And pVal.ItemUID = "YOUR_matrix_UID"  _
   And pVal.ColUID = "col_3"  _
   And pVal.CharPressed = "9" ' TAB KEY
    If Matrix_ReplicateValue(oForm,pVal.Row) Then
    End If
  End If
End Sub

Private Function Matrix_ReplicateValue(oForm,iRow) As Boolean

' 1st you need to get value in col_3 of the current row
Dim oEdit 
oEdit = oMatrix.Columns.Item("col_3").Cells.Item(iRow).Specific
Dim sValue As String = oEdit.Value
' 2nd you need to set value in col_3 of the other rows in matrix

For i = iRow To oMatrix.VisualRowCount

End Function

Edited by: Sierdna S on Oct 9, 2008 3:49 PM

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question