Skip to Content
0
Former Member
Jun 10, 2009 at 02:20 AM

Error on Production Orders Add-on when 2 or more users at the same time.

591 Views

Hi.

Our add-on creates special production orders (SAPbobsCOM.BoProductionOrderTypeEnum.bopotSpecial) with no problem when used by one user, but if there are two or more users everyone on his own SAPBO session it starts to throw different errors, we think it may be a concurrence problem due to several transactions.

Here a short brief of the code sample and the process:

(error handling and object members not included in the sample)

oDoc.ProductionOrderType = SAPbobsCOM.BoProductionOrderTypeEnum.bopotSpecial

If the oDoc.Add() is correct, We get the last production order created and release it:

Me.sKey = Me.Company.GetNewObjectKey
oDoc = Me.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductionOrders)
oDoc.GetByKey(Me.sKey)
oDoc.ProductionOrderStatus = SAPbobsCOM.BoProductionOrderStatusEnum.boposReleased
oDoc.Update()

Then we go for an inventory Entry:

oDoc = Me.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenEntry)
oDoc.DocDate = Date.Now
oDoc.Lines.BaseEntry = Me.sKey
oDoc.Add

And Finally to close the production order:

oDoc.ProductionOrderStatus = SAPbobsCOM.BoProductionOrderStatusEnum.boposClosed
oDoc.Update()

This works fine when only one user is using the add-on, but in the end there wil be at least eight users simultaneously working with this add-on

The test:

We have four users creating production orders with the add-on.

Two of them get the usual success messages and the created documents in SAPBO are all correct.

The other two users get diferrent errors messages during the process.

If they wait and try again to run the process it works fine.

Repeating the test get errors on different users depending on which one started the process first.

Our client needs to generate beetwen 900 and 1200 production orders per day, so they can't wait until the process is free for each user to work with it.

The common erros detected are:

Changing the status of the production order:

-5002 - The warehouse is not defined for the item.
-4002 - To generate this document,
           first define the numbering series in the Administration module
-1029 - Field cannot be updated

Adding the production order and inventory entry:

-2038
-1116
-5002

Regards,

Omar Fonseca