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.

Similar Messages

  • 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.

  • No support for text files attached in emails

    I was shocked to discover that a simple RTF (Rich Text File) is not supported by iPhone. I was sent a small attachment as a text file and was unable to open it. Surely something as simple as a text file attachment should be easy to display.
    Come on Apple, lets get working on version 1.1

    fixed in later OS

  • 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.

  • 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 in text file attachment while sending to lotusnotes

    Hi friends,
    Good day. I am sending the ALV report data as a text file to lotus notes. I am getting the text file as an attachment and finding data while opening it. But data is not coming properly. I am getting some space in between two rows in text file.
    I am using below code to get new line.
    data: c_val type x value ' 0D'.
    concatenate c_value itab into itab.
    Actual Result
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    Expected result
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest
    testtesttesttesttesttesttesttesttesttest.
    Please send some code to get the lines properly.
    Thanks
    Kumar

    use this :
    data: c_val type c value CL_ABAP_CHAR_UTILITIES=>CR_LF.

  • 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.

  • How to I read a text file attachment in email on my playbook

    I can read it on my black berry smartphone, I have a program that will read text files but it can not see into wherever email attachments are saved.
    I get log files in emails and the phone screen is a bit small to read them so I would like to use my playbook.
    Any ideas.

    Attachments are saved in your downloads folder:
    /accounts/1000/shared/downloads
     You might like to try Files & Folders, which gives you access to that folder and has a built-in text viewer.
    Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands

  • Text File Attachment in SAP Mail ECC 6.0

    Hi,
    Is it possible to use a text format 'TXT' on the Function Module "O_NEW_DOCUMENT_ATT_SEND_API1" in ECC 6.0? Because I've seen alot of examples in the forum that are using 'XLS' Format attachments.
    I made a program that have been attaching text fomat file in the SAP mail. It is working fine in other SAP boxes but in our current box, as I tested it, opening the text attachment, the result is a file text now contained a long string (max1022 char) instead of a file that is tab-delimited. What would you suggest on this?

    yes u can attach txt file.refer to the code below!
    data: itcpo like itcpo,
          tab_lines like sy-tabix.
    Variables for EMAIL functionality
    data: maildata   like sodocchgi1.
    data: mailpack   like sopcklsti1 occurs 2 with header line.
    data: mailhead   like solisti1 occurs 1 with header line.
    data: mailbin    like solisti1 occurs 10 with header line.
    data: mailtxt    like solisti1 occurs 10 with header line.
    data: mailrec    like somlrec90 occurs 0  with header line.
    data: solisti1   like solisti1 occurs 0 with header line.
    perform send_form_via_email.
          FORM  SEND_FORM_VIA_EMAIL                                      *
    form  send_form_via_email.
      clear:    maildata, mailtxt, mailbin, mailpack, mailhead, mailrec.
      refresh:  mailtxt, mailbin, mailpack, mailhead, mailrec.
    Creation of the document to be sent File Name
      maildata-obj_name = 'TEST'.
    Mail Subject
      maildata-obj_descr = 'Subject'.
    Mail Contents
      mailtxt-line = 'Here is your file'.
      append mailtxt.
    Prepare Packing List
      perform prepare_packing_list.
    Set recipient - email address here!!!
      mailrec-receiver = [email protected]'.
      mailrec-rec_type  = 'U'.
      append mailrec.
    Sending the document
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           exporting
                document_data              = maildata
                put_in_outbox              = ' '
           tables
                packing_list               = mailpack
                object_header              = mailhead
                contents_bin               = mailbin
                contents_txt               = mailtxt
                receivers                  = mailrec
           exceptions
                too_many_receivers         = 1
                document_not_sent          = 2
                operation_no_authorization = 4
                others                     = 99.
    endform.
         Form  PREPARE_PACKING_LIST
    form prepare_packing_list.
      clear:    mailpack, mailbin, mailhead.
      refresh:  mailpack, mailbin, mailhead.
      describe table mailtxt lines tab_lines.
      read table mailtxt index tab_lines.
      maildata-doc_size = ( tab_lines - 1 ) * 255 + strlen( mailtxt ).
    Creation of the entry for the compressed document
      clear mailpack-transf_bin.
      mailpack-head_start = 1.
      mailpack-head_num = 0.
      mailpack-body_start = 1.
      mailpack-body_num = tab_lines.
      mailpack-doc_type = 'RAW'.
      append mailpack.
      mailhead = 'TEST.TXT'.
      append mailhead.
    File 1
      mailbin = 'This is file 1'.
      append mailbin.
      describe table mailbin lines tab_lines.
      mailpack-transf_bin = 'X'.
      mailpack-head_start = 1.
      mailpack-head_num = 1.
      mailpack-body_start = 1.
      mailpack-body_num = tab_lines.
      mailpack-doc_type = 'TXT'.
      mailpack-obj_name = 'TEST1'.
      mailpack-obj_descr = 'Subject'.
      mailpack-doc_size = tab_lines * 255.
      append mailpack.
    *File 2
      mailbin = 'This is file 2'.
      append mailbin.
      data: start type i.
      data: end type i.
      start = tab_lines + 1.
      describe table mailbin lines end.
      mailpack-transf_bin = 'X'.
      mailpack-head_start = 1.
      mailpack-head_num = 1.
      mailpack-body_start = start.
      mailpack-body_num = end.
      mailpack-doc_type = 'TXT'.
      mailpack-obj_name = 'TEST2'.
      mailpack-obj_descr = 'Subject'.
      mailpack-doc_size = tab_lines * 255.
      append mailpack.
    endform.
    regards,
    madhu

  • Mail automatically sending forwarded messages as text file attachment

    Hi everyone,
    We have a client who is using Mac Mail, and whenever she tries to forward on a message it automatically puts the message into an attached text edit format file. Generally the forwarded message should just be inline text but in this case it isn't. I've googled this problem without much luck, hopefully someone on here has an idea of what's going on and it's just a simple fix, unfortunately I cannot have access to the machine when I want but if anyone has any advice that would be great, cheers.

    Bump...
    Apparently it only happens when another file is attached as well to the same email.
    I tried forwarding my colleague an email through Mac Mail with an attached image and inline text and it came out fine, I thought it might of been a flaw with Mac Mail itself but no.
    Anymore ideas?

  • 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

  • How to read UTF-8 encoded text file randomly?

    I am trying to read a text file which has been encoded in UTF-8. The problem is that I need to access the file randomly. The RandomAccessFile is a low-level class and there seems to be no-way to wrap it in InputStreamReader so that UTF-8 encoding can be done on-the-fly. Is there any easy way to do that. Below is the simplified version of my program.
    import java.io.*;
    public class Test{
            public Test(String filename){
                    try{
                            RandomAccessFile rafTemIn = new RandomAccessFile(new File(filename), "r");
                            while(true){
                                    char chr = rafTemIn.readChar();
                                    System.err.println(chr);
                    } catch (EOFException e) {
                            System.err.println("File read.");
                    } catch (IOException e) {
                            System.err.println("File input error");
            public static void main(String[] args){
                    Test t= new Test("template.idx");
    }

    The file that I am going to read could be few hundreds of MBs or GBs. Hence, I will index interesting items in the file. The index file contain the keyword and the byte offset in the file. So, I will need to seek to any byte to read it. The file could be UTF-8 encoded XML or UTF-8 encoded plain text.
    Also, would like to add-up that in the sample program above I am reading the file sequentially. The concerned class has another method which actually does the reading randomly. If this helps, I am pasting the simplified version of code again but this also includes the said method.
    import java.io.*;
    public class Test{
            long bloc;
            long eloc;
            RandomAccessFile rafTemIn;
            public Test(String filename){
                    bloc=0L;
                    eloc=0L;
                    try{
                            rafTemIn = new RandomAccessFile(new File(filename), "r");
                            while(true){
                                    char chr = rafTemIn.readChar();
                                    System.err.println(chr);
                    } catch (EOFException e) {
                            System.err.println("File read.");
                    } catch (IOException e) {
                            System.err.println("File input error");
            public String getVal(String templateName){
                    String stemval=null;
                    try {
                            rafTemIn.seek(bloc); //bloc is a long value for beginng location to read from. It changes.
                            byte[] b = new byte[(int)(eloc - bloc + 1L)];
                            rafTemIn.read(b,0,(int) (eloc - bloc + 1L));
                            stemval = new String(b,"UTF-8");
                    } catch(IOException eio) {
                            System.err.println("Template Dump file IO error.");
                    return stemval;
            public static void main(String[] args){
                    Test t= new Test("template.idx");
                    System.out.println(t.getVal("wikipedia"));
    }

  • File attachment encoding problem

    Guys,
    I spend to much time trying to get trough this.
    I use xsl mapping for preparing to send mail by mail adapter.
    File is encoded ANSI (not UTF-8) when i zip it to import it as archive for using this in maaping.
    It's realy simple XSL.
    It's adding IDOC ORDERS04 as xml attachment.
    This is the XSL file:
    "<?xml version="1.0" encoding="iso-8859-2"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" version="1.0" exclude-result-prefixes="rfc">
           <xsl:output method="xml" encoding="iso-8859-2" indent="yes"/>
           <xsl:template match="*">
                   <ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
                           <Subject>Order no. <xsl:value-of select="//BELNR" /></Subject>
                           <From>testattest.pl</From>
                           <To>
                           <xsl:value-of select="//RCVLAD" />
                           </To>
                           <Content_Type>multipart/mixed; boundary="--AaZz"</Content_Type>
                           <Content>
    AaZz
    Content-Type: text/plain; charset=iso-8859-2
    Content-Disposition: inline
    <xsl:text>Order file.
    AaZz
    Content-Type: text/xml; name=order.xml
    Content-Disposition: attachment; filename=Order no. <xsl:value-of select="//BELNR" />.xml
    <xsl:text>
    </xsl:text>
          &lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-2&quot; ?&gt;
          &lt;?xml-stylesheet href=&quot;idoc_orders04.xsl&quot; type=&quot;text/xsl&quot;?&gt;
    <ORDERS04>
    <xsl:text>
    </xsl:text>
    <IDOC BEGIN='1'>
    <xsl:text>
    </xsl:text>
    <xsl:copy-of select="//EDI_DC40"/>
    <xsl:text>
    </xsl:text>
    <xsl:for-each select="//E1EDK01">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK14">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK03">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK04">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK05">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDKA1">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK02">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK17">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK18">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK35">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDK36">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDKT1">
    <E1EDKT1>
    <xsl:copy-of select="TDID"/>
    <xsl:copy-of select="TSSPRAS"/>
    <xsl:copy-of select="TSSPRAS_ISO"/>
    <xsl:copy-of select="TDOBJECT"/>
    <xsl:copy-of select="TDOBNAME"/>
    <xsl:for-each select="E1EDKT2">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    </E1EDKT1>
    </xsl:for-each>
    <xsl:for-each select="//E1EDP01">
    <E1EDP01>
    <xsl:copy-of select="POSEX"/>
    <xsl:copy-of select="ACTION"/>
    <xsl:copy-of select="PSTYP"/>
    <xsl:copy-of select="KZABS"/>
    <xsl:copy-of select="MENGE"/>
    <xsl:copy-of select="MENEE"/>
    <xsl:copy-of select="BMNG2"/>
    <xsl:copy-of select="PMENE"/>
    <xsl:copy-of select="ABFTZ"/>
    <xsl:copy-of select="VPREI"/>
    <xsl:copy-of select="PEINH"/>
    <xsl:copy-of select="NETWR"/>
    <xsl:copy-of select="ANETW"/>
    <xsl:copy-of select="SKFBP"/>
    <xsl:copy-of select="NTGEW"/>
    <xsl:copy-of select="GEWEI"/>
    <xsl:copy-of select="EINKZ"/>
    <xsl:copy-of select="CURCY"/>
    <xsl:copy-of select="PREIS"/>
    <xsl:copy-of select="MATKL"/>
    <xsl:copy-of select="UEPOS"/>
    <xsl:copy-of select="GRKOR"/>
    <xsl:copy-of select="EVERS"/>
    <xsl:copy-of select="BPUMN"/>
    <xsl:copy-of select="BPUMZ"/>
    <xsl:copy-of select="ABGRU"/>
    <xsl:copy-of select="ABGRT"/>
    <xsl:copy-of select="ANTLF"/>
    <xsl:copy-of select="FIXMG"/>
    <xsl:copy-of select="KZAZU"/>
    <xsl:copy-of select="BRGEW"/>
    <xsl:copy-of select="PSTYV"/>
    <xsl:copy-of select="EMPST"/>
    <xsl:copy-of select="ABTNR"/>
    <xsl:copy-of select="ABRVW"/>
    <xsl:copy-of select="WERKS"/>
    <xsl:copy-of select="LPRIO"/>
    <xsl:copy-of select="LPRIO_BEZ"/>
    <xsl:copy-of select="ROUTE"/>
    <xsl:copy-of select="ROUTE_BEZ"/>
    <xsl:copy-of select="LGORT"/>
    <xsl:copy-of select="VSTEL"/>
    <xsl:copy-of select="DELCO"/>
    <xsl:copy-of select="MATNR"/>
    <xsl:copy-of select="VALTG"/>
    <xsl:copy-of select="HIPOS"/>
    <xsl:copy-of select="HIEVW"/>
    <xsl:copy-of select="POSGUID"/>
    <xsl:text>
    </xsl:text>
    <xsl:for-each select="E1EDP02">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1CUREF">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1ADDI1">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP03">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP04">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP05">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP20">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDPA1">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP19">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP17">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP18">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDP35">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="E1EDPT1">
    <E1EDPT1>
    <xsl:copy-of select="TDID"/>
    <xsl:copy-of select="TSSPRAS"/>
    <xsl:copy-of select="TSSPRAS_ISO"/>
    <xsl:for-each select="E1EDPT2">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    </E1EDPT1>
    </xsl:for-each>
    <xsl:for-each select="E1EDC01">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    </E1EDP01>
    </xsl:for-each>
    <xsl:for-each select="//E1CUCFG">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDL37">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    <xsl:for-each select="//E1EDS01">
    <xsl:copy-of select="."/>
    <xsl:text>
    </xsl:text>
    </xsl:for-each>
    </IDOC>
    <xsl:text>
    </xsl:text>
    </ORDERS04>
    </Content>
                   </ns:Mail>
           </xsl:template>
    </xsl:stylesheet>"
    When i import it i can view this file when i open imported archive.
    There i can see that this is iso-8859-2 encoded file.
    When i recive mail and when i save the file it's UTF-8 encoded.
    I'm not talking about declaration in XML file etc. There everything is OK.
    Just when i open file lets say in Edit++ and check code page for file it's UTF-8.
    I need iso-8859-2 code page for the file.
    How can i convert it/do this?
    I used TextCodepageConversionBean but this is not working for that scenerio.
    In file adapter you can choose it.
    Thanks for help,
    Olek

    Are you sure, that your xslt is really used?
    In your XSLT I see:
    <Content>
    ----AaZz
    Content-Type: text/plain; charset=iso-8859-2
    Content-Disposition: inline
    The same place in the SXMB_MONI there is:
    <Content>
    ----AaZz
    Content-Type: text/plain; charset=UTF-8
    Content-Disposition: inline
    I assume that you changed the XSLT meanwhile, but the changes are not active.

  • Working with UTF-8 text files as if they were ANSI?

    I have a text file saved in UTF-8, containing several characters from different languages. It's created in Notepad.
    I want to read that file into my Java application, which before only was used with regular ANSI .txt files.
    When showing the contents of the file on the screen (Swing GUI), the text is totally distorted. The application obviously doesn't understand from the beginning that the text file is encoded with UTF-8.
    Somehow I must convert the information in the file so that
    1) I can process the UTF-8 text in all String functions as if it were common ANSI text, and
    2) I can show the contents of those Strings on the screen in my Java application, and making it look like it should, whether it's English or Russian.
    Does anyone here have any tips or code samples that I can use?
    Thanks

    That is kind of what I'm trying to find out, how to read the file...
    When I read a text file that is saved as UTF-8, the letters don't show properly on the screen. Instead of, for example, a Pi symbol I would get a ?� or something.
    Though if I hardcode a String object that contains "\u0030" or a similar Unicode character, it shows properly.
    How do you read in the file???
    When you read in the file, you have to take the
    encoding into account.
    Take a look at InputStreamReader. This class allows
    you to specify the character encoding you will use.

  • Problen when Sending the text file as attachment to the external mail

    HI,
    I am sending the text file as an attachment to a aexternal mai. mailing is going with text file attachment, but text file is empty. No information in the file is going, only empty text file is going. I am sending the code  iam using. Please suggest, if I need to change any passing parameters orany other other solution.
    tables: knb1,kna1,adr6,ITEMSET,bsid,TSP01.
               INTERNAL TABLES
    DATA: BEGIN OF it_kna1 occurs 0,
            KUNNR LIKE KNA1-KUNNR,
            ADRNR LIKE KNA1-ADRNR,
          END OF it_kna1.
    DATA: BEGIN OF it_email occurs 0,
            ADDRNUMBER LIKE ADR6-ADDRNUMBER,
            SMTP_ADDR LIKE ADR6-SMTP_ADDR,
          END OF it_email.
    DATA: BEGIN OF it_bsid occurs 0,
           KUNNR LIKE BSID-KUNNR,
           BUKRS LIKE BSID-BUKRS,
         END OF it_bsid.
    DATA: BEGIN OF it_final occurs 0,
            KUNNR LIKE KNA1-KUNNR,
            ADRNR LIKE ADR6-ADDRNUMBER,
            EMAIL LIKE ADR6-SMTP_ADDR,
          END OF it_final.
    DATA: BEGIN OF BUFFER OCCURS 10000,
              TEXT(255) TYPE C,
            END OF BUFFER.
    data:xtext type solix_tab." occurs 0 with header line."line.
    data:xi_pdf type soli_tab.
    DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2  WITH HEADER LINE,
          OBJHEAD LIKE SOLISTI1   OCCURS 1  WITH HEADER LINE,
          OBJBIN  LIKE SOLISTI1   OCCURS 0  WITH HEADER LINE,
          OBJTXT  LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE,
          RECLIST LIKE SOMLRECI1  OCCURS 5  WITH HEADER LINE,
          DOC_CHNG  LIKE SODOCCHGI1,
         PARAMS   LIKE PRI_PARAMS,
         ARPARAMS LIKE ARC_PARAMS,
         DAYS(1)  TYPE N VALUE 8,
         COUNT(3) TYPE N VALUE 1,
         VALID    TYPE C,
         RECEIVER(30),
         STR(256).
    data:  spoolid    type tsp01-rqident,
           pdf_table like tline occurs 0 with header line,
           v_bytecount type i,
           itab_pdf like tline occurs 10 with header line,
          xi_pdf  like tline occurs 0 with header line,
          xi_pdf  like buffer occurs 0 with header line,
           xi_pdf_1 like xi_pdf,
           v_length(2) type p,
           html  like solisti1   occurs 0  with header line,
           xi_temp      like bapiqcmime occurs 0 with header line,
           xi_mime(255) type c occurs 0 with header line.
              VARIABLES
    data: g_email type adr6-smtp_addr,
          TAB_LINES LIKE SY-TABIX,
          G_FLAG(1) TYPE C.
         g_norm(1) TYPE C,
         g_shbv(1) TYPE C,
         g_merk(1) TYPE C,
         g_park(1) TYPE C,
         g_apar(1) TYPE C.
    data: l_lines     type i,
          line1       type i,
          l_temp(500) type c,
          l_offset    type p,
          l_lineslen(2) type p,
          l_mimelen(2)  type p,
          v_spono like tsp01-rqident,
          l_tabix       like sy-tabix.
    *****VIA SELECTION-SCREEN
    ENDFORM.                    " SEND_TO_SPOOL
    *&      Form  GET_SPOOL_ID
    *&      Form  CONVERT_SPOOL_TO_PDF
    *&      Form  SEND_MAIL
    FORM SEND_MAIL .
      data:l_lin  like sy-tabix,
            l_lint like sy-tabix,
            it_list like abaplist occurs 0,
            l_newline(2) type x value '0D0A'.
    *--Data for the status output after sending
      data: user_address like sousradri1 occurs 1 with header line,
            sent_to_all like sonv-flag.
      clear: reclist, reclist[],
             objtxt , objtxt[],
             objpack, objpack[],
             objbin , objbin[],
             doc_chng.
    *--move list to office table objbin
    *--Start of Changes to support PDF attachments - UB20030116
    loop at html.
       objbin-line = html-line.
       append objbin.
       clear objbin.
    endloop.
    loop at xi_pdf.
       objbin-line = xi_pdf-text.
       append objbin.
       clear objbin.
    endloop.
    *--We may write additional text to the main document
    *--For faxing this will be the cover page. Like sending from SAPoffice
    *--the layout set Office-Telefax will be used.
      objtxt-line = 'NOTE : Please Consider the below Headers'.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Assignment -->  Purchase order number '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Document  -->   Invoice No '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Amount In DC --> Amount Due '.
      append objtxt.
      clear objtxt.
      objtxt-line = '                                            '.
      append objtxt.
      clear objtxt.
      objtxt-line = '                                            '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Please find attached statement for this week'.
      append objtxt.
      clear objtxt.
      objtxt-line = '                                            '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'This is an AUTO GENERATED MAIL'.
      concatenate objtxt-line 'Please Do not reply to this mail' into
      objtxt-line separated by ' '.
      append objtxt.
      clear objtxt.
      describe table objtxt lines tab_lines.
      read table objtxt index tab_lines.
    *--Create the document which is to be sent
    doc_chng-obj_name  = 'List'.
      doc_chng-obj_name = 'SAPRPT'.
    doc_chng-obj_descr = 'Customer statement for the week'.
      concatenate 'Customer statement for '
                  sy-datum into
                  doc_chng-obj_descr
                  separated by ' '.
      doc_chng-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
    *--Fill the fields of the packing_list for the main document:
    *--It is a text document
      clear objpack-transf_bin.
    *--The document needs no header (head_num = 0)
      objpack-head_start = 1.
      objpack-head_num = 0.
    *--but it has a body
      objpack-body_start = 1.
      objpack-body_num = tab_lines.
    *--of type RAW
      objpack-doc_type = 'RAW'.
      append objpack.
    *--Create the attachment (the list itself)
      describe table objbin lines tab_lines.
    *--Fill the fields of the packing_list for the attachment:
    *--It is binary document
    objpack-transf_bin = 'X'.
    *--we need no header
      objpack-head_start = 1.
      objpack-head_num = 0.
    *--but a body
      objpack-body_start = 1.
      objpack-body_num = tab_lines.
    *--of type G_DOC_TYPE
    objpack-doc_type = 'PDF'. "commented on 12/13/2007
      objpack-doc_type = 'TXT'. "commented on 12/13/2007
      objpack-obj_name = 'Attachment'.
    objpack-obj_descr = 'Customer Statement'.
      concatenate 'Customer Statement' sy-datum into objpack-obj_descr.
      objpack-doc_size = tab_lines * 255.
      append objpack.
      reclist-receiver = g_email.
      reclist-rec_type = 'U'.
    reclist-com_type = 'FAX'.
      append reclist.
      data:xi type soli.
    xi-line = 'haisdgsfsdf'.
    append xi to xi_pdf.
    xi-line = 'haisdfdsfd'.
    append xi to xi_pdf.
    xi-line = 'haisfgsdfsd'.
    append xi to xi_pdf.
    xi-line = 'haisdfsgfsdgg'.
    append xi to xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    CALL FUNCTION 'SO_SOLITAB_TO_SOLIXTAB'
        EXPORTING
          ip_solitab        = xi_pdf[]
       IMPORTING
         EP_SOLIXTAB       = xtext[].
    **--Send the document by calling the SAPoffice API1 module for sending
    **--documents with attachments
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = doc_chng
          PUT_IN_OUTBOX              = 'X'
         COMMIT_WORK                = 'X'
        IMPORTING
          sent_to_all                = sent_to_all
        TABLES
          packing_list               = objpack
          object_header              = objhead
         contents_bin               = objbin
          contents_txt               = objtxt
          contents_hex               = xtext
          receivers                  = reclist
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          others                     = 99.

    HI,
    There are lots of bugs.
    Please refer this sample program to fix it.
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    Best regards,
    Prashant

Maybe you are looking for

  • Converting to ACC - file names

    hi, when i'm converting mp3 to ACC with iTunes, i would like to name of the file stay the same, but iTunes chenges the name of the file and makes a folder with the name of the singer, is it possible to just convert the files with not changing their n

  • Error in CRM outbound queue

    Hi Guys When I create or modify a customer in CRM to ERP is not replicated, in the outbound queue indicates CRM SYSFAIL error that says:" Gruping is not assigned and account group in IS-M". Please help my! Thank you winston

  • Lotus Notes Traveler sync issues and problems

    No device Hello I could connect my Palm Pre2 to our company's Lotus Notes Traveler successfully. It is not as straight as on iPhone as my colleagues, the only point is to indicate completely the path to the Microsoft Exchange link, like: https://myco

  • Control/Observe Mode Windows 10

    BirdLaw wrote: For Windows 7 and 2008 R2, there's something called Remote Assistance or MSRA.exe /expert (allows unsolicited remote assistance) that will allow you to do this. I would imagine that they have it in Windows 10 and Windows 2012 as well.T

  • I need to put some real estate listings on a site from the MLS Site

    I am working on a realtors web site and he asked me to put his listings from the mls website on to his website, any ideas,