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: 

How to Lock a Transaction

Former Member
0 Kudos

Hi,

<b>

How do we Lock a Transaction?</b> (not standard tran Eg: a report which updates some information or a BDC)

when a user is trying to access a transaction and if another user is trying to access the same transaction

then it should lock the transaction for the 2nd user and specify the transaction is run by another user.

how do we do this?

any Std FM are available?

Thanks in Advance.

5 REPLIES 5

Former Member
0 Kudos

Refer thread...

Former Member
0 Kudos

Hi Pavithra,

Use the lock object in the code of the report program. If the first user is using the program the lock object gets locked. The second user will not be able to use it. Check the sy-subrc and stop the next user from proceeding further.

Regards

Arun

Former Member
0 Kudos

hi,

look at SM01 transaction.

Former Member
0 Kudos

Hi,

create lock object on table using se11 for table ar

row level or table level

and call FM

CALL FUNCTION 'ENQUEUE_EZSDXA'

EXPORTING

MODE_ZSDRORI = 'E'

MANDT = SY-MANDT

WERKS = S_WERKS

BELNR = X_LOCK_LEVEL

POSNR = '000000'

ZZSUBITEM = ' '

  • X_WERKS = ' '

  • X_BELNR = ' '

  • X_POSNR = ' '

  • X_ZZSUBITEM = ' '

  • _SCOPE = '2'

  • _WAIT = ' '

  • _COLLECT = ' '

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2

OTHERS = 3.

at end of program use

call function 'DEQUEUE_ALL'.

else check out trnsaction SM01.

Regards

amole

Former Member
0 Kudos

Hi,

<b>SM01</b> --> Lock Transactions.

sm01 is a very useful transaction. Not only can you lock transactions from being used at all in the system, but as a general SAP use it can also be used to look up transaction codes, whether for functional information or simply because you forgot which code you need.

mark all the helpful answers

Regards

Sudheer