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
The commands through which an abap/4 module can “branch to “ or “call” the next screen are?
Did you create help views?
How to handle errors in call transaction bdc method without using bdcmsgcoll internal table? : abap bdc
Do we create table fields with out data elements and domains?
dynamic programming in sap abap
when are objects are passed from task to the change request?
What is the use of f4if_shlp_exit_example function module ? : sap abap data dictionary
What is tmg?
What is the structure of bdcmsgcoll? : abap bdc
What is the difference between collect and sum?
What is sap script? Describe its components.
out bound process code for quotation?
Work most on which module: name a few tables?
How do you execute the payroll
What are the disadvantages of using explicit enhancement?