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: 

to find the lock object on the table-- urgent

Former Member

hi all..

how do i find which lock object or the enquee function is used for the table t001b..

if any one knows the lock objec/ FM plz lemme know..

thnx..

4 REPLIES 4

Former Member
0 Kudos

use transaction SM12 for it..

points please....

Former Member
0 Kudos

Hi

check this

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 -

Regards

Anji

varma_narayana
Active Contributor

Hi Neha..

To find out the Lock Objects on a Table :

Go to SE11 tcode:

Enter the Table Name Eg: t001b

Select the Where-Used-List button from the Application ToolBar.

Select the Check Box Lock objects(only).

It will list all the Lock Objects based on the Given Table.

If there is no Lock object found on the Table t001b , Then create a new Lock object.

Name of the Lock object starts with EZ or EY.

<b>Reward If Helpful.</b>

Former Member
0 Kudos

Hi,

E_TABLEE is the common lock object using to lock and unlock the table.

Check the code below:

lv_progname = sy-repid.

  • Concatenating sy-mandt and program name in one variable.

CONCATENATE sy-mandt lv_progname INTO lv_x_tabname.

  • Calling the ENQUEUE_E_TABLEE function to lock the table

CALL FUNCTION 'ENQUEUE_E_TABLEE'

EXPORTING

tabname = lv_uptabname "table

varkey = lv_x_tabname "key variable

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

IF sy-subrc NE gc_zero_num.

IF sy-batch EQ gc_x.

MESSAGE e020 WITH lv_progname. "#EC *

ELSE.

MESSAGE i020 WITH lv_progname. "#EC *

LEAVE LIST-PROCESSING.

ENDIF.

ELSE.

  • Adding the records in to Record table

MODIFY Ztable FROM TABLE gt_itab2.

IF sy-subrc EQ gc_zero_num.

COMMIT WORK.

ELSE.

ROLLBACK WORK.

MESSAGE e021.

LEAVE LIST-PROCESSING.

ENDIF.

CALL FUNCTION 'DEQUEUE_E_TABLEE'

EXPORTING

tabname = lv_uptabname

varkey = lv_x_tabname.

ENDIF.

Regards,

Kannaiah