REPORT zgan_show MESSAGE-ID zz.
TABLES: v_username,
sscrfields.
sscrfields.
DATA: BEGIN OF usr_tabl OCCURS 10.
INCLUDE STRUCTURE uinfo.
DATA: END OF usr_tabl.
INCLUDE STRUCTURE uinfo.
DATA: END OF usr_tabl.
DATA: opcode TYPE x,
slave_mode TYPE x,
loc_utid LIKE usr_tabl-tid.
slave_mode TYPE x,
loc_utid LIKE usr_tabl-tid.
CONSTANTS: c_fcode_slon LIKE sy-ucomm VALUE 'SLON',
c_fcode_slof LIKE sy-ucomm VALUE 'SLOF'.
c_fcode_slof LIKE sy-ucomm VALUE 'SLOF'.
SELECTION-SCREEN BEGIN OF BLOCK userid WITH FRAME.
PARAMETERS: p_userid LIKE uinfo-bname.
SELECTION-SCREEN END OF BLOCK userid.
SELECTION-SCREEN BEGIN OF BLOCK show WITH FRAME.
SELECTION-SCREEN PUSHBUTTON /10(25) slon USER-COMMAND slon.
SELECTION-SCREEN PUSHBUTTON 45(25) slof USER-COMMAND slof.
SELECTION-SCREEN END OF BLOCK show.
PARAMETERS: p_userid LIKE uinfo-bname.
SELECTION-SCREEN END OF BLOCK userid.
SELECTION-SCREEN BEGIN OF BLOCK show WITH FRAME.
SELECTION-SCREEN PUSHBUTTON /10(25) slon USER-COMMAND slon.
SELECTION-SCREEN PUSHBUTTON 45(25) slof USER-COMMAND slof.
SELECTION-SCREEN END OF BLOCK show.
INITIALIZATION.
MOVE 'On Screen Flow Show' TO slon.
MOVE 'Off Screen Flow Show' TO slof.
MOVE 'On Screen Flow Show' TO slon.
MOVE 'Off Screen Flow Show' TO slof.
AT SELECTION-SCREEN ON p_userid.
IF NOT p_userid IS INITIAL.
SELECT SINGLE bname
INTO v_username-bname
FROM v_username
WHERE bname = p_userid.
IF sy-subrc <> 0.
MESSAGE e999 WITH 'Invalid User Id'.
ENDIF.
ELSE.
MESSAGE e999 WITH 'Specify the User Id'.
ENDIF.
IF NOT p_userid IS INITIAL.
SELECT SINGLE bname
INTO v_username-bname
FROM v_username
WHERE bname = p_userid.
IF sy-subrc <> 0.
MESSAGE e999 WITH 'Invalid User Id'.
ENDIF.
ELSE.
MESSAGE e999 WITH 'Specify the User Id'.
ENDIF.
AT SELECTION-SCREEN.
FREE usr_tabl.
opcode = 2.
CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode ID 'TAB' FIELD usr_tabl-*sys*.
FREE usr_tabl.
opcode = 2.
CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode ID 'TAB' FIELD usr_tabl-*sys*.
READ TABLE usr_tabl WITH KEY bname = p_userid TRANSPORTING tid.
IF sy-subrc <> 0.
MESSAGE e999 WITH 'Requested User Id is not available'.
ENDIF.
IF sy-subrc <> 0.
MESSAGE e999 WITH 'Requested User Id is not available'.
ENDIF.
loc_utid = usr_tabl-tid.
slave_mode = 5.
slave_mode = 5.
IF sscrfields-ucomm = c_fcode_slon.
opcode = 14.
CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode ID 'S_TID' FIELD loc_utid
ID 'S_MODE' FIELD slave_mode.
ELSEIF sscrfields-ucomm = c_fcode_slof.
opcode = 15.
CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode ID 'S_TID' FIELD loc_utid.
ENDIF.
opcode = 14.
CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode ID 'S_TID' FIELD loc_utid
ID 'S_MODE' FIELD slave_mode.
ELSEIF sscrfields-ucomm = c_fcode_slof.
opcode = 15.
CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode ID 'S_TID' FIELD loc_utid.
ENDIF.