Application Development and Automation 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: 
Read only

lock object effect on primary key!

Former Member
0 Likes
1,542

I have one table zxyz.

profit center is the primary key in the table zxyz.

now I made two other fields (period and year) as primary keys.

Do I need to adjust the table here in se14 ?

Previoulsy there was lock object on profit center.

The lock object can continue to lock on profit center even though I am adding period/year to the key??? Is that technically possible.

9 REPLIES 9
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,207

Yes, I think it is a good idea to adjust using SE14.

And yes, it is technically possible to achieve a lock without the full key, but you must know what the requirement is and proceed accordingly.

For example, if you proceed without changing the lock object(and the function calls), you will end up locking all of the records for the profit center, so if you have 10 records for profit center each having a different period/year, then you will be locking all of them.

Regards,

Rich Heilman

Message was edited by:

Rich Heilman

Read only

Former Member
0 Likes
1,207

hi Sam,

It is always better to readjust in SE14 .. Yes it is possible

Regards,

Santosh

Read only

Former Member
0 Likes
1,207

u have to adjust ur table using SE14...Also, u need to delete and create a new table maintenance generator from SE11....About lock all entries will get locked..means all fields..

Read only

Former Member
0 Likes
1,207

Previoulsy there was lock object on profit center.

If I made the other two fields as primary keys , then adjust in se14 and regenerate TMG.

and after creating lock object ( I am new to lock object )....

I need the lock object can continue to lock on profit center even though I am adding period/year as primary key . my coding is like below.

FORM update_zxyz

perform lock_zxyz.

loop at izccod_t

...

...

...

endloop.

perform unlock_zxyzt.

ENDFORM.

COULD YOU PLEASE TELL ME IF lock object can continue to lock on profit center even though we are adding period/year to the key, if that is technically possible. It seems it need to lock only profit center.

Onemore thing :

lock object locks all the primary key fields or only one primary key field we can lock ?

Could you please explain me

Read only

Former Member
0 Likes
1,207

Previoulsy there was lock object on profit center.

As per your guidance, I made the other two fields as primary keys , then adjusted in se14 and regenerate TMG.

and after creating lock object ( I am new to lock object )....

<b>I need the lock object can continue to lock on profit center even though I am adding period/year as primary key</b> . my coding is like below.

FORM update_zxyz

perform lock_zxyz.

loop at izccod_t

...

...

...

endloop.

perform unlock_zxyzt.

ENDFORM.

<b>COULD YOU PLEASE TELL ME IF lock object can continue to lock on profit center even though we are adding period/year to the key, if that is technically possible.</b> It seems it need to lock only profit center.

Onemore thing :

lock object locks all the primary key fields or only one primary key field we can lock ?

Could you please explain me

Read only

0 Likes
1,207

As the other posts said, yes - you can lock on only some of the primary keys, but you will lock all of the records that you have specified in the lock argument.

Rob

Read only

Former Member
0 Likes
1,207

but you will lock all of the records that you have specified in the lock argument.

Read only

Former Member
0 Likes
1,207

but you will lock all of the records that you have specified in the lock argument.

Sorru I did not understand . Could you please explain me inmore detailed.

Rob hats off to you for your help. and your valuable contribution.

We value our contribution.

Read only

0 Likes
1,207

Well, I appreciate the vote of confidence, but I think Rich's post says it the best. If you lock based only on the profit center, then all records with that profit center will be locked.

Rob