Send email with 1 excel file and multiple sheet

Hi,
I need to send an email with attachment file in excel format.  The problem is now the requirement requires 2 worksheets/tabs in 1 excel file.
For example: I need to put details data in sheet1 and summary data in sheet2 and this program should be working also if it is run in background mode.
Currently, I’m using cl_document_bcs to create document, but could not find a way to create 2 tabs in the excel file.
Has anyone got an ideas on how it should done?

Hi,
Welcome to SDN.
check these links :
/people/sap.user72/blog/2006/02/07/downloading-data-into-excel-with-format-options
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c1d54348-0601-0010-3e98-bd2a2dcd9e6c
Regards
Appana
*reward Points for helpful answers

Similar Messages

  • Send email with existing excel-file as attachment

    Is there a function to send an e-mail with an attachment which is an existing excel-file on my C:\-drive.
    I found lots of possibilities to send mail with internal tables as attachment but in my case the attachment is an existing excel-file (c:\test.xls)...
    thanx

    Hi,
    FOund these function modules
    Try this out.
    ISR_FI_SEND_EMAIL             
    ISR_FI_SEND_EMAIL_NEW_USER    
    SLS_CUST_SEND_EMAIL_TOOL      
    OR
    report y_cr17_mail.
    data method1 like sy-ucomm.
    data g_user like soudnamei1.
    data g_user_data like soudatai1.
    data g_owner like soud-usrnam.
    data g_receipients like soos1 occurs 0 with header line.
    data g_document like sood4 .
    data g_header like sood2.
    data g_folmam like sofm2.
    data g_objcnt like soli occurs 0 with header line.
    data g_objhead like soli occurs 0 with header line.
    data g_objpara  like selc occurs 0 with header line.
    data g_objparb  like soop1 occurs 0 with header line.
    data g_attachments like sood5 occurs 0 with header line.
    data g_references like soxrl occurs 0 with header line.
    data g_authority like sofa-usracc.
    data g_ref_document like sood4.
    data g_new_parent like soodk.
    data: begin of g_files occurs 10 ,
      text(4096) type c,
       end of g_files.
    data : fold_number(12) type c,
           fold_yr(2) type c,
           fold_type(3) type c.
    parameters ws_file(4096) type c default 'c:\debugger.txt'.
    Can me any file fromyour pc ....either xls or word or ppt etc ...
    g_user-sapname = sy-uname.
    call function 'SO_USER_READ_API1'
    exporting
       user                            = g_user
       PREPARE_FOR_FOLDER_ACCESS       = ' '
    importing
       user_data                       = g_user_data
    EXCEPTIONS
       USER_NOT_EXIST                  = 1
       PARAMETER_ERROR                 = 2
       X_ERROR                         = 3
       OTHERS                          = 4
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    fold_type = g_user_data-outboxfol+0(3).
    fold_yr = g_user_data-outboxfol+3(2).
    fold_number =  g_user_data-outboxfol+5(12).
    clear g_files.
    refresh : g_objcnt,
      g_objhead,
      g_objpara,
      g_objparb,
      g_receipients,
      g_attachments,
      g_references,
      g_files.
    method1 = 'SAVE'.
    g_document-foltp  = fold_type.
    g_document-folyr   = fold_yr.
    g_document-folno   = fold_number.
    g_document-objtp   = g_user_data-object_typ.
    *g_document-OBJYR   = '27'.
    *g_document-OBJNO   = '000000002365'.
    *g_document-OBJNAM = 'MESSAGE'.
    g_document-objdes   = 'sap-img.com testing by program'.
    g_document-folrg   = 'O'.
    *g_document-okcode   = 'CHNG'.
    g_document-objlen = '0'.
    g_document-file_ext = 'TXT'.
    g_header-objdes =  'sap-img.com testing by program'.
    g_header-file_ext = 'TXT'.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = sy-uname
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header
      FOLMEM_DATA        =
      RECEIVE_DATA       =
    File from the pc to send...
    method1 = 'ATTCREATEFROMPC'.
    g_files-text = ws_file.
    append g_files.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = g_owner
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header
    method1 = 'SEND'.
    g_receipients-recnam = 'MK085'.
    g_receipients-recesc = 'B'.
    g_receipients-sndex = 'X'.
    append  g_receipients.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = g_owner
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header.
    *-- End of Program
    Thanks & Regards,
    Judith.

  • When i send email with 2 account 3G and wi-fi it take 15 minutes help

    when i send email with 2 account 3G and wi-fi it take 15 minutes help

    Welcome to Apple Support Communities.
    It's probably quite simple, and nothing to do with your Address Book group.
    It is a matter of 'junk mail' or 'spam' filtering on the recipient end, I think.
    1. Apparently not everyone in your Address Book group (12 of 15 apparently?) has your current email address among their 'permitted email addresses', so, your original email message ends up in their 'junk mail' or 'spam filter' or whatever it is called by their email provider. Some businesses and schools also filter incoming messages for subject, language, content, or by sender's address (one company I dealt with prohibited all incoming email from Hotmail, for example), so it could be filtered at that level. In that case, the recipient might have to specifically ask the IT department to add your email address to a 'permitted' list.
    2. When someone else in the group hits 'reply all', THEIR email address IS among the 'permitted email addresses' for everyone else, and they are in effect 'forwarding' your message from their email address, so the filtering affecting your email address does not affect their re-sending of your message.

  • Send Email with more existing files

    Hi,
    Does anybody explain to me if ...
    Is there a function in ABAP to send an external email with more than one files that exist already?
    Something like : a function with parameters
        - a table for the directory\name(attachments).
        - a table for the text lines for the email.
        - a table for the internet addres.
    I must send an email wiht 3 different kind of files (pdf, txt and xls) and some text to explain the content of them.
    Thak you,

    For sending mails with attachment of text and xls you can refer the following code:
    REPORT Z34332_MAIL_WITH_ATTACHMENT1.
    types: begin of t_mara,
    matnr type mara-matnr,
    matkl type mara-matkl,
    mtart type mara-mtart,
    meins type mara-meins,
    end of t_mara.
    data: gt_mara type table of t_mara,
    wa_mara like line of gt_mara,
    it_packing_list type table of SOPCKLSTI1,
    wa_packing_list like line of it_packing_list,
    it_receivers type table of SOMLRECI1,
    wa_receivers like line of it_receivers,
    it_mailbody type table of SOLISTI1,
    wa_mailbody like line of it_mailbody,
    it_attachment type table of SOLISTI1,
    wa_attachment like line of it_attachment.
    data: la_doc type SODOCCHGI1.
    constants:
    con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
    con_cret type c value cl_abap_char_utilities=>CR_LF.
    get material
    select matnr matkl mtart meins
    into table gt_mara
    from mara
    up to 25 rows.
    Populate the subject/generic message attributes
    la_doc-obj_langu = sy-langu.
    la_doc-obj_descr = 'Material Details' . "Mail Header
    la_doc-sensitivty = 'F'.
    la_doc-doc_size = 1.
    Add the recipients email address
    CLEAR wa_receivers.
    REFRESH it_receivers.
    wa_receivers-receiver = 'PCSDEVL'.
    wa_receivers-rec_type = 'U'.
    wa_receivers-com_type = 'INT'.
    wa_receivers-notif_del = 'X'.
    wa_receivers-notif_ndel = 'X'.
    APPEND wa_receivers to it_receivers.
    Mail Body
    CLEAR wa_mailbody.
    REFRESH it_mailbody.
    wa_mailbody-line = 'Please find the attachment'.
    APPEND wa_mailbody to it_mailbody.
    Mail attachmwnt
    CLEAR wa_attachment.
    REFRESH it_attachment.
    CONCATENATE 'MATNR' 'MATKL' 'MTART' 'MEINS'
    INTO wa_attachment SEPARATED BY con_tab.
    CONCATENATE con_cret wa_attachment INTO wa_attachment.
    APPEND wa_attachment to it_attachment.
    LOOP AT gt_mara INTO wa_mara.
    CONCATENATE wa_mara-matnr wa_mara-matkl
    wa_mara-mtart wa_mara-meins
    INTO wa_attachment SEPARATED BY con_tab.
    CONCATENATE con_cret wa_attachment INTO wa_attachment.
    APPEND wa_attachment to it_attachment.
    ENDLOOP.
    Describe the body of the message
    CLEAR wa_packing_list.
    REFRESH it_packing_list.
    wa_packing_list-transf_bin = space.
    wa_packing_list-head_start = 1.
    wa_packing_list-head_num = 0.
    wa_packing_list-body_start = 1.
    wa_packing_list-body_num = 1.
    wa_packing_list-doc_type = 'RAW'.
    APPEND wa_packing_list to it_packing_list.
    Create attachment notification
    wa_packing_list-transf_bin = 'X'.
    wa_packing_list-head_start = 1.
    wa_packing_list-head_num = 1.
    wa_packing_list-body_start = 1.
    DESCRIBE TABLE it_attachment LINES wa_packing_list-body_num.
    wa_packing_list-doc_type = 'XLS'. " To word attachment change this as 'DOC'
    wa_packing_list-obj_descr = ' '.
    concatenate wa_packing_list-doc_type 'file' into wa_packing_list-OBJ_DESCR
    separated by space.
    wa_packing_list-doc_size = wa_packing_list-body_num * 255.
    APPEND wa_packing_list to it_packing_list.
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
    EXPORTING
    document_data = la_doc
    PUT_IN_OUTBOX = 'X'
    SENDER_ADDRESS = SY-UNAME
    SENDER_ADDRESS_TYPE = 'B'
    COMMIT_WORK = 'X'
    IMPORTING
    SENT_TO_ALL =
    NEW_OBJECT_ID =
    SENDER_ID =
    tables
    packing_list = it_packing_list
    OBJECT_HEADER =
    CONTENTS_BIN = it_attachment
    CONTENTS_TXT = it_mailbody
    CONTENTS_HEX =
    OBJECT_PARA =
    OBJECT_PARB =
    receivers = it_receivers
    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.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    But to send attachment of pdf , refer the following process:
    DATA: BEGIN OF i_mara OCCURS 0,
    matnr LIKE mara-matnr.
    DATA: END OF i_mara.
    DATA: v_dest LIKE tsp01-rqdest,
    v_handle LIKE sy-tabix,
    v_spool_id LIKE tsp01-rqident,
    v_rc TYPE c,
    v_errmessage(100) TYPE c,
    v_text(70) TYPE c.
    START-OF-SELECTION.
    SELECT matnr FROM mara INTO TABLE i_mara.
    CALL FUNCTION 'RSPO_OPEN_SPOOLREQUEST'
    EXPORTING
    dest = 'LOCL'
    LAYOUT =
    NAME =
    SUFFIX1 =
    SUFFIX2 =
    COPIES =
    PRIO =
    IMMEDIATE_PRINT =
    AUTO_DELETE =
    TITLELINE =
    RECEIVER =
    DIVISION =
    AUTHORITY =
    POSNAME =
    ACTTIME =
    LIFETIME = '8'
    APPEND =
    COVERPAGE =
    CODEPAGE =
    DOCTYPE =
    IMPORTING
    handle = v_handle
    spoolid = gd_spool_nr
    rc = v_rc
    errmessage = v_errmessage.
    LOOP AT i_mara.
    v_text = i_mara-matnr.
    CALL FUNCTION 'RSPO_WRITE_SPOOLREQUEST'
    EXPORTING
    handle = v_handle
    text = v_text
    LENGTH =
    CODEPAGE =
    TRUNCATE =
    IMPORTING
    rc = v_rc
    errmessage = v_errmessage
    EXCEPTIONS
    handle_not_valid = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDLOOP.
    CALL FUNCTION 'RSPO_CLOSE_SPOOLREQUEST'
    EXPORTING
    handle = v_handle
    IMPORTING
    rc = v_rc
    errmessage = v_errmessage
    EXCEPTIONS
    handle_not_valid = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
    EXPORTING
    src_spoolid = gd_spool_nr
    no_dialog = c_no
    dst_device = c_device
    IMPORTING
    pdf_bytecount = gd_bytecount
    TABLES
    pdf = it_pdf_output
    EXCEPTIONS
    err_no_abap_spooljob = 1
    err_no_spooljob = 2
    err_no_permission = 3
    err_conv_not_possible = 4
    err_bad_destdevice = 5
    user_cancelled = 6
    err_spoolerror = 7
    err_temseerror = 8
    err_btcjob_open_failed = 9
    err_btcjob_submit_failed = 10
    err_btcjob_close_failed = 11
    OTHERS = 12.
    CHECK sy-subrc = 0.
    get the spool number
    Declaration of local variables.
    DATA:
    LV_RQ2NAME LIKE TSP01-RQ2NAME.
    CONCATENATE SY-REPID+0(8)
    SY-UNAME+0(3)
    INTO LV_RQ2NAME SEPARATED BY '_'.
    Get the spool number.
    SELECT * FROM TSP01 WHERE RQ2NAME = LV_RQ2NAME
    ORDER BY RQCRETIME DESCENDING.
    V_RQIDENT = TSP01-RQIDENT.
    EXIT.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    CLEAR V_RQIDENT.
    ENDIF
    Pablo
    Reward points if helful

  • Sending email with 3 excel attachments

    Hi,
    Is there a function that I can use to send 3 different excel attachments in an email?
    Points will be rewarded. Thanks.

    see the following sample code.
    DATA: P_EMAIL TYPE SOMLRECI1-RECEIVER.
    DATA: T_PACKING_LIST LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
    T_CONTENTS LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    T_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
    T_ATTACHMENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    T_OBJECT_HEADER LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    W_CNT TYPE I,
    W_SENT_ALL(1) TYPE C,
    W_DOC_DATA LIKE SODOCCHGI1,
    GD_ERROR TYPE SY-SUBRC,
    GD_RECIEVER TYPE SY-SUBRC.
    DATA: IT_ATTACH TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
    WITH HEADER LINE.
    DATA: IT_MESSAGE TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
    WITH HEADER LINE.
    **Sending mail to the receipients
      if not it_final[] is initial.
        PERFORM SUB_GET_MAIL_ADDR.
    Populate table with detaisl to be entered into .xls file
        PERFORM BUILD_XLS_DATA_TABLE.
        PERFORM POPULATE_EMAIL_MESSAGE_BODY.
    Send file by email as .xls speadsheet
        PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
        TABLES IT_MESSAGE
        IT_ATTACH
        USING P_EMAIL
        'Sales Register Report - Set Top Box / Accessories'
        'XLS'
        'SSTB'
        CHANGING GD_ERROR
        GD_RECIEVER.
    Instructs mail send program for SAPCONNECT to send email(rsconn01)
        PERFORM INITIATE_MAIL_EXECUTE_PROGRAM.
      endif.
    *&      Form  BUILD_XLS_DATA_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_XLS_DATA_TABLE .
      data: wa_itab like it_final.
      CONSTANTS:
      CON_TAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,
      CON_CRET TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.
      CONCATENATE 'Business Place' 'Region Code' 'Region' 'Branch Code'
                  'Branch' 'Material Desc' 'Area off Code'
                  'Area Name' 'Zone code' 'Zone Name' 'Cust No' 'Cust Name'
                  'Bill Doc No' 'Bill Date' 'Base Val' 'Total Val' 'Quantity'
      INTO IT_ATTACH SEPARATED BY CON_TAB.
      CONCATENATE CON_CRET IT_ATTACH INTO IT_ATTACH.
      APPEND IT_ATTACH.
      LOOP AT IT_FINAL INTO WA_ITAB.
        CONCATENATE   WA_ITAB-BUSINESS_PLACE
                  WA_ITAB-KVGR1
                  WA_ITAB-REGION
                  WA_ITAB-VKBUR
                  WA_ITAB-SALES_OFF
                  WA_ITAB-ARKTX
                  WA_ITAB-vkgrp
                  WA_ITAB-sales_grp
                  WA_ITAB-bzirk
                  WA_ITAB-zone
                  WA_ITAB-kunnr
                  WA_ITAB-name
                  WA_ITAB-vbeln
                  WA_ITAB-fkdat
                  WA_ITAB-base_value
                  WA_ITAB-total_value
                  WA_ITAB-fkimg
        INTO IT_ATTACH SEPARATED BY CON_TAB.
        CONCATENATE CON_CRET IT_ATTACH INTO IT_ATTACH.
        APPEND IT_ATTACH.
      ENDLOOP.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
          text
    -->  p1        text
    <--  p2        text
    FORM POPULATE_EMAIL_MESSAGE_BODY .
      REFRESH IT_MESSAGE.
      CONCATENATE SY-DATUM6(2) '/' SY-DATUM4(2) '/' SY-DATUM+0(4) INTO G_DATE.
      IT_MESSAGE = 'Please find attached excel sheet.'.
      APPEND IT_MESSAGE.
      IT_MESSAGE = 'Sales Register Report - Set Top Box / Accessories'.
      APPEND IT_MESSAGE.
      Concatenate 'Report generated date' ':' G_Date '.' into IT_MESSAGE.
      APPEND IT_MESSAGE.
      clear it_message.
      append it_message.
      IT_MESSAGE = 'This is an autogenerated mail, please do not reply'.
      APPEND IT_MESSAGE.
    ENDFORM.                    " POPULATE_EMAIL_MESSAGE_BODY
    *& Form SEND_FILE_AS_EMAIL_ATTACHMENT
    Send email
    FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES PIT_MESSAGE
    PIT_ATTACH
    USING P_EMAIL
    P_MTITLE
    P_FORMAT
    P_FILENAME
    P_ATTDESCRIPTION
    P_SENDER_ADDRESS
    P_SENDER_ADDRES_TYPE
    CHANGING P_ERROR
    P_RECIEVER.
      DATA: LD_ERROR TYPE SY-SUBRC,
      LD_RECIEVER TYPE SY-SUBRC,
      LD_MTITLE LIKE SODOCCHGI1-OBJ_DESCR,
      LD_EMAIL LIKE SOMLRECI1-RECEIVER,
      LD_FORMAT TYPE SO_OBJ_TP ,
      LD_ATTDESCRIPTION TYPE SO_OBJ_NAM ,
      LD_ATTFILENAME TYPE SO_OBJ_DES ,
      LD_SENDER_ADDRESS LIKE SOEXTRECI1-RECEIVER,
      LD_SENDER_ADDRESS_TYPE LIKE SOEXTRECI1-ADR_TYP,
      LD_RECEIVER LIKE SY-SUBRC.
      LD_EMAIL = P_EMAIL.
      LD_MTITLE = P_MTITLE.
      LD_FORMAT = P_FORMAT.
      LD_ATTDESCRIPTION = P_ATTDESCRIPTION.
      LD_ATTFILENAME = P_FILENAME.
      LD_SENDER_ADDRESS = P_SENDER_ADDRESS.
      LD_SENDER_ADDRESS_TYPE = P_SENDER_ADDRES_TYPE.
    Fill the document data.
      W_DOC_DATA-DOC_SIZE = 1.
    Populate the subject/generic message attributes
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE .
      W_DOC_DATA-SENSITIVTY = 'F'.
    Fill the document data and get size of attachment
      CLEAR W_DOC_DATA.
      READ TABLE IT_ATTACH INDEX W_CNT.
      W_DOC_DATA-DOC_SIZE =
      ( W_CNT - 1 ) * 255 + STRLEN( IT_ATTACH ).
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE.
      W_DOC_DATA-SENSITIVTY = 'F'.
      CLEAR T_ATTACHMENT.
      REFRESH T_ATTACHMENT.
      T_ATTACHMENT[] = PIT_ATTACH[].
    Describe the body of the message
      CLEAR T_PACKING_LIST.
      REFRESH T_PACKING_LIST.
      T_PACKING_LIST-TRANSF_BIN = SPACE.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM = 0.
      T_PACKING_LIST-BODY_START = 1.
      T_PACKING_LIST-OBJ_NAME = 'stb'.
      DESCRIBE TABLE IT_MESSAGE LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE = 'RAW'.
      APPEND T_PACKING_LIST.
    Create attachment notification
      T_PACKING_LIST-TRANSF_BIN = 'X'.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM = 1.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE T_ATTACHMENT LINES T_PACKING_LIST-BODY_NUM.
    T_PACKING_LIST-DOC_TYPE = LD_FORMAT.
      T_PACKING_LIST-DOC_TYPE = 'XLS'.
    T_PACKING_LIST-OBJ_DESCR = LD_ATTDESCRIPTION.
      T_PACKING_LIST-OBJ_DESCR = 'Sales_STB'.
    T_PACKING_LIST-OBJ_NAME = LD_ATTFILENAME.
      T_PACKING_LIST-OBJ_NAME = 'stb'.
      T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.
      APPEND T_PACKING_LIST.
    Add the recipients email address
      CLEAR T_RECEIVERS.
      REFRESH T_RECEIVERS.
      LOOP AT IT_RECV.
        T_RECEIVERS-RECEIVER = IT_RECV-EMAIL.
        T_RECEIVERS-REC_TYPE = 'U'.
       T_RECEIVERS-COM_TYPE = 'INT'.
    T_RECEIVERS-COPY = 'X'.
       T_RECEIVERS-NOTIF_DEL = 'X'.
       T_RECEIVERS-NOTIF_NDEL = 'X'.
        APPEND T_RECEIVERS.
      ENDLOOP.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA              = W_DOC_DATA
          PUT_IN_OUTBOX              = 'X'
          SENDER_ADDRESS             = LD_SENDER_ADDRESS
          SENDER_ADDRESS_TYPE        = LD_SENDER_ADDRESS_TYPE
          COMMIT_WORK                = 'X'
        IMPORTING
          SENT_TO_ALL                = W_SENT_ALL
        TABLES
          PACKING_LIST               = T_PACKING_LIST
          CONTENTS_BIN               = T_ATTACHMENT
          CONTENTS_TXT               = IT_MESSAGE
          RECEIVERS                  = T_RECEIVERS
        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.
    Populate zerror return code
      LD_ERROR = SY-SUBRC.
    Populate zreceiver return code
      LOOP AT T_RECEIVERS.
        LD_RECEIVER = T_RECEIVERS-RETRN_CODE.
      ENDLOOP.
    ENDFORM.                    "SEND_FILE_AS_EMAIL_ATTACHMENT
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
          text
    -->  p1        text
    <--  p2        text
    FORM INITIATE_MAIL_EXECUTE_PROGRAM .
      WAIT UP TO 2 SECONDS.
      SUBMIT RSCONN01 WITH MODE = 'INT'
      WITH OUTPUT = ''
      AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  SUB_GET_MAIL_ADDR
          text
    -->  p1        text
    <--  p2        text
    FORM SUB_GET_MAIL_ADDR .
      select * from ZSD_REP_MAIL INTO TABLE IT_RECV.
    ENDFORM.                    " SUB_GET_MAIL_ADDR

  • Sending email with an excel attachment

    Hi,
    I have designed one workflow for PO approval .For the release code 01 i am displaying the one custom report to the approver .
    Now the requirement is after release of the code 01 i have to download this custom  report into excel format and i have to send this excel sheet to the vendor email id through workflow .
    Please can any one give me how to achieve this functionality of downloading the report and sending this to vendor in background task.
    Regards
    Pavee

    You can make use of FM
    SO_NEW_DOCUMENT_ATT_SEND_API1
    For use of this FM try to search with this FM as keyword in ABAP Forum.
    Thanks
    Arghadip

  • Send email with column values before and after change with workflow

    I am trying to send an email to specified users when a column in a list changes in MOSS 2007 with workflow. I have a comments column in a list and whenever any user updates that comment, a mail should go to the creator and specific group stating what has
    changed.
    I saw a response which states to create 2 lists and keep them in sync and compare values of comments from the two lists. But that is not a perfect solution.
    Please help. Thanks in advance.

    Hi,
    If we want to compare a column with itself, we need the help of another column. We can create a column in the same list
    named Comment2 for example, and it’s the backup copy of
    comments.
    The workflow conditions can be set that if
    comments not equal Comment2, in Actions set send an email (we can get the previous value in
    Comment2 and new value in comments), and then update the
    Comment2 to comments.
    Thanks,
    Emir

  • ODI send email with latest error file attachment

    We have kick-out/error file with the format *err.txt. Whenever error occurs the same gets overwritten by the latest file. We are attaching this error file on the completion of the job. If error file generates, everything is fine. But, on the successful run, I mean when there are no error file generation, it attaches the previous run error file.
    Anyone of you help me how to handle this situation. Is there any way to validate the file generation date before attaching the file.
    Thanks in advance
    Edited by: user12958295 on Oct 30, 2012 7:42 AM

    Hi,
    Thanks for the response.
    As of now we are following that as a workaround. However our client wants to avoid the manual work of delete/move/renaming the error file.
    Is it possible to check the file generated date with sysdate for attaching the error file by odisendmail.
    Thanks!
    BRM

  • Send email with excel attachment in outlook structure - SAP 6.0

    Hello experts..
    I need send a email with a excel attachment and use the signature in outlook to send.
    The attachment will be create in the process of send email program.
    Is it possible?
    How can I created and attach in the same process?
    How can I use the outlook strutucture to send a email?

    I  resolved my own problem using the BCS_EXAMPLE_7 program as sample.

  • Problems sending emails with iPhone 3G and outlook exchange

    I have a problem sending email with exchange. Receiving and answering mail works fine and calender updates work fine. However when I initiate an email from the phone it syncs and ends up in the sent folder in the computer but never reaches the recipient. I have tried this many times with different recipients and phones. It only happens from my iphone and ipad. Any suggestions?
    Any help much appreciated

    The iPhone you returned is still syncing against your server and locking out your account. Someone possibly has access to your mail data. I'd recommend having your Exchange Administrator install the Microsoft Exchange Server ActiveSync Web Administration Tool (http://www.microsoft.com/downloads/details.aspx?FamilyID=E6851D23-D145-4DBF-A2CC -E0B4C6301453&displaylang=en) and attempt to wipe/delete/block that other iPhone.
    Message was edited by: ethanm

  • Need Help for Sending Email with LabWindows 8.5 or 9

    Hi,
    I'm trying to send an email with attach excel files to it using InetSendMail function and outlook activeX and always having no success on it.
    I am still a student so i dont have much time for researching these functions, so im asking for an example working code for this problem.
    Thanks for your the help in advance...
    I've also tried changing the examples from the package
    Solved!
    Go to Solution.

    Hi,
    You can use LaunchExecutableEx to determine the window state:
    LaunchExecutableEx ("command.com /C calc.exe", LE_HIDE, NULL);
    Beware that this function does not wait for the started executable to exit.
    It executes the command in the string and continues.
    If your application has to get the results of the call, then you need to get the application handle  (3rd parameter, put a variable instead of the NULL above) and call ExecutableHasTerminated in a loop to find out if the execution finished.
    Read carefully the help for the LaunchExecutableEx function and Handle parameter.
    To get the result of the command line call, you can add a "> output.txt" parameter to the end of your command line call.
    This way all the text output of the command is written to the output.txt file, from which you can read the result.
    Check the command-line email sender program's help if there is a special paramter to make it more "verbose".
    Hope this helps, 
    S. Eren BALCI
    www.aselsan.com.tr

  • Send email with PDF attachements (Smartform/SAP script)

    Hello All,
    I have 3 existing programs A, B & C whose output is in SAP Script/Smartform. Now I need to create new program D which needs to execute program A, B & C and then convert their smartform/SAP script output into PDF format and send email with attachements (PDF files). Any pointers how I can proceed. Thanks a lot.

    hi Sarita,
      v_ctrlparams-no_dialog = 'X'.
      v_ctrlparams-getotf = 'X'.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname = 'Smartform name'
        IMPORTING
          fm_name  = v_func_mod.
      CALL FUNCTION v_func_mod
        EXPORTING
          control_parameters = v_ctrlparams
        IMPORTING
          job_output_info    = v_joboutput
        TABLES
          t_nonsigner        = t_nonsigner.
    fill the document
      doc_chng-obj_name = 'Descriptoipn'.
    Fill the subject line
    doc_chng-obj_descr = 'Manpowe'.
      doc_chng-obj_descr = 'Reminder .
      doc_chng-sensitivty = 'P'.
    Fill the content of the mail
      objcont = 'Dear all,'.
      APPEND objcont.
      CLEAR objcont.
      APPEND objcont.
      CLEAR objcont.
      objcont =
    'The manpower sign-off is pending for the list of employees as per th' &
    'e attached sheet.'
      APPEND objcont.
      CLEAR objcont.
      APPEND objcont.
      CLEAR objcont.
      objcont =
      'Please click on the following link for the manpower sign-off:'.
      APPEND objcont.
      CLEAR objcont.
      APPEND objcont.
      CLEAR objcont.
      DESCRIBE TABLE objcont LINES entries.
      READ TABLE objcont INDEX entries.
      doc_chng-doc_size = ( entries - 1 ) * 255 + STRLEN( objcont ).
    Creating the entry for the compressed document
      CLEAR objpack-transf_bin.
      objpack-head_start = 1.
      objpack-head_num   = 0.
      objpack-body_start = 1.
      objpack-body_num   = entries.
      objpack-doc_type   = 'RAW'.
      APPEND objpack.
    Creating the document attachment
    (Assume the data in OBJBIN are given in BMP format)
      LOOP AT v_joboutput-otfdata INTO wa_otfdata.
        APPEND wa_otfdata TO objbin.
        CLEAR wa_otfdata.
      ENDLOOP.
      DESCRIBE TABLE objbin LINES tab_lines.
      objhead = 'NonSignerDetails.otf'. APPEND objhead.
    Creating the entry for the compressed attachment
      objpack-transf_bin = 'X'.
      objpack-head_start = 1.
      objpack-head_num   = 1.
      objpack-body_start = 1.
      objpack-body_num   = tab_lines.
      objpack-doc_type   = 'OTF'.
      objpack-obj_name   = 'ATTACHMENT'.
      objpack-obj_descr = 'NonSignerDetails'.
      objpack-doc_size   = tab_lines * 255.
      APPEND objpack.
    Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = doc_chng
          put_in_outbox              = 'X'
          commit_work                = 'X'
        TABLES
          packing_list               = objpack
          object_header              = objhead
          contents_bin               = objbin
          contents_txt               = objcont
          receivers                  = reclist
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
    hope this will help u..
    regards,
    Santosh Thorat

  • Sending emails with both body and attachment to multiple recipients

    I have a requirement to send email with body and attachment to multiple recipients.
    Body of the email is a standard text. It is a proxy-to-mail scenario.
    Here is what I've done: (I'm using PI 7.11)
    One mapping from Source to Target structure (format of the attachment text file)
    Second mapping from Target Structure to Mail Package format.
    In the second mapping I'm concatenating the output of first step into "Content" of the Mail Package.
    "XIPAYLOAD" is the message protocol used.
    The "Keep attachments" option in the Mail adapter allows only to send "Content" as attachment or as body of the email.
    How to send an email with both content and text?
    The other problem is even with using ASMA, I can't send email to multiple recipients. I can only do CC and TO for 1 person each - a total of 2. Although I can resolve this by creating mailing lists, it is better if this can be addressed in PI.
    Thanks for any input you can provide!
    Edited by: crazylad on Jan 18, 2012 3:39 PM

    Thank you for your response Mikael.
    For the first question, I was able to find the solution in the following blog:
    XI Mail Adapter : Dynamically building attachment and message body content using a simple UDF
    (I just needed to search with the right set of key words )
    The key is to set the "Content Encoding" as "None" in the mail adapter. If this is not done, the mail will be sent with an attachment - untitled.bin containing both the mail body and the attachment text. Also, don't forget to check the "Keep Attachments" checkbox in the mail adapter.
    Multiple recipients could be added by separating the email IDs with a Comma. I have used ASMA to set the recipients.

  • Sending email with excel file as an attachment

    Hi,
    In my procedure I am creating one excel file and keeping that excel file in one location as specified in UTL_FILE_DIR.Now my requirement is to pick that excel file from that path and send it as an attachment through an Email.
    Can anyone please give me the code to do that and what are the required set up to be done before sending the mail.
    Please help me in this regard. This is an urgent requirement.
    Thanks
    Subhabrata

    Hi,
    Please refer the following link:
    http://www.dbasupport.com/oracle/ora10g/10g_PLSQL02.shtml
    There is para headed Sending E-Mail and Attachments with UTL_MAIL will clarify all your doubts. Link Listing 2.6
    is good example.
    If you get stuck while coding, get back to us.
    Twinkle

  • I have Windows 7, Microsoft Outlook and PSE 13. I have used the "Share photos as embedded images" feature frequently, but today when I went to use it, it wasn't there, only the option to send email with files attached. How do I get back the ability to sen

    I have Windows 7, Microsoft Outlook and PSE 13. I have used the "Share photos as embedded images" feature frequently, but today when I went to use it, it wasn't there, only the option to send email with files attached. How do I get back the ability to send emails with photos embedded. I like adding the frames and backgrounds and I think it's easier for recipients to look at the photos. Thanks for any suggestions of things to try.
    Gail

    I had a similar problem in that my wife's iphone 5 could not send pics with imessage.  Had to set the settings to default to SMS or whatever.  After laboring many hours on the web I coincidentally was on the phone with the internet people to question my internet speed.  They changed the router channel, which is something that I am capable of doing myself.  After that, the pics go over imessage.  My own Iphone didn't have the problem.  We are both latest IOS 7.0.6.

