2006 Feb 20 12:34 PM
Hi Folks,
I am uploading excel sheet using function module 'ALSM_EXCEL_TO_INTERNAL_TABLE', but I notice a strange thing, format of date in excel sheet is 'DD/MM/YYYY' but while uploading the FM turns the date into the format 'mm/dd/yyyy'.
I also changed my user settings but the problem didnt solved.
Thanks in advance.
2006 Feb 20 12:38 PM
Hi punit,
1. Well if you are sure the date is
converted into this format everytime,
then after uploading in to itab,
just loop
and convert it into dd/mm/yyyy.
2. However,
It IS ALWAYS BEST THING TO
PUT THE DATE IN EXCEL IN
YYYYMMDD format only.
and take the variable in itab as sy-datum.
3. This will take care of
all formatting problems !
regards,
amit m.
2006 Feb 20 12:45 PM
when u r defining the internal table for the flat file or excel file the fields u accept them as string and then convert it to their real format. this avoids u interchanging of formats, etc.,
for suppose, the itab is having vbeln, name1, erdat.
u just take the itab as
begin of itab occurs 0,
vbeln(10) type c,
name1(35) type c,
erdat(10) type c,
end of itab.
after u get the data into itab, u can convert it into the original format.
2006 Feb 20 1:39 PM
hi ,
it may due to some conversion subroutine on date field.
1.The best solution as is to declare one more date field(D2) in ur internal table.
2. loop ur internal table and then move the downloaded date format in the format mm/dd/yyyy(as u said right now) to this new date field(d2) as dd/mm/yyyy using
write:/ d1 to d2 using edit mask dd/mm/yyyy.
3.check the length of the date field as it is 10 charaters or 8 .for ur query it should be 10 characters
4.now modify the internal table.
i think this will solve ur query.
vijay.
2015 Sep 23 12:57 PM
Anybody solve this issue? I have the same problem.
I am using function module ALSM_EXCEL_TO_INTERNAL_TABLE, cells with format DD/MM/YYYY are uploading changing the order of months and Days.(EX. 12/01/1986 become 01/12/1986)
More strange thing: it does this only if day are less than 12... If I write a date that have day more than 12 it take the date in right format.(Ex. if I write 13/01/1986 come exact 13/01/1986)...
I tried to change the format of the cell in Excel file but it doesen't cause any effect...
Internal table exporting by the function doesen't have any date format declared for the field that stored the value from excel cells, I can't undestand where and why it do this convertion....
Anyhelp will be appreciated.
2016 Apr 04 5:29 PM