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: 

How can i disable a selection screen when another one is inputing ?

Former Member
0 Kudos

Suppose user A is inputing something in the selection screen to execute the report, Now user A has opened another session but this time he will not get able to input into the selection screen means I want that whenever one selection screen is enable for inputing no other selection screen will be enable at the same time, It will be disable. How can i do that? Is there any reference has been stored in a table during the execution of the selection screen?

Thanks In Advance

With Regards,

Abhijit

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can use a custom table for this.

In the PBO of the screen just call the function module

' ENQUEUE_E_TABLEE '

If same or any other user tries to open the same screen

the user will get a message

" Object requested is currently locked by user XYZ "

In flow logic of screen write


PROCESS BEFORE OUTPUT.
module lockscreen.

in module


   CALL FUNCTION 'ENQUEUE_E_TABLEE'
   EXPORTING
*     MODE_RSTABLE         = 'E'
     tabname              =  " 'Ztablename'
     varkey               = sperrdat
   EXCEPTIONS
     foreign_lock         = 1
     system_failure       = 2
     OTHERS               = 3
            .
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

6 REPLIES 6

messier31
Active Contributor
0 Kudos

I doubt, if this is possible. What you can do is set a flag in custom table and before providing selection you if this flag is set or not .

Enjoy SAP.

Pankaj Singh.

former_member188685
Active Contributor
0 Kudos

you have to work with some custom table with some flags, when ever some one is working on the program update that table falg . when other person running the program that time first select the table and check flag value accordingly you can work..

Former Member
0 Kudos

Hi Abhijit,

I think it can be achieved by using SET/GET Paramater transaction

When you edit the first selection screen set a parameter and in when you try to run the report again trying GET parameter for the same field.If it is field is set then

AT SELECTION-SCREEN OUTPUT event make all the fields non editable.

Cheers,

KD

Edited by: Krutiman Das on Sep 30, 2008 5:45 PM

Edited by: Krutiman Das on Sep 30, 2008 5:57 PM

Former Member
0 Kudos

You can use a custom table for this.

In the PBO of the screen just call the function module

' ENQUEUE_E_TABLEE '

If same or any other user tries to open the same screen

the user will get a message

" Object requested is currently locked by user XYZ "

In flow logic of screen write


PROCESS BEFORE OUTPUT.
module lockscreen.

in module


   CALL FUNCTION 'ENQUEUE_E_TABLEE'
   EXPORTING
*     MODE_RSTABLE         = 'E'
     tabname              =  " 'Ztablename'
     varkey               = sperrdat
   EXCEPTIONS
     foreign_lock         = 1
     system_failure       = 2
     OTHERS               = 3
            .
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

Abhijit74
Active Contributor
0 Kudos

Thanks everyone for your reply. But i want to ask you a question can it be possible to modify the default selection screen 1000? Because If you try to edit it is giving the message "Selection screen: Report generation makes screen changes ineffective" ...

With Regards,

Abhijit

0 Kudos

even you modify the selection screen, after that you change anything and activate the program then the changes you made will be lost. if you want to change any thing on screen then you have to use the event at selection-screen output.