2009 Jul 16 5:54 AM
Hi,
I have created lock objects on a ztable using all its primary keys:
VKORG
VBELN
DATE
I need to insert records into the ztable from internal table.
In the internal I will have one VKORG through out internal table & Date will be sy-datum always. But I will have different values of VBELN.
Table entries are For eg:
VKORG VBELN DATE
GR16 1 15.07.2009
GR16 2 15.07.2009
GR16 3 15.07.2009
Please let me know if it is fine to use Lock object without VBELN field by commenting VBELN at the time of calling FM.
CALL FUNCTION 'ENQUEUE_/EUR/EOGR_PRINT'
EXPORTING
mode_/eur/ogrt_print = l_c_e
mandt = sy-mandt
vkorg = 'GR16'
vbeln =
datum = SY-DATUM
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
Or please let me know the best way to use this FM.
Regards,
Shraddha
2009 Jul 16 6:37 AM
If you use like this, then you are acquiring locks on all 3 rows which is not correct becuase you are stopping others to work with other records which differs only in VBLEN value. So, it is better to use all the key fields while acquring any locks on record.
Regards,
Siva.
2009 Jul 16 6:44 AM
Hi Shiva,
How can I do so when I have various entries in VBELN.
Even if I take all VBELN in a range and pass it to the FM, if a lock fails for one entry I will not be able to update whole internal table.
Please let me know how to deal with these scenarios.
Regards,
Shraddha
2009 Jul 16 6:47 AM
In this case, you can actually use FM like whatever you have mentioned in first memo.
2009 Jul 16 7:10 AM
Hi,
But is this right to use like this. I mean I am just blocking other VBELN to be updated.
Regards,
Shraddha
2009 Jul 16 7:13 AM
When you are not sure which entries you will be updating, then you need to lock all the entries. Or else you can call this FM individually for all the objects which will be part of your internal table. SO, that you will be blocking only those which you might update.
2009 Jul 16 7:18 AM
hi,
the thing wht u did is right only use the lock object. with out giving vbeln field then it will lock other entries which is having same date and vkorg except vbeln. udate table. what wrong ur getting their.
regards
rajesh varma.