Matrix addrow problem

I want to enter some value in a matrix
I enbled matrix with
oMatrix.AddRow()
but problem is
that - when I am inputing data in matrix fields , after pressing tab the value disappears
how can I resolve the problem?

thts because your matrix's columns are not bound with any user or DB datatsource. alternatively , you will have to bind it with the columns of table to which you are saving the data.
regards,
Binita

Similar Messages

  • Matrix.AddRow "eats" rows

    Hello
    I'm trying to do sorting on matrix object. I'm almost there but there is small problem. Here is the code
                    for (int i = 0; i < dbDataSource.Size; i++)
                        dbDataSource.Offset = sortedList<i>.Idx;
                        matrix.AddRow(1, ++i);
    every time I fire double click event (which contains sorting code) my matrix will show less and less items until it becomes blank.
    If it helps somehow I'm posting code which I use for actual sorting.
                if (pVal.ColUID == "col_dost")
                    matrix.Clear();
                    List<Dostawca> dostawcy = new List<Dostawca>();
                    DBDataSource dbDataSource = form.DataSources.DBDataSources.Item("@CT_PRP1");
                    int count = dostawcy.Count;
                    int k = 0;
                    for (int i = 0; i < dbDataSource.Size; i++)
                        string sValue = dbDataSource.GetValue("U_CardName", i);
                        Dostawca dostawca = new Dostawca();
                        dostawca.Nazwa = sValue;
                        dostawca.Idx = k;
                        dostawcy.Add(dostawca);
                        k++;
                    var sortedList = dostawcy.OrderBy(x => x.Nazwa).ToList();
                    for (int i = 0; i < dbDataSource.Size; i++)
                        dbDataSource.Offset = sortedList<i>.Idx;
                        matrix.AddRow(1, ++i);
    and here is my "Dostawca" class
        public class Dostawca
            private string _nazwa;
            private int _id;
            public Dostawca() { }
            public string Nazwa
                get
                    return _nazwa;
                set
                    _nazwa = value;
            public int Idx
                get
                    return _id;
                set
                    _id = value;
    Thanks
    Kamil

    Ok, never mind. I see the problem.

  • Matrix addrow

    Hi
    I have a simple form. As soon as i click Addrow button i need to add a row in the matrix.  I have opened the form first time and clicked addrow buttond a new row is getting added into the matrix. Now i have clicked the cancel button in the form. And then i reopened the form again when i click addrow button 2 new rows are getting added. but i need to add only single row.
    Please let me know the solution. i have given the sample code for your reference.
    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
    If (FormUID = "Frm_QTENT1") Then
                    If (pVal.Before_Action = False) Then
                        If (pVal.ItemUID = "Addrow") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) Then
                            Dim f As SAPbouiCOM.Form
                            Dim oMatrix As SAPbouiCOM.Matrix
                            f = SBO_Application.Forms.Item(FormUID)
                            oMatrix = f.Items.Item("mat1").Specific
                            f.DataSources.DBDataSources.Item(1).Clear()
                            oMatrix.AddRow(1)
                        End If
                    End If
                End If
    End sub
    You can also test . Just add a matrix to a form and then add one button. In the itemevent just past the code above and run the form. And then click addrow button
    you can see a new row is added into the matrix. When cancel the form. And now open the form again now click add button only once. You can see 2 rows are getting added. The code what is pasted will be fired 2 wise .
    Please let me know how can i solve this problem.
    If any one able to solve this problem i will give full reward points
    regards
    Suresh

    hi,
    Still i am facing the same problem. I have given the comple code. please let me have a solution for the same. When i click next sample i need to populate all the parameter for the item in the matrix. for that i have writtern the code. It works fine still i did not click cancel button. But as soon as i click cancel button and add click next sample button multiple time this item is getting fired and row are getting add for the time which i have added first time.
    If (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) And (pVal.ItemUID = "nextsample") Then
                            Dim oEdit As SAPbouiCOM.EditText ' Sample no
                            Dim oEdit1 As SAPbouiCOM.EditText ' Para code
                            Dim oEdit2 As SAPbouiCOM.EditText ' Para desc
                            Dim oEdit3 As SAPbouiCOM.EditText ' UOM Code
                            Dim oEdit4 As SAPbouiCOM.EditText ' UOM Name
                            Dim oEdit5 As SAPbouiCOM.EditText ' Standard Value
                            Dim oEdit6 As SAPbouiCOM.EditText ' Tollerance Pluse
                            Dim oEdit7 As SAPbouiCOM.EditText ' Tollerance minus
                            Dim i As Integer
                            Dim k As Integer
                            Dim sSQL As String
                            Dim oDocRec As SAPbobsCOM.Recordset
                            samno = samno + 1
                            txtsamno.Value = samno
                            oDocRec = Ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                            sSQL = "select b.U_paracode,b.U_paradesc,b.U_UomCode,b.U_uom,b.U_value,b.U_tollplus,b.U_tollmins from [@PSSIT_QCSTANDHDR1] a,  [@PSSIT_QCSTANDDTL1] b where a.U_itemcode = '" & cbogrp.Selected.Value.ToString() & "' and a.Code = b.Code"
                            'sSQL = "select b.U_paracode,b.U_paradesc,b.U_UomCode,b.U_uom,b.U_value,b.U_tollplus,b.U_tollmins from [@PSSIT_QCSTANDHDR1] a, [@PSSIT_QCSTANDDTL1] b where a.U_itemcode = '" & oForm.DataSource.UserDataSource.Item("ItemCode").ValueEx & "' and a.Code = b.Code"
                            oDocRec.DoQuery(sSQL)
                            Oform.Freeze(True)
                            '**********8
                            Dim f1 As SAPbouiCOM.Form
                            Dim oDBs As SAPbouiCOM.DBDataSource
                            f1 = SBO_Application.Forms.Item(FormUID)
                            oMatrix = f1.Items.Item("mat2").Specific
                            oDBs = f1.DataSources.DBDataSources.Item("@PSSIT_QCDTL1")
                            oDBs.Clear()
                            Omatrix.Clear()
                            '  If RefFlag = False Then
                            Omatrix.AddRow(1)
                            If oDocRec.RecordCount > 0 Then
                                For i = 0 To oDocRec.RecordCount - 1
                                    'MessageBox.Show(oDocRec.RecordCount)
                                    ' Omatrix.AddRow(1)
                                    'Sample no
                                    oEdit = matcol1.Cells.Item(totrow).Specific
                                    oEdit.Value = CInt(samno)
                                    matcol1.Editable = False
                                    'Parameter code
                                    oEdit1 = matcol2.Cells.Item(totrow).Specific
                                    oEdit1.Value = oDocRec.Fields.Item(0).Value
                                    matcol2.Editable = False
                                    'Parameter Name
                                    oEdit2 = matcol3.Cells.Item(totrow).Specific
                                    oEdit2.Value = oDocRec.Fields.Item(1).Value
                                    matcol3.Editable = False
                                    'UOM Code
                                    oEdit3 = matcol4.Cells.Item(totrow).Specific
                                    oEdit3.Value = oDocRec.Fields.Item(2).Value
                                    matcol4.Editable = False
                                    'UOM Name
                                    oEdit4 = matcol5.Cells.Item(totrow).Specific
                                    oEdit4.Value = oDocRec.Fields.Item(3).Value
                                    matcol5.Editable = False
                                    'Standard Value
                                    oEdit5 = matcol6.Cells.Item(totrow).Specific
                                    oEdit5.Value = oDocRec.Fields.Item(4).Value
                                    matcol6.Editable = False
                                    'Tollerance Pluse
                                    oEdit6 = matcol7.Cells.Item(totrow).Specific
                                    oEdit6.Value = oDocRec.Fields.Item(5).Value
                                    matcol7.Editable = False
                                    'Tollerance minus
                                    oEdit7 = matcol8.Cells.Item(totrow).Specific
                                    oEdit7.Value = oDocRec.Fields.Item(6).Value
                                    matcol8.Editable = False
                                    oDocRec.MoveNext()
                                    If oDocRec.EoF = True Then
                                        totrow = totrow + 1
                                        Oform.Freeze(False)
                                        Exit For
                                    End If
                                    totrow = totrow + 1
                                    Omatrix.AddRow(1)
                                Next i
                                Oform.Freeze(False)
                            Else
                                MessageBox.Show("Parameter is not updated for this item")
                            End If
                        End If

  • Can you help me to solve this matrix filling problem?

    Hi,
    I need to fill a matrix column. this is the description briefly.
    1.This is my binding
    oForm.DataSources.UserDataSources.Add("usr_col5", SAPbouiCOM.BoDataType.dt_DATE, 50);
    oColumn = oColumns.Add("Col5", SAPbouiCOM.BoFormItemTypes.it_EDIT);
                    oColumn.Description = "Konteringsdato";
                    oColumn.TitleObject.Caption = "Konteringsdato";
                    oColumn.DataBind.SetBound(true, "", "usr_col5");
                    oColumn.Width = 89;
                    oColumn.Editable = false;
    2.I am going to fill this column using record set's field. all of the other column's fillings are ok.but problem is here
    oForm.DataSources.UserDataSources.Item("usr_col5").Value = oRs.Fields.Item("DocDate").Value.ToString();
    I think there should be a casting instead of of using ToString(). But i couldn't able to do it. So please help me.

    Hi,
    you can try once to set
    ((SAPbouiCOM.EditText)((SAPbouiCOM.Matrix)(oForm.Items.Item("mtxItemUID").Specific)).Columns.Item("Col5").Cells.Item(cellnumber).Specific).String = oRs.Fields.Item("DocDate").Value.ToString();
    or
    ((SAPbouiCOM.EditText)((SAPbouiCOM.Matrix)(oForm.Items.Item("mtxItemUID").Specific)).Columns.Item("Col5").Cells.Item(cellnumber).Specific).Value = oRs.Fields.Item("DocDate").Value.ToString();
    regards
    David

  • Matrix-binding problem

    Hi,
    I created one UDO form.
    in that i am trying to fill the matrix with recordset.
    becoz i am selecting the value from combobox and i run the query with this value.
    so this resultant record set i want to fill in matrix rows.
    oForm = SBO_Application.Forms.Item("JBWISSUES_")
    oItem = oForm.Items.Item("mtx_0")
    oMatrix = oItem.Specific
    oColumns = oMatrix.Columns
    'frm = app.Forms.ActiveForm
    'oMat = frm.Items.Item("gd_act").Specific
    'oMatrix.Clear()
    oComboBox = oForm.Items.Item("27").Specific
    ds = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
    ds.DoQuery("select a.code as Code,b.Itemname as Desc1,a.quantity as Quantity from itt1 a,oitm b where a.code=b.Itemcode and a.code='" & oComboBox.Selected.Value & "'")
    ds.MoveFirst()
    oColumn = oColumns.Item("col_0")
    For i = 0 To ds.RecordCount - 1
    oColumn.ValidValues.Add(ds.Fields.Item("Code").Value, ds.Fields.Item("Desc1").Value)
    ds.MoveNext()
    Next
    oMatrix.AddRow()
    here i am getting error like Object reference not set to instance error at oColumn.validvalues....... plz hel p me in that.
    Regards,
    Ravi

    Hai Ravi,
                U try this coding..........Write the function to fill the matrix with combo and then call this function in combo select event........
    Sub LoadGridCombo()
            Dim oMat As SAPbouiCOM.Matrix
            Dim oCol As SAPbouiCOM.Column
            Dim oCmb As SAPbouiCOM.ComboBox
            Dim ds As SAPbobsCOM.Recordset
            Dim i As Integer
            Try
                frm = app.Forms.ActiveForm
                oMat = frm.Items.Item("gd_act").Specific
                oMat.Clear()
                oCmb = frm.Items.Item("cmb_dept").Specific
                ds = com.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                ds.DoQuery("Select Code,U_Activity from [@PLANT_ACTIVITY] where U_dept='" & oCmb.Selected.Value & "'")
                ds.MoveFirst()
                oMat = frm.Items.Item("gd_act").Specific
                oCol = oMat.Columns.Item("g_act")
                If oCol.ValidValues.Count > 0 Then
                              For i = 0 To ds.RecordCount - 1
                    oCol.ValidValues.Add(ds.Fields.Item(0).Value, ds.Fields.Item(1).Value)
                    ds.MoveNext()
                Next
    End If
                oCol = oMat.Columns.Item("g_freq")
                If oCol.ValidValues.Count = 0 Then
                    oCol.ValidValues.Add("1", "Annually")
                    oCol.ValidValues.Add("2", "Semi Annually")
                    oCol.ValidValues.Add("3", "Quarterly")
                End If
                oMat.AddRow()
            Catch ex As Exception
                app.MessageBox(ex.Message)
            End Try
        End Sub
    Regards,
    Anitha

  • Group Matrix Report Problem

    when i build a group matrix report ,i only able to get the summary totals of columns (in the cross product ) at group level,but fail to get the summary totals of columns (in the cross product) at report level.So please tell me , how can i achieve this one?

    Dear Waheed....I think u just have to set property of summary column
    'Reset at = Report'
    I this does'nt work then u should explain ur problem.
    Kashif

  • Crystal Repoorts 2008 W2008R2 Dot Matrix Printing Problems

    Using CR2008 running on Windows Server 2008R2 - printing toLexMark 2580n dot matrix printers.
    I have developed reports that print correctly WHEN I call them up in Crystal Reports 2008 and print them from that application. If I call that same report from within a Visual Studio application, it does not print at all as expected (or desired!!). Similarly, I cannot get other reports to print correctly running directly out of Crystal yet if I call them from the Visual Studio application it does work/behave.
    Also, I have some label reports that are printing to a 3.5"W x 2.0"H size (I created a custom label like usual in printer server properties) that behave when I run them directly from Crystal but consistently print out vertically (90 degrees to the right) when I run it from Visual Studio. It's maddeming. I tested the reports when I first purchased CR2008 to make sure it would run on W2008R2 Server (and it did work). Did not see this problem coming. Any assistance would be helpful.
    FYI I am printing to LexMark 2580n dot matrix, brand new printers (had to purchase these to make drivers work on W2008R2). LexMark has effectively (to my satisfaction) ruled out their printers as the problem.
    Any advice would be greatly appreciated.

    Links to SP 4:
    SP4     https://smpdl.sap-ag.de/~sapidp/012002523100008782452011E/cr2008sp4.exe
    SP4 MSI     https://smpdl.sap-ag.de/~sapidp/012002523100008782532011E/cr2008sp4_redist.zip
    SP4 MSM     https://smpdl.sap-ag.de/~sapidp/012002523100008782522011E/cr2008sp4_mm.zip
    Ludek

  • AddRow problem in a OAF page

    Dear all,
    Hope you are well.
    i am facing a problem whiling adding a row in Table by clicking a AddRow button.
    the problem is when i click AddRow button then previous rows are also showing as well as adding a new row.
    but i am not executing that VO so why should show the previous rows.
    i am required only when i click a button then a new row will be generated.
    please suggest.
    Regards
    Mofizur

    Hi Mofizur
    You can create a submit button for Add rows and write below code for creating a new row
    //in AM
      public void addRow()
        OAViewObject vo = getYourVO1();
        if (!vo.isPreparedForExecution())    
        vo.setWhereClause("1=0");
          vo.executeQuery();
      Row row = vo.createRow();
       vo.insertRow(row);
       row.setNewRowState(Row.STATUS_INITIALIZED);
    }Call above method from controller on ADD Rows button event.
    Thanks
    AK

  • Udo matrix -save problem

    Hi,
    i am creating a form by using UDO form generator.
    in that documet and doucument rows are existed. if user select the combobox value from the form, by taking that value and i am generating a query, i am generating a recordset. by using Userdatasources i am binding each column in matrix.
    i binded all values to the matrix successfully. but
    but when i press Add button, this matrix rows are not getting saved. and also if i have two rows, when i press add, in database only one row is adding with NULL values. how to save that matrix data?
    please help me urgent
    asap
    regards,
    nagababu

    I believe this is a duplicate of
    Udo matrix rows saving problem
    Pls read the guidelines. Don't duplicate requests, this just cause confusion and
    inefficiency in the forum. And pls remember that this is a community of very very
    busy developers, each of them with his/her "urgencies" ....

  • Matrix CFL problem

    Hello
    I have a following problem:
    I want to make one column in matrix editable and CFL(from OITM).
    If I bind it with userdatasource, the chosen value cannot be changed later.
    If I bind it with DBdatasource, when I choose the proper value in CFL, I get an error :Bad form Value.
    I made very similar thing but not with columns(with form items) and then I could bind an item with EditText field and everything was cool.  edittext1 = (SAPbouiCOM.EditText)oItem.Specific;
    But now I cannot convert a column to EditText object 
    Anybody help me, please?

    Could you send me more code to look for the problem?
    Regards,
    J:

  • Option + Drag notes in Matrix editor problem

    I cant say when this started but at some point holding option while dragging a note to copy it stopped working as expected. Basically I want to copy a note in the matrix editor and I want it to go where I drag it (am I asking too much?). Right now as soon as I drop the note in the desired position it jumps forward several beats. Did I do something that changed the way the option key works? If I just drag the note without holding option the note goes where I want it. But as soon as I option + drag. I get this wackyness!! its hugely frustrating! Thanks in advance for any help.

    Well I have a workaround now but am still confused. I discovered that if I click the little button "featuring a square graphic" in the upper left corner of my matrix window (manual says its called the "Up One Display Level button—or
    UDL button"), it fixes the problem... for that matrix edit window only. As soon as I close it and reopen it (by double clicking on a midi region) it goes back into crazy freak **** mode. Something else I noticed is that when I reopen the matrix editor window the little screen read out area (that displays the notes etc under Edit/Functions/View) says "sel 1" right above the notes etc. It says this when its in crazy freak **** mode. When I click the UDL button it changes from "sel 1" to "1/AudioInst 1" which is the instrument for the midi Im working on. So how do I get crazy freak **** mode to stop messing up my matrix editor windows? Its great to have a workaround but its a pain in the butt to have to remember to push this button ( that I never needed to push before) so I can properly option+drag a midi note. I tried reading the manual about this button but I just dont get what its for (other than turning off freak **** mode). And I forgot to mention my logic version before: Logic version 7.2.1 (959.30) Thanks again in advance if you can help me:)

  • Printing using dot matrix printer,problem with landscape printing

    Hi all,
    We are planning to use Dot matrix printers for printing through SAP.We do front end printing using Windows OS. I am able to get prints properly if it is a script form. In case of list outputs, printer is printing the text outside the paper.Only half of the text is printing on the continuous stationary. Actually document is to be printed in Landscape format. So printer should print data vertically on the paper,but it's printing horizontally. I have created sparate output device for this printer.My printer is TVS Electronics HD745 24 Pin heavy duty printer. I have assigned OKI341 as device type for this device.Any more settings I need to do to get printing in landscape mode?

    closing thread

  • Matrix Report Problem in Oracle Apps

    Hii All,
    I have created a matrix report in Orace Application using Oracle 6i. It running properly in Report 6i. But after registering in Oracle Apps,
    It does not shows any output.
    Database 10g
    Report 6i
    EBS Oracle 11i
    Thanks
    PS

    Hi PS
    Please check below links:
    How to create a matrix report
    How to create a matrix report
    how to build matrix report
    how to build matrix report
    Oracle Reports Building Reports
    http://download.oracle.com/docs/html/B10602_01/part4.htm
    Regard
    Helios

  • 2D Matrix, Compacting problem

    Hi!
    I'm about to implement a matrix class that need som kind of "compacting" support, meaning:
    If the the following matrix (3x4) is compacted:
    [1][0][2][8]
    [7][0][3][9]
    [0][0][0][0]
    The resulting matrix (2x3)would be:
    [1][2][8]
    [7][3][9]
    Column 2 will be removed since it's empty (only zeros)
    and row 3 will be removed as well sinces its empty.
    I've tried a number of solutions, but they are all inneficient and/or cumbersome.
    I'm thinking like this:
    Find out which rows and columns should be removed.
    Create a new matrix with the new size, and iterate over the first matrix copying the values.
    Any ideas that come to mind?
    What about choice of datastructure?
    Is the best I can do to use a long[][] or maybe a
    combination of Lists of some sort?
    Any ideas for the algorithm?
    Oh, the size of the matrix will in most of the times be around 80x80 to maybe 120x120 (not necessarily same rowcount as colcount)
    And it must support getting/adding at specific cells, because of the way it's filled with values (from database)
    / Ronnie

    Find out which rows and columns should be removed.Well, that's easy. Two arrays of booleans, initially all false, iterate through the entire matrix setting appropriate booleans to true if you find a non-zero element.
    Create a new matrix with the new size, and iterate over the first matrix copying the values.Convert each array of booleans into an array of ints, which are the subscripts of the boolean arrays which were true. E.g. {f, t, ,t f, t} -> {1, 2, 4}.
    The sizes of these arrays give the matrix size. Two nested loops to copy elements across.

  • Addrow  problem in "Define Serial Numbers" form

    I have an item which is maintained by series nos at all transactions. i have to create series nos for that item for all documents. I have developed a specific logic for series nos for populating the nos in the "Define Serial Numbers" form matrix. When i am adding a row to the matrix it shows me a row id of 0 due to which even when i update the series nos only the first row is saved . Please provide a solution. i am using 2004.2b pl:40 SAP B1.

    HI,
    To update serial nos to delivery use the following FM L_SER_WS_DELIVERY_UPDATE.
    Use as follows
        CALL FUNCTION 'SERIAL_INTTAB_REFRESH'
          EXPORTING
            objects_status_refresh = 'E'.
        CALL FUNCTION 'L_SER_WS_DELIVERY_UPDATE'
          EXPORTING
            vbkok_wa                 = y_wa_vbkok
            synchron                 = 'X'
            commit                   = ' '
            delivery                 = y_p_vbel
            nicht_sperren            = 'X'
            if_get_delivery_buffered = ' '
            if_error_messages_send_0 = 'X'
            it_sernr_update          = y_li_sernr
          EXCEPTIONS
            error_message            = 1
            OTHERS                   = 2.
        CASE sy-subrc.
          WHEN 0.
            COMMIT WORK.
          WHEN OTHERS.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDCASE.
    Regards,
    Ankur Parab

Maybe you are looking for

  • I keep getting an error message while downloading music i purchased, how do i solve this issue

    Hi All, can you please help. I am struggling to dowload 3 songs from an album i just bought on iTunes. It keeps giving me an error message. What should i do?

  • ITunes not working since upgrading to iOS5

    My upgrade to iOS5 seemed pretty seemless over the weekend - that is until I went to play iTunes on my iPhone 4 (AT&T version.)  iTunes opens and displays the music but just won't play anything.  The scrub bar doesn't move and the play indicator indi

  • My Preview still wont open

    I have tried deleteing the home files, creating and loging in under TEST, nothing seems to work. I need help!!!! Thank you!!

  • Why i cant have new verision of Intel driver?

    Hi i am not very well with English,so i will be quick... I would like to update my driver to newer one ...and when i try to instal your 15.17.12.2226 Intel mobile graphic driver for Intel HD graphic( i3 350M) from intel download page it shows me this

  • Substitution Variable Capacity

    Does anyone remember if there is a substitution variable capacity (how many can exist per database) and what that number is?I've got some nasty reporting requirements for Analyzer which require 72 new variables be added and managed.Bill HodgsonMen's