How to send External mail in sap HR workflow

Hi experts,
     Anybody con tell me how  to send External mail in sap HR workflow ?
Regards,
Umesh.

Hello,
Check the workflow builder. There is a step type of "Send mail". Just put that into your workflow definition, and your workflow will send mail.
Regards,
Karri

Similar Messages

  • How to send external mails to the user

    Dears,
    How to send external mails to the user who creates the sales document (Quotation)
    Can you please suggest what modification required in the FM
    Thanks,
    pinky

    You can have a partner function like 'Created by' and use an exit to populate the User ID to this partner function(dont have the system right now but i think this can be done with standard partner detr. procedure also)
    Then, create an Output type for that Partner function with transmission medium as 'External Send'. You can use the standard SAP program to trigger the email. To send the actual email after the output is trigerred, the link connection has to be set up be BASIS but if you want to check, then goto SOST and see if the email got trigerred or not.

  • How to send E-Mail Notification executing through workflow?

    hi All
    I want to send E-Mail Notification executing through workflow in MDM Data Manager?
    I have tried it, But still i am unable to send E-Mail Notification?
    i will explain, how i have tried?
    1) I have created the simple workflow with the following components
        they are in sequence
          start--> process-> notify--->stop
    2)  owner of the workflow is Admin and launcher of the workflow is Admin and i have given email id to the Default Admin user in the console.
    3) i have created another user (i.e. User2) with default roles as like as Admin and i have assigned User2 to the process component in workflow and I have created e-mail address for the User2 in the console.
    4) i have created another user(i.e.User1) with default roles as like as Admin. and give e-mail address,under the notify component User1 is selected in To Field.
    5) stop component as usual
    coming to configuration part about the SMPT server in MDS.ini file
    1) in mds.ini file for the MailServer=, I have given SMTP Server name once and restarted the server and executed the workflow, but not worked
    2)in mds.ini file for the MailServer=, i have given SMTP Server IP Address and checked the port,and we have configured the host file also and restarted the server and executed the worflow , but not worked
    In all the ways i have executed and tried to send E-Mail Notifications through workflow, But I didn't
    can any one help where i have went wrong, so i can rectify  it
    what actually we have to give in mds.ini file? is any other cofiguration required for it?
    if any one have any solution for it , can you please explain me in step by step
    Thanks in Advance
    bharat.chinthapatla

    Hi Bharat,
    your steps seems to be correct. Just try to ping your mail server, to verify if your mail server is running up, besides note that mdm go throw port 25 for sending emails, so please check if you are able to send emails using port 25 in your network.
    Regards,
    Vito

  • How to send a mail from SAP 3.1H Ver.

    Hi,
      I am working on SAP 3.1H Version. I need to send mail from one of my ABAP program. Since SAP 3.1H version does not have Standard function modules which send mails from any ABAP program so how can I achive this task in this version of SAP.
    The Operating system of my application server is Sun solaris.
    Waiting for an early and postive reply.
    Thanks & Regards,
    Maqsood Khan

    REPORT ZSAPMAIL NO STANDARD PAGE HEADING.
    TABLES: DRAD,
            QINF,
            DRAW,
            SOUC,
            SOFD,
            DRAP.
    DATA: P_RETURN_CODE LIKE SY-SUBRC.
    data: d_username LIKE DRAP-PRNAM.
    mail declarations
    DATA : BEGIN OF NEW_OBJECT_ID.         " the newly created email object
            INCLUDE STRUCTURE SOODK.
    DATA : END OF NEW_OBJECT_ID.
    DATA : BEGIN OF FOLDER_ID.             " the folder id of the outbox
            INCLUDE STRUCTURE SOODK.
    DATA : END OF FOLDER_ID.
    DATA : BEGIN OF REC_TAB OCCURS 5.     " the table which will contain the
            INCLUDE STRUCTURE SOOS1.       " information on the destination
    DATA : END OF REC_TAB.
    DATA : BEGIN OF OBJECT_HD_CHANGE.      " the table which contains the
            INCLUDE STRUCTURE SOOD1.       " info for the object we will be
    DATA : END OF OBJECT_HD_CHANGE.        " creating
    DATA : OBJECT_TYPE LIKE SOOD-OBJTP.    " the type of object
    DATA : BEGIN OF OBJHEAD OCCURS 5.      " the header of the object
            INCLUDE STRUCTURE SOLI.
    DATA : END OF OBJHEAD.
    DATA : BEGIN OF OBJCONT OCCURS 0.      " the contents of the object
            INCLUDE STRUCTURE SOLI.        " i.e. the text etc
    DATA : END OF OBJCONT.
    DATA : BEGIN OF OBJPARA OCCURS 5.      " formatting options
            INCLUDE STRUCTURE SELC.
    DATA : END OF OBJPARA.
    DATA : BEGIN OF OBJPARB OCCURS 5.      " formatting options
            INCLUDE STRUCTURE SOOP1.
    DATA : END OF OBJPARB.
    DATA : BEGIN OF T_MAIL_TEXT OCCURS 0,  "Message table for messages to
            STRING(255),                   "user via mailbox
           END OF T_MAIL_TEXT.
    Parameter: p_uname like sy-uname.
    **START-OF-SELECTION
    START-OF-SELECTION.
        d_username = p_uname.
        PERFORM POPULATE_EMAIL_TEXT.
        PERFORM SETUP_TRX_AND_RTX_MAILBOXES USING P_RETURN_CODE.
        PERFORM CREATE_AND_SEND_MAIL_OBJECT.
          FORM POPULATE_EMAIL_TEXT                                      *
          Inserts text for email message                                *
    FORM POPULATE_EMAIL_TEXT.
      CLEAR T_MAIL_TEXT-STRING.            "puts a blank line in
      APPEND T_MAIL_TEXT.
      APPEND T_MAIL_TEXT.
    adds failed list  on to end of success list.
      T_MAIL_TEXT-STRING = 'Test email message line 1'.
      APPEND T_MAIL_TEXT.
      T_MAIL_TEXT-STRING = 'Test email message line 1'.
      APPEND T_MAIL_TEXT.
      CLEAR T_MAIL_TEXT-STRING.            "puts a blank line in
      APPEND T_MAIL_TEXT.
      T_MAIL_TEXT-STRING = 'Header1    Header2    Header3'.
      APPEND T_MAIL_TEXT.
      T_MAIL_TEXT-STRING = '----
      APPEND T_MAIL_TEXT.
    ENDFORM.
    *&      Form  SETUP_TRX_&_RTX_MAILBOXES
      Ensure that the mailboxes of the sender (INTMGR) are set up OK
    FORM SETUP_TRX_AND_RTX_MAILBOXES USING P_RETURN_CODE.
    get the user no of the sender in order to add the mail to the
    user name's outbox for future reference
      SELECT SINGLE * FROM SOUC
               WHERE SAPNAM = SY-UNAME.    "SAP name of a SAPoffice user
      IF SY-SUBRC NE 0.
        "Error finding the SAPoffice user info for the user
        MESSAGE E064(ZR53) WITH SY-UNAME.
        P_RETURN_CODE = 1.
        EXIT.
      ENDIF.
    *Get the outbox No for the sender from the user No where the folder
                                           " type is an outbox
      SELECT * FROM SOFD WHERE OWNTP = SOUC-USRTP   "Owner type from ID
                           AND OWNYR = SOUC-USRYR   "Owner year from the ID
                           AND OWNNO = SOUC-USRNO   "Owner number from the I
                           AND FOLRG = 'O'."Output box
      ENDSELECT.
      IF SY-SUBRC NE 0.
        " Error getting folder information for the user
        MESSAGE E065(ZR53) WITH SY-UNAME.
        P_RETURN_CODE = 1.
        EXIT.
      ENDIF.
    ENDFORM.                               " SETUP_TRX_&_RTX_MAILBOXES
    *&      Form  CREATE_AND_SEND_MAIL_OBJECT
    FORM CREATE_AND_SEND_MAIL_OBJECT.
      FOLDER_ID-OBJTP = SOFD-FOLTP.        " the folder type ( usually FOL )
      FOLDER_ID-OBJYR = SOFD-FOLYR.        " the folder year ( usually 22 )
      FOLDER_ID-OBJNO = SOFD-FOLNO.        " the folder no.
      OBJECT_TYPE     = 'RAW'.             " the type of object being added
    build up the object information for creating the object
      OBJECT_HD_CHANGE-OBJLA  = SY-LANGU.  " the language of the email
      OBJECT_HD_CHANGE-OBJNAM = 'PS to DM Interface'. " the object name
    mail subject 'Mass Linking of QA, pass/fail'
      MOVE TEXT-002 TO OBJECT_HD_CHANGE-OBJDES.
      OBJECT_HD_CHANGE-DLDAT = SY-DATUM.   " the date of the email
      OBJECT_HD_CHANGE-DLTIM = SY-UZEIT.   " the time of the email
      OBJECT_HD_CHANGE-OBJPRI = '1'.       " the priority ( highest )
      OBJECT_HD_CHANGE-OBJSNS = 'F'.       " the object sensitivity
    F is functional, C - company sensitive
    object_hd_change-skips  = ' '.       " Skip first screen
    object_hd_change-acnam  = 'SM35'.    " Batch imput transaction
    object_hd_change-vmtyp  = 'T'.       " Transaction type
    add the text lines into the contents of the email
      CLEAR OBJCONT.
      REFRESH OBJCONT.
    free objcont.      " added this to delete the mail contents records
      LOOP AT T_MAIL_TEXT.
        OBJCONT-LINE = T_MAIL_TEXT-STRING.
        APPEND OBJCONT.
      ENDLOOP.
      CLEAR OBJCONT.
    build up the table of receivers for the email
      REC_TAB-RCDAT = SY-DATUM.            " the date to send the email
      REC_TAB-RCTIM = SY-UZEIT.            " the time to send the email
    the SAP username of the person who will receive the email
      REC_TAB-RECNAM = D_USERNAME.
    the user type of the person who will send the email ( USR )
      REC_TAB-SNDTP = SOUC-USRTP.
    the user year of the person who will send the email ( 22 )
      REC_TAB-SNDYR = SOUC-USRYR.
    the user number of the person who will send the email
      REC_TAB-SNDNO = SOUC-USRNO.
    the sap username of the person who will send the email
      REC_TAB-SNDNAM = SY-UNAME.
    get the user info for the receiver of the document
      SELECT SINGLE * FROM SOUC WHERE SAPNAM = D_USERNAME.
      IF SY-SUBRC NE 0.
        WRITE : / TEXT-001, D_USERNAME.    "usnam.
        EXIT.
      ENDIF.
    the user number of the person who will receive the email ( USR )
      REC_TAB-RECNO = SOUC-USRNO.
    the user type of the person who will receive the email ( USR )
      REC_TAB-RECTP = SOUC-USRTP.
    the user year of the person who will receive the email ( USR )
      REC_TAB-RECYR = SOUC-USRYR.
    the priority of the email ( highest )
      REC_TAB-SNDPRI = '1'.
    check for delivery on the email
      REC_TAB-DELIVER = 'X'.
    send express so recipient knows there is a problem
      REC_TAB-SNDEX = 'X'.
    check for a return receipt
      REC_TAB-READ = 'X'.
    the sap username of the person receiving the email
      REC_TAB-ADR_NAME = D_USERNAME.       "usnam.
    add this receiver to the internal table
      APPEND REC_TAB.
      CLEAR REC_TAB.
    call the function to create the object in the outbox of the sender
      CALL FUNCTION 'SO_OBJECT_INSERT'
           EXPORTING
                FOLDER_ID                  = FOLDER_ID
                OBJECT_HD_CHANGE           = OBJECT_HD_CHANGE
                OBJECT_TYPE                = OBJECT_TYPE
                OWNER                      = SY-UNAME
           IMPORTING
                OBJECT_ID                  = NEW_OBJECT_ID
           TABLES
                OBJCONT                    = OBJCONT
                OBJHEAD                    = OBJHEAD
                OBJPARA                    = OBJPARA
                OBJPARB                    = OBJPARB
           EXCEPTIONS
                ACTIVE_USER_NOT_EXIST      = 1
                COMMUNICATION_FAILURE      = 2
                COMPONENT_NOT_AVAILABLE    = 3
                DL_NAME_EXIST              = 4
                FOLDER_NOT_EXIST           = 5
                FOLDER_NO_AUTHORIZATION    = 6
                OBJECT_TYPE_NOT_EXIST      = 7
                OPERATION_NO_AUTHORIZATION = 8
                OWNER_NOT_EXIST            = 9
                PARAMETER_ERROR            = 10
                SUBSTITUTE_NOT_ACTIVE      = 11
                SUBSTITUTE_NOT_DEFINED     = 12
                SYSTEM_FAILURE             = 13
                X_ERROR                    = 14
                OTHERS                     = 15.
      IF SY-SUBRC NE 0.
        MESSAGE A063(ZR53) WITH SY-SUBRC.
        EXIT.
      ENDIF.
    call the function to send the already created email to the receivers
      CALL FUNCTION 'SO_OBJECT_SEND'
           EXPORTING
                FOLDER_ID                  = FOLDER_ID
                OBJECT_ID                  = NEW_OBJECT_ID
                OUTBOX_FLAG                = 'X'
                OWNER                      = SY-UNAME
           TABLES
                RECEIVERS                  = REC_TAB
           EXCEPTIONS
                ACTIVE_USER_NOT_EXIST      = 1
                COMMUNICATION_FAILURE      = 2
                COMPONENT_NOT_AVAILABLE    = 3
                FOLDER_NOT_EXIST           = 4
                FOLDER_NO_AUTHORIZATION    = 5
                FORWARDER_NOT_EXIST        = 6
                NOTE_NOT_EXIST             = 7
                OBJECT_NOT_EXIST           = 8
                OBJECT_NOT_SENT            = 9
                OBJECT_NO_AUTHORIZATION    = 10
                OBJECT_TYPE_NOT_EXIST      = 11
                OPERATION_NO_AUTHORIZATION = 12
                OWNER_NOT_EXIST            = 13
                PARAMETER_ERROR            = 14
                SUBSTITUTE_NOT_ACTIVE      = 15
                SUBSTITUTE_NOT_DEFINED     = 16
                SYSTEM_FAILURE             = 17
                TOO_MUCH_RECEIVERS         = 18
                USER_NOT_EXIST             = 19
                X_ERROR                    = 20
                OTHERS                     = 21.
      IF SY-SUBRC EQ 0.
        MESSAGE I035(ZR53) WITH NEW_OBJECT_ID D_USERNAME. "usnam.
      ELSE.
        MESSAGE I036(ZR53) WITH D_USERNAME."      sy-subrc.
      ENDIF.
    ENDFORM.                               " CREATE_AND_SEND_MAIL_OBJECT
    award points if useful,
    Aleem.

  • Send External Mail from SAP

    Hi all,
    I have one ALV-report which has 64 columns.
    Now i want to send this report to external mail.
    I have already created a program for this but the problem is that my report contains 64 columns but only 30 columns is sending to external mail remaining data is not generating in excel sheet.

    first check o/p in spool t.code sp02
    o/p is having 64 columns or 30.

  • How to send a mail from SAP to Users more than 200

    Hi
    some one can help i have one scenario in my   company we have to send a mail to our user more than 200 to inform price changes once in a month or two month
    Thanks in advance
    Best Regards,
    MH

    Hi Mohammed
    As you want to send to around 200 customers then maintain a condition record with the combination of Output medium 7 in the Output medium field
    Second Option is Go to VA02 -> Edit -> Editor to reach the SAPscript Editor and then come back to the header output data and then The system sends the electronic mail at the time you have specified in the timing data..
    Regards
    Srinath

  • How to send attachment mail in sap

    hi all,
    please guide me how to use function module named SO_NEW_DOCUMENT_ATT_SEND_API1.
    i have text files in internal table.
    please guide me how can i send files in my internal table as in attachment.

    Manish,
    Just copy paste the below code as given into a report only changing the email address of receipient to your email address to testing.
    That is line:
    lwa_reclist-receiver = '[email protected]'. " Email address of your receipient
    Then I think your SCOT is not configured for automatic execution hence once you have run your report go to transaction SCOT and press (Ctrl + F7) to start send process.
    A mail will be sent to your email address specified in the receipient list and a copy of it also placed in your SBWP Outbox.
    Let me know if you need further help, else reward neccessary points.
    Code
    *& Report  ZMFV_ROUGH_PAD
    REPORT  zmfv_rough_pad.
    DATA :
    li_attachment TYPE TABLE OF soli, " hold attachment contents
    li_pdf        TYPE TABLE OF tline, " hold data from spool in PDF format
    li_objpack    TYPE TABLE OF sopcklsti1, " hold email body, attachment details
    li_objtxt     TYPE TABLE OF solisti1, " hold message contents
    li_reclist    TYPE TABLE OF somlreci1. " hold email reciever details
    DATA :
    lwa_attachment    LIKE LINE OF li_attachment,
    lwa_pdf           LIKE LINE OF li_pdf,
    lwa_objpack       LIKE LINE OF li_objpack,
    lwa_objtxt        LIKE LINE OF li_objtxt,
    lwa_reclist       LIKE LINE OF li_reclist,
    lwa_document_data TYPE sodocchgi1. " hold document details like title, size etc.
    DATA :
    lv_sent_to_all     TYPE c, " flag to check if mail is sent to all
    l_att_lines        TYPE i, " hold number of lines in attachment table
    lv_spool_desc(68)  TYPE c. " hold description of spool
    CONSTANTS : lc_email_txt TYPE solisti1-line VALUE 'Find attached Payment Advice sent by this email.',
    lc_sensitivity TYPE sodocchgi1-sensitivty VALUE 'O',
    lc_raw         TYPE sopcklsti1-doc_type VALUE 'RAW',
    lc_pdf         TYPE sopcklsti1-doc_type VALUE 'PDF',
    lc_transf_bin  TYPE sopcklsti1-transf_bin VALUE 'X',
    lc_email       TYPE sopcklsti1-obj_name VALUE 'Email',
    lc_ext_id      TYPE somlreci1-rec_type VALUE 'U',
    lc_outbox      TYPE sonv-flag VALUE 'X',
    lc_obj_name    TYPE sodocchgi1-obj_name VALUE 'Email Test',
    lc_1           TYPE n VALUE '1',
    lc_0           TYPE n VALUE '0'.
    CLEAR: lwa_attachment,
    lwa_pdf,
    lwa_reclist,
    lwa_objtxt,
    lwa_objpack,
    lwa_document_data.
    REFRESH : li_attachment,
    li_pdf,
    li_reclist,
    li_objtxt,
    li_objpack.
    Build attachment table
    lwa_attachment-line = 'YOUR TEXT FROM INTERNAL TABLE LINES'.
    APPEND lwa_attachment TO li_attachment.
    Body of email
    CLEAR lwa_objtxt.
    MOVE lc_email_txt TO lwa_objtxt.
    APPEND lwa_objtxt TO li_objtxt.
    Title of the email
    lwa_document_data-obj_descr = 'Title of email'.
    lwa_document_data-sensitivty = lc_sensitivity.
    lwa_document_data-expiry_dat = sy-datum + 15.
    lwa_document_data-doc_size = STRLEN( lwa_objtxt ).
    lwa_document_data-obj_name = lc_obj_name.
    e-mail body
    CLEAR lwa_objpack.
    lwa_objpack-head_start = lc_1.
    lwa_objpack-head_num = lc_0.
    lwa_objpack-body_start = lc_1.
    lwa_objpack-body_num = lc_1.
    lwa_objpack-doc_type = lc_raw.
    lwa_objpack-doc_size = STRLEN( lwa_objtxt ).
    APPEND lwa_objpack TO li_objpack.
    For e-mail attachment
    DESCRIBE TABLE li_attachment LINES l_att_lines.
    CLEAR lwa_attachment.
    READ TABLE li_attachment INDEX l_att_lines INTO lwa_attachment.
    CLEAR lwa_objpack.
    lwa_objpack-transf_bin = lc_transf_bin.
    lwa_objpack-head_start = lc_1.
    lwa_objpack-head_num = lc_1.
    lwa_objpack-body_start = lc_1.
    lwa_objpack-body_num = l_att_lines.
    lwa_objpack-doc_type = lc_raw.
    lwa_objpack-obj_name = lc_email.
    lwa_objpack-obj_descr = lv_spool_desc.
    lwa_objpack-doc_size = ( 255 * ( l_att_lines - 1 ) ) + STRLEN( lwa_attachment-line ).
    APPEND lwa_objpack TO li_objpack.
    make recipient list
    CLEAR lwa_reclist.
    lwa_reclist-receiver = '[email protected]'. " Email address of your receipient
    lwa_reclist-rec_type = lc_ext_id. " To external email id
    lwa_reclist-COM_TYPE = 'INT'.     " Internet mail
    APPEND lwa_reclist TO li_reclist.
    send mail with attachment
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
        document_data              = lwa_document_data
        put_in_outbox              = lc_outbox
        commit_work                = 'X'
      IMPORTING
        sent_to_all                = lv_sent_to_all
      TABLES
        packing_list               = li_objpack
        contents_bin               = li_attachment
        contents_txt               = li_objtxt
        receivers                  = li_reclist
      EXCEPTIONS
        too_many_receivers         = 1
        document_not_sent          = 2
        document_type_not_exist    = 3
        operation_no_authorization = 4
        parameter_error            = 5
        x_error                    = 6
        enqueue_error              = 7
        OTHERS                     = 8.
    IF sy-subrc = 0.
      WRITE: 'Success'.
    ENDIF.

  • Problem sending externail mail from SAP

    I am facing problem in sending external mail from SAP. for ex: yahoo, hotmail like that. But, i can able to send the mails to my domain ids. I have configured both the SMTP and SAP internet gateway to send mails.
    But, i dont know what could be the problem in sending external mails.
    Is there any body to help me in this regard
    Regards,
    B.Sudharsan

    Hi Sudarsan,
    How are you trying to send an e-mail using ABAP or using actions or ?
    Enclosed link gives you a complete overview of the settings and the way to send an e-mail using ABAP ( if necessary).
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
    Reward points if it helps.
    Regards,
    Vamsi Krishna P.

  • Send External mail with Attchment from SAP

    Hi All,
    OUR REQUIREMENT: We need to send EXTERNAL MAIL with ATTACHMENT(Excel) form SAP .
    We have developed a function module which converts the internal table data into Excel Format and sends it as an attachment to External Mail.
    ISSUE : But our issue is we are unable to open that document using GOOGLE DOCS Could any one help me how to do this.
    it was thriughing error like
    Error log is .
    ''Sorry, we are unable to generate a view of the document at this time. Please try again later.
    You can also try to download the original document by clicking here. Alternatively, you can view the plain HTML (automatically redirecting).
    Regards
    Venkat .
    Edited by: venkata pradeep on Mar 5, 2012 10:26 AM
    Edited by: venkata pradeep on Mar 5, 2012 10:28 AM

    Is the excel file recognized by MS Excel? If not, then issue is you have wrongly converted your attachment and/or your FM to create an excel file was wrongly coded or you have passed it wrongly to your mail code.
    If you consider an OOP approach in sending external mail, refer to this link:
    http://wiki.sdn.sap.com/wiki/display/Snippets/SendingmailwithattachmentusingObjectOriented+Approach

  • BASIS Configuration needed to send an external mail from SAP Program

    Can you please help me about the BASIS configuration needed to send an external mail from SAP Program?
    Regards,
    Subhasish

    Hi Subhasish,
    Please go thru the below link.
    Re: SCOT Configuration--for external mail
    Regards,
    Lakshman.

  • How will we send smtp mail from SAP via Exchange

    Hi;
    We changed SAP OS between Windows and Linux and still 4.6c . Now we use linux OS.
    We used smtp mail at SAP via Exchange with 3.party (sendmail,indigomail etc.) But Now I dont know how will we send smtp mail from SAP.
    Please help me,
    Thanks for answers.
    Moderator message: not directly related to ABAP development, please have look in the Netweaver forums, also search for available information on sending emails.
    Edited by: Thomas Zloch on Nov 22, 2010 2:39 PM

    Hi,
    What is the nature of the URL you wish to include in the e-mail ?
    Is it fixed or dynamic ?
    Cheers
    Colin.

  • Sending external mail with excel attachment from SAP

    Hi All,
    I am trying to send a external mail from SAP. Mail is getting posted correctly with attachment having type excel. If attach file has more than 1 records then in mail it is coming in a single lines. it is not getting wrap.
    e.g. my attach internal table has records like LINE1
                                                                      LINE2
                                                                      LINE3
    output in attach excel file is : LINE1         LINE2          LINE3
    in attach file it should come line by line.
    source code of my function module is as follows :
    FUNCTION ZXI_SEND_MAIL_WITH_ATTACHMENT.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(SUBJECT) TYPE  SO_OBJ_DES OPTIONAL
    *"     REFERENCE(ATTACH_NAME1) TYPE  SOOD-OBJDES
    *"     REFERENCE(EXT1) TYPE  SOODK-OBJTP
    *"     REFERENCE(MAIL_ID) TYPE  ADR6-SMTP_ADDR
    *"  TABLES
    *"      IT_CONTENT TYPE  SOLI_TAB OPTIONAL
    *"      IT_ATTACH TYPE  SOLI_TAB OPTIONAL
      DATA: send_request       TYPE REF TO cl_bcs.
      DATA: document           TYPE REF TO cl_document_bcs.
      DATA: sender             TYPE REF TO cl_sapuser_bcs.
      DATA: recipient          TYPE REF TO if_recipient_bcs.
      DATA: exception_info     TYPE REF TO if_os_exception_info,
      bcs_exception      TYPE REF TO cx_document_bcs.
      DATA i_attachment_size TYPE sood-objlen.
    Creates persistent send request
      send_request = cl_bcs=>create_persistent( ).
      TRY.
    *****Create txt mail document**************************
          document = cl_document_bcs=>create_document(
                                        i_type    = 'RAW'
                                        i_text = it_content[]
                                        i_subject = subject ).
    **************Creates Attachment 1***********************
          CALL METHOD document->add_attachment
            EXPORTING
              i_attachment_type    = ext1
              i_attachment_subject = attach_name1
              i_att_content_text   = it_attach[].
    Add document to send request
          CALL METHOD send_request->set_document( document ).
    Get sender object
          sender = cl_sapuser_bcs=>create( sy-uname ).
    Add sender
          CALL METHOD send_request->set_sender
            EXPORTING
              i_sender = sender.
          recipient = cl_cam_address_bcs=>create_internet_address(
                               i_address_string = mail_id ).
          CALL METHOD send_request->add_recipient
            EXPORTING
              i_recipient  = recipient
              i_express    = 'U'
              i_copy       = ' '
              i_blind_copy = ' '
              i_no_forward = ' '.
    **********Trigger e-mails immediately****************************
          send_request->set_send_immediately( 'X' ).
          CALL METHOD send_request->send( ).
          COMMIT WORK.
        CATCH cx_document_bcs INTO bcs_exception.
      ENDTRY.
    ENDFUNCTION.
    please suggest me a solution and thanks in advance.
    Thanks&Regards,
    Sachin

    See the sample code  for sending attachment as Mail
    Mailing with Attachment by ABAP Coding  
    Refer this link:
    Mail with attachment.
    FORM send_list_to_basis .
      DATA: w_path      LIKE rlgrap OCCURS 0 WITH HEADER LINE,
            lt_index    TYPE sy-tabix,
            doc_type(3) TYPE c,
            descr       LIKE it_objpack_basis-obj_descr,
            temp_data   LIKE w_path,
            temp1       TYPE string,
            tab_lines   TYPE i,
            langu(15)   TYPE c,
            expirydate  TYPE so_obj_edt,
            L_FILE1(100).
      CONCATENATE 'C:\' sy-repid '_' sy-datum '.XLS' INTO L_FILE1.
      W_PATH-FILENAME = L_FILE1.
      APPEND w_path.
      CLEAR w_path.
      wa_doc_chng-obj_descr  = 'User List not logged on for 180 days'.
      wa_doc_chng-obj_langu  = 'E'.
      wa_doc_chng-obj_expdat = sy-datum.
      CLEAR w_subject.
      CONCATENATE 'Please find attached document with list of users'
                  'not logged on for 180 days for client' sy-mandt
                  INTO w_subject SEPARATED BY space.
      it_objtxt_basis-line = w_subject.
      APPEND it_objtxt_basis.
      CLEAR it_objtxt_basis.
      it_objtxt_basis-line = text-004.
      APPEND it_objtxt_basis.
      CLEAR it_objtxt_basis.
      CLEAR w_tab_line.
      DESCRIBE TABLE it_objtxt_basis LINES w_tab_line.
      READ TABLE it_objtxt_basis INDEX w_tab_line  INTO l_cline.
      wa_doc_chng-doc_size =
       ( w_tab_line - 1 ) * 255 + STRLEN( l_cline ).
      CLEAR it_objpack_basis-transf_bin.
      it_objpack_basis-head_start = 1.
      it_objpack_basis-head_num   = 0.
      it_objpack_basis-body_start = 1.
      it_objpack_basis-body_num   = w_tab_line.
      it_objpack_basis-doc_type   = 'RAW'.
      APPEND it_objpack_basis.
      CLEAR it_objpack_basis.
      LOOP AT w_path.
        temp1 = w_path.
        descr = w_path.
        CALL FUNCTION 'STRING_REVERSE'
          EXPORTING
            string  = descr
            lang    = 'E'
          IMPORTING
            rstring = descr.
        CALL FUNCTION 'STRING_SPLIT'
          EXPORTING
            delimiter = '\'
            string    = descr
          IMPORTING
            head      = descr
            tail      = temp_data.
        CALL FUNCTION 'STRING_REVERSE'
          EXPORTING
            string  = descr
            lang    = 'E'
          IMPORTING
            rstring = descr.
        CALL FUNCTION 'STRING_SPLIT'
          EXPORTING
            delimiter = '.'
            string    = descr
          IMPORTING
            head      = temp_data
            tail      = doc_type.
        CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename      = temp1
            filetype      = 'BIN'
            header_length = 0
            read_by_line  = 'X'
            replacement   = '#'
          TABLES
            data_tab      = it_upload.
        DESCRIBE TABLE it_upload LINES tab_lines.
        DESCRIBE TABLE it_objbin_basis LINES lt_index.
        lt_index = lt_index + 1.
        LOOP AT it_upload.
          wa_objbin_basis-line = it_upload-line.
          APPEND wa_objbin_basis TO it_objbin_basis.
          CLEAR wa_objbin_basis.
        ENDLOOP.
        it_objpack_basis-transf_bin = 'X'.
        it_objpack_basis-head_start = 0.
        it_objpack_basis-head_num   = 0.
        it_objpack_basis-body_start = lt_index.
        it_objpack_basis-body_num   = tab_lines.
        it_objpack_basis-doc_type   = doc_type.
        it_objpack_basis-obj_descr  = descr.
        it_objpack_basis-doc_size   = tab_lines * 255.
        APPEND it_objpack_basis.
        CLEAR it_objpack_basis.
      ENDLOOP.
      it_reclist_basis-receiver = '[email protected]'.
      it_reclist_basis-rec_type = 'U'.
      APPEND it_reclist_basis.
      CLEAR it_reclist_basis.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = wa_doc_chng
          put_in_outbox              = 'X'
          commit_work                = 'X'
        TABLES
          packing_list               = it_objpack_basis
          contents_txt               = it_objtxt_basis
          contents_bin               = it_objbin_basis
          receivers                  = it_reclist_basis
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      IF sy-subrc EQ 0.
        SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
      ENDIF.
    ENDFORM.                    " send_list_to_basis
    Reward points if useful
    Regards
    Anji

  • Sending external mail using SO_NEW_DOCUMENT_ATT_SEND_API1

    When i use this RFC by appending the internal table receiver with receiver: sapuser name and rec_type  B it triggers mail to the sap user login .But when i give external email address for receiver with rec_type 'U' it is not triggering any mail.Can anyone please tell me how to use this RFC in sending external mails??

    I went back and you are right "INT" was not the REC_TYPE it was the COM_TYPE.
    Sorry for any confusion caused.
    However,
    I suggest 2 more tests and then I give up and can not think about anything else.
    Try:
    #1
    REC_TYPE = 'X'.
    if it does not work.
    #2
    REC_TYPE = 'R'.
    Hope that will do the trick. I was trying a lot when I had to get that working some time ago.
    And surely the other colleagues point to something which must be setup as well. Transaction SCOT the SMTP settings.
    Furthermore there could be another issue. I remember that I worked at a client who had turned off the send settings on their email server. So SAP finished everything and handed the emails on to a mail server. The mail server had a setting to block any emails from the development environment.
    So that might be another cause of your issue.

  • How to send a Mail purchase order automaticaly from ME22N

    How to send a Mail purchase order automaticaly from ME22N

    Hi,
    First create an entry via NACE with medium =   5 ( External send ) with all other details same as normal print option. Now ensure that vendor master of the po has got the external e-mail id of the vendor. Now go to ME22n in mesages create a message with medium = 5 ( External Send ). Go to communication method, key in Communication strategy.Go to Further date & against Despatch time pick up option 4 viz. Send immeidately while saving an application. Now once you press the save button it will be sent to the address maintained in the vendor master of the vendor of the PO. Please note you require some basic settings from BASIS side as well.
    I hope this helps,
    You may also refer to the SAP note 191470.
    Regards
    Raju Chitale

  • External mail to SAP

    HI,
    I have a requuirement where users can send a mail to SAP server and upon receiving the mail, a program or workflow has to execute.
    We can send mails from Sap to external mail...... how do we do this other way around.... external mail to SAP and how can we trigger the execution of a program upon receiving this mail.
    Regards,
    Tarun Bahal

    Hello Tarun,
    This can be done using Inbound Distribution
    http://help.sap.com/saphelp_nw70/helpdata/EN/6c/69c2e3418d11d1896e0000e8322d00/frameset.htm
    Check more details about Workflow on help.sap.com using Workflow you can also trigger processing of incoming documents.
    The link i gave you has Workflow information too.
    Regards,
    Siddhesh

