Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Send email with CSV attachment

Former Member
0 Kudos
2,288

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

4 REPLIES 4

Former Member
0 Kudos
553

Hi William,

Check this code on the wiki below :-

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

Regards

Abhii

Former Member
0 Kudos
553

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?

Former Member
0 Kudos
553

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

Former Member
0 Kudos
553

Solved