‎2009 Oct 17 9:30 PM
HI ,
I have tables which are updated from FM .
the table have user context .
my question is if i need to use lock object if i dont create maintenance view for the tables ?
Or in other words when to use it and when not ?
Regards
JOy
Edited by: Joy Stpr on Oct 18, 2009 8:29 AM
‎2009 Oct 18 1:21 PM
If there's any possibility of two users trying to update the same record at the same time, then you need to use locking.
matt
‎2009 Oct 18 1:21 PM
If there's any possibility of two users trying to update the same record at the same time, then you need to use locking.
matt
‎2009 Oct 18 3:00 PM
When your tables ared used in a user context you should use proper locking.
When you say that the tables are updated via function modules check the function group of these function modules.
Most probably the function group will contain function modules to logically lock the table via enqueues functions.
You can build in these enqueue functions in your program.
Wim
‎2009 Oct 18 7:44 PM
HI Matt,
what should i do in bulk delete of users ?
the use case is that i have option to delete bulk of users i,e, delete from table Z.... ?
one option is to do loop but it's not good from performance aspects so what u suggest ?
Regards Joy
‎2009 Oct 18 10:13 PM
> the use case is that i have option to delete bulk of users i,e, delete from table Z.... ?
An after-thought --> obviously there is some program using this table as well...
Why don't you change the program to check an authorization object and then control the "entries" via the assignment of a role which includes with object with appropriate authorization fields?
This way you can re-use the same object with different field values, and use your FM in a modularized way - instead if using this lock workaround to treat a symptom of the design problem.
Cheers,
Julius
‎2009 Oct 18 3:32 PM
Hi Joy,
my 2 cents added:
The standard maintenance view uses a generic lock object locking the whole table - as long as a user edits the table using the maintenance view, no other user can change the table using this maintenance view.
If you create a table-specific lock object, you can specify a key for locking so that speific records are not changed at the same time.
There is ample documentation on lock objects.
Regards,
Clemens
‎2009 Oct 18 6:05 PM
Hi Joy,
Well to be specific I had used Locking the object in HR module, so i would like to explain based on that.
HR modules have many views in a transaction...and they display data from tables.
now when we change data...at times it is necessary that the data must not be changed at all.
in such scenarios, we lock the object, means no changes can be done.
as 1 friend has rightly mentioned abt enqueue function.
actually theres a function module for enqueue...when u need to make any changes to the data...
u shud 1st enqueue that particular record, so that no one else can edit it, or work on it....after making necessary changes, u then dequeue it...so that it becomes accessible for editing.
so, basically locks, as name suggest can be used to prevent editing.
either temporarily till u r making changes to it....or for a long time...
but the locks can also be removed by coding...
Hope this information helps u
Regards,
Radhika
‎2009 Oct 18 7:07 PM
Moderator message The use of abbreviations like "abt" instead of "about" is suitable when you send a text message, or when you use IM. It is not suitable for a professional forum. Please spell words out in full. Not everyone on these forums is a fluent English speaker and the use of abbreviations doesn't help - and it is lazy.
matt
‎2009 Oct 18 7:13 PM
‎2009 Oct 18 7:15 PM
‎2009 Oct 18 7:25 PM
Can you please do me another favour as well in telling to also not use the same type of sms txt spk in the same places and in the same threads as your same answers...?
‎2009 Oct 18 7:54 PM
Hello Sir,
How can I tell someone to stop using sms type text...I was told by moderator, I corrected myself.
It would be good if moderator tells that person directly.
‎2009 Oct 18 8:44 PM
> It would be good if moderator tells that person directly.
That person told us that they know you, quite well...
‎2009 Oct 18 9:08 PM
oh that is strange and weird.....
but i can say for sure i dont know that person...100% sure.....
basically i dont know anyone from sdn forum, i just come here to give answers and to find out answers to my questions.
I feel this discussion is going away from the actual topic. Sir, you can warn that person, since you have the authority. I dont know that person. I cant tell & I wont tell. Sorry.
‎2009 Oct 18 9:19 PM
> I feel this discussion is going away from the actual topic.
True. I will hand it over to SAP to investigate that user further.
‎2009 Oct 18 9:29 PM
Fine. Thank you very much sir.
I wonder how can someone just say that they know me quite well, whereas i dont know that person at all.
‎2009 Oct 18 9:38 PM
Yes, even I am finding it strange that the person is sending me mails then.
Please change your password to be safe.
Cheers,
Julius
‎2009 Oct 18 8:59 PM
As this is a z-table updated from a z-FM, why don't you try locking the use of the FM (or transaction to call it) while it is being called by another user.
There are some SAP standard transactions which work in this way. Take a look at STRUST for an example.
If you choose a transaction code option and it is a report type transaction, then remember to call FM AUTHORITY_CHECK_TCODE in the report as well...
Perhaps if you give clearer information upfront when asking the question, then it will save folks a lot of guess work, if they read the question clearly.
Cheers,
Julius