Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Custom Lock objects few question issues

Hello guys , i create a custom lock object for my z tables ( ZFISGC_MCFG ) which have 3 key field

MANDT

ID_EMPRESA

CL_MVTOSGC

now in my program doing testing i put a break point after the ENQUEUE_ of the lock object

then when i go to the sm30 and try modif the value of the entry using the same key i pass to the ENQUEUE_ fm i can modif and save the entry now i am now if that is the right workflow in custom object lock or if i am doing something wrong , this is how i can the enqueue FM:

call function 'ENQUEUE_EZFISGCOBJECT'
 EXPORTING
   MODE_ZFISGC_MCFG       = 'E'
   MANDT                  = SY-MANDT
   ID_EMPRESA             = p_bukrs
*   X_ID_EMPRESA           = ' '
*   _SCOPE                 = '2'
*   _WAIT                  = ' '
*   _COLLECT               = ' '
 EXCEPTIONS
   FOREIGN_LOCK           = 1
   SYSTEM_FAILURE         = 2
   OTHERS                 = 3
          .
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.

Thanks

Former Member
Former Member replied

You have to remember that SAP locks are logical locks, not physical. This means that whatever you enqueue is not physically locked from changes. You have to ensure that any program that tries to update your table, first checks these locks and stops the update if it finds that it is already locked.

Rob

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question