SAP MC_SEND_MAIL Function Module for









MC_SEND_MAIL is a standard mc send mail SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for mc send mail FM, simply by entering the name MC_SEND_MAIL into the relevant SAP transaction such as SE37 or SE38.

Function Group: MCS2
Program Name: SAPLMCS2
Main Program: SAPLMCS2
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function MC_SEND_MAIL pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'MC_SEND_MAIL'"
EXPORTING
MS_MAIL_SENDMODE = "
* MS_MAIL_TITLE = "
* MS_MAIL_DESCRIPTION = "
* MS_MAIL_RECEIVER = "Recipient(s)
* MS_MAIL_EXPRESS = "
* MS_MAIL_DLINAME = "Distribution list
* MS_MAIL_LANGU = SY-LANGU "Language Key
* MS_MAIL_FUNKOBJ_TYP = "
* MS_MAIL_FUNKOBJ_NAME = "

IMPORTING
MS_OK_CODE = "

TABLES
MS_MAIL_CONT = "
* MS_MAIL_FUNKOBJ_PARM = "
* MS_MAIL_SETGET_PARM = "
* MS_MAIL_RECEIVERS = "

EXCEPTIONS
SEND_ERROR = 1 CANCELED = 2 NO_TITLE = 3 NO_DESCRIPTION = 4 NO_RECEIVER_OR_DLI = 5 INVALID_SENDMODE = 6 NO_CONTENT = 7 INVALID_FUNCTIONAL_PARAMS = 8
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLMCS2_001 Change Key Figure Texts in Standard Analyses

IMPORTING Parameters details for MC_SEND_MAIL

MS_MAIL_SENDMODE -

Data type: C
Optional: No
Call by Reference: No ( called with pass by value option)

MS_MAIL_TITLE -

Data type: SOOD1-OBJNAM
Optional: Yes
Call by Reference: No ( called with pass by value option)

MS_MAIL_DESCRIPTION -

Data type: SOOD1-OBJDES
Optional: Yes
Call by Reference: No ( called with pass by value option)

MS_MAIL_RECEIVER - Recipient(s)

Data type: SOOS1-RECNAM
Optional: Yes
Call by Reference: No ( called with pass by value option)

MS_MAIL_EXPRESS -

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

MS_MAIL_DLINAME - Distribution list

Data type: SOOS1-DLINAM
Optional: Yes
Call by Reference: No ( called with pass by value option)

MS_MAIL_LANGU - Language Key

Data type: SY-LANGU
Default: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)

MS_MAIL_FUNKOBJ_TYP -

Data type: SOOD1-VMTYP
Optional: Yes
Call by Reference: No ( called with pass by value option)

MS_MAIL_FUNKOBJ_NAME -

Data type: SOOD1-ACNAM
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for MC_SEND_MAIL

MS_OK_CODE -

Data type: SY-UCOMM
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for MC_SEND_MAIL

MS_MAIL_CONT -

Data type: MCMAILOBJ
Optional: No
Call by Reference: No ( called with pass by value option)

MS_MAIL_FUNKOBJ_PARM -

Data type: SOOP1
Optional: Yes
Call by Reference: No ( called with pass by value option)

MS_MAIL_SETGET_PARM -

Data type: SELC
Optional: Yes
Call by Reference: No ( called with pass by value option)

MS_MAIL_RECEIVERS -

Data type: SOOS1
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

SEND_ERROR -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

