Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Bind Matrix

Hello Gurus,

I have 3 matrixes with the same column numbers. The difference is that each of it have there own corresponding value. In my user defined table, in one record, i want to load all the type="T" in matrix 1, type="P" in matrix 2 and type="H" in matrix 3. Can i use the binding method of SAP. Currently, i just bind the header and programatically loading values in the matrix when the user click on the navigation buttons. My problem is, it is slow loading the records in the matrix. Please help me...

replied

Hi Gilbert

There is two ways to approach this

1) Use SBO grid, this grid is populated with a single query. Once the query is executed the grid object places the data in the columns accordingly. Look at the grid example that comes with 2005 sdk.

2) Use database datasource with conditions to return a certain data set. Here you can specify what will be loaded from UDT. The only thing is that you can't realy change the order of the data in the matrix because it will load by primary key. Here is an example of a single matrix being binded and loaded

oForm.DataSources.DBDataSources.Add("OOPR")

oMatrix = oForm.Items.Item("SaleOppMat").Specific

oDBDatasource = oForm.DataSources.DBDataSources.Item("OOPR")

'add conditions to filter by branch

oConditions = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_Conditions)

oCondition = oConditions.Add

oCondition.Alias = "U_Brnch"

oCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

oCondition.CondVal = BranchGlobal

oCondition.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND

oCondition = oConditions.Add

oCondition.Alias = "Status"

oCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

oCondition.CondVal = "O"

'load data

oMatrix.Clear()

oDBDatasource.Clear()

oDBDatasource.Query(oConditions)

oMatrix.LoadFromDataSource()

Hope this helps

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question