DATA: lv_date_int TYPE i.
C_EXCEL_BASELINE_DATE = '19000101'.
c_excel_1900_leap_year = '19000228'.
TRY.
lv_date_int = ip_value.
ep_value = lv_date_int + c_excel_baseline_date - 2.
" Needed hack caused by the problem that:
" Excel 2000 incorrectly assumes that the year 1900 is a leap year
" http://support.microsoft.com/kb/214326/en-us
IF ep_value < c_excel_1900_leap_year.
ep_value = ep_value + 1.
ENDIF.
CATCH cx_sy_conversion_error.
RAISE EXCEPTION TYPE zcx_excel
EXPORTING
error = 'Index out of bounds'.
ENDTRY.