selection-screen的示例

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.

阅读更多
文章标签: structure user table c
个人分类: SAP-ABAP
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

selection-screen的示例

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