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

Issue in displaying numbers in Excel

Former Member
0 Likes
1,942

Hi,

I am converting my report output to XLS format using the CL_BCS class. I am converting my string into binary content and adding it as a xls attachement.

cl_bcs_convert=>string_to_solix(

EXPORTING

iv_string = lv_string

iv_codepage = '4103'

iv_add_bom = 'X'

IMPORTING

et_solix = binary_content

ev_size = size ).

*add attachment

document->add_attachment(

i_attachment_type = 'xls'

i_attachment_subject = 'Output'

i_attachment_size = size

i_att_content_hex = binary_content ).

I am able to email the generated excel file but if my column hold numbers with more digtis (ie, 1234567891234 , displayed as 1.23457E+12), its getting displayed as exponent format.

pl guide me on handling this im my program itself.

Regards,

BG

4 REPLIES 4
Read only

Former Member
0 Likes
831

Hi

I tried using your example and also added some more digits to it and I realised the error works this way - if it is a 13 digit number 1234567891234

The error will be 1.23457E+12 and similarly anything bigger like say 15 digit will have 14 after the plus.

I changed the formatting to number and it worked. So I believe this can be reported as a bug in Excel.

Rgds

Read only

Former Member
0 Likes
831

Hi BG,

Try declaring the column of internal table as CHAR type, instead of a numeric field.

Regards,

Nisha Vengal.

Read only

Former Member
0 Likes
831

Dear all,

I am using the same ABAP code and do the same purpose. but in received Excel attachment, when the field content should be "1E2", it displays as "1.00E02" ; when it shold be "1E8", displays as "1.00E08". but when it is "1ED" or "1EY", it displays correctly.

looking forwarding to your reply

Read only

Former Member
0 Likes
831

Dear all,

I meet the same problem as yours,

You could try Cl_ixml class to make it as formatted Excel. http://wiki.sdn.sap.com/wiki/display/Snippets/FormattedExcelasEmailAttachment

need to use MXL to control its format and data,

it works for me, but increase the file size.

Peter Ding