Receiver mail with text file attached without line feeds

Hi, friends
I have a text file  to mail scenario, where file must be attached to receiver mail.
Receiver CC mail is protocol XIPAYLOAD and use mail package and keep attachment.
In tab module, i have:
Module name --> SAP XI Sample/ConvertCRLFfromToLF
Module configuration --> mode LFtoCRLF
The plain text file is attached to mail but there are no line feeds after the plain text lines.
Thanks, in advance

Stefan,
This is not a Java mapping, it's an ABAP mapping.
I've tryed also to insert this characters, but without success.
In my abap class i have:
  data: l_newline type c value cl_abap_char_utilities=>newline.
  data: l_linefeed type c value cl_abap_char_utilities=>CR_LF.
  clear wa_string.
  incode = idocument->get_elements_by_tag_name( 'linea' ).
  length = incode->GET_LENGTH( ).
  do length times.
    outcode = incode->get_item( index = d_lines ).
    wa_linea = outcode->get_value( ).
    if wa_string is initial.
      wa_string = wa_linea.
    else.
      concatenate wa_string l_newline  l_linefeed crlf wa_linea into wa_string.
    endif.
    add 1 to d_lines.
  enddo.
  l_element_dummy  = l_document->create_simple_element(
                name = 'Content'
                VALUE = wa_string
                parent = l_element_root  ).
so...it's similar to your suggestion..
Any other input, please?
Regards,
Carme.

