This is a test message to test the length of the message box.
Login
|
ABAP Quick popup online users
Created by Software-Heroes

ABAP Quick - Popup to all users

1836

Here's a quick tip on how you can read all current users who are logged into the system, what they are doing and how you can send them a personal message.

Advertising


Send an instant message to every logged in user in the system? With today's little tip that should not be a problem for you anymore. Unlike system messages, the messages are displayed immediately and are not displayed only after a user action.

 

Determination of the users

For the determination of the online users there is a special kernel function with which one you can read in the users. There are two ways to do this.

In the system there is an example of SAP, which is still based on the old ABAP. Here they have worked with a header line and only a part of the users are read. Below is the example from the standard.


DATA: BEGIN OF usr_tabl OCCURS 10.
        INCLUDE STRUCTURE uinfo.
DATA: END OF usr_tabl.
DATA: opcode TYPE x VALUE 2.

CALL 'ThUsrInfo' 
 ID 'OPCODE' FIELD opcode
 ID 'TAB' FIELD usr_tabl-*sys*.

 

The more modern approach without using a header line, reads also more users, including technical connections and RFC users. With this variant you have to filter more values to get the real online users.


DATA: 
  lt_user TYPE STANDARD TABLE OF uinfo,
  ld_opcode TYPE x VALUE 2.

CALL 'ThUsrInfo' 
 ID 'OPCODE' FIELD ld_opcode
 ID 'TAB' FIELD lt_user.

 

Generation of the popup

With the simple function module TH_POPUP you can create the message for the user or a special message to a selected user ID. To create popup's for all users, the function module have to be called in a loop.


DATA: 
  ld_message TYPE c LENGTH 128 VALUE 'This is my instant message to you!'.

" Create the popup
CALL FUNCTION 'TH_POPUP'
  EXPORTING
    client         = sy-mandt
    user           = 'TEST_USER' "usr_tabl-bname
    message        = ld_message
  EXCEPTIONS
    user_not_found = 1.
IF sy-subrc <> 0.
ENDIF.

 

The popup displays the system from which it was sent, as well as the user ID. The message comes from the SAP GUI and not directly from ABAP, so it looks like a normal Windows window.

ABAP example for popup

 

Conclusion

With just a few commands and the right function module, this function can easily be implemented by you. The notification should be used judiciously, because it can also cause some harm to the users when the popups occur in large numbers and thus interfere.


Included topics:
QuickPopupOnline-User
Comments (0)



And further ...

Are you satisfied with the content of the article? We post new content in the ABAP area every Tuesday and Friday and irregularly in all other areas. Take a look at our tools and apps, we provide them free of charge.


DDIC of the Future (Comparison)

Category - ABAP

What does the future hold for the DDIC, and can we already use the new features today? In this article, we compare the world of today with that of tomorrow and show you where to find all the features.

07/03/2026

DDIC of the Future (Tomorrow)

Category - ABAP

What does the future hold for the DDIC, and can we already use its new features today? In this article, we'll take a look at tomorrow and how CDS artifacts can help us with modeling.

06/30/2026

DDIC of the Future (Today)

Category - ABAP

What does the future hold for the DDIC, and can we already use the new features today? In this article, we'll look at the current state of the dictionary in ABAP.

06/26/2026

ABAP Tools - VS Code (Quick Start)

Category - ABAP

The ABAP Development Tools for VS Code are now available, and in this short guide we'll look at everything you need to get started.

05/30/2026

ABAP Tools - Working with Eclipse (Classes)

Category - ABAP

In this article, we'd like to discuss working with classes and how you can extend them cleanly and easily in Eclipse. We'll also look at further options available in the ABAP Development Tools.

04/21/2026