2010 Mar 04 6:10 PM
Hi all,
I have an internal table with a field defined as char 12. I pass this internal table to FM MS_EXCEL_OLE_STAN DARD_DAT but I find in my excel file this value: 9,87654E+11.
Any idea to obtain the correct value 987654321011?
Thanks in advance for your kind support.
Regards,
Luigi
2010 Mar 04 6:20 PM
Hi,
In excel file, format the cell category as 'NUMBER'.
right click on the cell in excel file and click on format cell, select the category as 'NUMBER', Value will come appropriately.
Thanks
Hemant
2010 Mar 04 7:04 PM
Hi,
Just try to expand that cell width. It will display complete value. It is the standard excel property.
Thanks,
Vinod.
2010 Mar 05 9:34 AM
Hi,
this is my test.
FM SAP_CONVERT_TO_XLS_FORMAT and FM MS_EXCEL_OLE_STANDARD_DAT: the value in excel file is 9,87654E+11 launching both functions. If I try to resize the column, this value don't change. If I set as cell type (manually) number with zero decimals, this is ok.
For may test I userd the field knvv-eikto.
How it is possible to have this value downloaded correctly into the excel file?
Thanks in advance for your kind support.
Regards,
Luigi
2010 Mar 05 10:03 AM
Hi,
If the excel file which you are downloading is only for display purpose, you can include an apostrophe ( ' ) prior to char12..
The output then looks as you expected.
'987654321012
Regards,
Sailaja.
2010 Mar 05 10:07 AM
With a leading apostrophe its no longer a number.
There is no way to control excel how it displays numbers, excel is even taking the screen width in consideration (more or less/broader/smaller columns) when choosing the cell format.
2010 Mar 05 1:17 PM
Ok I tried using the FM 'GUI_DOWNLOAD' but I obtained the same issue.
Using OLE objects (TYPE-POOLS ole2) I find many possibilities to "create" a workbook" in the same way I can use excel macro.
Do you have any suggestion or abap code?
Thanks.
Luigi
2010 Mar 05 9:34 PM
In the above FM there is parameter called 'FILE TYPE'
pass the value for it as 'DBF'
it will work.
2010 Mar 05 10:50 PM
Luigi, in this thread , I explained how to record a macro in Excel in VBA, and convert it (manually of course ) into ABAP OLE statements. You will easily get the code to set the cell number format.
Note that SAP created a layer called Desktop Office Integration (DOI), based on OLE. It may ease some operations. There are some demo programs in SAP (search DEMOINTEGR* or DEMODOI*).
2010 Mar 06 4:51 AM