SAP系统中发送消息的几种办法

1、SM02

创建消息,并设定有效期。当用户刷新窗口或打开窗口时会显示。

这个消息对client中的所有用户有效

2、So00中创建“到期邮件”

So00中创建一个普通邮件,在下面选择收件人,收件人后面有三个可选项,选中第一个(闪电标志):到期邮件

邮件发出后,当用户刷新窗口或打开窗口时会显示。

3、用ABAP程序创建系统提示:这个提示的效果像是SAP系统出错时的提示,用户体验可能不够好,代码如下:

*&---------------------------------------------------------------------*
*& Report  YSENDMSG                                                    *
*&---------------------------------------------------------------------*
REPORT  ysendmsg  MESSAGE-ID zsd.
DATA: list LIKE uinfo OCCURS 0 WITH HEADER LINE.
DATA: mess LIKE sm04dic-popupmsg.
PARAMETERS: p_mandt  LIKE  sy-mandt DEFAULT sy-mandt,
            p_user   LIKE sy-uname,
            p_mess1(40),
            p_mess2(40),
            p_mess3(25),
            p_sender LIKE sy-uname DEFAULT sy-uname,
            p_time TYPE i DEFAULT '1'.

AT SELECTION-SCREEN.
  PERFORM check.

START-OF-SELECTION.
  CONCATENATE p_sender 'says:' p_mess1 p_mess2 p_mess3 INTO mess.
  CONDENSE mess.
  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

你可能感兴趣的:(netweaver)