Skip to Content

To unlock a table that is locked by means of SM30

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2009 at 07:41 AM

    >

    > 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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2009 at 10:08 AM

    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.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2009 at 04:31 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.