How can i disable a selection screen when another one is inputing ?
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
Mrugesh Phatak replied
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.
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.