01-08-2007 9:11 AM
Morning,
I have created a lock object for a table and then called the ENQUEUE function module to lock records. Unfortunately I want to lock records based upon a field that is not included within the primary key of the table. As the field is not part of the primary key it is not one of the parameters for the function module.
The 2 solutions I can come up with are as follows:-
Solution 1
1. Read the records into an internal table.
2. Lock the corresponding records.
3. Read the records into another internal table and then compare the 2 internal tables.
Disadvantage of this solution
1. Have to perform an additional read and perform a internal table comparison.
2. I am reading before locking.
Solution 2
1. Include the field in the primary key of the table.
Disadvantage of this solution
1. The field should not be part of the primary key.
Any additional useful suggestions would be appreciated.
Regards
John.
01-08-2007 9:37 AM
Hi!
In Soulution 1, the 2.nd disagvantage can be eliminated, if you read the corresponding records one more after the locking. This means a double read for the same data, but some performance loss may cause a better and stable work for your module.
Anyways, the 1st solution is much more "friendly" for me...
Regards
Tamá
01-08-2007 9:37 AM
Hi!
In Soulution 1, the 2.nd disagvantage can be eliminated, if you read the corresponding records one more after the locking. This means a double read for the same data, but some performance loss may cause a better and stable work for your module.
Anyways, the 1st solution is much more "friendly" for me...
Regards
Tamá
01-09-2007 4:58 PM