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.