用FM: TH_POPUP可以实现向用户发出一条即时信息的功能
CALL FUNCTION 'TH_POPUP'
EXPORTING
client = '669'
user = 'PEIPING.LI'
message = 'Zero test'
* MESSAGE_LEN = 0
* CUT_BLANKS = ' '
* EXCEPTIONS
* USER_NOT_FOUND = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
下面是核心代码, OPCODE = '1F'
CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE_SEND_POP_UP
ID 'CLIENT' FIELD CLIENT
ID 'USR' FIELD USER
ID 'MSG' FIELD MESSAGE
ID 'MSG_LEN' FIELD MESSAGE_LEN
ID 'CUT_BLANKS' FIELD LOC_CUT_BLANKS.
效果图