Skip to Content

Sending .CVS via email

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!

image.png (6.6 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jul 21, 2016 at 04:44 AM

    Hi,

    FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'' is obsolete now,


    try Classes CL_DOCUMENT_BCS and CL_BCS its method for sending emails with attachment..

    Method for the attachment ADD_ATTACHMENT

    refer the following link : Send email from ABAP with class CL_BCS - Code Gallery - SCN Wiki

    thanks!!

    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.