cancel
Showing results for 
Search instead for 
Did you mean: 

Locking Web dynpro abap application screens

former_member206441
Contributor
0 Kudos

Dear Experts,

I am developing an application in which the completed information screen can be accessible by different users at the same time.

My query is, if the application is opened by a person it will be in editable mode and another person also tries to open the same application it should be in disabled mode ie.It should be locked ( The persons other than first person who opened the application should get the application in locked mode as how it works in SAP tcode programs ) and should not be allowed to edit. if the first person closes the application and other person can access it in editable mode.

Any idea to implement the above scenario will be very much helpful.

Thanks & Regards

Arun.K.P

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

Hi Arun,

I've approached this issue by using the standard lock objects. Before you read the view's data from your database, call the appropriate ENQUEUE_* function module. If the data is not already locked by another user, the FM will succeed. If the data is already locked by another user, the FM will return sy-subrc >0 and you can issue a message to your user that another user is already editing the data.

You can determine which lock object is appropriate for a database table by doing a "where used" on the table and selecting "Lock Objects". And don't forget to release the lock on the table record when the user is finished editing. You can release the lock after the user saves and/or in componentcontroller->wddoexit.

Cheers,

Amy

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Arun,

For your requirement you need a table with a flag field in it.

In the wedynpro Component controller WDOINIT just check this table flag if it has 'X' .

I

First time when some one uses this component in INIT you will check the table and see if it has 'X' or '  '

If it has a space then just have another global variable a flag in the assistance class and fill it with the value you get from the table.

In the layout out all the layout in a Transparent container and bind a context variable to the enable property and fill the enable property field of the context with the assistance class field value or directly can fill in the value form the table.

And after this you will have to update the Ztable flag field with 'X' in case the value was space.

So now if some one else opens the component you are reading the value in the WDOINIT of component controller and you will have 'X' init if  you have 'X' then just make the layout disable.

And also you have to create a lock object for the Ztable and then use it accordingly.

Hope this helps you, Let me know if you need more explanation.

Thanks

Phani

former_member206441
Contributor
0 Kudos

Hi Amy - Phani,

Thank you for the reply i will be proceeding with my development with the guidance you gave. any other refrence document will be really helpful.

Thanks & Regards

Arun.K.P