Skip to Content
0
Jul 20, 2016 at 11:13 PM

Sending .CVS via email

203 Views

Hi,

I´m using this function:

CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'

EXPORTING

i_field_seperator = ','

* I_LINE_HEADER =

* I_FILENAME =

* I_APPL_KEEP = ' '

TABLES

i_tab_sap_data = it_file_titles

CHANGING

i_tab_converted_data = it_tabla_csv

EXCEPTIONS

conversion_failed = 1

OTHERS = 2.

IF sy-subrc <> 0.

bnd_error = 'E'.

ENDIF.

This function transforms an internal table to a .CSV file, then I try to send by email the table it_tabla_csv with this function:

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = doc_chng

put_in_outbox = 'X'

commit_work = 'X'

TABLES

packing_list = objpack

object_header = objhead

contents_bin = objbin

contents_txt = objtxt

receivers = reclist

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

operation_no_authorization = 4

OTHERS = 99.

When I send the file and check it in my email, the file has spaces in the first column of each row.

Help please!

Attachments

image.png (6.6 kB)