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: 

Locking the transaction

Former Member
0 Kudos
99

I have a custom transaction , which edits a perticular table entries and allows to modify them. I wanted it to be locked if somebody is already using it.

Could somebody suggest me how the locking should be done ?

2 REPLIES 2

Former Member
0 Kudos
65

Hi,

the possible solution of using the lock object

'E_DSVAS_TRDIR' to lock a program

Reward if helpfull...

Cheers,

Sowjanya.

Former Member
0 Kudos
65

at initialization event

you can use lock function module

prg = sy-repid.

CALL FUNCTION 'ENQUEUE_ESINDX'

EXPORTING

MODE_INDX = 'E'

MANDT = SY-MANDT

  • RELID = 'ZZ'

SRTFD = prg

  • SRTF2 =

  • X_RELID = ' '

  • X_SRTFD = ' '

  • X_SRTF2 = ' '

  • _SCOPE = '2'

  • _WAIT = ' '

  • _COLLECT = ' '

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2

OTHERS = 3

.

IF sy-subrc <> 0.

message e000(yw) WITH sy-msgv1 'Is Already Executing The Program' prg

.

ENDIF.

this will help u out..its workin..i mean i m using this..