Application Development 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: 

To unlock a table that is locked by means of SM30

former_member196438
Participant
0 Kudos

Dear all,

I have a custom table that has an associated table maintenance generator. The table is being maintained through SM30, whereby the entire table gets locked even if a single user tries to modify data.

My current requirement is to change data in the table by creating a program. The program should have the capacity to unlock the table (if a user is making changes to it through SM30), so that any no of users will be able to update the table at any time. The program should generate a view similar to that generated by means of SM30 (for which i have done using VIEW_MAINTENACE_CALL and is working fine), unlock the table if it is already locked, allow multiple users to make changes at any time.

Please suggest as to where will it be appropriate to dequeue the table. I tried dequeuing in the events of the table, PBO of the screen, in the program, but nothing works. The table gets locked in some standard programs.

Regards,

C. Aiswarya

4 REPLIES 4

Former Member
0 Kudos

>

> unlock the table if it is already locked, allow multiple users to make changes at any time.

> C. Aiswarya

System enables lock to maintain consistency.For Customising entries multiple users to edit is not expected.

If this is the requirement (multiple users,more frequency): Developing Module Pool program with Tcodes for CREATE ,CHANGE and DISPLAY.and enable the lock during CHANGE (for the particular document)

..is an option

Cheers

0 Kudos

Hi,

Thanks for your reply. I have stated clearly in my message that i only need to create a program, not a module pool. I can only make use of the existing table maintenance generator of the table and try to enhance it.

Former Member
0 Kudos

Hi Aiswarya,

Once a database table is locked, the system will not allow other users to unlock untill the changes are made and the table is unlocked by the current user.

In other words, If a user is making changes in the database table then you cannot stop him suddenly and make the changes (even through programs).

But you can prevent users from making changes to the database table (through SM30 transaction).

In the table maintenance generator, you can find the "Maintenance Screen No". In the PBO of that maintenance screen, you can add a code as shown below.


module tcode_check output.

  if sy_tcode eq 'SM30'.

    appropriate error message. For example, (You are not authorised to make changes).

  endif.

endmodule.

Former Member
0 Kudos

Hi,

Could you please provide the code that you have for dequeue logic? Just a note, if the table is locked by SM30, the lock key is different and looks something like this:

...

Table name: RSTABLE

Lock argument: <z-table> ......

....

Shahram