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

What is the use of the raising exception?

568


What is the disadvantage of using exec sql statement in abap?

534


Where do you code the hide statement?

568


Have you processed BDCs ?

627


HOW CAN YOU USE A PAGE COUNT IN CALLING A PAGE IN SMARTFORM?

1630






It is not possible to create an abap/4 program, which contains only subroutines. State true or false. : abap modularization

710


What is a multiple line field?

588


Explain what are the different functions used in sap script? What are the parameters used in each function?

553


What is runtime analysis?

602


Which database object is used for storing the system variables? : abap data dictionary

728


hi experts,,, what is meant by documentation? test casr preparation? documentation and preparation and Tcode for this? quality and releasing? test case scenario?

1720


What is the difference between collect and sum?

577


What are two methods of modifying sap standard tables?

580


What is the difference between tables and structures?

624


What are the differences between structure and table in data dictionary in abap? : sap abap data dictionary

585