This website is not affiliated with, sponsored by, or approved by SAP AG.

Export Excel file

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Export Excel file

Postby karen1712 » Wed May 07, 2014 5:12 am

Hi experts,

Could you please help me How to display Material Number like below.

Currently : Display Material number in excel file is 1.46852E+12.
Expected : Display Material number in excel file is 1468522273079
I'm using 2 functions below to download excel file :
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
i_field_seperator = cl_abap_char_utilities=>horizontal_tab
TABLES
i_tab_sap_data = lt_temp
CHANGING
i_tab_converted_data = lt_temp1
EXCEPTIONS
OTHERS = 1.

CALL FUNCTION 'SCMS_TEXT_TO_BINARY'
IMPORTING
output_length = lt_temp1
TABLES
text_tab = lt_temp3
binary_tab = lt_temp4
EXCEPTIONS
failed = 1
OTHERS = 2.
I would like appreciate for your help.
thank you so much .
karen1712
 
Posts: 4
Joined: Fri Nov 22, 2013 9:09 am

Re: Export Excel file

Postby Gothmog » Wed May 07, 2014 5:21 am

Excel will display huge numbers using scientific notation.
In order to display the character string, Excel must not think your filed is a number.
Try prefixing it with a single quote ('), or set the column type to Text when you open the txt file in Excel.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1942
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: Export Excel file

Postby karen1712 » Sun May 11, 2014 9:37 pm

Hi Gothmog,

Thank you for you help but how to set the column type to Text before opening excel file?

Thank you so much
Karen
karen1712
 
Posts: 4
Joined: Fri Nov 22, 2013 9:09 am

Re: Export Excel file

Postby Gothmog » Mon May 12, 2014 3:46 am

The column type does not exist outside of Excel, and you are not using an Excel file.
Either produce a real excel file with the correct formatting (using OLE, or the SCN Community project abap2xlsx), or continue using a tabulated text file, and in this case, it's when you open it that you can manage the columns format (when opening it from Excel, not from the File Explorer).
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1942
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home


Return to ABAP

Who is online

Users browsing this forum: No registered users and 9 guests





This website is not affiliated with, sponsored by, or approved by SAP AG.