Skip to Content

Hello All,

I was Facing Issue While Loading Large Data in Matrix on User Defined Object.You can do it as follows.

 

GOD_Form = BSPL_Main.BSPL_Application.Forms.GetForm("frmProc", pVal.FormTypeCount)
Dim GOD_Matrix As SAPbouiCOM.Matrix
GOD_Matrix = GOD_Form.Items.Item("matProc").Specific

GOD_Form.DataSources.DBDataSources.Add("@GOD_PCB1")

Dim GOD_DBDataSource As SAPbouiCOM.DBDataSource
GOD_DBDataSource = GOD_Form.DataSources.DBDataSources.Item("@GOD_PCB1")

Dim GOD_strFetch As String = ""
Dim GOD_RecFetch As SAPbobsCOM.Recordset
GOD_RecFetch = GOD_Main.GOD_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
GOD_strFetch = "SELECT U_ProcessCode 'Process Code',U_ProcessName 'Process Name' From [@GOD_PCB1]"
GOD_RecFetch.DoQuery(GOD_strFetch)

GOD_Form.DataSources.DBDataSources.Item("@GOD_PCB1").Clear()
For i As Integer = 0 To GOD_RecFetch.RecordCount - 1
     GOD_Form.DataSources.DBDataSources.Item("@GOD_PCB1").InsertRecord(GOD_DBDataSource.Size)
     GOD_DBDataSource.SetValue("LineId", GOD_DBDataSource.Size - 1, i + 1)
     GOD_DBDataSource.SetValue("U_ProcCode", GOD_DBDataSource.Size - 1, Convert.ToString(GOD_RecFetch.Fields.Item("Process Code").Value))
     GOD_DBDataSource.SetValue("U_ProcName", GOD_DBDataSource.Size - 1, Convert.ToString(GOD_RecFetch.Fields.Item("Process Name").Value))
     GOD_RecFetchAllBeams.MoveNext()
Next

GOD_Matrix.Clear()
GOD_Matrix.LoadFromDataSource()

 

For More Information Pls Check CopyMatrix

Thanks and Regards,

Mahendrakumar

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. batman joker

    every UI API action (e.g. putting a property for a specific object) will cause an inter-method name between your
    upload-on and the B1 software, that’s why you need to lessen calls to UI API to the truely required
    minimum.
    step one to lessen the variety of calls is to apply XML in all actions in which the XML layout is normal:
    Menus and forms certainly, cf. segment person defined paperwork creation.
    A 2nd step is to try to preserve variables for references you need to reuse several times in the equal approach
    (form, gadgets,…). for instance at the same time as operating with matrixes you’ll for instance fill special strains for the
    same column; in this situation you could hold the cells of every column
    (oMatrix.Columns.item(“A”).Cells) and reuse it for all rows.
    Use DataSources
    Updating and getting values of shape objects is greater efficient when you access them via their certain

    DataSource object (to be had item sorts are: UserDataSource, DBDataSource or DataTable) as an alternative
    of directly accessing the item cost assets. that is specifically true for matrixes containing many items, but
    ought to be carried out in general.
    Please note that on B1 machine paperwork the values within the datasources cannot be changed!!!
    UserDataSources: Use the fee belongings of the UserDataSource certain to an item or a Column in a
    Matrix to set/get the values.
    DBDataSources: Use the SetValue and GetValue methods of the DBDataSource certain to an object or
    a Column. Applies to DataTable as nicely.
    For the matrixes the FlushToDataSource and LoadFromDataSource techniques synchronize all data
    between the matrix and the DataSources. The identical mechanism may be used line through line with
    GetLineData(row) and SetLineData(row).
    o To update matrix information, when working with UserDataSources, carry out the subsequent recursively on the
    matrix strains:
    GetLineData(Row)
    UserDataSource.price = fee
    SetLineData(Row)
    DataTables: facts of DataTable is constantly the same we can see within the Grid, there may be no want to use any approach to synchronize among the Grid and its DataTable. To set/get the values we are able to use the GetValue a

    Showbox| Kodi | Lucky Patcher|

    (1) 

Leave a Reply