Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

function module

Former Member
0 Likes
850

Hi sdn members,

can any one say the funtionality of DEQUEUE_E_TABLE.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
806

Hi Elias,

We can use the function modules ENQUEUE_E_TABLE for locking tables and the function module DEQUEUE_E_TABLE for unlocking tables. With this method, we don't need to lock objects in order to lock the tables. In other words, any table can be locked/unlocked using these function modules. Sample code is given below :

report z_enqueue.

* testing the locking of tables...
data:
  varkey like rstable-varkey.

  varkey = sy-mandt.

* locking the tables............................
call function 'ENQUEUE_E_TABLE'
 exporting
*   MODE_RSTABLE         = 'E'
   tabname              = 'MARA'
   varkey               = varkey
*   X_TABNAME            = ' '
*   X_VARKEY             = ' '
*   _SCOPE               = '2'
*   _WAIT                = ' '
*   _COLLECT             = 'X'
 exceptions
   foreign_lock         = 1
   system_failure       = 2
   others               = 3
          .
  case sy-subrc.
    when 1.
        message i184(bctrain) with 'Foreignlock'.
    when 2.
      message i184(bctrain) with 'system failure'.
    when 0.
      message i184(bctrain) with 'success'.
        when others.
        message i184(bctrain) with 'others'.
  endcase.

* unlocking the table...............

  call function 'DEQUEUE_E_TABLE'
   exporting
*     MODE_RSTABLE       = 'E'
     tabname            = 'MARA'
     varkey             =  varkey
*     X_TABNAME          = ' '
*     X_VARKEY           = ' '
*     _SCOPE             = '3'
*     _SYNCHRON          = ' '
*     _COLLECT           = ' '  .

Regards,

Swapna.

3 REPLIES 3
Read only

Former Member
0 Likes
806

hii

this FM is used to unlock database table.if updation is completed then you need to unlock that table for further process that time this FM is used.

When need to update a database table ENQUEUE FM is used this will lock that table for updation so anybody else will not be able to update same table.other person can view data but can not update if it is locked by this FM but after completing updation we should unlock that table so for that DEQUEUE FM is used.

regards

twinkal

Read only

Former Member
0 Likes
807

Hi Elias,

We can use the function modules ENQUEUE_E_TABLE for locking tables and the function module DEQUEUE_E_TABLE for unlocking tables. With this method, we don't need to lock objects in order to lock the tables. In other words, any table can be locked/unlocked using these function modules. Sample code is given below :

report z_enqueue.

* testing the locking of tables...
data:
  varkey like rstable-varkey.

  varkey = sy-mandt.

* locking the tables............................
call function 'ENQUEUE_E_TABLE'
 exporting
*   MODE_RSTABLE         = 'E'
   tabname              = 'MARA'
   varkey               = varkey
*   X_TABNAME            = ' '
*   X_VARKEY             = ' '
*   _SCOPE               = '2'
*   _WAIT                = ' '
*   _COLLECT             = 'X'
 exceptions
   foreign_lock         = 1
   system_failure       = 2
   others               = 3
          .
  case sy-subrc.
    when 1.
        message i184(bctrain) with 'Foreignlock'.
    when 2.
      message i184(bctrain) with 'system failure'.
    when 0.
      message i184(bctrain) with 'success'.
        when others.
        message i184(bctrain) with 'others'.
  endcase.

* unlocking the table...............

  call function 'DEQUEUE_E_TABLE'
   exporting
*     MODE_RSTABLE       = 'E'
     tabname            = 'MARA'
     varkey             =  varkey
*     X_TABNAME          = ' '
*     X_VARKEY           = ' '
*     _SCOPE             = '3'
*     _SYNCHRON          = ' '
*     _COLLECT           = ' '  .

Regards,

Swapna.

Read only

Former Member
0 Likes
806

Hi,

We Use the FM ENQUEUE_E_TABLE when you want to lock the table..

and the FM 'DEQUEUE_E_TABLE' to unlock it

You create a lock object for you table via SE11, doing so, creates two function modules, an ENQUEUE function module and a DEQUEUE funciton module. When you want to lock a table entry, you simply call the ENQUEUE function module for that lock object and pass the values in which are the key of the record that you want to lock.

http://help.sap.com/saphelp_nw2004s/helpdata/en/a2/3547360f2ea61fe10000009b38f839/frameset.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21eef3446011d189700000e8322d00/content.htm

Regards,

Omkaram.