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

Table updation problem .

Former Member
0 Likes
973

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?

6 REPLIES 6
Read only

Former Member
0 Likes
926

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

Read only

naimesh_patel
Active Contributor
0 Likes
926

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

Read only

Former Member
0 Likes
926

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

Read only

Former Member
0 Likes
926

hello,

Please create lock objects for your table.

It will solve your problem.

Reward points if helps.

Thanks,

krishnakumar

Read only

Former Member
0 Likes
926

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

Read only

Former Member
0 Likes
926

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.