08-12-2014 8:25 AM
Hi All,
Below is my data type for date field.
data : begin of t_date occurs 0 ,
p_date(10) type c ,
belnr like bkpf-belnr ,
end of t_date .
data : w_budat(10) type c .
values in final internal table t_date in debugging:
P_Date
12/06/2008
12/06/2008
24/06/2008
24/06/2008
I am downloading the data to excel file using ws_download. Below is the date in excel file.
Posting DT
12/6/2008
12/6/2008
24/06/2008
24/06/2008
why the first 2 records are having different format in excel file. Please help me.
Thanks,
HT
08-12-2014 2:40 PM
08-12-2014 8:47 AM
Hello
It might be because of Excel formatting.
Try putting an apostrophe (') before the date. Excel treats all values with an apostrophe in front of as a string.
regards
08-12-2014 8:59 AM
Hi Haritha,
Could you please let us know what else parameters are you passing to ws_download function module.
If possible try to use GUI_DOWNLOAD function module as WS_download is Obsolete .
Regards,
Pravin
08-12-2014 1:05 PM
Hi Pravin,
This is 4.0B version. So there is no GUI_DOWNLOAD.
Below are the parameters that I passed.
call function 'WS_DOWNLOAD'
exporting
* BIN_FILESIZE = ' '
* CODEPAGE = ' '
filename = p_file
filetype = 'DAT'
* MODE = ' '
* WK1_N_FORMAT = ' '
* WK1_N_SIZE = ' '
* WK1_T_FORMAT = ' '
* WK1_T_SIZE = ' '
* COL_SELECT = ' '
* COL_SELECTMASK = ' '
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
tables
data_tab = t_date
fieldnames = col_head
exceptions
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_table_width = 4
invalid_type = 5
no_batch = 6
unknown_error = 7
gui_refuse_filetransfer = 8
others = 9.
Also I observed something.
In my code I have 2 statements.
at new zbelnr.
-----
endat.
t_date-p_date = w_budat.
append t_date.
clear t_date.
at new class.
t_date-p_date = w_budat.
append t_date.
clear t_date.
endat.
after at new...endat statement the records appended are coming as
12/6/2008
12/6/2008
but the records appended inside at new class...endat are coming correctly as
24/06/2008
24/06/2008
after the ws_download also, values in final internal table t_date in debugging are showing correctly.
P_Date
12/06/2008
12/06/2008
24/06/2008
24/06/2008
Thanks,
HT
08-12-2014 10:14 AM
08-12-2014 11:51 AM
You have to maintain your excel settings correctly, and then open the file with the excel wizard.
08-12-2014 2:40 PM