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
How the transaction that are programmed by the user can be protected?
What are the two different ways of building a match code object?
What is the difference between tables and structures?
Business scenarios related to your objects( In my case -Rulebook and Pricing work flow)
Explain the types of bdc's?
What is append search help? : sap abap data dictionary
In which particular scenario we use sorted table and which particular scenario we use standard table?
Where do you create indexes in abap?
singleton class
What are the differences between domain and data element?
1 . how do u design technical documentation in abap ? 2 . what u currently devloped in sap abap ?
What are the layers of data description in r/3? : abap data dictionary
What was the requirement of IDoc in your project? How it was working?
What is open sql?
Does every abap/4 have a modular structure? : abap modularization