Enqueue/Dequeue - Locking/Unlocking object

Hi all,
Please help me working with this enqueue/dequeue command. What I'm trying to do is to lock a Service Order. My requirement is to do a BDC for the Service Order Settlement Rule. So after hitting SAVE, a secondary process will be kicked off to perform my BDC for the same order. Now what Im doubting is that what if user re-enter the same Service Order again so quick. So my BDC program will not be performed immediately since it will be locked by the usser.
So my idea is to lock it first while my BDC program is still running. Any help please? Thanks.

Nope. Just 1 BDC -on my 2nd program only. Or to make it simple, I have modified ZXWOCU07 (IWO10009) to perform/kick off a call function( this is being triggered after hitting on SAVE). And this FM contains my checking if SO is now open for change then do the do the BDC.
What I'm thinking is to lock first the SO  to block any user from accessing that SO, so it will do the BDC first. But I'm not yet familiar with the locking/unlocking of objects. Please help me on how to use enqueue or locking object.

Similar Messages

  • Finding Enqueue/Dequeue functions

    Hi,
    Is there an easy way to find the enqueue/dequeue lock functions for a specific table?
    I tried to find the enqueue/dequeue functions for table LIKP. It took me a while to find it, but it turns out the name is ENQUEUE_EVVBLKE.
    You'd think that the table name would be incorporated into the function name to make it easy to find?!
    Does anyone have a suggestion?
    Thx.
    Andy

    Yes bro most of the times the table or field names would be in the Function module name.
    Raghav

  • 2515 Locking FMs to Enqueue/Dequeue/ Which one to use?

    I know this question is redundant, and has been responded to a million times....all differently. However, being their are 2,515 function modules to choose from, what are the best choices for locking and unlocking a custom database table?
    And, why are their 2,515 of them?
    I take that back....many many more!
        Thank-You
    Edited by: Tom Matys on Sep 23, 2011 12:15 PM

    Hi
    I think the best way is to create a new lock object for every custom tables.
    Every table should have an own lock object (so own fms to Enqueue/Dequeue) because it makes sure the same lock object is not used for another table at the same time.
    If the same lock object is used for many tables it can risk to find a certain record locked although nobody locks it really.
    Max

  • ENQUEUE, DEQUEUE of objects

    Hi all,
    i want to lock sales orders with fm ENQUEUE_EVVBAKE and
    DEQUEUE_EVVBAKE.
    This two fms work fine if i am in the same mode.
    I start the fm ENQUEUE_EVVBAKE from one mode and want to unlock the entries from another mode.
    The fm DEQUEUE_EVVBAKE runs with no errors. But the lock entry in the SM12 still exists.
    Any ideas?
    regards

    Hi
    See this and do accordingly
    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
    SAP Provide three type of Lock objects.
    - Read Lock(Shared Locked)
    protects read access to an object. The read lock allows other transactions read access but not write access to
    the locked area of the table
    - Write Lock(exclusive lock)
    protects write access to an object. The write lock allows other transactions neither read nor write access to
    the locked area of the table.
    - Enhanced write lock (exclusive lock without cumulating)
    works like a write lock except that the enhanced write lock also protects from further accesses from the
    same transaction.
    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
    Technicaly:
    When you create a lock object System automatically creat two function module.
    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
    You have to use these function module in your program.
    check this link for example.
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    tables:vbak.
    call function 'ENQUEUE_EZLOCK3'
    exporting
    mode_vbak = 'E'
    mandt = sy-mandt
    vbeln = vbak-vbeln
    X_VBELN = ' '
    _SCOPE = '2'
    _WAIT = ' '
    _COLLECT = ' '
    EXCEPTIONS
    FOREIGN_LOCK = 1
    SYSTEM_FAILURE = 2
    OTHERS = 3
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Normally ABAPers will create the Lock objects, because we know when to lock and how to lock and where to lock the Object then after completing our updations we unlock the Objects in the Tables
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    purpose: If multiple user try to access a database object, inconsistency may occer. To avoid that inconsistency and to let multiple user give the accessibility of the database objects the locking mechanism is used.
    Steps: first we create a loc object in se11 . Suppose for a table mara. It will create two functional module.:
    1. enque_lockobject
    1. deque_lockobject
    before updating any table first we lock the table by calling enque_lockobject fm and then after updating we release the lock by deque_lockobject.
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    GO TO SE11
    Select the radio button "Lock object"..
    Give the name starts with EZ or EY..
    Example: EYTEST
    Press Create button..
    Give the short description..
    Example: Lock object for table ZTABLE..
    In the tables tab..Give the table name..
    Example: ZTABLE
    Save and generate..
    Your lock object is now created..You can see the LOCK MODULES..
    In the menu ..GOTO -> LOCK MODULES..There you can see the ENQUEUE and DEQUEUE function
    Lock objects:
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    Match Code Objects:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm
    http://searchsap.techtarget.com/tip/0,289483,sid21_gci553386,00.html
    See this link:
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    Check these links -
    lock objects
    Lock Objects
    Lock Objects
    Regards
    Anji

  • Query on sap locks(ENQUEUE/DEQUEUE)

    Hi All,
    should the sap locks ENQUEUE/DEQUEUE need to be used  for all the updation/insertion  of records ino the table?
    Please confirm.Should this locking technique be used even for insertion of records into the table?
    Regards,
    Pra.

    Hi,
    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
    SAP Provide three type of Lock objects. 
    - Read Lock(Shared Locked)
       protects read access to an object. The read lock allows other  transactions read access but not write access to 
       the locked area of  the table
    - Write Lock(exclusive lock)
       protects write access to an object. The write lock allows other  transactions neither read nor write access to 
        the locked area of the  table.
    - Enhanced write lock (exclusive lock without cumulating)
      works like a write lock except that the enhanced write lock also  protects from further accesses from the 
      same transaction.
    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
    Technicaly:
    When you create a lock object System automatically creat two function module.
    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
    You have to use these function module in your program.
    Hope this will give a basic idea.

  • Enqueue: Elem.lock 0 contains unpermitted lock mode . lock object EZBEV_BO

    Hello Guru's,
    we have a unusual problem in the syslog of our ERP System.
    Enqueue: Elem.lock 0 contains unpermitted lock mode . lock object EZBEV_BO
    We can't found any note or forum entry to solve this.
    We checked SAP Notes: 1324099, 891372, 606425, 447242, 1260601 and searched in the forum, but nothing helpful found.
    System Data:
    ERP 6.0 / NW7.01 with EHP4
    SAP Kernel :  701_REL
    created on  :  Jan 18 2010 21:47:07
    Kernel Patch number : 77
    Source ID  :  0.077
    DBSL Patch No. : 075
    Database
    ORACLE 10.2.0.2
    Operating System
    AIX 5.3
    Can someone help?
    regards
    Chris

    developer error

  • FM to find user who locked the object using enqueue...

    Hello,
    How can I find name of user who enqueued the lock object in ABAP ?
    Regards,
    Jainam.

    Hi Jainam,
    See the SAP documentation, e.g. [FAQ - Lock concepts|http://help.sap.com/saphelp_NW04/helpdata/en/cb/168237d30d974be10000009b38f8cf/content.htm]:
    How can I find out who is currently holding the ungranted lock? In other words, how can check the program after an ENQUEUE to determine which use is currently holding the lock so that I can let him or her know?                                 
    This graphic is explained in the accompanying text Answer
    When the ENQUEUE_... function module is returned, the name of the lock owner is listed in SY-MSGV1.
    If you don't want to attempt to lock an object and just check who might own a lock use function module ENQUEUE_READ. Lots of comments in the forum...
    Cheers, harald

  • Enqueue: Elem.lock 0 contains unpermitted lock mode /. lock object

    Hello All,
    SCM 5.0 system which is upgraded from 4.1:
    System log entries contains:
    <b>Enqueue: Elem.lock 0 contains unpermitted lock mode /. lock object /sapapo/E</b>
    Work process log file contains :
    LOG GE8===>0 /sapapo/E_MATLOC
    I have gone through few notes like  606425, 447242.( lower version)
    From which I came to the conclusion that it is program error.
    Also group GE and No:8 What does it mean?
    Please let  me know your thoughts.Thanks.
    Regards,
    Tushar
    Message was edited by:
            Tushar Chavan
    Message was edited by:
            Tushar Chavan

    Hi,
    I found one more note :
    Note 891372 - Lock entries for TemSe obj remain after completion of proc
    The issue looks pretty similar. I think the notes you found are better suited for sap apo.
    Log a call with SAP and check what they have to say.
    Regards,
    Siddhesh

  • HR OM  LOCK and UNLOCK object!

    hi!
    some one know HR OM object's LOCK and UNLOCK object ?
    thank you very much!

    Hi ,
    these can be used to lock/unlock  om objects..
    CALL FUNCTION 'HR_ENQUEUE_OBJECT'
           EXPORTING
                PLVAR            = ACT_ENQK-PLVAR
                OTYPE            = ACT_ENQK-OTYPE
                OBJID            =  ACT_ENQK-OBJID
                ENQUEUE_ONCE     = ' '
           IMPORTING
    call function HR_DEQUEUE_OBJECT
    These can be used to lock the OM objects..
    Br,
    Vijay.

  • Unlock object by lock object name

    Hi all,
    scenario:
    We are locking some objects in ERP via RFC. (ENQUEUE_EVVBAKE)
    Now i want to unlock the objects within a user exit but the fm DEQUEUE_EVVBAKE is not running successfully. I know why (different mode)!!!
    Is there a possibility to delete a lock entry by object name??
    How can i solve my problem??
    regards

    i think we have to cast it, can u help me how to cast
    the obj to the classname that i get as inputThat's exactly the point why you shouldn't be doing this. You can't have a dynamic cast at compile time already. It doesn't make sense. Which is also the reason why class.forName().newInstance() is a very nice but also often very useless tool, unless the classes loaded all share a mutual interface.

  • Material Enqueue & Dequeue

    I hav designed a new application for store i wish to enqueue & dequeue  materials which store persons are using.
    So how can this be done.Please guide once i open any material in my applcation its locked untill i come out my application.I wishto unclock as my processing is over.
    Pls guide whch FM to use.

    hi,
    Create a lock object from SE11 by giving the name
    lock object : ezlock_material.
    call the function module enqueu_ezlock  in  th loop to which to all the materials to lock.
    to lock the material
    call the function module dequeu_ezlock  in  th unloop to which to all the materials to unlock.
    to unlock the material.
    Regards,
    Madhavi

  • Locking of objects between service calls

    Hello,
    Is there any practial way to lock an object (for example a loan) with one service so that it stays locked until another service commits the transaction and releases the lock? The service is a RFC function module that will be called by a web application. My problem is that when I use the standard ENQUEUE function the lock dissappears as soon as the first service is finished.
    Also, if one service would create a lock of an object and another one starts the update task, they probably wouldn't be in the same LUW, would that be a problem? If so, is there a solution?
    Thank you and kind regards,
    Steffen

    Steffen:
    In the locking service use the _SCOPE parameter value of 3 in your enqueue function call. This retains the lock after the first service (locking process) ends. The second service that does the update can then dequeue the lock after the update is processed.
    No problem with setting & freeing locks in different LUW, as the SAP locking mechanism is co-operative (i.e. software controlled) rather than database controlled. Just make sure that you use a standard SAP enqueue function so that other unrelated processes will honor the lock set by your first service.
    Regards,
    D.

  • How to unlock objects in Transport Organizer?

    I found a program to unreleased the objects. And create new TR so it wont affect the logs on the old TR#s. Do you think I'm doing the safe way?
    Now, I need to delete and create another object(fmod, fgroup or table) to save it in a new transport request. My problem is the object I deleted is locked in the old TR # so it saves on the same TR. How will I unlock this object?
    Actually, I made a program where I can modify TLOCK table that changes the TR# where it is locked. Is it also safe to forced change the TR?
    Thanks guys!

    Hi Maui,
    To unlock a transport use goto se03 --> Request Task --> Unlock Objects
    Eneter your request and select unlock and execute. this will unlock the request.
    Cheers
    VJ

  • What exactly is the difference between enqueue,latch & lock

    Can someone explain in simple words (with example if possible) what exactly is the difference between enqueue,latch & lock?
    I have gone through documentation & other links,but just not able to figure out the exact & clear difference between these three..
    Cheers,
    Kunwar

    In addition to links provided by Sb and nice explanations by Aman, i would like to add below :
    1.Latches and enqueues are lightweight serialization devices used to coordinate multi-user access to
    shared data structures, objects and files.
    Latches are locks that are held for extremely short periods of time, for example the time it takes to modify
    an in-memory data structure. They are used to protect certain memory structures, such as the database
    block buffer cache or the library cache in the shared pool (as described in Chapter 2, Architecture). Latches
    are typically requested internally in a ‘willing to wait’ mode. This means that if the latch is not available,
    the requesting session will sleep for a short period of time and retry the operation later. Other latches may
    be requested in an ‘immediate’ mode, meaning that the process will go do something else rather than sit
    and wait for the latch to become available. Since many requestors may be waiting for a latch at the same
    time, you may see some processes waiting longer than others. Latches are assigned rather randomly, based
    on the ‘luck of the draw’, if you will. Whichever session asks for a latch right after it was released will get it.
    There is no line of latch waiters, just a ‘mob’ of waiters constantly retrying.
    Oracle uses atomic instructions like ‘test and set’ for operating on latches. Since the instructions to set
    and free latches are atomic, the operating system itself guarantees that only one process gets it. Since it
    is only one instruction, it can be quite fast. Latches are held for short periods of time and provide a
    mechanism for clean-up in case a latch holder ‘dies’ abnormally while holding it. This cleaning up
    process would be performed by PMON.
    Enqueues are another, more sophisticated, serialization device, used when updating rows in a database
    table, fro example. They differ from latches in that they allow the requestor to ‘queue up’ and wait for
    the resource. With a latch request, the requestor is told right away whether they got the latch or not.
    With an enqueue, the requestor will be blocked until they actually attain it. As such, they are not as fast
    as a latch can be, but they do provided functionality over and above that which a latch can offer.
    Enqueues may be obtained at various levels, so you can have many ‘share’ locks and locks with various
    degrees of ‘shareability’.
    Source:Expert Oracle Database Architecture by Thomas Kyte
    2.Good PPT at http://nocoug.org/download/2001-05/latches.ppt
    3.Good PPT by Mark bobak at http://www.mi-oaug.org/Presentations/Understanding%20Locks%20and%20Enqueues.ppt
    HTH
    Girish Sharma

  • Issue with Enqueue / Dequeue

    We are working on a scenario where data is got into SAP through Web methods to create Sales orders.
    If we were to use Enqueue / Dequeue function while doing this would the web methods connection hold till the process is complete or would this time out in the middle?
    Is there any time out period for the connection with web methods, and if so how can it can be reset to an alternate value

    Hi,
    in ITS if you click on object, you can see the parmaters like
    ~TRANSACTION
    <b>~TIMEOUT</b>
    give more time for Time out parameter, that should solve the problem.
    Regards
    Vijay D T T.

Maybe you are looking for

  • How can I share printers using a non apple router, imac to ipad?

    Newbie in osx, but experienced in linux. My new imac has 3 printers setup for sharing, but ipad 2 / iphone 4 fail to see them.  I am using the belkin router that I owned already, instead of buying an Airport. I found a solution at askubuntu.com Q 261

  • SQL Query for TOP 10 Average CPU

    Have a SCOM Report request for a line graph showing top 10 average CPU for a group of servers. I have a query that will show all of the servers in a group for the last day, with the average CPU by hour. How can I extend the SQL query to only select t

  • How do I change the location of the coldfusion-out.log and coldfusion-error.log files in CF10

    When I change the log location in ColdFusion Administrator it changes the location of most but not all the log files.  I have a requirement from my customer to place all log files on a separate partition on the server.  For ColdFusion 9 I was able to

  • Xinit randomly doesn't start [solved]

    Recently I ran into a strange problem with xinit;  unfortunately there's not much I can say about it.  Basically, when I try to start X with xinit/startx, my laptop just hangs on a black screen.  I can't change ttys, magic Alt-SysRec keys don't work.

  • Can anyone help with Photoshop CC download error (49)?

    I'm not sure what to do with trying to get the update installed so that I can start the trial version.  I have turned off McAfee already.  Any suggestions?