‎2008 Oct 29 3:45 PM
Basically my program submits the file path into another program and file get executed there. The program basically creates the Sales order for the corresponding PO in the file.
Parallel processing :
I opened my program in two parallel sessions .
I used the same file path/test file which creates sales order for the corresponding PO number in the file.
And ran two parallel sessions for the same program with this same file path/test file yet a time. And two sales orders were created for the same PO number.
But we donu2019t need this. We should make sure that duplicate sales orders for one corresponding should not get created. For that reason, we are checking in the middle of the program vbak entry and if there is no entry in vbak table then we are collecting SO data using bapi to create SO and at the end we are writing commit which creates SO. But this is not fulfilling the purpose of duplicate SO creation.
Because incase of parallel processing the program in each sessions checking the vbak entry where there is no entry u2026then creating sales order info and finally both sessions are u201Ccommitu201D executed and so that two Sales orders are getting creatred.
In this case, can I put file lock
Is there any way by which we can set up a lock at the file so that it cannot be used by another session if it is already in use by one session?
Thanks in ADVANCE.
‎2008 Oct 30 3:04 AM
Hi Jai,
the links you have given are table locks.
By looking that I did not get idea of how to lock the program.
Can I get the code to lock and unlock the program so that the when ever the program runs in parallel session will abort or wait. ?
THANKS IN ADVANCE.
‎2008 Oct 29 3:49 PM
rather than providing a lock to file, how about locking the program not to execute in parallel sessions?
[this link should help u|http://help.sap.com/saphelp_nw04/helpdata/EN/7b/f9813712f7434be10000009b38f8cf/content.htm]
Edited by: Jay Sadaram on Oct 29, 2008 11:50 AM
‎2008 Oct 29 3:51 PM
‎2008 Oct 29 4:23 PM
Could you please explain/guide me with the code like how can I lock the whole program or part of the program.
Thanks for your replies.
THANKS AGAIN,
‎2008 Oct 29 4:48 PM
hi sam refer to this[ link its neatly explained|http://help.sap.com/saphelp_nw04/helpdata/EN/cf/21eebf446011d189700000e8322d00/frameset.htm]
‎2008 Oct 30 3:04 AM
Hi Jai,
the links you have given are table locks.
By looking that I did not get idea of how to lock the program.
Can I get the code to lock and unlock the program so that the when ever the program runs in parallel session will abort or wait. ?
THANKS IN ADVANCE.
‎2008 Oct 30 7:01 AM
To lock
- the program (one job processed at a time) - use FM [ENQUEUE_ESRDIRE|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=enqueue_esrdire&adv=false&sortby=cm_rnd_rankvalue],
- the purchase order (one job per purchase order at a time) - use FM [ENQUEUE_EMEKKOE|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=enqueue_emekkoe&adv=false&sortby=cm_rnd_rankvalue]
For lock concept look at [The SAP Lock Concept (BC-CST-EQ)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCSTEQ/BCCSTEQ_PT.pdf] or [Function Modules for Lock Requests|http://help.sap.com/saphelp_nwpi71/helpdata/en/cf/21eebf446011d189700000e8322d00/frameset.htm], both locks will be released by COMMIT/ROLLBACK WORK or explicit call of DEQUEUE FM,
Regards
‎2008 Oct 30 2:13 PM
understand.
means if we lock ....on some thing , it unlock automatically after commit or rollback statement.
One question is
in my scenario the where/on what can I put the lock. I totally don't understand this.
Could you please help me with the required code also because i am not good in lock and unlock ..FMs
THANK YOU Sir