Fix date identification logic for newer AS ABAP versions

The texts of domain XUDATFM changed in newer systems:
NW 7.40: DD.MM.YYYY
NW 7.52: DD.MM.YYYY (Gregorian Date)

This breaks the date identification logic.

New logic copied from get_date_format_des of class cl_abap_datfm, which is called in method get_default_excel_date_format of class zcl_excel_worksheet to get the users default date pattern.
This commit is contained in:
Oliver Hütköper 2024-10-07 16:56:09 +02:00 committed by GitHub
parent c00fa49e79
commit a9c31f1715
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -125,6 +125,7 @@ CLASS ZCL_EXCEL_WRITER_CSV IMPLEMENTATION.
SELECT ddtext INTO ls_format-attvalue FROM dd07t WHERE domname = 'XUDATFM'
AND ( ddlanguage = sy-langu OR ddlanguage = 'E' ).
ls_format-cmpname = 'DATE'.
ls_format-attvalue = ls_format-attvalue(10). " Ignore description, only use pattern
CONDENSE ls_format-attvalue.
CONCATENATE '''' ls_format-attvalue '''' INTO ls_format-attvalue.
APPEND ls_format TO lt_format.