on 10-08-2008 3:14 PM
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
Hi
I think you can delete this line
<
oMatrix.SelectRow(i, False, True)
>
and you can use
<
oMatrix.ClearSelections
>
after the add
Bruno
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yatsea,
thanks for reply. In the fact, on developing computer where I have visual studio is PL31 and by customer is PL41. Now the problem for me is, that I cannot on develop PC make upgrade to PL41 due other companies Im working on - its pitty problem with different SBO PL. Thats the reason why Im trying to solve it in theoretic way - if somebody knows
Because the customer is hurry about this problem, I will today apply PL42 and check if the problem still occurs. If it will be not solved with PL42, I will tommorow upgrade my computer to PL42 and debug the code to finding the bottle neck.
In matrix is in producing db hundreds rows, but when I simulate it in 2 rows, it takes 10 seccond for each row as well.
I`ll inform tommorow.
thanks
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
User | Count |
---|---|
109 | |
15 | |
10 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.