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 are the arithmetic operators in the sap abap?

804


Does sap handle multiple currencies?

780


Sal abap on hana interview

940


Is it possible to pass data to and from include programs explicitly? : abap modularization

973


Explain sap abap 3-tier architecture?

977


What is screen flow logic? What are the sections in it?

815


What is PS structure

1839


Write an abap program for creation of customer enquiry using BAPI 'BAPI_INQUIRY_CREATEFROMDATA'.

1956


How to insert a line into abap internal tables?

790


Hi! I want to join SAP ABAP course in Hyderabad, can any one tell me where should I join? and Which is the best institute for SAP WORKSHOP? Thank you...

1201


What are the client dependant objects in abap / sap?

705


Have you worked with support? How ticket comes to you? What were the timings for resolving tickets types of severity?

1815


What are pooled tables? : abap data dictionary

878


What is hotspot?

1156


pls if any one have idea ,reply as soon as possible 1.Allied solution group inc. is a genuine company or not ? 2.what is update module. 3.Transaction: scc3 what it is?

1713