Regarding ENQUEUE DEQUEUE

hey guys,
I want to make record level lock for the user entered in the screen Simultaneously.
I have change button and Tablecontrol in screen.
when user enter VBELN and Other values and execute, the retrieved values from
internal table will be popupated in table control at next screen 9100.
I want to lock other user whom tries to make change in this screen or <b>(when he clicks change button in screen)</b>
i did below logic and its not working for me..could you pls help me out.
MAIN PROGRAM******************************************************
SELECT-OPTIONS:S_WADAT   FOR LIKP-WADAT_IST.       
SELECT-OPTIONS:S_KUNAG   FOR LIKP-KUNAG.          
SELECT-OPTIONS:S_KUNNR   FOR LIKP-KUNNR.           
SELECT-OPTIONS:S_LGORT   FOR LIPS-LGORT            
                         MATCHCODE OBJECT ZMLG.
SELECT-OPTIONS:S_VGBEL   FOR LIPS-VGBEL.          
SELECT-OPTIONS:S_VBELN   FOR LIKP-VBELN.        
SELECT-OPTIONS:S_POSNR   FOR LIPS-POSNR.           
SELECT-OPTIONS:S_ZBUNK   FOR ZSDTB_LOT-ZBUNKTU.  
<b>START-OF-SELECTION.</b>
  CLEAR:FLG_CHG,                                   
        FLG_UPD.                                 
  FLG_SAV = C_ON.                               
  <b>PERFORM SEL_DATA.</b> <i>"Fetches data and put into internal table IT_DATA.</i>
  CLEAR W_LINE.
  DESCRIBE TABLE IT_DATA LINES W_LINE.         
  IF W_LINE = 0.                                  
     MESSAGE ID 'ZPP' TYPE 'S' NUMBER '011'.
  ELSE.
   <b>  CALL SCREEN '9100'.   </b>
  ENDIF.
PERFORM DEQ_TBL.          
FORM SEL_DATA.
STORED VALUES INTERNAL TABLE IT_DATA.
ENDFORM.
*WHEN USER CLICK CHANGE BUTTON in APPLICATION BAR>
MODULE USER_COMMAND_9100 INPUT.
  CASE OK_CODE.                   
    WHEN 'CSCG'.           "Change button                         
     IF FLG_CHG = C_ON.
     CLEAR:FLG_CHG,FLG_SAV.
     LOOP AT IT_DATA INTO WA_DATA.
     AT END OF VBELN.
      <b> PERFORM ENQ_TBL USING WA_DATA.
       IF FLG_ERR = C_ON.
        EXIT.
        ENDIF.</b> 
    ENDAT.
     ENDLOOP.
    IF FLG_ERR = C_ON.
     <b>MESSAGE ....<.INFORMATION ERROR VBELN LOCKED></b>    ENDIF.
     IF FLG_UPD = C_ON.                       
        PERFORM INSERT_TBL.                  
     ENDIF.
    ELSE.
         FLG_CHG = C_ON.
    ENDIF.
    WHEN 'SAVE'.                    
      IF FLG_UPD = C_ON.                           
         PERFORM INSERT_TBL.                        
      ENDIF.
  ENDCASE.
ENDMODULE.          
<b>FORM ENQ_TBL  USING    I_VBELN.
  CLEAR FLG_ERR.
  CALL FUNCTION 'ENQUEUE_EZSDTB_LOT'
    EXPORTING
      MODE_ZSDTB_LOT       = 'E'
      MANDT                = SY-MANDT
      VBELN                = I_VBELN
    EXCEPTIONS
      FOREIGN_LOCK         = 1
      SYSTEM_FAILURE       = 2
      OTHERS               = 3
IF SY-SUBRC <> 0.
    FLG_ERR = C_ON.
ENDIF.</b>ENDFORM.                    " ENQ_TBL

