Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Send Mail using SO_OBJECT_SEND

Former Member
0 Likes
1,363

Hi All,

What are all the parameters that has to be filled in order to send a internal mail to SAP to a User using the function module SO_OBJECT_SEND?

A sample code or link will be helpful.

Regards, Senthil G.

1 REPLY 1
Read only

SG141
Active Participant
0 Likes
568

Here is one of the sample code for FM <b>SO_OBJECT_SEND</b>

DATA: OBJECT_HD_CHANGE LIKE SOOD1 OCCURS 0 WITH HEADER LINE,
      OBJPARA          LIKE SELC  OCCURS 0 WITH HEADER LINE,
      RECEIVERS        LIKE SOOS1 OCCURS 0 WITH HEADER LINE.


OBJECT_HD_CHANGE-OBJLA  = SY-LANGU.
OBJECT_HD_CHANGE-OBJNAM = MAILNAME.
OBJECT_HD_CHANGE-OBJDES = SUBJECT.
OBJECT_HD_CHANGE-OBJSNS = 'F'.
OBJECT_HD_CHANGE-VMTYP  = 'T'.
OBJECT_HD_CHANGE-SKIPS  = 'X'.
OBJECT_HD_CHANGE-ACNAM  = 'SP01'.
OBJECT_HD_CHANGE-OBJCP  = 'X'.

RECEIVERS-RCDAT  = SY-DATUM.
RECEIVERS-RCTIM  = SY-UZEIT.
IF DLI IS INITIAL.
    RECEIVERS-RECNAM = RECEPIENT.
    RECEIVERS-RTUNAM = RECEPIENT.
ELSE.
    RECEIVERS-RECNAM = DLI.
    RECEIVERS-ADR_NAME = DLI.
    RECEIVERS-RECESC = 'C'.
ENDIF.
RECEIVERS-SNDEX  = 'X'.     " Express-Mail
APPEND RECEIVERS.

OBJPARA-NAME = 'SPI'.
OBJPARA-LOW  = SPOOLNUMBER.
APPEND OBJPARA.


 CALL FUNCTION 'SO_OBJECT_SEND'
      EXPORTING
           OBJECT_HD_CHANGE           = OBJECT_HD_CHANGE
           OBJECT_TYPE                = 'RAW'
           OWNER                      = SY-UNAME
      TABLES
           OBJCONT                    = TEXT
           OBJPARA                    = OBJPARA
           RECEIVERS                  = RECEIVERS
      EXCEPTIONS
           OTHERS                     = 01.

IF SY-SUBRC NE 0.
   RAISE ERROR.
ENDIF.

ENDFUNCTION.

<b>

Please go thru the documentation of the FM in T-code SE37</b>