Skip to Content
avatar image
Former Member

How to Enter the Data in Matrix Columns Manually

Hi,

I've created a matrix and have i've set the Column property edit as true like "oColumn.Editable = True" where oColumn is the name i've given for Matrix columns,but still i failed to add data to matrix manually

can any one help me

Thanks

Raghu

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 04, 2004 at 10:09 AM

    Hi Raghu

    First of all U have to create the matrix with the columns, as for example:

    Set oItem = oForm.Items.Add("Matrix1", it_MATRIX)

    oItem.Left = 5

    oItem.Width = 557

    oItem.Top = 50

    oItem.Height = 260

    Set oMatrix = oItem.Specific

    Set oColumns = oMatrix.Columns

    Set oColumn = oColumns.Add("#", it_EDIT)

    oColumn.TitleObject.Caption = "#"

    oColumn.Width = 30

    oColumn.Editable = False

    Set oColumn = oColumns.Add("Codpro", it_EDIT)

    oColumn.TitleObject.Caption = "Cod project"

    oColumn.Width = 127

    oColumn.Editable = True

    Set oColumn = oColumns.Add("CodUs", it_EDIT)

    oColumn.TitleObject.Caption = "User"

    oColumn.Width = 127

    oColumn.Editable = True

    The the second step is to add the Add the Data Source to your own form:

    Public Sub AddDataSourceToForm()

    Set oDBDataSource = oForm.DataSources.DBDataSources.Add("Tablename")

    End Sub

    And then to bind the data to each column:

    Public Sub BindDataToForm()

    Dim oMatrix As SAPbouiCOM.Matrix

    Dim oColumns As SAPbouiCOM.Columns

    Dim oColumn As SAPbouiCOM.Column

    Set oMatrix = oForm.Items.Item("Matrix1").Specific

    Set oColumns = oMatrix.Columns

    Set oColumn = oColumns.Item("Codpro")

    oColumn.DataBind.SetBound True, "Tablename", "U_proyecto"

    Set oColumn = oColumns.Item("CodUs")

    oColumn.DataBind.SetBound True, "TableName", "U_usuario"

    End Sub

    For more help yo can find an example in the UI SAMPLES.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Natalia

      Thanks 4 the Reply , i'm sorry may be i'm not clear in my question, the code which u have put here Pulls the data from a Particular Table to the Matrix colums, but this is not i want bcoz what i want to do actually is like i've a matrix with two columns with names like "FieldName" and "Field Description" and here i've also put a Button create now what i want to peform is i give values in the Cloumns for Field Name and Field Description and under the button item handling event i'll put the code 4 creating UDF, and the UDF will be created based on the values entered in Cloumns,this is what i actually want, but i'm faling to gie the values in the Matrix colums manully,

      Hope i' Clear in my ?

      Thanks&Regards

      Raghuram

  • avatar image
    Former Member
    Jun 04, 2004 at 08:32 AM

    Hi Raghu,

    have you added a row to the matrix? You'll need to add a row before you can add data. Also I think you need to add a datasource to each column (that's what I've done anyway).

    Hope this hels

    Rgds

    Jesper Carstensen

    Add comment
    10|10000 characters needed characters exceeded