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: 

Email with txt attachment - issue with carriage return

Former Member
0 Kudos

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.

2 REPLIES 2

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

Start using  cl_bcs .

Also please look at

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.

Former Member
0 Kudos

Hi Adrian,

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

Thanking You All..!!