From 371dfbba566180046d923846087a144148f401bd Mon Sep 17 00:00:00 2001 From: FoxAhead Date: Thu, 29 Sep 2016 15:00:57 +0300 Subject: [PATCH] Method DATE_TO_EXCEL_STRING: Date field = space Sometimes you get date field empty - containing only space(s) (not zeroes '00000000'). This value treated as not initial in ABAP for fields typed as D. This resulted in passing by CHECK ip_value IS NOT INITIAL and calculating lv_date_diff = ip_value - c_excel_baseline_date + 1. which returns "-693596". In EXCEL this displayed as #########... --- ZA2X/CLAS/ZCL_EXCEL_COMMON.slnk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ZA2X/CLAS/ZCL_EXCEL_COMMON.slnk b/ZA2X/CLAS/ZCL_EXCEL_COMMON.slnk index ec06b8c..175af45 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_COMMON.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_COMMON.slnk @@ -1673,7 +1673,8 @@ endmethod. method DATE_TO_EXCEL_STRING. DATA: lv_date_diff TYPE i. - CHECK ip_value IS NOT INITIAL. + CHECK ip_value IS NOT INITIAL + AND ip_value <> space. " 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