Max no. of files as attachment in mail

Hi,
Can you please let me know how many maximum number of files we can send as an attachment through FM
SO_DOCUMENT_SEND_API1.
If there are multiple files as an attachment, can we zip it and send it as attachment.
Please provide sample code if you have.

its possible in CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
for example :
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
           DOCUMENT_DATA                    = GS_DOCDATA
          PUT_IN_OUTBOX                    = 'X'
          COMMIT_WORK                      = 'X'
     TABLES
           PACKING_LIST                     = GT_OBJPACK                   
       OBJECT_HEADER                        = OBJHEAD
        CONTENTS_BIN                     = OBJBIN_FINAL
          CONTENTS_TXT                     = I_OBJTXT
           RECEIVERS                        = GT_RECLISTEXCEPTIONS
          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
in GT_OBJPACK you can pass multiple file with extension like :
     GS_OBJPACK-DOC_TYPE = 'ZIP'.
     GS_OBJPACK-OBJ_NAME = 'FILE'.
     GS_OBJPACK-OBJ_DESCR = 'FILE_1'.
     GS_OBJPACK-DOC_SIZE =  GV_DESC_LINES  * 255 .
     APPEND GS_OBJPACK TO GT_OBJPACK.

Similar Messages

  • Sending File as attachment using Mail adapter with naming convention

    Dear All,
    I am working on a scenario in which my sender file adapter is sending one file named 'ABC.ok' in one of the folders in application server. I have to send the same file with the same name  to one of the folders at FTP and also to my customer at his email id.
    I have used File Content onversion at the receiver side and has selected adapter specific attributes due to which the required file is getting generated at FTP folder with the same name as that of the source. But how to send the same file using the mail adapter by keeping same name as "ABC.ok". Kindly guide me out in this.
    Regards,
    NJ

    what you need to do:
    1) Select ASMA in Sender and receiver File CC...already done
    2) Using the Dynamic Config UDF get the sender file name in the field Content-Type...for this you need to have a return statement in your UDF
    3) now before pushing this file name to the Content-Type you have to append (concat)the actual type of the file content (xml, txt)
    so your entire Content-Type node will have something like text/plain; name="abc.ok"
    SAP Note has reference on how to do this:
    https://service.sap.com/sap/support/notes/856599
    From the note:
    Q: How can I set the file name of a mail attachment?
    Regards,
    Abhishek.

  • Send XML File as attachement in Mail Receiver adapter

    Hi all,
    i have the following scenario. i would like to read an XML file from the file system and send this file as an attachement of a mail to a mail receiver specified in this file.
    i would like to fill the payload of the mail with some information from the xml file and in addition i would like to send the complete xml file as an mail attachement.
    can anybody tell me, how the mail receiver adater needs to be specified ?
    best regards,
    martin

    Hey,
    you can go for dynamic configuration of mail adapter.
    In this you need to import a mail structure.
    mail details such as to, from, subject and content of the mail are a part of the structure.
    In your ID check the Use Mail package and also keep attachments.
    Now you can give your details in mapping itself.
    whatever you want to map in the content of the mail, map it in the content field.
    also your file will behave as an attachment.
    refer to this blog.
    this is the mail structure. Import it as extenal definitions.
    <?xml version="1.0" encoding="utf-8" ?>
    <!--
    SAP takes no position regarding the validity or scope of any intellectual property or
    other rights that might be claimed to pertain to the implementation or use of the
    technology described in this document or the extent to which any license under such
    rights might or might not be available; neither does it represent that it has made any
    effort to identify any such rights.
    Copyright © SAP 2003-2004. All Rights Reserved.
    This document and translations of it may be copied and furnished to others, and derivative
    works that comment on or otherwise explain it or assist in its implementation may be
    prepared, copied, published and distributed, in whole or in part, without restriction of
    any kind, provided that the above copyright notice and this paragraph are included on all
    such copies and derivative works. However, this document itself does not be modified in
    any way, such as by removing the copyright notice or references to SAP.
    This document and the information contained herein is provided on an u201CAS ISu201D
    basis and SAP DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
    ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY
    IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
    -->
    <xs:schema targetNamespace="http://sap.com/xi/XI/Mail/30"
      xmlns:xi="http://sap.com/xi/XI/Mail/30"
      xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!--
    Mail
      -->
      <xs:element name="Mail">
        <xs:annotation>
          <xs:documentation>Mail package for XI - Mail Adapter</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Subject" type="xs:string" minOccurs="0"/>
            <xs:element name="From" type="xs:string" minOccurs="0"/>
            <xs:element name="To" type="xs:string" minOccurs="0"/>
            <xs:element name="Reply_To" type="xs:string" minOccurs="0"/>
            <xs:element name="Content_Type" type="xs:string" minOccurs="0"/>
            <xs:element name="Date" type="xs:dateTime" minOccurs="0"/>
            <xs:element name="Message_ID" type="xs:string" minOccurs="0"/>
            <xs:element name="X_Mailer" type="xs:string" minOccurs="0"/>
            <xs:element name="Content" minOccurs="0">
              <xs:annotation>
                <xs:documentation>any type</xs:documentation>
              </xs:annotation>
            </xs:element>
          </xs:sequence>
          <xs:attribute name="encoding" type="xs:string"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="MailReceipt">
        <xs:annotation>
          <xs:documentation>Mail Receipt for XI - Mail Adaper</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Server" type="xs:string"/>
            <xs:element name="Format" type="xs:string"/>
            <xs:element name="UseMailPackage" type="xs:boolean"/>
            <xs:element name="Encoding" type="xs:string"/>
            <xs:element name="Subject" type="xs:string" minOccurs="0"/>
            <xs:element name="From" type="xs:dateTime" minOccurs="0"/>
            <xs:element name="To" type="xs:string" minOccurs="0"/>
            <xs:element name="Date" type="xs:dateTime" minOccurs="0"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
    regards,
    milan

  • Dynamic File Name attachment in Mail Adpater

    Hi All,
    We have Requirement where we need attach file with Dynamic Names in mail adapter PI7.0 .Right now we are using some of the modules to genarate file attachement with hard coded value for name of the file.
    Java beans we are using are
    localejbs/AF_Modules/StrictXml2PlainBean
    localejbs/AF_Modules/MessageTransformBean
    localejbs/AF_Modules/TextCodepageConversionBean
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
    Please let us know how we can acheive this.
    Thanks,
    Madhu

    Hi Madhusudhan,
    File attachment with the dynamic name is possible by using the Adapter module as well as without the Adpater module through coding.
    let me know which kind of attachment you want in mail and which is your sending system (like SAP R/3)?
    Thanks & Regards
    Jagesh

  • How to send other language data into excel file in attachment thru mail

    Hi - ,
    I have to send other language data (russian) into excel file and send as an attachment through e-mail.
    I had used F.M SO_NEW_DOCUMENT_ATT_SEND_API1 to send email.
    In internal table , it is in correct format, but when using SO_NEW_DOCUMENT_ATT_SEND_API1, the excel file sent has junk characters in it.
    Can u please help me on this?
    Thanks,
    Gyanaraj

    Hi ,
    Can anyone help me on this.
    Thanks,
    Gyanaraj

  • Excel file as attachment in mail

    Hi Friends,
    I have a requirement of sending th Excel sheet through email attachment.
    I am getting the records into the internal table,but after sending the Email and receiving it the first line in the excel sheet is a blank line.
    Can you please provide me a solution with source code.

    Hi Pooja,
    check thios code...hope it helps
    *& Report ZWBSAP_EMAIL *
    *Send an email via SAP Workplace
    *Select files from SAP server
    *Note:
    Uses custom table zlookup to pick up a group of email addresses to send to
    if more than one is needed.
    Please note some hard coding.
    REPORT zsap_email MESSAGE-ID z001.
    TABLES: rlgrap, btcxpm, zlookup.
    DATA:
    v_zcode(3) TYPE c,
    svrname LIKE zlookup-zdesc,
    wa_error(80) TYPE c,
    global_filemask_all(80).
    DATA: t_soud LIKE soud.
    DATA: p_infolder LIKE sofdk.
    DATA: p_outfolder LIKE sofdk.
    DATA: object_hd_display LIKE sood2.
    DATA: object_id LIKE soodk.
    DATA: document LIKE sood4.
    DATA: header_data LIKE sood2.
    DATA: link_folder_id LIKE soodk.
    DATA: folder_selections LIKE sofds.
    DATA: folder_list LIKE soxli OCCURS 0 WITH HEADER LINE.
    DATA: receivers LIKE soos1 OCCURS 0 WITH HEADER LINE.
    DATA: objcont LIKE soli OCCURS 0 WITH HEADER LINE.
    DATA: objhead LIKE soli OCCURS 0 WITH HEADER LINE.
    DATA: object_content LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    DATA: object_hd_change LIKE sood1.
    DATA: BEGIN OF files OCCURS 0,
    line(200) TYPE c,
    END OF files.
    DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
    *Email to addresses
    SELECTION-SCREEN: BEGIN OF BLOCK bl1 WITH FRAME TITLE text-bl1.
    PARAMETERS: p_mailto(240) TYPE c.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN COMMENT 10(2) text-001.
    *Use zlookup-ztype as group to define multiple email to addresses
    SELECT-OPTIONS: s_mailto FOR zlookup-ztype.
    SELECTION-SCREEN: END OF BLOCK bl1.
    *Subject
    SELECTION-SCREEN: BEGIN OF BLOCK bl2 WITH FRAME TITLE text-bl2.
    PARAMETERS: p_subj LIKE document-objdes.
    SELECTION-SCREEN: END OF BLOCK bl2.
    *Body
    SELECTION-SCREEN: BEGIN OF BLOCK bl3 WITH FRAME TITLE text-bl3.
    PARAMETERS: p_body1 LIKE solisti1-line LOWER CASE.
    PARAMETERS: p_body2 LIKE solisti1-line LOWER CASE.
    PARAMETERS: p_body3 LIKE solisti1-line LOWER CASE.
    PARAMETERS: p_body4 LIKE solisti1-line LOWER CASE.
    PARAMETERS: p_body5 LIKE solisti1-line LOWER CASE.
    PARAMETERS: p_body6 LIKE solisti1-line LOWER CASE.
    SELECTION-SCREEN: END OF BLOCK bl3.
    *Attachments
    SELECTION-SCREEN: BEGIN OF BLOCK bl4 WITH FRAME TITLE text-bl4.
    PARAMETERS: p_fname1 LIKE files-line.
    PARAMETERS: p_fname2 LIKE files-line.
    PARAMETERS: p_fname3 LIKE files-line.
    PARAMETERS: p_fname4 LIKE files-line.
    PARAMETERS: p_fname5 LIKE files-line.
    PARAMETERS: p_fname6 LIKE files-line.
    SELECTION-SCREEN: END OF BLOCK bl4.
    AT SELECTION-SCREEN.
    PERFORM chk_selection.
    IF NOT wa_error IS INITIAL.
    MESSAGE e001 WITH wa_error.
    ENDIF.
    START-OF-SELECTION.
    END-OF-SELECTION.
    PERFORM send_email.
    FORM chk_selection *
    FORM chk_selection.
    CLEAR wa_error.
    *Loop only once ???
    *If more checkings to be done.
    *Think about it and if not clear.
    *Let it sink in for a couple of minutes.
    *Still doesn't make sence? Go home and sleep on it.
    DO 1 TIMES.
    *Check Email to
    IF p_mailto IS INITIAL
    AND s_mailto IS INITIAL.
    wa_error = 'Invalid or no EMAIL TO selection'.
    EXIT.
    ENDIF.
    ENDDO.
    ENDFORM.
    *& Form send_email
    text
    --> p1 text
    <-- p2 text
    FORM send_email.
    PERFORM get_folder_info.
    PERFORM fill_body.
    PERFORM ins_new_object.
    PERFORM crt_attachments.
    PERFORM fill_receivers_info.
    PERFORM snd_email.
    ENDFORM. " send_email
    FORM Get_folder_info *
    FORM get_folder_info.
    CLEAR t_soud.
    *Small so should be quick.
    SELECT * FROM soud
    INTO t_soud
    WHERE sapnam = sy-uname.
    p_infolder-foltp = 'FOL'.
    p_infolder-folyr = t_soud-inbyr. "inbox
    p_infolder-folno = t_soud-inbno.
    p_outfolder-foltp = 'FOL'.
    p_outfolder-folyr = t_soud-outyr. "outbox
    p_outfolder-folno = t_soud-outno.
    ENDSELECT.
    ENDFORM.
    FORM fill_body *
    FORM fill_body.
    object_content-line = p_body1.
    APPEND object_content.
    object_content-line = p_body2.
    APPEND object_content.
    object_content-line = p_body3.
    APPEND object_content.
    object_content-line = p_body4.
    APPEND object_content.
    object_content-line = p_body5.
    APPEND object_content.
    object_content-line = p_body6.
    APPEND object_content.
    ENDFORM.
    FORM ins_new_object *
    FORM ins_new_object.
    object_hd_change-objnam = 'Notes'.
    object_hd_change-objdes = p_subj.
    CALL FUNCTION 'SO_OBJECT_INSERT'
    EXPORTING
    folder_id = p_outfolder
    object_hd_change = object_hd_change
    object_type = 'RAW'
    owner = sy-uname
    IMPORTING
    object_hd_display = object_hd_display
    object_id = object_id
    TABLES
    objcont = object_content
    objhead = objhead
    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 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM.
    FORM crt_attachments *
    --> P_SUBJ *
    FORM crt_attachments.
    document-foltp = p_outfolder-foltp.
    document-folyr = p_outfolder-folyr.
    document-folno = p_outfolder-folno.
    document-objtp = object_id-objtp.
    document-objyr = object_id-objyr.
    document-objno = object_id-objno.
    document-objnam = 'Notes'.
    document-objdes = p_subj.
    document-okcode = 'CHNG'.
    document-file_ext = 'TXT'.
    link_folder_id = object_id.
    header_data-objla = 'EN'.
    header_data-objnam = document-objnam.
    header_data-objdes = document-objdes.
    header_data-objpri = '5'.
    header_data-objsns = 'O'.
    header_data-file_ext = 'TXT'.
    REFRESH files.
    CLEAR files.
    IF NOT p_fname1 IS INITIAL.
    files-line = p_fname1.
    APPEND files.
    ENDIF.
    IF NOT p_fname2 IS INITIAL.
    files-line = p_fname2.
    APPEND files.
    ENDIF.
    IF NOT p_fname3 IS INITIAL.
    files-line = p_fname3.
    APPEND files.
    ENDIF.
    IF NOT p_fname4 IS INITIAL.
    files-line = p_fname4.
    APPEND files.
    ENDIF.
    IF NOT p_fname5 IS INITIAL.
    files-line = p_fname5.
    APPEND files.
    ENDIF.
    IF NOT p_fname6 IS INITIAL.
    files-line = p_fname6.
    APPEND files.
    ENDIF.
    IF NOT files[] IS INITIAL.
    CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
    EXPORTING
    method = 'ATTCREATEFROMPC'
    TABLES
    files = files
    CHANGING
    document = document
    header_data = header_data.
    IF sy-subrc = 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDIF.
    ENDFORM.
    FORM fill_receivers_info *
    FORM fill_receivers_info.
    DATA: BEGIN OF reclist OCCURS 0,
    rec LIKE receivers-recextnam,
    END OF reclist.
    *Build reclist
    REFRESH reclist.
    IF NOT p_mailto IS INITIAL.
    reclist-rec = p_mailto.
    APPEND reclist.
    ENDIF.
    IF NOT s_mailto IS INITIAL.
    SELECT zdesc
    INTO reclist-rec
    FROM zlookup
    WHERE ztype IN s_mailto.
    APPEND reclist.
    ENDSELECT.
    ENDIF.
    REFRESH receivers.
    LOOP AT reclist.
    folder_selections-folnam = 'INBOX'.
    CALL FUNCTION 'SO_FOLDER_LIST_READ'
    EXPORTING
    folder_selections = folder_selections
    owner = sy-uname
    region = 'P'
    TABLES
    folder_list = folder_list
    EXCEPTIONS
    component_not_available = 1
    operation_no_authorization = 2
    owner_not_exist = 3
    parameter_error = 4
    x_error = 5
    OTHERS = 6.
    IF sy-subrc = 0.
    CLEAR receivers.
    receivers-rcdat = sy-datum.
    receivers-rctim = sy-uzeit.
    receivers-recnam = reclist-rec.
    receivers-recno = folder_list-parno.
    receivers-rectp = folder_list-partp.
    receivers-recyr = folder_list-paryr.
    receivers-sndtp = folder_list-partp.
    receivers-sndyr = folder_list-paryr.
    receivers-sndno = folder_list-parno.
    receivers-sndnam = sy-uname.
    receivers-sndpri = '1'.
    receivers-msgid = 'SO'.
    receivers-msgno = '619'.
    receivers-deliver = 'X'.
    receivers-not_deli = 'X'.
    receivers-read = 'X'.
    receivers-mailstatus = 'E'.
    *receivers-ADR_NAME
    receivers-resend = ' '.
    receivers-sortfield = ' '. "'USER WF_BATCH INDIGO BATCH'.
    receivers-sortclass = '5'.
    APPEND receivers.
    ELSE.
    CLEAR receivers.
    receivers-sel = 'X'.
    receivers-recesc = 'U'.
    receivers-recnam = 'U-'.
    receivers-recextnam = reclist-rec.
    receivers-deliver = 'X'.
    receivers-not_deli = 'X'.
    receivers-read = 'X'.
    receivers-mailstatus = 'E'.
    receivers-adr_name = reclist-rec.
    receivers-sortfield = reclist-rec.
    receivers-sortclass = '5'.
    APPEND receivers.
    ENDIF.
    ENDLOOP.
    ENDFORM.
    FORM snd_email *
    FORM snd_email.
    CALL FUNCTION 'SO_OBJECT_SEND'
    EXPORTING
    folder_id = p_outfolder
    object_id = object_id
    outbox_flag = 'X'
    owner = sy-uname
    check_send_authority = 'X'
    originator_type = 'J'
    link_folder_id = link_folder_id
    TABLES
    objcont = object_content
    receivers = receivers
    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
    originator_not_exist = 20
    x_error = 21
    OTHERS = 22.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM.
    Thanks
    Nayan

  • File With Attachment to Mail with Attachment

    I'm developing above scenario. I want to retain the name of the attachment. Is it possible to do with UDF ?. Attachment is in csv format and Main file may be txt format.

    Use MessageTransformBean module in adapter configuration to achieve this.
    Enter "localejbs/AF_Modules/MessageTransformBean" as the module. Select the Type "Local Enterprise Bean" and select a value for Module Key. Use this module key to create the following three lines in Module Configuration:
    Transform.ContentDisposition attachment;filename="myfilename.csv"
    Transform.ContentDescription myfilename.csv
    Transform.ContentType application/xls;name="myfilename.csv"
    Regards,
    TK

  • Send file as attachment via mail

    Dear All,
    I want to send a report (ALV) as attachment to some mail. I am using SO_NEW_DOCUMENT_SEND_API1. Can you please suggest how can I send mail as attachment. I am able to send ALV report as HTML format. I want to send it as attachment.
    Thanks and regards,
    Atanu

    Hi,
    plz check the below code.
    it sends Excel sheet attachment with the mail using FM 'SO_DOCUMENT_SEND_API1'
    code>>>>>>>>>>>>>>>>>>>>.
    form send_email_with_attachment .
    DATA: l_t_objbin LIKE solisti1 OCCURS 100 WITH HEADER LINE.
      DATA: i_body TYPE soli_tab WITH HEADER LINE.
      DATA: l_t_objtxt  LIKE solisti1   OCCURS 100 WITH HEADER LINE.
      DATA: l_t_objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
      DATA: l_t_objhead LIKE solisti1   OCCURS 1 WITH HEADER LINE.
      DATA: l_t_reclist LIKE somlreci1  OCCURS 5 WITH HEADER LINE.
      DATA: w_tabln TYPE i .              "for number of table lines
      DATA: w_line        TYPE so_text255.       " Line of text
      DATA: l_doc_chng  LIKE sodocchgi1.
      DATA: l_tab_lines LIKE sy-tabix.
      DATA: l_att_lines TYPE i.
      DATA: lv_lines  TYPE i.
      DATA : BEGIN OF wa_mrpnm,
               werks TYPE ZCSVT024D-werks,
               dispo TYPE ZCSVT024D-dispo,
               name_first TYPE ZCSVT024D-name_first,
               name_last  TYPE ZCSVT024D-name_last,
             END OF wa_mrpnm,
             l_i_mrpnm LIKE STANDARD TABLE OF wa_mrpnm.
      DATA : l_name TYPE string.
    *Used for delimiting the columns in Excel Sheet.
      CLASS cl_abap_char_utilities DEFINITION LOAD.
      CONSTANTS:
      cr_mark(2) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
      constants c_l_newline type ABAP_CHAR1 value %_NEWLINE. "#EC NOTEXT
      CLEAR : l_t_objpack,
      l_t_objhead,
      l_t_objbin,
      l_t_objtxt,
      l_t_reclist.
      REFRESH: l_t_objpack,
      l_t_objhead,
      l_t_objbin,
      l_t_objtxt,
      l_t_reclist.
    Creating the content of the e-mail message text
      IF sy-sysid(1) = 'P'.
        IF p_order = 'X'.
         l_doc_chng-obj_name   = 'Subcontracting Setup Report'(m02).
          CONCATENATE 'Details of Orders Extract'(028) 'for Plant'(029)
                       p_werks
                       INTO l_doc_chng-obj_descr SEPARATED BY space.
          l_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( l_t_objtxt ).
        ELSE.
         l_doc_chng-obj_name   = 'TEST ONLY!! SC Setup Report'(m03).
          CONCATENATE 'Details of Forecast Extract'(030) 'for Plant'(029)
                       p_werks
                       INTO l_doc_chng-obj_descr SEPARATED BY space.
          l_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( l_t_objtxt ).
        ENDIF.
      ELSE.
        IF p_order = 'X'.
         l_doc_chng-obj_name   = 'Subcontracting Setup Report'(m02).
          CONCATENATE 'Details of Orders Extract'(028) 'for Plant'(029)
                       p_werks 'TEST TEST TEST'
                       INTO l_doc_chng-obj_descr SEPARATED BY space.
          l_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( l_t_objtxt ).
        ELSE.
         l_doc_chng-obj_name   = 'TEST ONLY!! SC Setup Report'(m03).
          CONCATENATE 'Details of Forecast Extract'(030) 'for Plant'(029)
                       p_werks 'TEST TEST TEST'
                       INTO l_doc_chng-obj_descr SEPARATED BY space.
          l_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( l_t_objtxt ).
        ENDIF.
      ENDIF.
      l_t_objtxt = 'Hi,'(036).
      APPEND l_t_objtxt.
      CLEAR l_t_objtxt.
      APPEND l_t_objtxt.
      CONCATENATE 'Please open the attachment to review details of the Report'(031)
                  'for plant'(029) p_werks INTO l_t_objtxt
                   SEPARATED BY space.
      APPEND l_t_objtxt.
      CLEAR l_t_objtxt.
      APPEND l_t_objtxt.
      DESCRIBE TABLE t_ddow LINES sy-tfill .
      IF sy-tfill GT 0 .
        MOVE 'These Materials have been marked as DDOW materials.'(032)
                TO l_t_objtxt.
        APPEND l_t_objtxt.
        CLEAR l_t_objtxt.
        APPEND l_t_objtxt.
        APPEND l_t_objtxt.
        APPEND l_t_objtxt.
        CONCATENATE 'Note! - This is an automatically generated email by the'(034)
                         'SAP system. Pls do not reply to the sender.'(035)
                   INTO  l_t_objtxt
                   SEPARATED BY space.
        APPEND l_t_objtxt.
        DESCRIBE TABLE l_t_objtxt LINES l_tab_lines.
        READ TABLE l_t_objtxt INDEX l_tab_lines.
       l_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( l_t_objtxt )
      Creating the entry for the email text in the packing list
        CLEAR l_t_objpack-transf_bin.
        l_t_objpack-head_start = 1.
        l_t_objpack-head_num = 1.
        l_t_objpack-body_start = 1.
        l_t_objpack-body_num = l_tab_lines.
        l_t_objpack-doc_type = 'RAW'.
        lv_lines = l_tab_lines.
        APPEND l_t_objpack.
    Columns Heading for Excel Attachment.
        CONCATENATE  'MRP Controller'(044)
                     'MRP Name'(047)
                     'Material'(037)
                     'Plant'(026)
                     'PP Cal'(038)
                     'Ship Date'(009)
                     'PO Number'(014)
                     'PO Line'(033)
                     'PP Text'(041)
             INTO i_body
            SEPARATED BY cr_mark.
        concatenate ' ' i_body into i_body separated by c_l_newline.
        APPEND i_body TO l_t_objtxt.
        CLEAR i_body.
      Get MRP Names
        SELECT werks dispo name_first name_last
          FROM ZCSVT024D
          INTO TABLE l_i_mrpnm
          FOR ALL ENTRIES IN t_ddow
          WHERE werks = t_ddow-werks
            AND dispo = t_ddow-dispo.
        IF sy-subrc = 0.
          SORT l_i_mrpnm by werks dispo.
        ENDIF.
    Data to be shown in Excel Sheet.
        LOOP AT t_ddow INTO w_ddow.
          CLEAR : l_name.
          READ TABLE l_i_mrpnm INTO wa_mrpnm WITH KEY werks = w_ddow-werks
                                                      dispo = w_ddow-dispo
                                                      BINARY SEARCH.
          IF sy-subrc = 0.
            CONCATENATE wa_mrpnm-name_first wa_mrpnm-name_last
              INTO l_name SEPARATED BY space.
          ENDIF.
          CONCATENATE  w_ddow-dispo
                       l_name
                       w_ddow-matnr
                       w_ddow-werks
                       w_ddow-mrppp
                       w_ddow-datum
                       w_ddow-ebeln
                       w_ddow-ebelp
                       w_ddow-pptxt
                INTO i_body
            SEPARATED BY cr_mark.
          concatenate ' ' i_body into i_body separated by c_l_newline.
          APPEND i_body TO l_t_objtxt.
          CLEAR : w_ddow.
        ENDLOOP.
        DESCRIBE TABLE l_t_objtxt LINES l_tab_lines.
        DESCRIBE TABLE l_t_objtxt LINES l_att_lines.
        l_tab_lines = l_tab_lines - lv_lines.
      Creating the entry for attachment in the packing list
      objpack-transf_bin = 'X'.
        lv_lines = lv_lines + 1.
        l_t_objpack-head_start = 2.
        l_t_objpack-head_num = 1.
        l_t_objpack-body_start = lv_lines.
        l_t_objpack-body_num = l_tab_lines.
        l_t_objpack-doc_type = 'XLS'.
        l_t_objpack-obj_name = 'DDOW_Materials'(045).
        l_t_objpack-obj_descr = 'DDOW Marked Materials'(046).
        l_t_objpack-doc_size = l_tab_lines * 255.
        APPEND l_t_objpack.
        lv_lines = l_att_lines.
         **RECEIVERS...
        LOOP AT t_ddow INTO w_ddow.
          REFRESH l_t_reclist .
          CLEAR l_t_reclist.
    * get the MRP controller from table
          READ TABLE t_mrpc INTO w_mrpc WITH KEY werks = p_werks
                                                 dispo = w_ddow-dispo
                                                 BINARY SEARCH .
          IF sy-subrc EQ 0 .
            MOVE: 'X'               TO l_t_reclist-express   ,
                  'U'               TO l_t_reclist-rec_type  ,
                  w_mrpc-smtp_addr  TO l_t_reclist-receiver  .
                  APPEND l_t_reclist.
            EXIT.
          ENDIF.
        ENDLOOP.
      Sending the document
        IF NOT l_t_reclist[] IS INITIAL.
          CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
            EXPORTING
              document_data              = l_doc_chng
              commit_work                = 'X'
            TABLES
              packing_list               = l_t_objpack
              object_header              = l_t_objhead
              contents_bin               = l_t_objbin
              contents_txt               = l_t_objtxt
              receivers                  = l_t_reclist
            EXCEPTIONS
              too_many_receivers         = 1
              document_not_sent          = 2
              operation_no_authorization = 4
              OTHERS                     = 99.
        ENDIF.
        IF sy-subrc <> 0.
    * Do nothing
        ELSE.
          COMMIT WORK AND WAIT.
          MESSAGE s899(8a) WITH 'Email Message sent successfully'."#EC
        ENDIF.
      ENDIF.
    <<<<<<<<<<<<<<<<<<<<<<<
    regards,
    vikas.
    plz reward if helpful..

  • How is it possible, that a pdf file turns into a psd file while sending with mail

    I have send a pdf file as attachment with mail. the file shows correctly as pdf file. but when the file arrived at the addressed location it turned into a psd file. in addition it seems there is a problem sending png and ai files. once those files have arrived through mail I am getting the feedback, that the files are are not scalable, they are fuzzy or completely messed up.
    has anyone an idea, where the problem comes from?
    thanks for response
    angelika

    Hello,
    toddisalive wrote:
    Additionally, I have found an AppleWorks file that could be the script, but it is ZERO bytes in size, and Pages won't even open it, saying that it is not a valid AppleWorks file.
    if the size of this file is really ZERO bytes, either the original file contained an empty data fork and a resource fork which was stored elsewhere (*) or the file is too damaged to retrieve anything. Moreover, as AppleWorks never generates file with empty data fork, at least to my knowledge, ....
    Concerning the Movie Magic ScreenWriter files, the application seems to exist for Yosemite http://www.write-bros.com/movie-magic-screenwriter.html ( but it seems "expensive"  and I do not know if it accepts to import old files )....
    (*) maybe in .TOTO or __MACOSX/.TOTO if the filename is TOTO

  • When I want to attach a file to an e-mail I'm sending from my iCloud account it makes the file show up in the body of the e-mail instead of attaching it as a separate file the receiver can open.  How can I change this?

    When I want to attach a file to an e-mail I'm sending from my iCloud account it makes the file show up in the body of the e-mail instead of attaching it as a separate file the receiver can open.  How can I change this?

    It should be an attachment.  Your Mac just displays a preview of certain attachments (such as .pdfs) in the body of the message.  A PC, for example, will see it as an attached file rather than a preview.
    You can save the attachment on your Mac by Control-clicking on it and selecting Save Attachment.

  • Smart Forms - Attaching HTML file as an attachment in Mail

    Hai,
    I have following requirements. I have to send the Payment Advice document output as a HTML format to the vendors.
    I am able to get the smartforms output as html file. The output of smartforms i am capturing
       call function '/1BCDWB/SF00000170'
          exporting
            control_parameters = w_control_parameters
            output_options     = w_output_options
            user_settings      = 'X'
            w_t001             = w_t001
            w_reguh            = w_reguh
            w_regud            = w_regud
            w_e1idrs1          = w_e1idrs1
          importing
            job_output_info    = w_job_output_info
          tables
            t_item             = t_item
          exceptions
            formatting_error   = 1
            internal_error     = 2
            send_error         = 3
            user_canceled      = 4
            others             = 5.
        w_xmloutput = w_job_output_info-xmloutput.
    *-SAP Smart Forms: Result of XSF Transformation
        w_htmldata  = w_xmloutput-trfresult-content[].
    Currently the w_htmldata informations are stored in the form of RAW 1024 characters.
    Using the below mentioned FM the attachment information i am passing through
           contents_txt               = it_message
    parameters.  The contents_txt support only 255 characters. But the smartforms returns RAW 1024 characters. When the HTML attachment is not showning the content properly and the data displays is misaligned. Kindly give me the suggestion how to overcome this issue !
      call function 'SO_DOCUMENT_SEND_API1'
          exporting
            document_data              = w_doc_data
            put_in_outbox              = 'X'
            sender_address             = ''
            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.

    Have you upgraded to Yosemite?  Then you could send the attachment using Mail Drop.
    You can use Mail Drop to send files that exceed the maximum size allowed by the provider of your email account. Mail Drop uploads the large attachments to iCloud, where they’re encrypted and stored for up to 30 days.
    If you have an iCloud account and you’re signed in to iCloud when you click Send, Mail automatically sends the attachments using Mail Drop. Mail Drop attachments don’t count against your iCloud storage.
    If you don’t have an iCloud account, or if you’re not signed in, Mail asks you whether to use Mail Drop (select “Don’t ask again for this account” to always use Mail Drop).
    If a recipient uses Mail in OS X Yosemite, the attachments are automatically downloaded and included in your message just like any other attachment. For other recipients, your message includes links for downloading the attachments and their expiration date.
    You can turn Mail Drop on or off for an account. Choose Mail > Preferences, click Accounts, select your account, click Advanced, then select or deselect “Send large attachments with Mail Drop.”

  • How do I send a large (23mb ) PDF file as an attachment in mail?

    How do I send a PDF mail attachment in mail that is greater than the crazy limit of 23MB?  Thanks for your help!

    Have you upgraded to Yosemite?  Then you could send the attachment using Mail Drop.
    You can use Mail Drop to send files that exceed the maximum size allowed by the provider of your email account. Mail Drop uploads the large attachments to iCloud, where they’re encrypted and stored for up to 30 days.
    If you have an iCloud account and you’re signed in to iCloud when you click Send, Mail automatically sends the attachments using Mail Drop. Mail Drop attachments don’t count against your iCloud storage.
    If you don’t have an iCloud account, or if you’re not signed in, Mail asks you whether to use Mail Drop (select “Don’t ask again for this account” to always use Mail Drop).
    If a recipient uses Mail in OS X Yosemite, the attachments are automatically downloaded and included in your message just like any other attachment. For other recipients, your message includes links for downloading the attachments and their expiration date.
    You can turn Mail Drop on or off for an account. Choose Mail > Preferences, click Accounts, select your account, click Advanced, then select or deselect “Send large attachments with Mail Drop.”

  • Not able to send pdf file as attachment in my apple mail.

    Hi, I was easily able to attach pdf files to my apple mail.  infact I could just open a pdf file and then send it as attachment in the email earlier. but after downloading and upgrading to os X Mountain lion, I am neither being able to attach and send pdf files in my apple mail, nor can I send PDF file as an attachment.
    Is there any issue with OS X Mountain Lion.
    Issue 1.  I compose Email , then click attach > Browse > select pdf file > click attach > it shows in my Email body either as an icon or as first page of the pdf document > I send it. >>> But when the receipient opens the Email, that pdf attachment is missing. In fact When I put a cc to my self and I open the Email, the attachment is mssing in the incoming E amil.
    Issue 2. I open the PDF document > Click on File > send as attachment in E-Mail > on right, a menu appears where I select the File and click attach> I get a message
    The SendMail doesnot know how to talk to your default mail client. Please select a different mail application to use. Attaching a screen shot.
    I never had these issues earlier with my Lion OS . but since the time I have upgraded to mountain Lion OS, I am having these issues.
    Are these the Mountain Lion issues, how to fix these please.

    I believe, the software team forgot to put a button for send or share as an attachment to preview.

  • Mail Receiver Adapter - Flat File as Attachment

    Hello,
    I would like to send a flat file as attachment using an E-Mail receiver communication channel.
    The flatfile is picked up beforehand using a file sender channel, so there is only routing necessary in PI.
    Is it possible to send the flatfile as attachment by checking the option "XIPAYLOAD" or would this result in an error?
    The scenario is quite simple and I am looking for the fastest and easiest way to implement it.
    Thank you very much.

    Hey
    You can follow as given in the below blog
    https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken]
    Thanks
    Aamir

  • File attachement in mail adapter

    Hi ,
    I need to send users an error report which I have captured in the form of a file. Is it possible to attach this file as an attachement via mail adapter. I have been reading that the payload can be sent as attachment by specifying the interface namespace and interface name. But my requirement is to trigger the mail once the file has been completely written and not for every message. The reason being I could have 3000 records in the file and I dont want to send 3000 MAILS out but just 1 mail for the entire 3000 records...
    Thanks,
    Teresa

    Hi Teresa,
    I hope, I understand you right.
    When you use the file-adapter for sending the file, you can without mapping send this file out to a mail receiver as attachment, there is nothing special to do.
    Regards
    Stefan

Maybe you are looking for

  • Connecting audio in to audio out

    I have a G4 with audio input and audio output jacks. How do you get the input to link to the output so you can listen to your input source through your output speakers? I have tried CD SpinDoctor and it does a software link between input and output,

  • How to stop storing messages from my device to my PC

    I am trying to stop my device from storing sent messages on my PC and my PC from storing sent messages on my device.  I have tried to follow the directions in the help section on my device. When I get to email settings, it doesnt show "save copy in s

  • NAC Guest Server and WLC's

    Just wanted to know if this will work or not... I was looking at a design from a client and they had two CAM and CAS plus a Guest server. My client wants to use the equipment above for guest access. The problem I'm having is that I'm building a wirel

  • Booleans to control programming flow

    Is it ok to use booleans within an object to control program flow in an Object Oriented approach? For eg: I have 2 tables in the database which are related. Some times both the tables need to be updated, other times, just 1 table. One approach would

  • Reg:In wdDoModifyView the changes take place one after the other in run tim

    hai all,         Iam using  wdDoModifyView() for displaying the description of the key value selected in the value helpin inputfield.I have 5 such input fields with value help.when i select the key from value help in order (i.e) from 1st input field,