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: 

Selection-Screen - Warning for similar screens with same info

Former Member
0 Kudos

Hi Gurus!

I have a small question regarding the screens. I have a program which splitting of the UWI's. This program has a selection screen for entry of the company code , plant and date and two radiobuttons to show incomplete ones and all lists. Now the problem is that when this report is used by 3 or 4 people in the department and if they are working on the same plant say 0311, everyone has this screen opened and can make changes without the other person knowing that the other person is also doing changes . I want to make something in the repot that will give a message that this screen is already opened for this particular plant (warning message) which will make the other ppl aware that someone is already working on that plant , not only that evben if a single person has two screens of it opened with similar plant , also it should give message as that its opened for that particular plant. Is it possible please.?

So like in here in my report I should be adding in something or what?


*&---------------------------------------------------------------------*
*&                  Module  CHECK_INPUT  INPUT                         *
*&---------------------------------------------------------------------*
*                      Field Input Check                               *
*----------------------------------------------------------------------*
MODULE check_input INPUT.

  DATA: lv_plant TYPE t001k-bukrs.

**** Checking For Plant Input.
  IF dyn_plant IS INITIAL.
    MESSAGE e000 WITH text-002.
  ELSE.
    SELECT SINGLE bwkey FROM t001k INTO t001k-bwkey
                  WHERE bwkey = dyn_plant.
    IF sy-subrc NE 0.
      MESSAGE e000 WITH text-019.
    ENDIF.
  ENDIF.

Thanks

Aarav

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I think u can use lock concept here, in event at selection screen after plant validation u can lock this plant in table t001w using fm 'ENQUEUE_E_TABLE'.And after end of processing u can remove the lock by using FM 'DEQUEUE_E_TABLE'. By this way I think u can restrict the user to use only 1 plant at a time.

9 REPLIES 9

Former Member
0 Kudos

Hi,

You need to use a lock object and lock the plants as they are processed.

You can create the lock object in SE11 and call the generated ENQUEUE function module to apply the lock and DEQUEUE to release the lock.

When calling the ENQUEUE if another person has the plant locked then the system variable sy-msgv1 will contain the name of the user who is locking it.

Regards,

Darren

0 Kudos

Thanks. But actually I have been asked to just give a warning message that teh screen is opened for that palnt , somewhat like a sift message so that nobody uses it at that time , rather than locking it completely , thats the reason I was tinking of just adding it in the above code so that it just pops a message.

Please advice.

Thanks

Former Member
0 Kudos

The lock object will still work, it's only a logical lock and you are in control of how you react when the lock fails. You could issue a warning and carry on processing.

Regards,

Darren

Former Member
0 Kudos

I think u can use lock concept here, in event at selection screen after plant validation u can lock this plant in table t001w using fm 'ENQUEUE_E_TABLE'.And after end of processing u can remove the lock by using FM 'DEQUEUE_E_TABLE'. By this way I think u can restrict the user to use only 1 plant at a time.

0 Kudos

I mean where exactly should I be putting the lock while checking the re-entry of same plant in another screen or somewhere else.

Thanks

0 Kudos

After the plant validation put the lock in the event "at selection-screen"

0 Kudos

I am sorry due to the lack of use of it (for me) I am asking this question. Which ENQUEUE call fuction should I be using .

Sorry for this question but help will be greatly appreciated.

thanks

0 Kudos

I have already mentioned in my earlier mail that u can use the FM ENQUEUE_E_TABLE for this purpose.

0 Kudos

I used the enqueue and dequeue function module in my program to dis-allow two or more people to work on the same screen with similar input of plant ,and I am getting the error message too on the first screen itself that "selected plant si used by another user", but the problem is that its not allowing me to get into it even when I am the first user, I wanted actually it to happen with the second user or if I open up another screen and try inputing same plant and try entering then it should give me the message but its giving me message in the first screen itself and locking , not allowing me to get in.

Kindly suggest what should I be doing to this happen in the second or thisrd ascreen and so on , but not on the frist screen.

I put the logical lock after the plant validation happens , but for teh first user it should allowing him to go through the screen and just give warning for other uses if they enter the same plant and try entering the screen.

Thanks

Aarav