Skip to Content
author's profile photo Former Member
Former Member

Send email with CSV attachment

Hi Expert,

I want send the .csv with as an attachment through email. And I try have tried the example program "BCS_EXAMPLE_7".

It works fine if the attachment is .xls, but when I change it to .csv, the attachment cannot be generated correctly.

The line break function is not working in the .csv file and all the content will display in the same row when open it through the notepad.

Also, I have try the sample below, but the number of characters are restricted to 255, but my case have more than 255 chars per row.

http://www.sapdev.co.uk/reporting/email/attach_xls.htm

Please help.

Best Regards,

WF

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 04, 2010 at 12:02 PM

    Hi William,

    Check this code on the wiki below :-

    [http://wiki.sdn.sap.com/wiki/display/Snippets/HowtosendInternalTabletoE_Mail+address]

    Regards

    Abhii

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 04, 2010 at 12:02 PM

    Have you tried inserting a carriage return or line feed or both at the appropriate point to create the line break? For your width, if you have a long row, can you fit within 255 characters using comma delimiters and condense keyword?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 05, 2010 at 10:47 AM

    BCS_EXAMPLE_7 check the following code already mention i_attachment_type = 'xls' so first u copy on 'z'report then u change it .CSV insted of XLS

    document->add_attachment(
            i_attachment_type    = 'xls'                        "#EC NOTEXT
            i_attachment_subject = 'ExampleSpreadSheet'         "#EC NOTEXT
            i_attachment_size    = size
            i_att_content_hex    = binary_content ).
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 12, 2010 at 01:56 AM

    Solved

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.