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: 

Unwanted linebreaks in Mail using CL_BCS

Clemenss
Active Contributor
0 Kudos
1,848

Hi experts,

I concatenate a couple of texts separated by cl_abap_char_utilities=>cr_lf.

Then I use

lt_soli = cl_bcs_convert=>string_to_soli( lv_string ).

Then I create the mail content

lo_document = cl_document_bcs=>create_document(

   i_type     = 'RAW'

   i_length   = lv_size_document

    i_text = lt_soli

   i_subject = lv_subject ).

The Mail is sent but mysteriously after 255 characters an additional linefeed is inserted.

I already tried

lt_solix = cl_bcs_convert=>soli_to_solix( lt_soli   ).

and passed the SOLIX_TAB to parameter I_HEX of method create_document.

Still I get the unwanted linebreaks.

Any solution?

Thanks in advance,

Clemens

1 ACCEPTED SOLUTION

former_member197445
Contributor
271

1. If you use the doctype RAW a linebreak is automatically inserted after each line (or 255 characters)

2. If you want to add lines which are longer than 255 characters you must use a doctype other than RAW. If you use TXT no line breaks are inserted after 255 characters. For TXT documents you are responsible for the line breaks.

For more information, see the SCN wiki page.

4 REPLIES 4

Former Member
0 Kudos
271

Did you really mean to insert the carriage return line feed then?

Looks like that is the problem.

0 Kudos
271

Hi,

yes, I inserted linebreaks to get the lines. This works fine. But in the mail I get unwanted additional linebreaks after each 255 characters.

Yes I want a couple of lines which I fill with characters, sometimes a TAB and spaces. These lines should appear one after another in my mail body.

This works fine the way I do it, but SAP seems to insert additional CR_LF after 254 characters in my string.

How can I get the mail as I want it ?

Thanks and regards

Clemens

former_member197445
Contributor
272

1. If you use the doctype RAW a linebreak is automatically inserted after each line (or 255 characters)

2. If you want to add lines which are longer than 255 characters you must use a doctype other than RAW. If you use TXT no line breaks are inserted after 255 characters. For TXT documents you are responsible for the line breaks.

For more information, see the SCN wiki page.

0 Kudos
271

Thank you this solved the Problem I had.