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

SBO 2007 PL41 issue - matrix or purchase order

Hi,

Im fighting for 2 weeks with PL41 and Im crazy for this already.

My scenario is:

I have user form, on this form is one matrix and lines of this matrix are itemcode, qty, warehouse, user1, user2.

User select rows in matrix (more lines) and click on button. By clicking is creating purchase order for selected rows (itemcodes) in matrix.

The system of creation of purchase order is:

in for next cycle Im going through all matrix lines and Im checking, if matrix row is selected, if yes, I add line in purchase order.

The part of code is:

obj = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders)

obj.CardCode = kod_dod

obj.RequriedDate = dtNejpoz

obj.DocDueDate = dtPom2

For i = 1 To oMatrix.RowCount

If oMatrix.IsRowSelected(i) Then

...

...

If bAddLine Then

obj.Lines.Add()

Else

bAddLine = True

End If

obj.Lines.ItemCode = code

obj.Lines.Quantity = qty

obj.Lines.WarehouseCode = whs

obj.Lines.UserFields.Fields.Item("U_ZAK").Value = zak

obj.Lines.UserFields.Fields.Item("U__ID").Value = id

oMatrix.SelectRow(i, False, True)

end if

next i

err_code = obj.Add()

The problem is, that when user run this, the table CHEN is locked for other users during creation of order.

With

oMatrix.SelectRow(i, False, True)

I can see in SBO app. that each row takes about 10 seccond to proceed. There only 2 possibilities: isrowselected is problem or line adding. Before was there PL30 and it works without problems, but with 41 it is too slow.

I will check PL42, but I will glad for your comments.

thanks

Edited by: Petr Verner on Oct 8, 2008 4:15 PM

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Oct 08, 2008 at 03:24 PM

    Hi

    I think you can delete this line

    <

    oMatrix.SelectRow(i, False, True)

    >

    and you can use

    <

    oMatrix.ClearSelections 

    >

    after the add

    Bruno

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      The problem isnt in the code, the unselecting one row in matrix is just for viewing, in which part of creation order is user. The problem is, that the order creation is too slow in PL41.

      The code worked fine for one year and only after upgrade to PL41 is there problem with speed. In changes of PL41 is nothing what Im using in code. Never before were blocked table for other users.

      Anyway thanks for reply.

  • Posted on Oct 09, 2008 at 06:23 AM

    Hello Petr,

    Table CHEN is a b1 table using for Caching Update Notification, most frequently used in B1.

    As you mentioned, it works fine in PL41, but slower than the previouse version. You doubt the cause is IsRowSelected or Adding Line.

    Can you analyze it further which is bottle neck in your code? I am sure It is a small deal for you. : )

    How many lines on average?

    if more than hundreds, I will suggest not to loop one by one with IsRowSelected.

    Instead, handle the click event to cache the selected row number in an array.

    also the purchase order, maybe prepare purchase in xml, then added it via xml in DI.

    Hope it helps. Thanks.

    Kind Regards

    -Yatsea

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Yatsea,

      I think I found the problem. The problem as usually isnt in the thing I thought, but somewhere else...

      The problem is doing combobox - if the combobox contains hundreds of records, the working with is too slow - comboboxes were slow in the past too, but in PL41, 42 its slower than before.

      What I did:

      For u = 0 To cmbOznac.ValidValues.Count
                                          vv = cmbOznac.ValidValues.Item(u)
                                          If w = oznac Then
                                             ...
                                              Exit For
                                          End If
        Next

      So I will rewrite the code for non using combos and I think, that it must be better.

      Thanks

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.