Un-bound Matrix

I have a problem about matrix, so I need a help, please =). I create a form using screen painter and I added a matrix, but I don't bind the columns in my matrix to a table, hence, when I fill my matrix, like this: oMatrix.Columns("Month").Cells(1).Specific.String = "January", it doesn't create any error, but what seems strange to me is as soon as the matrix is filled, it become empty again. Why should that happen? But it only happen when a column in a matrix is not bind to a table, actually this is the first time I am not binding my column to a table, when I bind the column, there is no problem in filling the cell, but when it un-bound, there came a problem.
Is there anyone who can give me a solution? Thanks for your kindly attention =)

Hello.
You must bing columns in matrix because it will doesn`t work.
You must bind column to UserDataSources or DBDataSources.
Regards
Kamil Wydra

Similar Messages

  • Dbdatasource bound matrix and form.freeze bug

    I have a UDO, with a child talbe attached to it correctly.
    I've build a form to handle the UDO and it's child, in a bound matrix, and everything works fine.
    There are 2 comboboxes in the matrix. I want to update a combobox upon selecting in the other combobox. it works fine, yet it looks 'silly' since you can see the focus going to the other cobobox and then return to the original combobox. I thought the Form.Freeze would help me, but it doesnt.
    It seems that a dbdatasource-bound-matrix will not show it changes made while being in From.Freeze(True) state. And although changes are not show, they are made, meaning you can click the other combobox and see that the selected value is the one you programmatically selected, but the value inside the box remains as it was before evoking From.Freeze(True).

    Hi Avi,
    I have created a UDForm for a UDO (Document) with a Matrix for the child table.  I am able to Add the Header with the Child Lines into the DB.  My Problem is that when I need to Update the Document, i call it up, and all the data is shown.  I call "Matrix.AddRow()" and it DUPLICATES the Last line from the matrix into the new row.  So I delete the Duplicated Item Code and retype the new added Item Code and relevent columns.  When I click on "UPDATE" the system says that....
    "This Entry Already Exists in the Following Tables " @EB.........
    I've been searching the forum for posible answers and I cam across your posting saying that you were successfull in achieving what I am battling with.
    Could you please help me with this issue.
    I've posted a new Thread as follows.....
    [New Row in Matrix is a Duplicate and Cannot update Object with new Row;

  • Save data from a bounded matrix

    Hi!
    I have a matrix bounded to a UDO table. This matrix is filtered by a Condition object. Which is the best way to update records to the database?
    Best regards,
    Jose

    I had these problems too but didn't find another way yet.
    Maybe any user with more experience can answer here.
    The way i did it was this:
    I queried the information from the UDO with a RecordSet object. Then I went throug it, line by line, and filled the UDSs that were bound to the colums of my matrix and added the line to the matrix. In one hidden column I wrote the uniq key to be able to update this line in the UDO after it had been changed.
    I think that this is not the best solution but it worked for me, very slow, but it worked.

  • Last cell change does not commit in Matrix

    Hello everyone,
    I use VB.Net+SAP2004, bound matrix with a UDT, there is a problem when save the data at et_ITEM_PRESSED event, it always can not save the last cell's changed value, just the value before edit. who can help me solve this problem.
    Thanks in advance.
    Lanjun

    Jose,
    Thank you very much for your replying,
    Actually, I want to show a message if edit value changed when user click "Cancel" buttong, I write data changed check and save code in et_FORM_UNLOAD event, because user can also click close button to close form, seems at this event the change lost, so I need also add code in "Cancel" button click or press event.
    Thanks again.
    Lanjun

  • Loading Matrix Bound to UDO with Large Data Set

    Hello Experts,
    I have been looking on the forums for the best method out there to effectively load a Matrix that is bound to a User Defined Object (UDO).  In short, I will explain to you what I would like to do.  I have a form that has a matrix on it bound to a User Defined Object.  This matrix takes data stored in other UDO forms/tables and processes it to extract new information. 
    Unfortunately, the resulting dataset is quite large (up to 1000 rows).  I realize if this were just a "report" I could easily do this with a Grid.  I also realize if this were just a Matrix bound to a User Defined Table, I could bind it to a DataTable and perform the query that way.  However, since this is a Matrix bound to a DBDataSource (as I would like to have SAP handle any updates/finds) I believe my only options are to try and use a DBDataSource.Query method and try to work with Conditions. 
    The DBDataSource.Query method has not proven to be effective due to the complexity of the query and the multiple tables involved.  I have read from others on the forum that I could just load the matrix by temporarily databinding the matrix to a DataTable and then, after it is loaded, switch the databinding back to the DBDataSource but this does not work as it comes back with an error informing me (rightly so) that there are already rows in the matrix.
    One final option would be to use the User Interface (UI) to cycle through and update each cell of the matrix with the results of a recordset, but, as I said, this can be a large dataset and that could take hours (literally).
    In short, I was wondering if anyone out there can advise me on the most effective options I have.  Is there  a way to quickly load a matrix bound to a DBDataSource?  Is there someway I can load the matrix by binding it to a DataTable and then quickly move this information over to the DBDataSource (I already attempted this and the method I used was as slow as using the UI to update the Matrix)?  Are there effective ways to use the DBDataSource.Query method that I do not know much about (and cannot find many examples of how this functionality is truly used)?  Should I abandon the DBDataSource (though I believe this is the SAP preferred method) and, if so, is there another technique to appropriately update the database other than using DBDataSource?  Others have mentioned handling the updates to the database themselves but I am not sure what this means (maybe it means using SQL UPDATE/INSERT?).  Is there a ways to Flush matrix information to a DBDataSource if the DBDataSource was not used in the loading and is not currently bound to the matrix? 
    Sorry for the numerous amount of questions but thanks for the advise.

            Dim oForm As SAPbouiCOM.Form
            Dim creationPackage As SAPbouiCOM.FormCreationParams
            creationPackage = sbo_application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
            creationPackage.UniqueID = "MyFormID"
            creationPackage.FormType = "MyFormID"
            creationPackage.ObjectType = "UDO_TEST"
            creationPackage.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed
            oForm = sbo_application.Forms.AddEx(creationPackage)
            oForm.Visible = True
            oForm.Width = 300
            oForm.Height = 400
            Dim oItem As SAPbouiCOM.Item
            oItem = oForm.Items.Add("1", BoFormItemTypes.it_BUTTON)
            oItem.Top = 336
            oItem.Left = 5
            oItem = oForm.Items.Add("2", BoFormItemTypes.it_BUTTON)
            oItem.Top = 336
            oItem.Left = 80
    Now put and Edit box to DocEntry
            oItem = oForm.Items.Add("3", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Top = 5
            oItem.Left = 5
            oItem.Width = 100
            Dim oEditText As SAPbouiCOM.EditText = oItem.Specific
            oForm.DataSources.DataTables.Add("oMatrixDT")
            oItem = oForm.Items.Add("oMtrx1", SAPbouiCOM.BoFormItemTypes.it_MATRIX)
            oItem.Top = 20
            oItem.Left = 20
            oItem.Width = oForm.Width - 30
            oItem.Height = oForm.Height - 100
            Dim oMatrix As SAPbouiCOM.Matrix = oItem.Specific
            Dim oColumn As SAPbouiCOM.Column = oMatrix.Columns.Add("#", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oColumn.TitleObject.Caption = "#"
            oColumn = oMatrix.Columns.Add("oClmn0", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON)
            oColumn.TitleObject.Caption = "BP Code"
            Dim oLinkedButton As SAPbouiCOM.LinkedButton = oColumn.ExtendedObject
            oLinkedButton.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_BusinessPartner
            ' Now bind Columns to UDO Objects in Add Mode
            oEditText.DataBind.SetBound(True, "@UDO_TEST", "DocEntry")
            oMatrix.Columns.Item("oClmn0").DataBind.SetBound(True, "@UDO_TEST1", "U_CARDCODE")
            oForm.DataBrowser.BrowseBy = "3"

  • Can I Upload Data from a table to matrix, while matrix is bound to another table??

    Hi Friends,
            right now i am uploading records to matrix row by row, but when records are very large in numbers then its taking too much time, so how can i upload these record directly to matrix without changing current data binding of the matrix.

    Hi Shrinivas,
    Can you please paste your code how your are copying your data to matrix ?
    Also have you tried this ?
    this.oDBDataSource= (DBDataSource)oForm.DataSources.DBDataSources.Add("@DETAILTABLE");
                                                                oForm.DataSources.DBDataSources.Item("@DETAILTABLE").InsertRecord(oDBDataSource.Size);
    this.oDBDataSource.SetValue("U_Field1", oDBDataSource.Size - 1, Convert.ToString(oDBDataSource.Size));
    this.oDBDataSource.SetValue("U_ICode", oDBDataSource.Size - 1, Convert.ToString(oRecSet.Fields.Item("ItemCode").Value));
    this.oDBDataSource1.SetValue("U_IName", oDBDataSource.Size - 1, Convert.ToString(oRecSet.Fields.Item("ItemName").Value));
    Finally use oMatrix.LoadFromDataSource()
    Hope it helps.
    Thanks & Regards
    Ankit Chauhan

  • Matrix Bound

    HI Experts,
    The following code i used for bind the query result to matrix. It bind sucessfully and  when i click Add button i am getting the sucsessful message .But when i close the programme and open the screen using screen painter and check the records then the records was not inserted successfully And also check rerords using query also not came.
    What is the problem . PLease guide me. I did any mistake in the following code?
    Case "TBL_MREADING_"
    oForm = SBO_Application.Forms.Item("TBL_MREADING_")
    Dim MReading As SAPbouiCOM.DataTable
    oForm.DataSources.DataTables.Add("MReading")
    oForm.DataSources.DataTables.Item("MReading").Clear()
    Dim sSQL As String = "SELECT CardCode as code,CardName as name,U_VOLTAGE as voltage FROM OCRD where GroupCode!= 100 order by GroupCode"
    oForm.DataSources.DataTables.Item("MReading").ExecuteQuery(sSQL)
    oItem = oForm.Items.Item("MATRIX")
    oMatrix = oItem.Specific
    oColumns = oMatrix.Columns
    '' oMatrix.Columns.Item("V_0").DataBind.Bind("drSlction", "DocEntry")
    oMatrix.Columns.Item("P_2").DataBind.Bind("MReading", "name")
    '' oMatrix.Columns.Item("V_2").DataBind.Bind("drSlction", "LineNum")
    oMatrix.Columns.Item("P_4").DataBind.Bind("MReading", "Code")
    oMatrix.Columns.Item("P_5").DataBind.Bind("MReading", "voltage")
    ' oMatrix.Columns.Item("P_5").DataBind.SetBound(True,"MReading", "voltage")
    oMatrix.LoadFromDataSource()
    """ For LineId Updation
    Dim  x As Integer = 1
                                        While x <= oMatrix.RowCount
                                            oMatrix.Columns.Item("V_0").Cells.Item(x).Specific.Value = x
                                            x = x + 1
                                        End While
    With Best Records,
    M.Thippa Reddy.

    See answer to your parallel posting...

  • Adding data from one matrix to another

    Hay guys.I'm having trouble with adding data, that is situated in a Matrix on form A and bound to a userdatasource,
    to a Matrix on form B that is bound to a dbdatasource.
    For some reason the data either does not display at all, or it only displays the last records' data as many times
    as there are records in the original matrix from form A.
    Here's the code I've tried: (Displays only last record x times)
    For i = 1 To oMatrixSync.RowCount
    oFormTime.DataSources.DBDataSources.Item("@TB_TIMEDET").SetValue("U_Activity", _
                              oMatrixTime.RowCount, _
                              oFormSync.DataSources.UserDataSources.Item("U_Act").ValueEx)
    oMatrixTime.AddRow()
    next
    And this code displays zip:
    For i = 1 To oMatrixSync.RowCount
      oCheckBox = oMatrixSync.Columns.Item("c_Check").Cells.Item(i).Specific
      If oCheckBox.Checked = True Then
        oEditS = oMatrixSync.Columns.Item("c_Activity").Cells.Item(i).Specific
        oFormTime.DataSources.DBDataSources.Item("@TB_TIMEDET").SetValue("U_Activity", _
                   oMatrixTime.RowCount, _
                   oEditS.Value)
      oMatrixTime.AddRow()
      oMatrixTime.LoadFromDataSource()
    next
    Any help would be greatly appreciated, thanx all!
    Message was edited by: Tjaard Du Plessis

    Thanks, Jaro!
    You are right. The code should look like this:
    Dim oDBDSTime As DBDataSource = oFormTime.DataSources.DBDataSources.Item("@TB_TIMEDET")
    Dim oUDSSync As UserDataSource = oFormSync.DataSources.UserDataSources.Item("U_Act")
    For i = 1 To oMatrixSync.RowCount
    oMatrixSync.GetLineData(i)
    oDBDSTime.InsertRecord(i)
    oDBDSTime.SetValue("U_Activity", _
                        i, _
                        oUDSSync.ValueEx)
    Next
    oMatrixTime.LoadFromDataSource()
    Regards,
    Frank

  • Updating and Loading a  Matrix Row with Mix of DB and Non DB fields

    Hi
    I'm using SAPB1 2005 SP1 PL14 with B1DE 1.3
    I have a matrix on a form that was generated by the UDO Form Generator. The Matrix contains data associated from a Document Lines table.
    The underlying table and (therefor the matrix as well) only had 1 user field (column)
    I've added a set of additional (read only) columns to the matrix together with supporting non db user datasources for each column. I've bound the new columns to the user datasources.
    The new columns are only informational and should display data associated with the actual db field (column) in the matrix.
    I require assistance / advice with 2 requirements:
    <i>Requirement 1.
    When loading the matrix, I'd like the non DB columns to be populated with data associated with the actual DB field.</i>
    <i>Requirement 2.
    When Adding / Updating the actual DB field in the matrix, I'd like the Non DB columns to be populated with the assocaited data.</i>
    I've managed to get requirement 2 working by using a matrix onValidate Event. (not sure if this is the best approach?)
    Any idea how I can achieve requirement 1 ?
    Cheers,
    Ben

    Hi Trinidad,
    Putting the additaional columns in the table will result in me storing redundant info in the specific table.
    The values are already stored in other related tables and I'd just like to display them as additional info fields.
    .Ben

  • How to save matrix do user table?

    Hi,
    I have created on system form matrix as:
                        oNewItem = oOrderForm.Items.Add("a", SAPbouiCOM.BoFormItemTypes.it_MATRIX)
                        oNewItem.Top = 150
                        omatrix1 = oNewItem.Specific
                        oColumns = omatrix1.Columns
                        oColumn = oColumns.Add("#", SAPbouiCOM.BoFormItemTypes.it_EDIT)
                        oColumn.TitleObject.Caption = "#"
                        oColumn.Width = 20
                        oColumn.Editable = False
                        oColumn = oColumns.Add("code", SAPbouiCOM.BoFormItemTypes.it_EDIT)
                        oColumn = oColumns.Add("name", SAPbouiCOM.BoFormItemTypes.it_EDIT)
                        oColumn = oColumns.Add("cesta", SAPbouiCOM.BoFormItemTypes.it_EDIT)
    This matrix i have bounded to datasource as:
                oDBDataSource = oOrderForm.DataSources.DBDataSources.Add("@SKIL_ATTACH")
                oConditions = New SAPbouiCOM.Conditions
                oCondition = oConditions.Add
                oCondition.BracketOpenNum = 2
                oCondition.Alias = "U_PATH"
                oCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                oCondition.CondVal = "xxx"
                oCondition.BracketCloseNum = 1
                oDBDataSource.Query(oConditions)
                oItem = oOrderForm.Items.Item("a")
                omatrix1 = oItem.Specific
                oColumns = omatrix1.Columns
                oColumn = oColumns.Item("cesta")
                oColumn.DataBind.SetBound(True, "@SKIL_ATTACH", "U_XCESTA1")
                oColumn = oColumns.Item("code")
                oColumn.DataBind.SetBound(True, "@SKIL_ATTACH", "CODE")
                oColumn = oColumns.Item("name")
                oColumn.DataBind.SetBound(True, "@SKIL_ATTACH", "NAME")
                omatrix1.LoadFromDataSource()
    The user table has 3 my fields (U_Path, U_xcesta and U_xcesta1) abd 2 fileds (code and name) - this two fields i didnt create, i think that are some system fields?
    On the system form everything seems to be ok, I can add rows, modify data, set new data, ... After changing any data in this matrix, the system button will change from OK to Update or Add and after click on this button in status bar is OK, the data was added or updated...
    The problem is, that in user table aren`t data modified and there are still old data.
    I tried to make update manually as:
                    oItem = oOrderForm.Items.Item("a")
                    omatrix1 = oItem.Specific
                    omatrix1.AddRow(1, 0)
                    Dim cell As SAPbouiCOM.Cell
                    Dim col As SAPbouiCOM.Column
                    Dim ed As SAPbouiCOM.EditText
                    col = omatrix1.Columns.Item("code")
                    cell = col.Cells.Item(1)
                    ed = cell.Specific
                    ed.String = CStr("some data")
                    omatrix1.Columns.Item("cesta").Editable = True
                    omatrix1.Columns.Item("cesta").Cells.Item(1).Click(SAPbouiCOM.BoCellClickType.ct_Double)
                    omatrix1.FlushToDataSource()
                    omatrix1.AddRow(1, 1)
    but nothing happens and data in table are still old. What I`m doing bad? Could anyone help me please?
    Please be patient, because Im working with SBO for short time. Thanks!

    I solved is through manual updating and inserting to database as"
                        oUserTable = oCompany.UserTables.Item("SKIL_ATTACH")
                        oOrderForm.DataSources.DataTables.Item(0).ExecuteQuery("SELECT coalesce(max(convert(integer, code)),0) as max from dbo.[@SKIL_ATTACH] with(nolock)")
                        oUserTable.UserFields.Fields.Item("U_Popis").Value = "xxxxx"
                        oUserTable.UserFields.Fields.Item("U_PATH").Value = "xxxxx"
                        oUserTable.UserFields.Fields.Item("U_OP").Value = "xxxxx"
                        lRetCode = oUserTable.Add
    It works, but I think that it is not the easiest way.

  • Deleting row from a table binded to a matrix

    Hi all
    i have a form with a matrix binded to a user table which is handled as a Master Data lines by UDO.
    i want to enable deleting lines from the table by selecting a row in the matrix and clicking a delete button.
    currently i'm handling the click event by usint the method DeletRow of the matrix object.
    when i press the Update button (UID = "1"). the fact that a row was deleted from the matrix does not affect the bounded table.
    my question is how in code can i cause the deletion of a row from the matrix to also be deleted from the database table?
    appreciate the help
    Yoav

    Hi Yechiel
    flushToDatasource make the following:
    Flushes current data from the GUI to the bounded data source using the following process:
    1)Cleans the data source.
    2)Copies each row from the matrix to the corresponding data source record.
    In other words: This method load data from Matrix to DataSource (but not to database)
    the next step is update database from userdatasource
    Note: You migth read sdk help for more information

  • How to insert an empty row on a matrix with multiple loaded lines?

    Hi.
    I want to insert an empty row on my form's matrix. Currently I am using the <b>AddRow </b>method, as it is:
    // C# - it's mandatory to give parameters to the method (=
    oMatrix.AddRow(1,1)
    But, when the matrix already has some rows (at least 1), the method <b>AddRow </b>inserts the new line as a copy of above line, then, I have to manually clear all cells.
    Any idea on this?
    Thanks in advance.

    If you matrix is bound to a dbDatasource you can insert a record in the dbdataspurce instead of using matrix.AddRow... If not only way to do it is by clearing the row after add

  • 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

  • Set maximum matrix row and column size

    I hope someone can help me with this. Is there any way to set the row and column size of a matrix control? I have not been able to find a solution. The only way I've been able to set the size is by resetting matrix to its previous state if the user inputs a value outside of the bounds I would like to set. This is done in the 'value changed' event case.
    The matrix is large and therefore I cannot increase the size of the control to be the maximum size and then hide the row and column index controls. These have to be displayed.
    Any suggestions or help would be greatly appreciated. Thanks in advance.

    Here's a quick and dirty way.
    Simply hide the index controls and replace them with some fake numeric controls and set the data range accoding to your requirements.
    In the attached example (LV8.0), the fake index controls are limited to 0..2, the array size is 5x5 and the displayed array portion is 3x3. Seems to work fine.
    (Of course you could add a bit more code to set the limits automatically based on the various sizes.)
    You could also make it more fancy and turn the entire thing into an Xcontrol.
    Message Edited by altenbach on 06-06-2007 05:32 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    LimitArrayControl.vi ‏18 KB

  • 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

Maybe you are looking for