cancel
Showing results for 
Search instead for 
Did you mean: 

Matrix-Line Exists

Former Member
0 Kudos

hi,

i create the matrix column based on Header value. its created

now i changed header value for example 10 to 14

now i need create the 4 columns after 10

but its show the error " Matrix-Line Exists"

Below the code

Dim oItem As SAPbouiCOM.Item

Dim oColumns As SAPbouiCOM.Columns

Dim oColumn As SAPbouiCOM.Column

oItem = frmtemplate.Items.Item("MatTemp")

If prvious = "" Then

Dim i As Integer

Dim j As Integer

j = hrs

For i = 0 To hrs - 1

Dim K As String = ""

K = Convert.ToString(i + 1)

oMatrix1 = oItem.Specific

oColumns = oMatrix1.Columns

oColumn = oColumns.Add(K, SAPbouiCOM.BoFormItemTypes.it_EDIT)

oColumn.TitleObject.Caption = K + "hours"

oColumn.Width = 50

oColumn.DataBind.SetBound(True, "@PTM1", "U_Qty")

Next

oGFun.SetNewLine(oMatrix1, oDBDSDetail1)

Else

Dim k As Integer = 0

k = Convert.ToInt64(prvious)

Dim m As Integer

m = hrs - k

Dim y As Integer

oMatrix1 = oItem.Specific

oColumns = oMatrix1.Columns

For y = 0 To m - 1

Dim current As Integer = oMatrix1.Columns.Count()

current += 1

Dim header As String = ""

header = Convert.ToString(current)

oColumn = oColumns.Add(header, SAPbouiCOM.BoFormItemTypes.it_EDIT)

oColumn.TitleObject.Caption = header + "hours"

oColumn.Width = 50

oColumn.DataBind.SetBound(True, "@PTM1", "U_Qty")

Next

End If

Thannks & regards

B.Lakshmi Narayanan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Before add columns clear all matrix rows means oMatrix.Clear(). then it will be work.

Former Member
0 Kudos

hi Thillai,

Thanks for you valuable replies. when i used oMatrix.clear() all data's clear.For example already i fill in first row. its also deleted.

i need create new two columns not deleted any data's

Thanks & regards

B. Lakshmi Narayanan

Former Member
0 Kudos

Hi lakshmi narayanan.

According to me, with data you cannot add columns. If you try like like this SAP consider as a error (Matrix-Line Exits)

If you want like that store all data tempary table before clear the matrix, then restore the matrix's data from datatable, after adding a new column.

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks thillai