Hello All,
As per the business requirement my logic flows in this way.
1. I am calling BAPI_GOODSMVT_CREATE in test mode for the validation purpose and if the simulation is successful, I save the custom message "Simulation successful" in our custom log table.
2. I go and create batch in sap with BAPI_BATCH_CREATE followed by BAPI_TRANSACTION_COMMIT.
3. Once the batch is created, from the data passed through PI, I update batch characteristics for the metals with BAPI_OBJCL_CHANGE.
4. After batch characteristics update again i run BAPI_GOODSMVT_CREATE in real mode which generates the materil document number.
My problem is sometimes, during this whole process i get the error message "Object is currently locked by user ZRFC_USER after my custom message "Simulation Succesful" in step 1. In this case, batch is getting created without characteristics. This problem we getting 2-4 times a day and ultimately users need to correct batch manually.
I think, after batch is created, and before batch characteristics getting updated, SAP gives this error "Object is currently locked by user".
I will appreciate if someone has better idea to tackle this error.
Thanks in advance for your time and help.
Regards,
Sheetal