cancel
Showing results for 
Search instead for 
Did you mean: 

error while doing multiple object updation from EP ! object lock error

Former Member
0 Kudos

HI all,

I am doing multiple object updation using a standard RFC(BAPI_PROJECT_MAINTAIN). The RFC i am calling from Enterprise portal. I am sending data to RFC one by one. But the error i am getting is object is locked by user so data can't be save.

Though i am using Lock and unlock method before and after calling RFC the project lock error comes up.

What might be the reason

regards

sandeep

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

use saveand wait instead of save in bapi

Former Member
0 Kudos

Hi Sandeep,

Is the RFC you use for locking in the same model as the bapi BAPI_PROJECT_MAINTAIN? If it is not then you are using two connections for communication with the sap R/3 backend.

You can do 2 things.

1. You could add the RFCs for locking in the same model as the BAPI_PROJECT_MAINTAIN

2. Instead of adding the RFCs in one model synchronize the connections the models use as follows:


IWDDynamicRFCModel model1 = (IWDDynamicRFCModel) WDModelFactory.getModelInstance(Model1.class);
IWDDynamicRFCModel model2 = (IWDDynamicRFCModel) WDModelFactory.getModelInstance(Model2.class);
model1.setConnectionProvider(model2);

You can do this in the wdDoInit. This will make sure both models use the same connection but closing a connection will close both at the same time.

The same problem applies to commit/rollback functionality.

Regards,

Jeschael