Skip to Content
author's profile photo Former Member
Former Member

How to Enter the Data in Matrix Columns Manually


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



Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on 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 a 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 ?



  • author's profile photo Former Member
    Former Member
    Posted on 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


    Jesper Carstensen

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.