Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue with Lock object for material

Former Member
1,600

Hi Experts,

I have an issue with lock object for material data. In my report i am using below logic for material locking purpose but issue is when I am uploading material classification data and parallely i am in MM02 with that material in this time system not allowing to update the data. if i am in MM02 basic data tab then system allowing me to update, Anyone having solution how to handle this kind of issue.

CALL FUNCTION 'ENQUEUE_MATERIAL'
EXPORTING
matnr = material
* WAIT = ' '
werks = plant
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.

Thanks.

1 REPLY 1
Read only

roberto_forti
Contributor
976

Hi Ramesh,

Type of Lock regarding SAP concepts:

1.Shared lock/read lock S (shared):

More than one application can set a shared lock on the same record. An exclusive lock cannot be set for a record with an existing shared lock.

2.Exclusive lock/write lock E (exclusive):

Exclusive locks protect the lock object against all types of locks from any application. Only the application that locked the object can reset the lock. Locked data can be edited or displayed by a single user.

3.Exclusive and non-cumulative X (exclusive noncumulative)

Exclusive locks can be requested several times within the same application and are processed successfully. In contrast, exclusive but non-cumulative locks can be applied only once within an application; all other lock requests are rejected.

4.Below SAP link:

https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/abensap_lock.htm?file=abensap_loc...

Regards,