Sendmessage


How does it work?
In the standard system the user gets a pop-up window immediately when he receives an express mail. In the utility this notification window is modified to display custom messages. The sender program calls the express mail event thus initiating the express mail notification process. If the user is not logged in, he can not receive this notification. Therefore the user exit on the logon screen is used to ensure that the user receives the message after his next login.
Table ZZSYSMES is used to store the numbered messages. Table ZZSYSUSR is used to assign a message number to a specific user. If the user works in the system he will receive the message immediately. If he is not logged in, an entry is made in table ZZSYSUSR. When he logs in, the entry will be deleted and the message will be displayed.
Disclaimer
This function should only be used with the prior understanding of how it works. The function was tested on 30f, development system. In other SAP versions the programs must be analysed and modified. In it's present form it is not acceptable for productive systems.

1. Request a Developer Access Key for the following object:

2. The express mail notification is:

The dynpro must be changed. Modify the window area in order to have a larger display area.

3. The PBO module of the dynpro is in program LSO02O00, module d0100_init output. In this module an include must be inserted. This include will put the messages in the window area.
Program LSO02O00
module d0100_init output.
[..]
  else.
* initialisation
    include zbctcbl1.       " This is the modification.
    move text-201 to sos02-text2.
    move text-202 to sos02-text4.
    set pf-status 'EXPR'.
    set titlebar '002'. 
  endif.
endmodule.
4. Create and upload the include ZBCTCBL1.
This is the include we inserted in program LSO02O00. It delivers the message for the user without the express mail notification. It is also prepared to send the express mail notification with when needed.

5. Create a user exit in 'Projects and Enhancements' for SUSR0001, for the exit EXIT_SAPLSUSF_001 . Upload the program ZXUSRU01 and activate the project. This program runs automatically when the user logs in. It checks the user's messages and notify the user.

6. Create table ZZSYSMES and ZZSYSUSR. Generate a Table Maintenance for table ZZSYSMES.

 Name               ZZSYSMES    Transparente Tabelle                              
 Kurzbeschreibung   System Messages                                               
 Letzte Änderung    SZHTCB          14.08.1997         Mastersprache        D     
 Status             aktiv           gesichert          Entwicklungsklasse   $TMP  
 -------------------------------------------------------------------------------- 
 AusliefKlasse      L Tabelle für Ablage temporärer Daten, wird leer ausgeliefert 
                                                                                  
                                                                                  
 Feldname   Key Datenelem. Typ  Länge  PrüfTab    Kurzbeschreibung                
 ZZINDEX        NUM03      NUMC      3            Zaehler                         
 ZZNUM          NUM03      NUMC      3            Zaehler                         
 TEXT           TEXT45     CHAR     45            Text in Länge 45                

Name ZZSYSUSR Transparente Tabelle
Kurzbeschreibung System Messages, User table
Letzte Änderung SZHTCB 14.08.1997 Mastersprache D
Status aktiv gesichert Entwicklungsklasse $TMP
--------------------------------------------------------------------------------
AusliefKlasse L Tabelle für Ablage temporärer Daten, wird leer ausgeliefert


Feldname Key Datenelem. Typ Länge PrüfTab Kurzbeschreibung
MANDT MANDT CLNT 3 * Mandant
BNAME XUBNAME CHAR 12 * Benutzername im Benutzerstamm
ZZINDEX NUM03 NUMC 3 Zaehler
ZZENDDA DATUM DATS 8 Datum
ZZENDZE SYUZEIT TIMS 6 SYSTEM: Uhrzeit

7. Create and upload program ZSBEN001

That's all. Now you are ready to test the Sendmail function. First create entries in table ZZSYSMES.
ZZINDEX is the message number. ZZNUM is the row number.
Table ZZSYSMES, Example:
  ZZINDEX ZZNUM TEXT
  1       1     Message One, Title
  1       2     Test message
  1       3     System Administrator
  2       1     Message Two, Title
  2       2     Sysadmin - test  
Now start program ZSBEN001. Fill out the selection screen:
BNAME      Recipient's User-id 
MESS_NO    The message number ( Here 1 or 2 )
ENDDA      End date   (the message will be delivered only
ENDZE      End Time    before end date/time)

Now the recipient must do something in SAP to receive the message in a pop-up.


Bence Toth