Problem in matrix Column

Hi,
In a matrix column if all row contains data 'A' means in the header text it should display 'A'  but if in matrix column if 5 rows contains 'A' and 3 rows contains 'B' means in the header text should display 'B'. How to do this i have done but its not working correctly in all entries.
Regards,
madhavi

Hi Madhavi,
sounds like an algorithm problem in your code.
you problem should be no big deal:
1. you have have two counter variables
2. go through the matrix.rowcount
3. look in the column if there's A or B
4. add 1 to the correct counter
5. look which counter is higher - more A or more B
6. set the column title.
lg David

Similar Messages

  • Problem with Matrix columns of type Float

    Hi all!
    I need to show in a matrix column a quantity with the number of decimal set in SBO. My code is:
    Dim dt As SAPbouiCOM.DataTable = oFrm.DataSources.DataTables.Add("PCKG")
    dt.Columns.Add("clQta", SAPbouiCOM.BoFieldsType.ft_Float, 30)
    oCl = oGrid.Columns.Add("clQta", SAPbouiCOM.BoFormItemTypes.it_EDIT)
    oCl.Width = 100
    oCl.TitleObject.Caption = tr.getTranslation("clQta") '"Quantità"
    oCl.DataBind.Bind("PCKG", "clQta")
    In this way the number of decimal that i see is 2 because the field type is Float, but in SBO parameterization i have set 4 decimal and would like to see the same number of decimal set in SBO parameterization.
    How can I do?
    Thanks

    Hi,
    If i know well, this is now a limitation of B12007 version. in 8.8 this problem will be resolved.
    othwewise of you set all the prices, Quantities, Sumarizes to 4 it will display for. I think it is now displaying the Quantity settings. (float)
    Regards,
    J.
    Edited by: János Nagy on Oct 7, 2009 12:50 PM

  • Problem with Matrix columns of type Quantity

    Hi all!
    I need to show in a matrix column a quantity with the number of decimal set in SBO. My code is:
    Dim dt As SAPbouiCOM.DataTable = oFrm.DataSources.DataTables.Add("PCKG")
                    dt.Columns.Add("clQta", SAPbouiCOM.BoFieldsType.ft_Float, 30)
    In this way the number of decimal that i see is 2, but in SBO parameterization i have 4 decimal.
    How can I do?
    Thanks

    Hi,
    Check this option.  Go to Administration -> System Initialization -> General Settings -> Display tab.  Here check the Decimal places for Quantities.  It might be 4.  Change it to 2 and recheck the value in your form.
    Hope this helps.
    Regards,
    Satish.

  • Problem in Matrix column -- ChoosefromList

    Hello
        I created a user defined form with matrix of  4  column .Column No:3 is of type ChoosefromList. When the single row of the matrix is filled with  the values  ChoosefromList (Column.No:3) is working good. 
         When multiple rows are filled in matrix  say 1,2,3,4,5 .After filling the  5 rows ,if i want to change value of the 2nd row  column no:3 (where i used choosefrom list),the newly selected value from the ChoosfromList get displayed in the 5 th row column no:3.
        The following is the code snippet :
    If (pVal.ColUID = "DNGLANo") Then
                    If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
                        Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
                        oCFLEvento = pVal
                        Dim sCFL_ID As String
                        sCFL_ID = oCFLEvento.ChooseFromListUID
                        DNForm = SBO_Application.Forms.Item(FormUID)
                        Dim oCFL As SAPbouiCOM.ChooseFromList
                        oCFL = DNForm.ChooseFromLists.Item(sCFL_ID)
                        If oCFLEvento.BeforeAction = False Then
                            Dim oDataTable As SAPbouiCOM.DataTable
                            oDataTable = oCFLEvento.SelectedObjects
                            Dim val As String
                            Try
                                val = oDataTable.GetValue(0, 0)
                                DNEdTGLA = DNColumn12.Cells.Item(DNMatrix3.RowCount).Specific
                                DNEdTGLA.Value = val
                            Catch ex As Exception
                            End Try
                        End If
                    End If
                End If

    Since you mentioned matrix rowcount,  the CFL value is displayed in last row and hence replace matrix.rowcount with pval.row.
    If (pVal.ColUID = "DNGLANo") Then
    If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
    Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
    oCFLEvento = pVal
    Dim sCFL_ID As String
    sCFL_ID = oCFLEvento.ChooseFromListUID
    DNForm = SBO_Application.Forms.Item(FormUID)
    Dim oCFL As SAPbouiCOM.ChooseFromList
    oCFL = DNForm.ChooseFromLists.Item(sCFL_ID)
    If oCFLEvento.BeforeAction = False Then
    Dim oDataTable As SAPbouiCOM.DataTable
    oDataTable = oCFLEvento.SelectedObjects
    Dim val As String
    Try
    val = oDataTable.GetValue(0, 0)
    DNEdTGLA = DNColumn12.Cells.Item(pval.row).Specific
    DNEdTGLA.Value = val
    Catch ex As Exception
    End Try
    End If
    End If
    End If

  • Problem in Matrix while Populating Data

    Hello All,
    I am facing a problem in matrix column in SAP 8.8
    I am filling a matrix with data from a table ITT1.
    Matrix1 = oChlSelc.Items.Item("3").Specific
    oChlSelc.DataSources.DataTables.Add("Approval")
    oChlSelc.DataSources.DataTables.Item("Approval").Clear()
    Dim Str_Query As String = "Select Father,Code,Quantity From ITT1"
    oChlSelc.DataSources.DataTables.Item("Approval").ExecuteQuery(Str_Query)
    Matrix1.Columns.Item("col_1").DataBind.Bind("Approval", ",Code")
    Matrix1.Columns.Item("col_2").DataBind.Bind("Approval", "Quantity")
    matrix1.LoadFromDatasource
    The problem is that the data is getting populated in the matrix without any problem but the Quantity field is not showing the
    exact Value means its showing the RoundOff Value i.e. 1.45 = 1
    If Quantity is 1.45 in matrix column its showing 1 .
    That what i am facing .
    Thanks
    Amit

    Hi Amit
    Its working fine in my system
    and also im getting the quantity value as 1.00  by using this code
      Dim matrix1 As SAPbouiCOM.Matrix
            Dim oform As SAPbouiCOM.Form
            oForm = SBO_Application.Forms.Item("frm_test")
            matrix1 = oForm.Items.Item("1").Specific
            oForm.DataSources.DataTables.Add("Approval")
            oForm.DataSources.DataTables.Item("Approval").Clear()
            Dim Str_Query As String = "Select Father,Code,Quantity From ITT1"
            oForm.DataSources.DataTables.Item("Approval").ExecuteQuery(Str_Query)
            matrix1.Columns.Item("V_0").DataBind.Bind("Approval", "Code")
            matrix1.Columns.Item("V_1").DataBind.Bind("Approval", "Quantity")
            matrix1.LoadFromDatasource()
    Thanks
    Shafi

  • Problem with checkbox column in matrix

    Hello.
    I have a little problem with checkbox column in matrix.
    Column is binded to the UserData.
    It has ValOn="Y", ValOff="N".
    I use C++. It is wird problem. In matrix I have 10 columns - scrollbar role and if You want see checkbox column, You must role to the right. If this column is on the screen, and I use:
    checkcell->PutChecked(VARIANT_TRUE);
    then the checkbox is cheched, and if the checkbox isn`t on the screen and I use this comment - it nothing happening.
    I tried to use ValOn="Y", PutChecked...
    The problem i solved if the column is on the screen - if the column is first in matrix or second, but if it`s last I have a big problem.
    My column with checkbox is not editable, but I tried to make it editable, check it, and then make it uneditable - the same efect.
    How can I solve it ?
    Sorry for my english.
    Kamil Wydra

    Hello Kamil,
    I am not sure about your problem, but here is an example of how to use checkbox in UI API.
    First, create the matrix with checkbox column in Screen painter, and the output is an xml file, like this. Type as 121 indicates that it is a check box.
    - <column AffectsFormMode="0" backcolor="-1" description="" disp_desc="0" editable="0" right_just="0" title="Rented" type="121" uid="Rented" val_off="N" val_on="Y" visible="1" width="41">
      <databind alias="U_RENTED" databound="1" table="@VIDS" />
      <ExtendedObject />
    Second, bind the column to table from DB. This is a bug of 2004 Screen Painter, so if you are using 2005 Screen Painter, there is no problem.
    Third, when you open the form, you can check and uncheck the cell.
    BTW, please set the editable of the column to true.
    Hope this helps,
    Nick

  • How to Calculate Line items Total of Matrix Column

    hai experts,
                  Im facing a problem like
                   1. i have a matrix with a column Labour Costs in that im taking some cost.
                   2. in footer a have a Edit Text like Total Labour Cost
                   3 when i enter amount in matrix column it sholud disply that value in total labour cost and when we add new row ,labour cost it should add to 'total labour cost' in footer.Like Invoice Documents.

    Where do you want to implement this like sapscript / smartforms or adobe forms? please specify.

  • Check box in matrix column bind correctly but doesn't appear check sign

    Dear Sirs,
    I have a check box in a matrix column (the matrix is placed i an extra folder in the item master data form).
    The column is bound to a DBDataSource related to the user defined table @IIT_ITM1 as reported in the following code. The table field bound to the check box column is alphanumeric of size 1.
    I use the following code:
                    oCln = oMtx.Columns.Add("Per_coll", SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX);
                    oCln.DisplayDesc = true;
                    oCln.Description = "For test";
                    oCln.TitleObject.Caption = "For test";
                    oCln.ValOn = "Y";
                    oCln.ValOff = "N";
                    oCln.Width = 60;
                    oCln.DataBind.SetBound(true, "@IIT_ITM1", "U_IIT_PerColl");
                    oCln.Editable = true;
    The problem is: the binding to the database work (if I click on the check box and save the data, then the database content change accordingly) but I CANNOT LET THE USER SIGN APPEAR on the check box control!
    Does anyone have the solution?
    Thank you for help
    Massimo

    No response from the forum

  • Unusual Problem with Matrix

    Hi Guys,
    I have a matrix which is on the UDO form. I have bound all the columns with DB DataSources. I have one column of combobox type where in the back end i have the valid values
    "1-Approved"
    "2-Pending"
    "3-Rejected"
    The problem here is that when the form is opened the matrix column only shows values 2 and 3 ("2-Pending","3-Rejected").
    I also have another Column with 2 Valid values, again facing the same problem. Only one value is being shown.
    But in the backend when i check in the "Manage User Fields" Screen all the 3 Valid values are visible.
    Am i doing something wrong..??
    Thanks in Advance,
    Vasu Natari.

    Hi,
    For me, even if the validvalues are added, it is working. Real.
    Here is a code for matrix columns, and it is shows me on the form the description.
    You must have to add of course validvalues to show the description (as in the description). This sample
    is shows you the ship types of orders. You also can use userdatasources....
    Sub ComboDesc()
            Dim oForm As SAPbouiCOM.Form = m_SBO_Application.Forms.Add("TEST_MTX")
            oForm.Visible = True
            Dim oitem As SAPbouiCOM.Item = oForm.Items.Add("MTX", SAPbouiCOM.BoFormItemTypes.it_MATRIX)
            With oitem
                .Top = 5
                .Left = 5
                .Width = oForm.Width - 15
                .Height = oForm.Height - 15
                .AffectsFormMode = False
            End With
            Dim oMatrix As SAPbouiCOM.Matrix = oitem.Specific
            Dim oColumns As SAPbouiCOM.Columns = oMatrix.Columns
            Dim oDBDataSource As DBDataSource = oForm.DataSources.DBDataSources.Add("ORDR")
            Dim oColumn As SAPbouiCOM.Column = oColumns.Add("#", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            With oColumn
                .TitleObject.Caption = "#"
                .Description = .TitleObject.Caption
                .Width = 30
                .DataBind.SetBound(True, "ORDR", "DocEntry")
                .Editable = False
            End With
            oColumn = oColumns.Add("COL1", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)
            With oColumn
                .Width = 80
                .TitleObject.Caption = "ShipType"
                .Description = .TitleObject.Caption
                .Editable = False
                .DataBind.SetBound(True, "ORDR", "TrnspCode")
                .DisplayDesc = True
                .Visible = True
            End With
            Dim vv As SAPbouiCOM.ValidValues = oColumn.ValidValues
            Dim ors As SAPbobsCOM.Recordset = ocmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
            ors.DoQuery("select * from OSHP")
            Do While Not (ors.EoF)
                vv.Add(ors.Fields.Item(0).Value, Left(ors.Fields.Item(1).Value, 30))
                ors.MoveNext()
            Loop
            oDBDataSource.Query()
            oMatrix.LoadFromDataSource()
        End Sub
    Regards
    J.

  • Changing Matrix column title?

    Hi all,
    Is it possible to change a matrix column title using the ColumnTitle.Caption property? I have tried using the following code but it does not work:
    'Sales order form - Add mode.
    If pVal.FormType = 139 And pVal.FormMode = 3 Then
    'After form loads
    If pVal.EventType = et_FORM_LOAD And pVal.Before_Action = False Then
    'SO form.
    Set oForm = oApp.Forms.Item(FormUID)
    Set oItem = oForm.Items.Item("38")
    Set oMatrix = oItem.Specific
    Set oColumn = oMatrix.Columns.Item("1")
    oColumn.TitleObject.Caption = "Item Code"
    End If
    End If
    Thank you.
    Andrew.

    Hi John,
    Thanks for the reply. Your questions/suggestions led me on a path to finding the problem and a solution.
    I tried the same block of code in another company db and it changed the column title fine. The reason it wouldn't work in the current company db I'm working on was because I had previously changed the column title to 'Item No.' (using ctrl & double-click). So the SDK was changing the Original Description but the new desc. of 'Item No.' remained unchanged. As soon as I deleted the new desc. the SDK worked fine.
    Thanks for your help.
    Regards,
    Andrew.

  • Is it possible to fetch matrix column through formatted search in UDF?

    HI,
    Is it possible to fetch the value of first row of quantity column in user defined field through formatted search?
    SELECT $[$38.11.number]
      does work but in user defined column of matrix only. I have requirement that when there will be only one row in matrix, the quantity should be accessible in user defined field. and for this, the above query gives internal error.
    thanks and regards,
    Binita

    David,
    I used the query sent by you and further facing following problem. may be my filtering is on wrong parameter.
    SELECT $[rdr1.quantity] * $[ordr.u_qty1.number] from ordr o, rdr1 r where o.cardcode= $[ordr.cardcode] and r.itemcode = $[rdr1.itemcode]
    this query gives correct result when assigning to matrix column.
    when I applied the same query to user defined field, then after selecting the row as suggested by you, it does give value but, in this case, it takes it from rdr1 instead of from matrix.
    for example, I have selected item A001 in matrix. if that item is already there in rdr1, then it fetches its quantity from table instead of that provided by me in matrix's quantity column
    Please guide further,
    thanks in advance,
    Binita
    Edited by: Binita  Joshi on Jun 5, 2008 2:45 PM
    even
    SELECT $[$38.11.number] * $[ordr.u_qty1.number] from ordr o, rdr1 r where o.cardcode= $[ordr.cardcode] and r.itemcode = $[$38.1.0]
    is not working. no clues.

  • Re:Picture in Matrix column

    Hi,
    I have Created a Matrix.I want to set a button like picture in one of the column in the matrix.How to achieve this.
    Thanx in advance
    Mohana

    Hi Petr,
    I have used the following code for loading the image in the matrix column.my problem is, no image is loading on the column.How should i achieve this
    Dim odbtable As SAPbouiCOM.DataTable
    Dim sql As String
    odbtable = oForm.DataSources.DataTables.Add("VEP")
    sql = "SELECT u_path from [@skil_attach]"
    odbtable.ExecuteQuery(sql)
    oInspecCol = oColumns.Item("Inspec")
    oInspecCol.Editable = False
    oInspecCol.DataBind.Bind("VEP","U_Path")
    I have created the table as skil_attach and i added a field as path with alphanumeric - 254
    Thanx in advance
    Mohana

  • I want to do editable a matrix column

    Hi all! I want to write a value in a not editable column of a matrix, so first i try to do editable the column,and then write the value,so i do this:
    Matrix.Columns.Item("34").Editable = True
    But i get this error:
    Item - the item is not a user defined item
    I'm working with the withholding tax table(column account). What can i do?

    Hi Miguel,
    There is one solution (not so nice) for your problem, we had the same problem.
    1. set the column editable through the gui en restart SBO
    In your addon
    1. at form load set the column to editable false
    2. just before the change, set the column to editable true
    3. change the column
    4. set the column to editable false.
    done
    Regards,
    Ad

  • How to set default value in matrix column

    Hi all,
    Does any one know how to set a default value in matrix column ?. I just want , when an event right click and add row. so i set a default value in a column field for example 'Test'. FYI the matrix is in the UDO.
    so my code will be like this
    If pVal.ItemUID = "Matrix" And pVal.MenuUID = "1292" Then
                        Try
                            Dim oColumn As SAPbouiCOM.EditTextColumn
                            Dim matrix As SAPbouiCOM.Matrix
                            matrix = oForm.Items.Item("Matrix").Specific
                           oColumn = mat.Columns.Item("Code").specific
                            oColumn.Value = "Test"
                        Catch ex As Exception
                            Debug.Print(ex.Message)
                            Debug.Print(ex.ToString)
                        End Try
                    End If
    I have run it and when i right click and add row it still can not set the default value in one of the matrx column.
    does any one know how to solve it. thanks in advance

    Hi Bodhi
    Sandeep is right you can set value using SetValue() function
    If pVal.ItemUID = "Matrix" And pVal.MenuUID = "1292" Then
                        Try
                            Dim matrix As SAPbouiCOM.Matrix= oForm.Items.Item("Matrix").Specific
                            oForm.DataSources.DBDataSources.Item("UDT").Clear()
                            matrix .AddRow()
                            matrix .FlushToDataSource()
                            With form.DataSources.DBDataSources.Item("UDT") 
                                    .SetValue("UDF", matrix .RowCount - 1, "Test")
                            End With
                            matrix .LoadFromDataSource()
                        Catch ex As Exception
                            Debug.Print(ex.Message)
                            Debug.Print(ex.ToString)
                        End Try
    End If

  • SSRS 2008R2 : Not able to use Previous aggregrate function in matrix columns cell

    Hi Expert,
    I have used a matrix tablix in my report. It is working fine. But when I am trying to use Previous aggregrate in one matrix column cell I get the below error:
    The use of previous aggregrate function ia a tablix cell with in 'Tablix1' is not supported.
    Please help me regarding that.
    Thanks Rana

    Hi Rana,
    In your scenario, you use previous function in the “Data” cell, right? Previous function cannot be used in the overlapping parts of row group and column group. One workaround of this issue is use custom code to get the previous value.
    Public Shared previous as Integer
    Public Shared current as Integer
      Public Shared Function GetCurrent(Item as Integer) as Integer
         previous=current
         current=Item
         return current
      End Function
      Public Shared Function GetPrevious()
         return previous
      End Function
    Then you can use the expression below in the “Data” cell to get the previous value:
    =Code.GetCurrent(fields!Score.Value) & "-Previous-" & iif(Code.GetPrevious()=0,"",Code.GetPrevious())
    If you have any questions, please feel free to ask.
    Regards,
    Charlie Liao
    TechNet Community Support

Maybe you are looking for