Fix dates not converterted to external format

Method get_default_excel_date_format of class zcl_excel_worksheet uses language "E" (English) to determine the date format from domain XUDATFM. 
Method create_csv of class zcl_excel_writer_csv has a logic to determine the field type from the number format. For this also the values from domain XUDATFM are used. But here they are read with sy-langu. Due to this, fields are not correctly identified as "date" when the user language is not English.

Solution: Additionally read domain values with language "E".
This commit is contained in:
Oliver Hütköper 2024-09-25 10:50:36 +02:00 committed by GitHub
parent 4eb1bf5b52
commit a49235de83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,7 +123,7 @@ CLASS ZCL_EXCEL_WRITER_CSV IMPLEMENTATION.
* --- Retrieve SAP date format * --- Retrieve SAP date format
CLEAR ls_format. CLEAR ls_format.
SELECT ddtext INTO ls_format-attvalue FROM dd07t WHERE domname = 'XUDATFM' SELECT ddtext INTO ls_format-attvalue FROM dd07t WHERE domname = 'XUDATFM'
AND ddlanguage = sy-langu. AND ( ddlanguage = sy-langu OR ddlanguage = 'E' ).
ls_format-cmpname = 'DATE'. ls_format-cmpname = 'DATE'.
CONDENSE ls_format-attvalue. CONDENSE ls_format-attvalue.
CONCATENATE '''' ls_format-attvalue '''' INTO ls_format-attvalue. CONCATENATE '''' ls_format-attvalue '''' INTO ls_format-attvalue.