Application Development 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: 

Custom Lock objects few question issues

edgar_almonte
Participant
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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 Kudos

Thanks a lot Rob