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: 

CSV as email attachment - leading spaces

Sharadha1
Active Contributor
0 Kudos

hi all,

I am using the FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' to send csv files as attachment. I am getting the file with a lot leading spaces in my file (except the first line is proper)

Please note that i am adding the line breaks manually in the table.

for ex: i am getting the file as

name,id,contactno,city

'aaa','123','9867847594','ABCD'

'bbb','456','9789269369','BNDR'

whats the reason? how can i delete them?

any ideas

3 REPLIES 3

Sharadha1
Active Contributor
0 Kudos

Hi all,

i solved this issue by following this thread

and using the FM

call function 'SCMS_STRING_TO_FTEXT'

exporting

text = str

  • IMPORTING

  • LENGTH =

tables

ftext_tab = text_content.

to prepare the text to be sent.

Thanks,

Sharadha

0 Kudos

Hi, for remove leading spaces in csv attachement apply OSS Note 1408083

anupam_anand
Participant
0 Kudos

Hi,

Concatenate cl_abap_char_utilities=>cr_lf before every line/record of the file.

This should resolve the issue.


Thanks,

Anupam