博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

afu

afu7548.cublog.cn
向同一服务器的任意Client任意在线用户发送弹出Message



*&---------------------------------------------------------------------*
*& Report  ZZMESSAGE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZZMESSAGE message-id za.
data: list like uinfo occurs 0 with header line.
data: mess like sm04dic-popupmsg.
parameters: p_mandt  like  sy-mandt default sy-mandt,  “ 接收者Client
           p_user like USR02-BNAME,   “ 接收者
           p_mess1(40),
           p_mess2(40),
           p_mess3(25),
           p_sender  like USR02-BNAME default sy-uname,  ” 发送者
           p_time type i default '1'.                    ”发送次数(<=3)


at selection-screen.
perform check.

start-of-selection.

concatenate p_sender '对你说:' p_mess1
  p_mess2 p_mess3 into mess.
condense mess.
 if  p_time > 3 .
   p_time = 3 .
 endif.
do p_time times.
   CALL function 'TH_POPUP'
        EXPORTING
             CLIENT  = p_mandt
             USER    = p_user
             MESSAGE = mess.
enddo.
*---------------------------------------------------------------------
*
*       FORM check
*
*---------------------------------------------------------------------
*
*       ........
*
*---------------------------------------------------------------------
*
FORM check.
CALL function 'TH_USER_LIST'
      TABLES
           LIST = list.
read table list with key bname = p_user mandt = p_mandt.
if sy-subrc <>  0.
   read table list with key bname = p_user.
   message e001 with 'the user not on this client, but in'
    list-mandt.
endif.
ENDFORM.                    " check
.

发表于: 2008-03-07,修改于: 2008-03-07 10:02,已浏览127次,有评论0条 推荐 投诉

给我留言
版权所有 ChinaUnix.net 页面生成时间:0.29066