SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Emergency Broadcast Message Transmitter



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Security and Monitoring
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Mon Feb 25, 2008 1:13 pm    Post subject: Emergency Broadcast Message Transmitter Reply with quote

Code:
report zexp_emergency no standard page heading.
***********************************************************
* Emergency Message Broadcast
*   Version 1.50
*
*   This is freeware. Please read the terms of use.
*   Written by Urs Rohner, Rohner IT Consulting & Engineering
*
*   Contact Author: Urs Rohner
*
*comments
*  This program sends a message in a popup window to the
*  screens of the users logged in. This method is different to
*  the SAP system message function, because the popup
*  window appears immediately (no dialog step is required).
*
*
*history
* History
* Vers  Date                 Own  Remark
* ----  -------------------  ---  -------------------------------------
* 1.00                            Initial version
* 1.10  23rd February  1999  rnr  Improve structure, layout, tags
* 1.20   5th October   2000  rnr  Get list of all active servers/users
* 1.30                       rnr  Only one popup per user
* 1.40                       rnr  Correct problem with non-identical IP
* 1.45  16th October   2000  rnr  Correct problems on AIX/4.0B
* 1.50  18th April     2001  rnr  Add xml tags
*
***********************************************************

* Includes
  include tskhincl.

* Type Declarations
  types:
    t_usr_e like uinfo,
    t_usr   type t_usr_e occurs 0,
    t_srv_e like msxxlist,
    t_srv   type t_srv_e occurs 0,
    begin of t_list_e,
      _srv type t_srv_e,
      _usr type t_usr,
    end of t_list_e,
    t_list type t_list_e occurs 0.

* Globals
  data:
    _a,
    _list type t_list with header line,
    _usr  type t_usr_e,
    _rcv  type t_usr_e occurs 0.
  tables usr02.

* Selection Screen
  select-options:
    p_class for usr02-class,
    p_bname for usr02-bname.

  parameters:
    message(128) default 'Test message'(t00) lower case.

*
* P A I ( )
*
  start-of-selection.
    if p_bname[] is initial and p_class[] is initial.
      _a = 'X'.
      call function 'SWO_POPUP_TO_CONFIRM'
        exporting
          text    = 'Send message to ALL users?'(t01)
          title   = 'Emergency Message Broadcast'(t02)
        importing
          answer  = _a.
      if sy-subrc is initial and _a eq 'J'.
        clear _a.
      endif.
    endif.
    if _a is initial.
      perform m_get_users using _list[].
      loop at _list[] into _list.
        loop at _list-_usr[] into _usr.
          read table _rcv[]
            with key bname = _usr-bname hostadr = _usr-hostadr
            transporting no fields.
          if not sy-subrc is initial.
            append _usr to _rcv[].
            select single * from usr02
              where bname eq _usr-bname
              and   bname in p_bname
              and   class in p_class.
            if sy-subrc is initial.
              call function 'TH_POPUP' destination _list-_srv-name
                exporting
                  client         = _usr-mandt
                  user           = _usr-bname
                  message        = message
                exceptions
                  user_not_found = 1.
              if sy-subrc is initial.
                write: / _list-_srv-name, _usr-mandt, _usr-bname.
              endif.
            endif.
          endif.
        endloop.
      endloop.
    endif.


* Method: m_get_users
* Get dialog users of all active servers
  form m_get_users using _l type t_list.
    data:
      l_   type t_list_e,
      srv_ type t_srv.

    " Prepare result
    clear _l[].
    " Get list of all active servers running dialog work processes
    call function 'TH_SERVER_LIST'
      exporting services = ms_dia
      tables    list     = srv_[]
      exceptions
        no_server_list   = 1
        others           = 2.
    if sy-subrc is initial.
      loop at srv_[] into l_-_srv.
        clear l_-_usr[].
        " get users
        call function 'TH_USER_LIST' destination l_-_srv-name
          tables     list   = l_-_usr[]
          exceptions others = 1.
        if sy-subrc is initial.
          delete l_-_usr[] where hostadr is initial.
        endif.
        append l_ to _l[].
      endloop.
    endif.
  endform.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Security and Monitoring All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.