09-30-2008 4:25 PM
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
10-01-2008 5:26 AM
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.
09-30-2008 4:31 PM
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.
09-30-2008 4:43 PM
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..
09-30-2008 4:45 PM
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
10-01-2008 5:26 AM
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.
10-01-2008 10:29 AM
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
10-01-2008 10:34 AM
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.