When uploading an Excel file in Web Dynpro for ABAP with date, the date looks like 41851
instead of 7/31/2014
.
How can I solve this problem?
When uploading an Excel file in Web Dynpro for ABAP with date, the date looks like 41851
instead of 7/31/2014
.
How can I solve this problem?
Excel stores Dates as numbers. To display that number as Date as you know it, format the cell as Date cell.
Use this formula =TEXT(41851,"YYYY-mm-dd") and the date should upload correctly (you can change the format string to whatever you need).
I found solution:
data: lv_data type sy-datum,
lv_startdate type sy-datum.
lv_startdate = '19000101'. "starting date(excel parameter)
lv_data = lv_startdate + 41851(the date from excel that we need to convert to normal date) - 2.
write lv_data.
this code works, thx all for help.