Maybe you are looking for

  • Drag and Drop Learning Interaction without Overlapping

    I would like to be able to drag and drop into a column without dragged items overlapping for a quiz question. I don't know Action Script and am using CS3. What do I need to do to get this to work. Component Inspector states Drag1 = Target 1, etc. I n

  • Rotate Smartform

    Hello Exoerts, I am printing a Smartform in Landscape format. When I take the print from a printer; the smartform rotate in anticlockwise direction if i compare it with a print in portrate format. I want the Smartform to rotate in clockwise direction

  • PLL exception not propagating to form.

    Hello all, I am working in form 10g with database 9i. I am calling one Pll procedure from one trigger and handling the exception in the trigger outblock. But the trigger is not handling in the pll ORA-06502, Numeric or Value error. It is poping up th

  • Itunes 7.3 upgrade

    I have followed install and uninstall many times-however when I click on Itunes icon - nothing happens. Hourglass appears for few seconds then nothing. When I go to shut down pc, Task Manager says itunes.exe is running! This happend when I went to in

  • RV320 and Shrew Soft vpn client - cannot get it to connect

    Hi, I have been trying to configure Shrew vpn client 2.2.2 to connect to the RV320 but i cant even get phase1 to work. I would be very grateful is someone has managed this and could post the configuration (tunnel, groupvpn or easyvpn). I use: RV320 w