hi, please descript more details on where the problem is.
Specially the symptom of your problem.
if you want to keep the exclusive access on thoes record, other application should also call 'ENQUEUE_EZSDTB_LOT' to try to get the access authority.
if no, your lock won't be effective.
And if the other application will be runned by a same user account in the SAP sever, you also should check the 'lock mode' of the lock object.
It is cumulative or not.
It's important, because Exclusive locks can be requested by the same transaction more than once and handled successively, but an exclusive but not cumulative lock can only be requested once by a given transaction. All other lock requests are rejected.
Hope it will be helpful
thanks

Similar Messages

  • 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.

  • 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.

  • 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

  • 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

  • What is AQ Enqueue/Dequeue

    Hi ,
    Can anybody explain me the concept of AQ Enqueue/Dequeue
    I google and read the document but no get clear picture
    Thanks in Advance

    Check this link.
    http://www.oracle-developer.net/display.php?id=319
    >
    I google and read the document but no get clear picture
    >
    Which document you read and what is not clear ? Try to be more precise and to the point in your questions. It will help you a lot in a getting quick and meaningful answers.
    thanks
    Raj

  • 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

  • JMS Enqueue/Dequeue without using oracle.jms package

    Hi,
    Is it possible to successfully enqueue/dequeue messages from Oracle AQ using JMS which only uses the classes under javax.jms package, not the classes under oracle.jms package. If possible, can anybody please provide some step by step example.
    Thanks

    You can get the connection factory and the queue from an application server's jndi. Create a resource provider reference in oc4j and get them from there. Read the oc4j services guide, oems (jms) chapter for how to do that.
    I think if you are not using an application server you can also get the connection factory and queue from an ldap directory. check out Aq user guide for that.

  • 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.

  • Enqueue/Dequeue in Oracle Aq Adapter

    Hi,
    I need to use enqueue/dequeue option in oracle aq adapter.
    However i need to know how the macthing of ids has to happen.
    Can any one provide me with an example with details steps?
    Thanks,
    Rosh

    The below url will provide information about AQ adapter,
    http://docs.oracle.com/cd/E21764_01/integration.1111/e10231/adptr_aq.htm
    Example of AQ adapter.
    http://jamessmith73.wordpress.com/oracle-fusion-middleware/oracle-soa-bpm-11g-blogs/soa-10g/soa-hands-on-4/
    Thanks,
    Vijay

  • Enqueue/Dequeue

    Hi,
    There are 2 reports accessing 1 table. I am facing the runtime error with description - "The database system detected a deadlock and avoided it by rolling back your transaction.u201D
    Have come across implementing the ENQUEUE and DEQUEUE concept on the table. Please clarify the below queries:
    1.Is the above error occuring beacuse the two reports are accessing the table at the same time?
    2.Implementing EN/DEQUEUE will solve the problem?
    3.If first report is writing the data to table at 12pm(after locking the table), and the second report trying to access the table at 12:10pm to write the data, will this wait in some queue and write the data after the first report releases the table lock?
    Regards,
    Rajkamal

    Hello Raj,
    You should understand the difference between Database Locks & SAP locks.
    The database system detected a deadlock and avoided it by rolling back your transaction
    1.Is the above error occuring beacuse the two reports are accessing the table at the same time?
    Initial look at the statement suggests that this is because of Database Lock collision. You need to check if both the programs were trying to write (INSERT/UPDATE/MODIFY/DELETE) the same data to the DB table.
    2. Implementing EN/DEQUEUE will solve the problem?
    It should. But make sure you don't lock the entire table, try to lock only the individual records which are being processed(This is a good coding practice, of course you can override it depending on your requirement).
    3.If first report is writing the data to table at 12pm(after locking the table), and the second report trying to access the table at 12:10pm to write the data, will this wait in some queue and write the data after the first report releases the table lock?
    No, afiak there is no such queue. Alternatively you can put the lock in a iteration(viz., DO loop, WHILE loop) & check when the locks are released.
    Hope i'm clear.
    BR,
    Suhas

  • Enqueue/ Dequeue Table record

    Dear Experts,
    I am updating a record in my z-table which is appended in LFA1 through a Z-program.
    Prior to my update command i want to Enqueue that particular record and once it is updated i want to dequeue it.
    Can you please suggest the function module to perform this.
    Best Regards
    Ankur Gupta

    Hi
    You this FMs.
    ENQUEUE_E_TABLE
    DEQUEUE_E_TABLE
    The type of locks used in these are explained in the link below.
    http://help.sap.com/saphelp_nw04/helpdata/en/7b/f9813712f7434be10000009b38f8cf/content.htm

  • Finding enqueue dequeue rate

    Hi,
    How to find enqueue and dequeue rate in Oracle Advanced Queue?
    Please post if there is any SQL query to find enqueue per second, dequeue per second.
    Regards,
    Guru

    Hello,
    Can you please show me how to run AWR report so that it generates AQ stats you talked about ?The AWR report will be started using the sql script "awrrpt.sql" ($ORACLE_HOME/rdbms/admin/awrrpt.sql).
    You will find all details in the original Oracle documentation, keyword AWR.
    In the generated report you will find two sections concerning AQ (including a list of all your defined AQs):
    ==> Persistent Queues
    Ordered by Queue Name
    indicates queue (re)started between Begin/End snaps
    %Exp Msgs - % of msgs enqueued with expiry
    %Delay Msgs - % of msgs enqueued with delay
    %Trasf Time - % of Enqueue time spent in transformation
    %Eval Time - % of Enqueue time spent in rule evaluation
    ==> Persistent Queues Rate
    Ordered by Queue Name
    indicates queue (re)started between Begin/End snaps
    Greetings
    WoG

  • 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

  • Enqueue - Dequeue Delay

    imsimta version
    Sun Java(tm) System Messaging Server 6.2-4.03 (built Sep 22 2005)
    libimta.so 6.2-4.03 (built 04:37:42, Sep 22 2005)
    SunOS pop1 5.10 Generic_118822-23 sun4u sparc SUNW,Sun-Fire-V240
    I am experiencing a delay , sometimes arround 30 minutes between enqueue and dequeue process.
    Any one have an idea how can I minimize this delay

    anagililangika wrote:
    I am experiencing a delay , sometimes arround 30 minutes between enqueue and dequeue process. There is an article on troubleshooting the MTA here:
    http://www.sun.com/bigadmin/sundocs/articles/troubleshoot-mta.jsp
    Regards,
    Shane.

