Skip to Content

How To Increase Performance Of Data Loading In Matrix – User Defined Forms

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

Be the first to leave a comment
You must be Logged on to comment or reply to a post.