how will you go for row level locking of a z table

Answer Posted / kubera naidu

Hi Swapna,

1)Create a lock object, suppose EZLOCK in SE11 for the table
ZLOCK (having fields..field1, field2, field3).

2)Activate it, system will automatically generates two
function modules for locking and unlocking.

3) How to use them in program ?
Here you go..

loop at itab into wa_tab.
* For Locking the table ZLOCK
CALL FUNCTION 'ENQUEUE_EZLOCK'
EXPORTING
mode_ZLOCK = 'E'
mandt = sy-mandt
field1 = wa_zlock-field1
field2 = wa_zlock-field2
field3 = wa_zlock-field3
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.

* For Unlocking the table ZLOCK
CALL FUNCTION 'DEQUEUE_EZLOCK'
EXPORTING
mode_ZLOCK = 'E'
mandt = sy-mandt
field1 = wa_zlock-field1
field2 = wa_zlock-field2
field3 = wa_zlock-field3

endloop.

Regards,
Kubera Naidu.

Is This Answer Correct ?    19 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How the transaction that are programmed by the user can be protected?

629


What are the two different ways of building a match code object?

581


What is the difference between tables and structures?

618


Business scenarios related to your objects( In my case -Rulebook and Pricing work flow)

826


Explain the types of bdc's?

591






What is append search help? : sap abap data dictionary

686


In which particular scenario we use sorted table and which particular scenario we use standard table?

1013


Where do you create indexes in abap?

616


singleton class

925


What are the differences between domain and data element?

566


1 . how do u design technical documentation in abap ? 2 . what u currently devloped in sap abap ?

2554


What are the layers of data description in r/3? : abap data dictionary

631


What was the requirement of IDoc in your project? How it was working?

1540


What is open sql?

571


Does every abap/4 have a modular structure? : abap modularization

692