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 is the use of the raising exception?
What is the disadvantage of using exec sql statement in abap?
Where do you code the hide statement?
Have you processed BDCs ?
HOW CAN YOU USE A PAGE COUNT IN CALLING A PAGE IN SMARTFORM?
It is not possible to create an abap/4 program, which contains only subroutines. State true or false. : abap modularization
What is a multiple line field?
Explain what are the different functions used in sap script? What are the parameters used in each function?
What is runtime analysis?
Which database object is used for storing the system variables? : abap data dictionary
hi experts,,, what is meant by documentation? test casr preparation? documentation and preparation and Tcode for this? quality and releasing? test case scenario?
What is the difference between collect and sum?
What are two methods of modifying sap standard tables?
What is the difference between tables and structures?
What are the differences between structure and table in data dictionary in abap? : sap abap data dictionary