Skip to Content
0
Former Member
Nov 24, 2011 at 09:52 AM

Matrix-Line Exists

319 Views

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