Skip to Content
author's profile photo Former Member
Former Member

How to get message in realtime sent by another user using FM TH_POPUP?

I want to create a chat function between two SAP users.

1.User A send a message to user B by using TH_POPUP,

At the same time, the message is showed in screen as

'Send message'

2.User B get the message

->My problem is how to get the message in realtime which I want to show it in screen as 'Received message'.

Can anybody tell me how to get the message sent by using FM TH_POPUP in realtime?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 07, 2008 at 01:00 PM

    Hi There,

    When u use the FM 'TH_POPUP' the other user will get a popup on his/her screen with the message.

    Here is how u can use the FM.

    In SE37, execute the FM TH_POPUP and enter the following details:

    1. RFC Target System- Standard name of an RFC destination of the reciever system (user B system)

    2. CLIENT- Client on which User B is logged in

    3. USER- Login ID of User B

    4. MESSAGE - message text u want to send to user B

    After entering these details just execute!

    Hope it helps.

    Regards,

    Sonal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 07, 2008 at 05:31 AM

    Jing,

    see the code

    REPORT ZPOPUP .

    **********************************************************

    • This program sends a message in a popup window to the

    • screens of the logged on users. This method is better,

    • then the SAP system message function, because the popup

    • window appears immediately (no dialog step is required),

    • and better, then the express mail method (the user can

    • not avoid it, no dialog step)

    **********************************************************

    DATA: MESSAGE(128) VALUE 'Test message'.

    DATA: OPCODE TYPE X VALUE 2.

    DATA: BEGIN OF USR_TABL OCCURS 10.

    INCLUDE STRUCTURE UINFO.

    DATA: END OF USR_TABL.

    CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE

    ID 'TAB' FIELD USR_TABL-SYS.

    LOOP AT USR_TABL.

    CALL FUNCTION 'TH_POPUP'

    EXPORTING

    CLIENT = SY-MANDT

    USER = USR_TABL-BNAME

    MESSAGE = MESSAGE

    EXCEPTIONS

    USER_NOT_FOUND = 1.

    ENDLOOP.

    Don't forget to reward if useful...

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      One of the problems here is that each user in dialog mode is running essentially a totally separate process in a different address space.

      I think the only way you could get something like this to work is to use some sort of central kernel module using a central memory area -- not a good idea for an application program really to have this type of access to what should be protected Operating System areas.

      If you look at the code from transaction SM02 (System messages) program SAPMSEM1 you might be able to "clone" something . You could perhaps have something like a "mini-server" program running in the background to which users can send and receive messages - but if you crash your system - then that's your own affair.

      You might also be able to use some part of the standard SAP send express mail where you receive a message on the screen and the note goes in the inbox. (transaction SBWP).

      For chatting with users --especially if you are using Windows IMO there are zillions of better methods using Windows functionality instead.

      Cheers

      Jimbo

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.