CANCELED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_TITLE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_DESCRIPTION -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_RECEIVER_OR_DLI -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INVALID_SENDMODE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_CONTENT -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INVALID_FUNCTIONAL_PARAMS -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for MC_SEND_MAIL Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_ms_ok_code  TYPE SY-UCOMM, "   
lv_send_error  TYPE SY, "   
lt_ms_mail_cont  TYPE STANDARD TABLE OF MCMAILOBJ, "   
lv_ms_mail_sendmode  TYPE C, "   
lv_canceled  TYPE C, "   
lv_ms_mail_title  TYPE SOOD1-OBJNAM, "   
lt_ms_mail_funkobj_parm  TYPE STANDARD TABLE OF SOOP1, "   
lv_no_title  TYPE SOOP1, "   
lv_ms_mail_description  TYPE SOOD1-OBJDES, "   
lt_ms_mail_setget_parm  TYPE STANDARD TABLE OF SELC, "   
lv_no_description  TYPE SELC, "   
lv_ms_mail_receiver  TYPE SOOS1-RECNAM, "   
lt_ms_mail_receivers  TYPE STANDARD TABLE OF SOOS1, "   
lv_ms_mail_express  TYPE C, "   
lv_no_receiver_or_dli  TYPE C, "   
lv_ms_mail_dliname  TYPE SOOS1-DLINAM, "   
lv_invalid_sendmode  TYPE SOOS1, "   
lv_no_content  TYPE SOOS1, "   
lv_ms_mail_langu  TYPE SY-LANGU, "   SY-LANGU
lv_ms_mail_funkobj_typ  TYPE SOOD1-VMTYP, "   
lv_invalid_functional_params  TYPE SOOD1, "   
lv_ms_mail_funkobj_name  TYPE SOOD1-ACNAM. "   

  CALL FUNCTION 'MC_SEND_MAIL'  "
    EXPORTING
         MS_MAIL_SENDMODE = lv_ms_mail_sendmode
         MS_MAIL_TITLE = lv_ms_mail_title
         MS_MAIL_DESCRIPTION = lv_ms_mail_description
         MS_MAIL_RECEIVER = lv_ms_mail_receiver
         MS_MAIL_EXPRESS = lv_ms_mail_express
         MS_MAIL_DLINAME = lv_ms_mail_dliname
         MS_MAIL_LANGU = lv_ms_mail_langu
         MS_MAIL_FUNKOBJ_TYP = lv_ms_mail_funkobj_typ
         MS_MAIL_FUNKOBJ_NAME = lv_ms_mail_funkobj_name
    IMPORTING
         MS_OK_CODE = lv_ms_ok_code
    TABLES
         MS_MAIL_CONT = lt_ms_mail_cont
         MS_MAIL_FUNKOBJ_PARM = lt_ms_mail_funkobj_parm
         MS_MAIL_SETGET_PARM = lt_ms_mail_setget_parm
         MS_MAIL_RECEIVERS = lt_ms_mail_receivers
    EXCEPTIONS
        SEND_ERROR = 1
        CANCELED = 2
        NO_TITLE = 3
        NO_DESCRIPTION = 4
        NO_RECEIVER_OR_DLI = 5
        INVALID_SENDMODE = 6
        NO_CONTENT = 7
        INVALID_FUNCTIONAL_PARAMS = 8
. " MC_SEND_MAIL




ABAP code using 7.40 inline data declarations to call FM MC_SEND_MAIL

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single UCOMM FROM SY INTO @DATA(ld_ms_ok_code).
 
 
 
 
 
"SELECT single OBJNAM FROM SOOD1 INTO @DATA(ld_ms_mail_title).
 
 
 
"SELECT single OBJDES FROM SOOD1 INTO @DATA(ld_ms_mail_description).
 
 
 
"SELECT single RECNAM FROM SOOS1 INTO @DATA(ld_ms_mail_receiver).
 
 
 
 
"SELECT single DLINAM FROM SOOS1 INTO @DATA(ld_ms_mail_dliname).
 
 
 
"SELECT single LANGU FROM SY INTO @DATA(ld_ms_mail_langu).
DATA(ld_ms_mail_langu) = SY-LANGU.
 
"SELECT single VMTYP FROM SOOD1 INTO @DATA(ld_ms_mail_funkobj_typ).
 
 
"SELECT single ACNAM FROM SOOD1 INTO @DATA(ld_ms_mail_funkobj_name).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!