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
What are the user groups?
What is the collect statement?
What is the sap abap?
Fallback class
Which function module would you use to check the user’s authorization to access files before opening a file?
What is difference between dialog program and a report?
Explain what is the difference between sy-tabix and sy-index? Where it is used?
What is function group?
Explain what are the problems in processing batch input sessions?
Difference between sy-tabix and sy-index? Where it is used? Can you check sy-subarc after perform?
what is the purpose of BAPI BAPI_CUSTMATINFO_GETLIST What is input and output of this BAPI.
What kind of BDC programs are written ?
Give an example of interface from your project explaining why you used it?
In the `select' statement what is group by ?
Explain the sequences of event block?