‎2009 Jan 13 4:31 PM
Hi,
I am writing a program that will send out an email with an excel attachment. When I open the excel file, it does show the leading zeros if the value contents only digits. For example. if the plant is '0005' the file displays just '5'. Do you know how to format the cell to text field?
I am using FM 'SO_DOCUMENT_SEND_API1' for the email sending.
Thanks,
Chuong
‎2009 Jan 13 4:34 PM
‎2009 Jan 13 4:39 PM
It's an excel thing.
The easiest solution is just to place a non numeric character at the beggining or end of the number to treat it like a string.
Something like .005 or {005
‎2009 Jan 13 5:03 PM
I'm thinking of a single quote but don't know how to define single quote in ABAP. Please help!
‎2009 Jan 13 5:09 PM
‎2009 Jan 13 5:17 PM
Thanks. However, the single quote does not have the same functionality as in Excel. It does not change to the text format.
‎2009 Jan 13 5:26 PM
I think if you pass data as '0005 then it should display as 0005 in excel.
Could you check whether you are loosing leading zero before you are passing the data to FM (for email)
If you are using CONCATENATE statement to add single quote to plant then check whether you are loosing zeros there.
‎2009 Jan 13 6:54 PM
I still have the zeors before passing to the FM. In excel, it displayed '0005 instead of 0005.
‎2009 Jan 13 7:25 PM
Hi,
You can configure the Excel to display the cell/collum in text format.
Best regards.
Henrique
‎2009 Jan 14 2:56 PM
‎2009 Jan 14 5:34 PM
Hi,
If you are using OLE automation to create the excel, you should format the cell like this:
SET PROPERTY OF cell 'NumberFormat' = '@'.
Regards,
Claudiu
‎2009 Jan 13 5:32 PM
Your file contains the leading zeros but when you open it in Excel, Excel is removing those leading zeros. Because excel treats that as a number.
Check this on [Preserve Downloaded data formatting in Excel |http://help-abap.blogspot.com/2008/09/preserve-downloaded-data-formatting-in.html]
Regards,
Naimesh Patel