‎2014 Jan 15 8:45 AM
Hi All,
I am writing a BDC program to process material masters. The program going to create same material for 2 plant. The material creation for 2nd plant referring to 1st plant.
The process for 2nd plant only initiated after the process in 1st plant is completed. The 2nd process failed because the material created in 1st process is locked. I need help on how to resolve this problem.
‎2014 Jan 15 9:03 AM
You could use BAPI and WAIT option in the COMMIT.
With BDC you wont have many options if response time are not excellent, as there is a delay between the end of the transaction (COMMIT) and the end of the update tasks that actually update database and share the lock during the process.
If you are using CALL TRANSACTION and not sessions you could try to lock the material reference (FM ENQUEUE_EMMARAE) til successful then release it and CALL the second TRANSACTION.
Regards,
Raymond
‎2014 Jan 15 9:03 AM
You could use BAPI and WAIT option in the COMMIT.
With BDC you wont have many options if response time are not excellent, as there is a delay between the end of the transaction (COMMIT) and the end of the update tasks that actually update database and share the lock during the process.
If you are using CALL TRANSACTION and not sessions you could try to lock the material reference (FM ENQUEUE_EMMARAE) til successful then release it and CALL the second TRANSACTION.
Regards,
Raymond
‎2014 Jan 15 9:24 AM
Hi,
you can create two different BDC sessions one for first and one for second plant. If session for first plant has completed for all materials without errors you can start the second session for the other plant.
Using CALL TRANSACTION you can try update modes 'S' and 'L'. Additional if needed you can use the lock loop mechanism Raymond suggested.
Regards,
Klaus
‎2014 Jan 15 9:39 PM
Hi Boon,
Instead of BDC, in the past I found myself quite confortable with MATERIAL_MAINTAIN_DARK function module, for a very similar requirement.
It's a well documented FM. You can pass almost all material fields in the available structures. It's easy to be used and efficient.
I hope this could be of any help. If you need further details, just let me know.
Bye,
Flavio
‎2014 Jan 15 10:19 PM
Hi,
I think, do you need use the Lock Object Function Module after process first material.
ENQUEUE_*MAT*
DEQUEUE_*MAT*
by check is material is locked use the ENQUEUE Function Module, if you want unlock use DEQUEUE Function Module.
Regards,