关闭

selection-screen的示例

标签: structureusertablec
321人阅读 评论(0) 收藏 举报
分类:

TABLES: v_username, sscrfields.

DATA: BEGIN OF usr_tabl OCCURS 10.
INCLUDE STRUCTURE uinfo.
DATA: END OF usr_tabl.

DATA: opcode TYPE x,
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'.

SELECTION-SCREEN BEGIN OF BLOCK userid WITH FRAME title frTitle.
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 'Enter an online user.' to frTitle.

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 'User not logged on'.
ENDIF.
ELSE.
 "MESSAGE E000 WITH 'UserID' display like 'E'.
 message id 'ZMSGCZW' type 'E' NUMBER '000' WITH 'UserID' display like 'E'.
ENDIF.

AT SELECTION-SCREEN.
refresh usr_tabl.
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.

loc_utid = usr_tabl-tid.
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.

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:12601次
    • 积分:268
    • 等级:
    • 排名:千里之外
    • 原创:14篇
    • 转载:3篇
    • 译文:0篇
    • 评论:2条
    文章分类
    文章存档
    最新评论
    SAP BLOGER