Application Development 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: 

Lock objects

Former Member
0 Kudos

how to lock a specific table entries?

1 ACCEPTED SOLUTION

ferry_lianto
Active Contributor
0 Kudos

Hi,

You can do by creating a lock object (SE11) and use this FM.

ENQUEUE_E_TABLE

DEQUEUE_E_TABLE

Regards,

Ferry Lianto

8 REPLIES 8

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

By using Lock Objects 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

Regards,

Rich Heilman

ferry_lianto
Active Contributor
0 Kudos

Hi,

You can do by creating a lock object (SE11) and use this FM.

ENQUEUE_E_TABLE

DEQUEUE_E_TABLE

Regards,

Ferry Lianto

Former Member
0 Kudos

sunil

check the below link may be useful for u

~~Guduri

Former Member
0 Kudos

use...

DB_GET_LOCKED_TABLES

BKK_PA_LOCKS_DB_SET_OBJECTS

BKK_CLOSCTRL_LOCK_OBJECTS

TRINT_OLE_LOCK_OBJECTS

Former Member
0 Kudos
* Lock Table ZFISVTAX_CCTR
  CALL FUNCTION 'ENQUEUE_E_TABLE'
   EXPORTING
     MODE_RSTABLE         = C_E
     TABNAME              = C_CCTR
   EXCEPTIONS
     FOREIGN_LOCK         = 1
     SYSTEM_FAILURE       = 2
     OTHERS               = 3

.

*   Unlock table ZFISVTAX_CCTR
     CALL FUNCTION 'DEQUEUE_E_TABLE'
      EXPORTING
        MODE_RSTABLE       = C_E
        TABNAME            = C_CCTR
               .

Former Member
0 Kudos

Hi Sunil,

If it is a standard table, there might be lock function modules created by SAP. If you want to create lock for ztable entries to use in custom transactions, create a lock object from SE11 starting with 'E' char like Eflightno and select lock parameters and table inside it. It will create two function modules in the Dictionary with names as

ENQUEUE_EFLIGHTNO and

DEQUEUE_EFLIGHTNO

which should be used in the custom transaction ..

Let me know, if i am not clear.

Regards,

Vivek

Former Member
0 Kudos