Maybe you are looking for

  • How to share the i-Photo Library on the same i-Mac with 2 Accounts?

    I am using a iMac running OSX 10.8.4. there are 2 accounts, mine and my wife's. we wish to be able to share the i-Photo Library on the same computer. So I copied the i-Photo library from my Library folder to the Users Shared folder and then deleted t

  • NullPointerException at oracle.jsp.runtime.OracleJspRuntime.encodeQueryStri

    Hi, I need to make a webservice call from remote https webservice in Jdeveloper 10.1.3 with JDK 1.4.2_13. Webservices Wrapper classes use JAx-RPC. I run my JSP to call webservice and got the following error: java.lang.NullPointerException     at orac

  • Filtering on used/unused photos within projects (un-/used e.g. in books, -)

    Hello, I'm trying to clean up my library by removing (archiving) all those unused photos. This means: all photos from a project should be removed which are not used in any album, book, web-gallery, etc. (or better: moved to a different backup project

  • IFRS - Ledger / Fiscal Year Selection.

    Hello, We would like to implement New GL with IFRS compliances . Please clarify on following  doubts: 1 . Whether Leading Ledger would be for IFRS  or Indian GAAP ?           What are the Pros and Cons of each selection ? 2. What exactly differences

  • Accidentally Clicked Publish Button

    Help! I'm using RH HTML X5.0.2. I accidentally clicked the "Publish" button rather than the "Preview" button after Generating. I've never setup any Publishing preferences so I have no idea what it's doing! When I try to open the project from Version