‎2006 Jul 28 10:55 AM
1). Person A opens the table 'Ztable' in edit mode via t-code : SM30.
2). Person B transmits file using program Z1234,
which created/makes entry in the field 'block' of table 'Ztable'.
3). Person A hits SAVE in SM30,
Will we lose the entry in the 'block' field that was created by Person B's program Z1234 transmission ? (Obviously , yes)
If so, is there any way to avoid losing this data?
‎2006 Jul 28 10:59 AM
You have to use LOCK mechanism.
Read abotu ENqueue and DEqueue.
http://help.sap.com/saphelp_erp2005/helpdata/en/f0/b57338788f4d72e10000009b38f8cf/frameset.htm
BR< JAcek
Message was edited by: Jacek Slowikowski
Message was edited by: Jacek Slowikowski
‎2006 Jul 28 10:59 AM
Hello,
Check the lock of the table.
See, when you open a table in SM30, and one more person opens it .. system will give the error that table is locked.. so, do that in your Z prog.
Use FM VIEW_ENQUEUE to get the lock status
Pass the parameters:
ACTION = E
ENQUEUE_MODE = S
VIEW_NAME = TABLE NAME
You get the exception : like table is locked
Regards,
Naimesh
‎2006 Jul 28 11:00 AM
Hello Sam,
Better U lock the table before before updation.
Warning: One person can able to open the table a time.
Reward if useful.
Vasanth
‎2006 Jul 28 11:00 AM
hello,
Please create lock objects for your table.
It will solve your problem.
Reward points if helps.
Thanks,
krishnakumar
‎2006 Jul 28 11:01 AM
In the update program check the lock status of table key the program is going to update?
For this you need to create a lock object for the table and use the function ENQUEUE_READ to check if the table is locked.
If the function ENQUEUE_READ returns number GT 0 then the table key is locked and may be you can add a wait of 5 seconds in your program and check the lock status again.
-Kiran
*Please mark useful answers
‎2006 Jul 28 2:21 PM
Hi Sam,
Even ENQUEUE for Ztable being placed into system, FYI it can't prevent anyone from editing the same table via SM30 at the same time.
Thus, you may need to use FM ENQUEUE_E_TABLE where this is the correct way to seize the lock with the incorporation of FM ENQUEUE_Ztable.
Hope it helps.