Maybe you are looking for

  • Can I get UHD (3840x2160p) @60Hz with full 8bit color (RGB/4:4:4) on HDMI2.0?

    With the latest release of UHD (3840x2160p) TVs, we get some questions about the support on HDMI2.0. And especially about the support for full color in UHD (3840x2160p) at 60Hz. The first gfx cards supporting HDMI2.0 are the Nvidia GTX 970 and GTX 98

  • DEBUG - how can I put a "break-point" when a variable have a certain value

    Hi I need help... Do you know some kind os instruction or tools to see and stop in debug a program when a variable have a specified value ? For example: At debug I want that a program "stop" when likp-vbeln = 70000123000. Now for do this, I change th

  • CRM OUTLOOK 2013, slow performance

    estimates, installing Outlook 2013 on my workstation, the team's performance is significantly degraded, to the point that the user can not operate normally, Outlook loading for the first time too you delay, how I can help solve the problem ?

  • Linktoaction cell editor

    Hi Experts, I have changed the existing column in a table(not alv) form a textview to linktoaction cell editor I have assigned the type also as function in the properties and a text which leads to values. The problem is it doesnt show the underline f

  • How to install the airport card to my macbook?, How to install the airport card to my macbook?

    One time when i was browsing using my macbook, it suddenly hanged. I waited for several minutes for it to return to its normal function to no avail. What i did was removed the battery then switched it on again. It worked again. But could not access t