Application Development and Automation 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: 
Read only

E-mail content is having extra lines

Former Member
0 Likes
1,309

Hi Team,

I am using CL_BCS / CL_DOCUMENT_BCS to send an-email with an attachment, however, I am facing below issue-

When line of the attachment is complete(all columns are filled) then next line is coming without any additional line feed, if previous line is not having all the columns filled (specially last one) then an additional line feed is coming. Let me take one example below-

ABAP content-

Field1 Field2 Field3

ABC  123     CDE

BCD  456     KDD

BCP

ABC   012    TYY

Excel content

ABC  123     CDE

BCD  456     KDD

BCP

                                             <<<<<<< This extra lines comes in the excel attachment, and I observed that previous line had last column empty.

ABC   012    TYY

I have used CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB for column tabs and CL_ABAP_CHAR_UTILITIES=>CR_LF for line feed and converted entire content in STRING format, then I used  string_to_solix method of CL_BCS_CONVERT to convert the contents in solix format, which ,later, is used in add_attachment method of CL_DOCUMENT_BCS

Kindly help.

Mohit

Hi Team,

I am using CL_BCS / CL_DOCUMENT_BCS to send an-email with an attachment, however, I am facing below issue-

When line of the attachment is complete(all columns are filled) then next line is coming without any additional line feed, if previous line is not having all the columns filled (specially last one) then an additional line feed is coming. Let me take one example below-

ABAP content-

Field1 Field2 Field3

ABC  123     CDE

BCD  456     KDD

BCP

ABC   012    TYY

Excel content

ABC  123     CDE

BCD  456     KDD

BCP

                                             <<<<<<< This extra lines comes in the excel attachment, and I observed that previous line had last column empty.

ABC   012    TYY

I have used CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB for column tabs and CL_ABAP_CHAR_UTILITIES=>CR_LF for line feed and converted entire content in STRING format, then I used  string_to_solix method of CL_BCS_CONVERT to convert the contents in solix format, which ,later, is used in add_attachment method of CL_DOCUMENT_BCS

Kindly help.

Mohit

3 REPLIES 3
Read only

naimesh_patel
Active Contributor
0 Likes
912

It is weird.

Can you share how you are concatenating the string from the data? Also, which code page you use when calling cl_bcs_convert=>string_to_solix( ) ?

Regards,
Naimesh Patel

Read only

0 Likes
912

Hi Naimesh,

Loop at gt_datatabwithfields INTO gs_datatabwithfields.

     concatenate all fields into gv_string separated by cl_abap_char_utilities=>horizontal_tab.

     concatenate gv_string cl_abap_char_utilities=>cr_lf INTO gv_string.

ENDLOOP.

Codepage used is '4103'.

Thanks

Mohit

Read only

0 Likes
912

The issue is resolved now. we have now used CL_ABAP_CHAR_UTILITIES=>NEWLINE instead of CR_LF.

Thanks ...