Similar Messages

  • Creating an e-mail with excel file attachment

    Morning,
    Does anyone know how to create an e-mail with a spreadsheet attachment (in foreground and background). I can create an e-mail (in foreground and background) with a text (tab delimited) file attachment with a suffix of .xls. I have created the file by writing text to a string and then putting it into a text format using the function module SCMS_STRING_TO_FTEXT.
    Thanks and regards
    John.

    See the following simple ex:
    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 = 'Report'.
      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

  • Sending mail with PDF file attachment ?

    Hi All,
    I have scenario File ---> Mail, monitoring FTP directory for PDF file and sending using mail attachment.
    At the moment i am using JAVA mapping to construct the mail package structure follow all the step in this blog : XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
    it is working if i am using text file but then how to encode the pdf content so i can send throught the mail adapter. ?
    Thank you and Best Regards
    Fernand

    Hi,
    Actually, i am using this java code below :
    try {
        //     create XML structure of mail package
        String output = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
               + "<ns:Mail xmlns:ns=\"http://sap.com/xi/XI/Mail/30\">"         
               + "<Subject>" + mailSubject     + "</Subject>"
               + "<From>" + mailSender     + "</From>"
               + "<To>" + mailReceiver     + "</To>"
               + "<Content_Type>multipart/mixed; boundary=\"" + boundary + "\"</Content_Type>"
               + "<Content>";
        out.write(output.getBytes());
        // create the declaration of the MIME parts
        //First part
        output = "--" + boundary + CRLF
               + "Content-Type: text/plain; charset=UTF-8" + CRLF
               //+ "Content-Transfer-Encoding: 8bit" + CRLF
               + "Content-Disposition: inline" + CRLF + CRLF
               + mailContent + CRLF
        //Second part
        + "--" + boundary + CRLF
        + "Content-Type: Application/pdf; name=" + attachmentName + CRLF  
        //+ "Content-Transfer-Encoding: base64" + CRLF
        + "Content-Disposition: attachment; filename=" + attachmentName + CRLF + CRLF;
        out.write(output.getBytes());
        //Source is taken as attachment
        copySource(in, out);
        out.write("</Content></ns:Mail>".getBytes());
      } catch (IOException e) {
        throw new StreamTransformationException(e.getMessage());
    protected static void copySource(InputStream in, OutputStream out)
         throws IOException {
        byte[] bbuf = new byte[in.available()];
        int bblen = in.read(bbuf);
        if (!(bblen < 0)) {
          //String sbuf = new String(bbuf);
          //String encoded = Base64.encode(sbuf);
          // replace all control characters with escape sequences
          //sbuf = sbuf.replaceAll("&", "&amp;");
          //sbuf = sbuf.replaceAll("\"", "&quot;");
          //sbuf = sbuf.replaceAll("'", "&apos;");
          //sbuf = sbuf.replaceAll("<", "&lt;");
          //sbuf = sbuf.replaceAll(">", "&gt;");
          out.write(bbuf);
    This code working fine with text file but not for pdf file. because i got error in mail adapter :
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: com.sap.aii.messaging.util.XMLScanException: java.lang.NullPointerException; nested exception caused by: com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Unsupported character: 8f(:main:, row:11, col:4)(:main:, row=11, col=4) -> com.sap.engine.lib.xml.parser.ParserException: Unsupported character: 8f(:main:, row:11, col:4)
    I guest the problem because the mail adapter doen't accept pdf content insite the mail package.
    please advise me
    Best Regards
    Fernand

  • Email with Text File Attachement as Source

    Hi All,
           One of my interfaces needs to listen to incoming mails with an text file attachements.I wish to know how we can convert the text file contents into XML to further process it on the reciever side.

    Hi,
    To perform content conversion of a flat file, check these blogs,
    /people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
    Also, to understand file content conversion better, you can check this link on SAP Help,
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    Regards,
    Bhavesh

  • Problem when trying to send a mail with pdf file attached

    When I use this features from Adobe reader, a new mail is opened with pdf file but my Outlook signature is not set automatically. Note that all is right configure in Outlook 2007 for the signature option...
    Do you have a solution for this problem ?

    someone else reported this (unless it was you) You'll have to insert your sig manually.

  • Problem in send mail with .txt file attached

    According to the diferent checks, I found the next problems:
    1.- Between each caracters there is an space, example:(E Q U I P M E N T) and could be (EQUIPMENT), the last one is the correct form.
    2.- For example, two registers in my internal table appear in one line of my .txt file, but i want that each register of my internal table appear in differents lines of my .txt file.
    3.- The length of each register of my internal table (objbin) is 255 characters, but i really want that the length of each register of my internal table be 1023 characters.
    Thank you

    This is my perform:
    FORM z_envia_correo .
      DATA: docu_data LIKE SODOCCHGI1,
            tablines TYPE i,
            destinatarios  like somlreci1  occurs 1 with header line.
      DATA: BEGIN OF packlist OCCURS 0.
              INCLUDE STRUCTURE SOPCKLSTI1.
      DATA: END OF packlist.
      DATA: BEGIN OF objbin OCCURS 0.
              INCLUDE STRUCTURE SOLISTI1.
      DATA: END OF objbin.
      DATA: BEGIN OF object_header OCCURS 0.
              INCLUDE STRUCTURE SOLISTI1.
      DATA: END OF object_header.
      DATA: BEGIN OF contents OCCURS 0.
              INCLUDE STRUCTURE SOLISTI1.
      DATA: END OF contents.
    *-->ihv270907
      DATA: l_string TYPE string,
            l_fecha(10) TYPE c,
            l_dia(2) TYPE c,
            l_mes(2) TYPE c,
            l_ano(4) TYPE c,
            l_hora(8) TYPE c,
            l_h(2) TYPE c,
            l_min(2) TYPE c,
            l_seg(2) TYPE c.
    *<--ihv270907
    Variable del destinatario para enviar el mail
      DATA: l_usrnam TYPE string.
    *Caracter salto de linea
      FIELD-SYMBOLS <hex_container> TYPE c.
      CONSTANTS: zz_tab TYPE x VALUE '0D' LENGTH 4. "valor del salto de linea en hexadecimal
      ASSIGN zz_tab TO <hex_container> CASTING.
    cargo el texto de cabecera del mail
      CLEAR docu_data.
      docu_data-obj_name = 'ZFLOTA'.
      CONCATENATE 'ZFLOTA' sy-datum INTO docu_data-obj_descr SEPARATED BY space.
      docu_data-proc_type = 'T'.
      docu_data-proc_name = 'ZFLOTA'.
    cargo el texto del cuerpo del mail
      CLEAR contents.
    *-->ihv270907
      l_string = TEXT-I04.
      REPLACE '&' IN l_string WITH sy-uname.
      l_ano = sy-datum+0(4).
      l_mes = sy-datum+4(2).
      l_dia = sy-datum+6(2).
      CONCATENATE l_dia l_mes l_ano INTO l_fecha SEPARATED BY '/'.
      REPLACE '&' IN l_string WITH l_fecha.
      l_h = sy-uzeit+0(2).
      l_min = sy-uzeit+2(2).
      l_seg = sy-uzeit+4(2).
      CONCATENATE l_h l_min l_seg INTO l_hora SEPARATED BY ':'.
      REPLACE '&' IN l_string WITH l_hora.
      contents = l_string.
    *<--ihv270907
      APPEND contents.
      DESCRIBE TABLE contents LINES tablines.
      READ TABLE contents INDEX tablines.
      docu_data-doc_size = ( tablines - 1 ) * 255 + STRLEN( contents ).
    cargo el contenido del attachmet
      LOOP AT g_gt_outtab_mail.
        g_gt_outtab_mail-line+254(1) = <hex_container>.
        MOVE g_gt_outtab_mail-line TO objbin-line.
        APPEND objbin.
      ENDLOOP.
    genero el nombre del archivo a ser attachado
      CLEAR object_header.
      object_header-line = 'ZFLOTA.txt'.
      APPEND object_header.
    armo las caracteristicas del mail
      CLEAR packlist.
      packlist-head_start = 1.
      packlist-head_num = 0.
      packlist-body_start = 1.
      packlist-body_num = tablines.
      packlist-transf_bin = space.
      packlist-doc_type = 'RAW'.
      APPEND packlist.
    armo las caracteristicas del attachment
      DESCRIBE TABLE objbin LINES tablines.
      packlist-transf_bin = 'X'.
      packlist-head_start = 1.
      packlist-head_num = 0.
      packlist-body_start = 1.
      packlist-body_num = tablines.
      packlist-doc_type = 'TXT'.
      packlist-obj_name = 'ZFLOTA.txt'.
      packlist-obj_descr = 'ZFLOTA.txt'.
      packlist-doc_size = tablines * 250.
      APPEND packlist.
    Destinatarios
      l_usrnam = sy-uname.
      MOVE: l_usrnam TO destinatarios-receiver.
      destinatarios-rec_type = 'B'.   "U externo; B -> SAP
      destinatarios-sap_body = 'X'.
      APPEND DESTINATARIOS.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA                    = docu_data
          PUT_IN_OUTBOX                    = 'X'
          COMMIT_WORK                      = 'X'
        TABLES
          PACKING_LIST                     = packlist
          OBJECT_HEADER                    = object_header
          CONTENTS_BIN                     = objbin
          CONTENTS_TXT                     = contents
          RECEIVERS                        = destinatarios
    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.
    ENDFORM.                    " z_envia_correo
    Thank you.

  • Problem with Text file attachment

    Hello All,
    I am sending data from my program via mail in an attachment of text format in 4.6C. But the format of the data in the attachment is not correct. There is no line break in the data.
    I've tried putting the line break manually by using hexadecimal code '09' as the line break. But it is not working.
    Kindly suggest.
    Thanks

    Hello Brad,
    I marked the problem as solved previously because the issue of all the lines coming together was solved.
    So, I marked the question as solved.
    Now, I have a different problem and rather than creating a new thread I opened this one only.
    Thank you

  • Text file attachment in UTF-8 encoding

    Hi
    I have written a program which sends  mails to the users with text file attached. the problem is the text file when you save it to the local desktop ( by clicking on save as ) the encoding is by default ANSI. I want to make the encoding as UTF-8. Is it possible to change this in program?.
    thanks
    sankar

    OPEN DATASET - encoding
    Syntax
    ... ENCODING { DEFAULT
                 | {UTF-8 [SKIPPING|WITH BYTE-ORDER MARK]}
                 | NON-UNICODE } ... .
    Alternatives:
    1. ... DEFAULT
    2. ... UTF-8 [SKIPPING|WITH BYTE-ORDER MARK]
    3. ... NON-UNICODE
    Effect
    : The additions after ENCODING determine the character representation in which the content of the file is handled. The addition ENCODING must be specified in Unicode programs and may only be omitted in non-Unicode programs. If the addition ENCODING is not specified in non-Unicode programs, the addition NON-UNICODE is used implicitly.
    Note
    : It is recommended that files are always written in UTF-8, if all readers can process this format. Otherwise, the code page can depend on the text environment and it is difficult to identify the code page from the file content.
    Alternative 1
    ... DEFAULT
    Effect
    : In a Unicode system, the specification DEFAULT corresponds to UTF-8, and in a non-Unicode system, it corresponds to NON-UNICODE.
    Alternative 2
    ... UTF-8 [SKIPPING|WITH BYTE-ORDER MARK]
    Addition:
    ... SKIPPING|WITH BYTE-ORDER MARK
    Effect
    : The characters in the file are handled according to the Unicode character representation UTF-8.
    Notes
    : The class CL_ABAP_FILE_UTILITIES contains the method CHECK_UTF8 for determining whether a file is a UTF-8 file.
    A UTF-16 file can only be opened as a binary file.
    Addition
    ... SKIPPING|WITH BYTE-ORDER MARK
    Effect
    : This addition defines how the byte order mark (BOM), with which a file encoded in the UTF-8 format can begin, is handled. The BOM is a sequence of 3 bytes that indicates that a file is encoded in UTF-8.
    SKIPPING BYTE-ORDER MARK
    is only permitted if the file is opened for reading or changing using FOR INPUT or FOR UPDATE. If there is a BOM at the start of the file, this is ignored and the file pointer is set after it. Without the addition, the BOM is handled as normal file content.
    WITH BYTE-ORDER MARK
    is only permitted if the file is opened for writing using FOR OUTPUT. When the file is opened, a BOM is inserted at the start of the file. Without the addition, no BOM is inserted.
    The addition BYTE-ORDER MARK cannot be used together with the AT POSITION.
    Notes
    : When opening UTF-8 files for reading, it is recommended to always enter the addition SKIPPING BYTE-ORDER MARK so that a BOM is not handled as file content.
    It is recommended to always open a file for reading as a UTF-8 with the addition WITH BYTE-ORDER MARK, if all readers can process this format.
    Alternative 3
    ... NON-UNICODE
    Effect
    : In a non-Unicode system, the data is read or written without conversion. In a Unicode system, the characters of the file are handled according to the non-Unicode codepage that would be assigned at the time of reading or writing in a non-Unicode system according to the entry in the database table TCP0C of the current text environment.

  • How to send a text file attachment through mail in ECC 6.0

    Hi Friends,
    As per the requirement, I need to send a ALV report result as text file attachment to user in ECC 6.0 . I know how to do in 4.6C version. But the same code is not working here in ECC 6.0.
    Generally to get the data in new row in the text file we use below code in 4.6c.
    data: c_value type x value ' 0D '.
    concatenate c_value itab-line into itab-line.
    By using above code, we get each row of the itab in a new line in text file.
    Same code is not working in ECC6.0 as it is not supporting  to concatenate bytes with characters. Getting the error like " field c_value should be diclared as type C or I or N or T or P"
    Even I have used function module NLS_STRING_CONVERT_TO_SYS to convert hexa to char. It is converting the value' 0D' to ' # '. But it is not working.
    Could you please suggest me that how can get each row of itab as a new line in text file in ECC 6.0.
    Itab value:
    abcdefdfldjfñlkdsjfñldsjfdsñljñla
    fdsljfñldskjfldsñkjfñldsjfñldsajñld
    vcxusfcxusfcusafcxusafcusafcdsauc
    Actual result currently coming in text file:
    abcdefdfldjfñlkdsjfñldsjfdsñljñlafdsljfñldskjfldsñkjfñldsjfñldsajñldvcxusfcxusfcusafcxusafcusafcdsauc
    Expected result in text file:
    abcdefdfldjfñlkdsjfñldsjfdsñljñla
    fdsljfñldskjfldsñkjfñldsjfñldsajñld
    vcxusfcxusfcusafcxusafcusafcdsauc
    Please do the needful.
    Thanks
    Kumar

    hi,
    Try this function Module
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1 '
    *example code
    ******* Create Message Body Title and Description****************
      i_objtxt = 'test with pdf-Attachment!'.
      append i_objtxt.
      describe table i_objtxt lines v_lines_txt.
      read table i_objtxt index v_lines_txt.
      wa_doc_chng-obj_name = 'smartform'.
      wa_doc_chng-expiry_dat = sy-datum + 10.
      wa_doc_chng-obj_descr = 'smartform'.
      wa_doc_chng-sensitivty = 'F'.
      wa_doc_chng-doc_size = v_lines_txt * 255.
    **** Main Text*****************************
      clear i_objpack-transf_bin.
      i_objpack-head_start = 1.
      i_objpack-head_num = 0.
      i_objpack-body_start = 1.
      i_objpack-body_num = v_lines_txt.
      i_objpack-doc_type = 'RAW'.
      append i_objpack.
    **** Attachment (pdf-Attachment)*************
      i_objpack-transf_bin = 'X'.
      i_objpack-head_start = 1.
      i_objpack-head_num = 1.
      i_objpack-body_start = 1.
      i_objpack-body_num = v_lines_bin.
      i_objpack-doc_type = 'PDF'.
      i_objpack-obj_name = 'smartform'.
      concatenate i_objpack-obj_name i_objpack-doc_type into
    i_objpack-obj_descr separated by '.'.
    *  I_OBJPACK-OBJ_DESCR = 'test'.
      i_objpack-doc_size =  v_lines_bin * 255 .
      append i_objpack.
    * Länge des Attachment ermitteln
      clear i_reclist.
      i_reclist-receiver = 'email address'.
      i_reclist-rec_type = 'U'.
      i_reclist-express = 'X'.
      data: tab_lines like sy-tabix.
      describe table i_objbin lines tab_lines.
      append i_reclist.
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        exporting
          document_data              = wa_doc_chng
          put_in_outbox              = 'X'
          commit_work                = 'X'
        tables
          packing_list               = i_objpack
          object_header              = wa_objhead
          contents_bin               = i_objbin
          contents_txt               = i_objtxt
          receivers                  = i_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:/ 'Error When Sending the File', sy-subrc.
      else.
        write:/ 'Mail sent'.
      endif.

  • Mail Adapter: How to send data as a simple text file attachment?

    Hi All
    I have a proxy to file scenario, where i write data to a text file.
    Now, i need to have a second receiver. I have to send an email, with the above file as an attachment, to this receiver.
    How can i do this?
    How can i send the data as a text file attachment to the receiver?
    Many Thanks
    Chandra

    Hi,
    To send the message to the second receiver you need to have:
    1) Necessary mail message format (can download from service marketplace)
    2) Receiver mail communication channel.
    3) Create the necessary Configuration Objects .... Receiver Determination, Interface Determination, Receiver Agreement.
    3) You can do a XSLT mapping (if required)....if no complex logic is needed then you can do a simple Message mapping.
    4) In the receiver CC make sure that you check the Adapter Specific Message Attribute checkbox.
    For more info you can refer my answer in this thread:
    Re: xml in mail
    Also refer the blog:
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    Regards,
    Abhishek.

  • I'm using OS 10.6.8 and Mail 4.5. When I receive mails with attachments which are visible the save button doesn't work. Some contacts have problems opening files sent by me using Mail too. This was never a problem on pre-Intel. A real Mac **** up !

    I'm using OS 10.6.8 and Mail 4.5. When I receive mails with attachments which are visible the save button doesn't work. And some contacts occasionally have problems opening files sent by me using Mail too. This was never a problem on pre-Intel Mac. A real Mac **** up ! Any ideas ?

    Can you drag and drop the attachments visible in the email to the Desktop OK or does that fail ?
    Re the sending: Are these recipients on Mac's or PC's as the file type could be an issue, if on Mac's then try setting the Mail Preferences Composing setting to Plain Text not Rich Text and see if that improves things.

  • I receive many e-mails with zipped files.  In the past few weeks I can no longer open them as I used to.  I get a window welcoming me to the Application Loader.  ( What is an Application Loader?)  It says I need my iTunes Connect login, but when I try my

    I receive many e-mails with zipped files.  I can no longer open or unzip my files. A window welcoming me to Application Loader drops down.  It prompts for an iTunes Connect login, but will no accept my iTunes login. I have no way to open or unzip my files. Help!!!!

    Application Loader, unless there's another one I'm not familiar with, is part of the iOS SDK. That have usurped the .zip, or you may have removed that application but your Mac is still holding onto the mapping of Zip files to that application. Select a .zip file in Finder, Get Info, and go to the Open with section. Select Archive Utility and click Change All. That should fix the problem.
    Regards.

  • Send mails with csv file as an attachment through oracle(SQL SCripts / Stor

    Hello Everybody,
    I have recently come across a requirement in which I am supposed to send mails with csv file as an attachment through oracle(SQL SCripts / Stored Procedure) .
    The contents of the csv file are to be retreived from the Database as well as the content of the mail and to whom it needs to be sent has also to be picked up from the database.
    Can somebody suggest me with a suitable code for the same?
    Would be of great help..!!
    Thanks & Regards,
    - VR
    Edited by: user646716 on Dec 18, 2009 10:44 AM

    read below links
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:255615160805
    http://www.orafaq.com/wiki/Send_mail_from_PL/SQL#Send_mail_with_UTL_TCP_-withattachments
    How to send csv file as an attachment

  • Receive mail with POP3 and saving to file using XI

    Hello! I'm new to XI, could you help me with this "simple" task: Receive mail with POP3 and saving to file.
    Thanks!

    Hi,
    you will need:
    Mail Sender Adapter
    http://help.sap.com/saphelp_nw04s/helpdata/en/23/c093409c663228e10000000a1550b0/frameset.htm
    and File Receiver Adapter
    http://help.sap.com/saphelp_nw04s/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm
    Regards
    Patrick

  • How to send the mail with multiple file attachments ?

    Sending mails with multiple files as attachments.

    You need to start from the app, assuming that it has an email function, that contains the files that you want to send as attachments. The Photos app allows you to send up to 5 photos on the same email, but if you want to send multiple file types then you need an app that supports all those file types. I use the GoodReader app which supports quite a few document/file types (e.g. PDF, Excel, Word, pictures), and from that I can select multiple files (including different types) and attach them to the same email.

Maybe you are looking for