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

Email with txt attachment - issue with carriage return

Hello,

I am trying to send an email with txt tab delimited file as attachment. I am following what Thomas Jung has suggested in other posts. I am able to generate the email with txt attachment but my issue is txt is not taking into account carriage return (CR_LF). But if I open the txt file with excel, I can see carriage return. Not sure what I am doing wrong for txt file to discard carriage return. Below is what I am doing. Thomas Jung or someone please help me.

I am using SCMS_STRING_TO_FTEXT per Thomas suggestion. My str2 string has the contents of my attachment with tab & carriage returns. And I am passing my IT_OBJBIN to CONTENTS_BIN of SO_DOCUMENT_SEND_API1.

Capture.PNG (10.3 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Aug 30, 2015 at 02:53 AM

    Hi,

    Start using cl_bcs .

    Also please look at Multi Line Cell In Excel Using CSV by Mail

    The program attached use cl_abap_char_utilities=>cr_lf .

    After generating the tab delimited string use:

    DATA: it_solix TYPE solix_tab .
    DATA: attachment_subject TYPE so_obj_des .

    DATA: ob_document_bcs TYPE REF TO cl_document_bcs.

    CALL METHOD cl_bcs_convert=>string_to_solix

    EXPORTING

    iv_string = your_string

    IMPORTING

    et_solix = it_solix.

    attachment_subject = 'Attachment subjec' .

    CALL METHOD ob_document_bcs->add_attachment

    EXPORTING

    i_attachment_type = 'txt'

    i_attachment_subject = attachment_subject

    i_att_content_hex = it_solix.

    Easy.....😊

    Regards.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2015 at 07:34 PM

    Hi Adrian,

    Pls. take help from Report BCS_EXAMPLE_7, available in your system..!!

    Thanking You All..!!

    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.