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

Table Locking

Former Member
0 Likes
1,333

Hi everyone ..

i am new here .

i want to asking about table locking

i have a problem, the problem like this

if user a acces table_a, table_a will locked by user a, so the other user only can view table_a and can't modified the table_a

i want to table_a not locked by a, so the other user can modified table_a in same time with user a.

i hope someone can help me to solve this problem

regards

novhard kordinov

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,284

You mean to say u want to disable locking on table_a so that user a as well as other users also maybe able to access it.

This would cause databse inconsistency and hence not recommended.

Correct me if i understood your question wrongly

12 REPLIES 12
Read only

Former Member
0 Likes
1,285

You mean to say u want to disable locking on table_a so that user a as well as other users also maybe able to access it.

This would cause databse inconsistency and hence not recommended.

Correct me if i understood your question wrongly

Read only

former_member156446
Active Contributor
0 Likes
1,284

let me know how will the table be changed?

Tr? sm30? program ?

Read only

Former Member
0 Likes
1,284

@kartik tarla

yaps, you understand my question,

it will make inconsitency

i want to change my question

like this

if a acces table_a at the first time , table_a will display in change view,

so table_a will be locked by user a,

so the other user only can display view in table_a,

i want to make if a acces table_a at first time, table_a will display in display view,

so table_a not locked by user a, but if a want to modified the record in table_a,

the record will be locked by user a, so the other user only can view the record

i hope some one can help me to solve the problem

@j@y

by program

thanks for the responses

Read only

0 Likes
1,284

u can use these fms 'ENQUEUE_E_TABLE' and DEQUEUE_E_TABLE to lock and unlock table,

Only when user a is modifying a record then lock the table and then unlock right after it.

Read only

Former Member
0 Likes
1,284

@Kartik Tarla

thanks for response me ..

mmm, how if i want to do record locking not table locking??

Read only

0 Likes
1,284

The above Fms that i have provided have a parameter varkey which is the concatenated key fields

If u provide this varkey then this fm will perform record level locking based on the key fields,

only teh record matching with the key that u provided will be ;locked

Edited by: Kartik Tarla on Oct 6, 2009 9:15 AM

Read only

0 Likes
1,284

Hi Novhard,

You can use custom lock objects (see SE11). If you create one object (it should start with 'EZ' or 'EY' for specific ones) lets say EZ_MY_TABLE, it will create to FM :

- ENQUEUE_EZ_MY_TABLE that will lock some entries of your table :


CALL FUNCTION 'ENQUEUE_EZ_LOCK_MATABLE'
 EXPORTING
   MODE_MY_TABLE = 'E'
   MANDT         = SY-MANDT
   KEYFIELD1     = 'VALUE1'
   KEYFIELD2     = 'VALUE2'.

- DEQUEUE_EZ_MY_TABLE that will unlock your entries


CALL FUNCTION 'DEQUEUE_EZ_LOCK_MATABLE'
 EXPORTING
   MODE_MY_TABLE = 'E'
   MANDT         = SY-MANDT
   KEYFIELD1     = 'VALUE1'
   KEYFIELD2     = 'VALUE2'.

Hope it will help you...

Best regards,

Samuel

Read only

Former Member
0 Likes
1,284

@Kartik Tarla,

i like to discuss with you ..

i am newbie using SAP and ABAP programming

if i am running program

in example ZHRSJ

that program will show table Equipment, at first time view, will be display in change view

and if somebody run ZHRSJ too

the other will be view table in display view, coz table Equipment already locked by me

i want to make that program will show the table at the first time in display view when i running it

can you help me, how to do that ..

thank you very much for all your responses for me

regards

novhard kordinov

Edited by: novhard on Oct 6, 2009 6:00 AM

Read only

0 Likes
1,284

are u using a table control

Read only

0 Likes
1,284

@ Kartik Tarla

i dont know,..

if we want to do like i mention before ..

is it the solution using table control??

Read only

Former Member
0 Likes
1,284

This message was moderated.

Read only

Former Member
0 Likes
1,284

thanks for all responses ,..

i am very newbie in SAP and ABAP programming

this is my first time, i have to remake a funciton in SAP

just confuse what i must to do,

still study the code,

later i will asking again ...

thanks all ..

regards

novhard kordinov