Messaging across SAP client using function module th_popup and ,how to calling transaction code from a program

Ever wanted to send message across use this function! huhu

th_popup

with a little bit of programming you can make a program to call the function Example

*&---------------------------------------------------------------------*
*& program to call function and to message sy-uid                      *
*& Function module th_popup is being called                            *
*&---------------------------------------------------------------------*
REPORT   Y_MARK_CALLFUNCTION.
* include section -----------------------------------------------------
* declaration part ----------------------------------------------------
TABLES: SSCRFIELDS,UINFO.
DATA CLIENT type sy-MANDT.
SELECTION-SCREEN BEGIN OF BLOCK BLK01 WITH FRAME TITLE TEXT-T01.
SELECTION-SCREEN SKIP.
PARAMETERS: "CLIENT LIKE  SY-MANDT OBLIGATORY,
            USER LIKE  SY-UNAME OBLIGATORY,
            MESSAGE LIKE  SM04DIC-POPUPMSG OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK BLK01.
SELECTION-SCREEN:  BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON (20) EXECUT USER-COMMAND EXECUT MODIF ID A.
SELECTION-SCREEN   END OF LINE.

INITIALIZATION.
  CLIENT = SY-MANDT."SY-SYSID.

AT SELECTION-SCREEN OUTPUT.
  MOVE 'Send by' TO EXECUT.

AT SELECTION-SCREEN.
  IF SSCRFIELDS-UCOMM EQ 'EXECUT' OR SSCRFIELDS-UCOMM is initial.
    SSCRFIELDS-UCOMM = 'ONLI'.
  ENDIF.
* main program  -------------------------------------------------------

START-OF-SELECTION.
  concatenate MESSAGE 'from' SY-UNAME into MESSAGE separated by space.
  CALL FUNCTION 'TH_POPUP'
    EXPORTING
      CLIENT  CLIENT
      USER    = USER
      MESSAGE = MESSAGE.
  IF SY-SUBRC <> 0.
  ENDIF.
  RETURN.
END-OF-SELECTION.
0 comments:

Post a Comment

message

Labels

NuffNang

Search google

Blog Archive

My Blog List

Twitter

Message

Followers