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: 

FM for locking n unlocking a table for update

Former Member
0 Kudos

I have to update a table named bnka, can anyone tel me the FM for locking and unlocking a table before updating the same..

thnkx

amit

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

Use the fms:

ENQUEUE_E_TABLE passing BNKA to the tabname parameter. and

DEQUEUE_E_TABLE passing BNKA to the tabname parameter.

or

ENQUEUE_EFBNKA and DEQUEUE_EFBNKA

Regards,

ravi

Message was edited by:

Ravi Kanth Talagana

6 REPLIES 6

former_member181962
Active Contributor
0 Kudos

Use the fms:

ENQUEUE_E_TABLE passing BNKA to the tabname parameter. and

DEQUEUE_E_TABLE passing BNKA to the tabname parameter.

or

ENQUEUE_EFBNKA and DEQUEUE_EFBNKA

Regards,

ravi

Message was edited by:

Ravi Kanth Talagana

manuel_bassani
Contributor
0 Kudos

Hi Amit

you can use FM ENQUEUE_EFBNKA to lock the table BNKA

and DEQUEUE_EFBNKA to unlock it

Example:


call function 'ENQUEUE_EFBNKA'
 EXPORTING
   MODE_BNKA            = 'E'
   BANKS                = bnka-banks
   BANKL                = bnka-bankl
 EXCEPTIONS
   FOREIGN_LOCK         = 1
   SYSTEM_FAILURE       = 2
   OTHERS               = 3.
if sy-subrc <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.

update BNKA .....

call function 'DEQUEUE_EFBNKA'
 EXPORTING
   MODE_BNKA       = 'E'
   BANKS           = bnka-banks
   BANKL           = bnka-bankl.

Cheers,

Manuel

venkata_ramisetti
Active Contributor
0 Kudos

Hi Amit,

You can use ENQUEUE_E_TABLES or ENQUEUE_E_TABLE function module.

Thanks

Ramakrishna

Former Member
0 Kudos

Hello,

Use,

ENQUEUE_* and DEQUEUE_* function modules.

Regards,

Shehryar Dahar

Former Member
0 Kudos

you can use FM ENQUEUE_EFBNKA to lock the table vbak

and DEQUEUE_EFBNKA to unlock it

Example:

call function 'ENQUEUE_EFBNKA'

EXPORTING

MODE_BNKA = 'E'

BANKS = bnka-banks

BANKL = bnka-bankl

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2

OTHERS = 3.

if sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

update BNKA .....

call function 'DEQUEUE_EFBNKA'

EXPORTING

MODE_BNKA = 'E'

BANKS = bnka-banks

BANKL = bnka-bankl.

0 Kudos

cut and paste, Srikanth ?