Skip to Content
author's profile photo Former Member
Former Member

How Add data into a Matrix

Hi ,everyone ,I want to Add lots data into a matrix ,for example ,in the production-define bill of materials(FormID 672) ,I want to add 200 items in the matrix ,and I use a way that the speed is very slowly.

such as

while not oRecordset.Eof

Set oEdit = oMatrix.Columns("1").Cells(ii).Specific

oEdit.String = oRecordSet.Fields("Code").Value

Set oEdit = oMatrix.Columns("4").Cells(ii).Specific

........

ii=ii+1

oRecordset.Movenext

wend

maybe there are other ways to add data in the matrix,

i try use DBDataSource to improve the speed .

Dim oDBDataSource As SAPbouiCOM.DBDataSource

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

Set oDBDataSource = oForm.DataSources.DBDataSources.Item("ITT1")

Dim oConditions As SAPbouiCOM.Conditions

Dim oCondition As SAPbouiCOM.Condition

'

Set oConditions = New SAPbouiCOM.Conditions

Set oCondition = oConditions.Add

oCondition.Alias = "Father"

oCondition.Operation = co_EQUAL

oCondition.CondVal = "QD10199 - BJ01" 'str(i)

If Not IsNull(oConditions) Then

oDBDataSource.Query oConditions

Else

Call oDBDataSource.Query

End If

but there are some error , the query'mothed ,oDBDatasource is failure.

does anyone have a better solution ?

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 06, 2005 at 07:18 AM

    Hi Dave,

    You can also try to freeze the form when doing the processing. This helps with the speed as the screen is not updated with every change. Then you oForm.Freeze(false) when you're done.

    Hope it helps,

    Adele

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 06, 2005 at 08:59 AM

    Hi Dave,

    I've checked the code we use, and there's small difference:

    ...

    oCondition.BracketOpenNum = 1

    oCondition.Alias = "U_Active"

    oCondition.Operation = co_EQUAL

    oCondition.CondVal = "Y"

    oCondition.BracketCloseNum = 1

    ...

    oDBDataSource.Query oConditions

    ...

    oMatrix.Clear

    oMatrix.LoadFromDataSource

    ...

    Only difference I can see, are brackets. Try to add them, perhaps it will work...

    Jaro

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.