08-06-2010 1:45 PM
Hi ,
I am downloading data from SAP to excel sheet using the WS_DOWNLOAD Function Module. The numeric data in not having leading zeros. if it is 0010 it is displaying 10 in the excel sheet . i need the leading zeros in the excel sheet. without manulally changing it to Text in the excel sheet .
Is there any way to do it .
Thanks,
Chetan
08-06-2010 2:51 PM
Declare the field as Text and save the value into it with leading zeroes.
08-06-2010 3:03 PM
i think that's an excel configuration, try sending the numbers in " "
regards, sebastian
08-06-2010 3:07 PM
Hi Chetan,
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
filename = w_file_path
filetype = 'DBF' "declare the File type as DBF then leading zeros will appear
write_field_separator = 'X'
confirm_overwrite = 'X'
TABLES
data_tab = Itab.
Regards,
Prabhudas
08-06-2010 3:14 PM
Use GUI_DOWNLOAD function module as WS_DOWNLOAD is obselete.
And give file type as 'DBF' in that fm which should give leading zeros in excel.
08-06-2010 3:30 PM
Chetan,
check this link
http://help-abap.blogspot.com/search/label/Excel%20Formatting
Thanks
Bala Duvvuri
09-29-2010 5:31 PM
A better solution is now here with the abap2xlsx Project: http://code.google.com/p/abap2xlsx/
09-30-2010 12:36 AM
Hello,
As Swastik Bharati mentioned, you should declare the field as char and save the value (with leading zeros) and an apostrophe preceding it (e.g. '0010), just like you can do in Excel.
Best regards.
09-30-2010 6:26 AM
This can be done by concatenating a single quotation to the field before downloading . I have done this before and worked fine.
You can refer this blog by Naimesh link:[http://help-abap.blogspot.com/2008/09/preserve-downloaded-data-formatting-in.html] for more details.