Update zcl_excel_common.clas.abap

This commit is contained in:
Bernd 2024-07-04 10:35:47 +02:00 committed by GitHub
parent 02f4a4ae18
commit 80726e54c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1106,12 +1106,12 @@ CLASS zcl_excel_common IMPLEMENTATION.
METHOD recursive_struct_to_class. METHOD recursive_struct_to_class.
" # issue 139 " # issue 139
DATA: descr TYPE REF TO cl_abap_structdescr, DATA: descr TYPE REF TO cl_abap_structdescr,
lo_refdescr TYPE REF TO cl_abap_refdescr,
wa_component LIKE LINE OF descr->components, wa_component LIKE LINE OF descr->components,
attribute_name LIKE wa_component-name, attribute_name LIKE wa_component-name,
type_kind TYPE abap_typekind, type_kind TYPE abap_typekind,
flag_class TYPE abap_bool, flag_class TYPE abap_bool,
* lo_refdescr TYPE REF TO cl_abap_refdescr, lv_clsname TYPE seoclsname.
o_border TYPE REF TO zcl_excel_style_border.
FIELD-SYMBOLS: <field> TYPE any, FIELD-SYMBOLS: <field> TYPE any,
<fieldx> TYPE any, <fieldx> TYPE any,
@ -1121,18 +1121,12 @@ CLASS zcl_excel_common IMPLEMENTATION.
DESCRIBE FIELD e_target TYPE type_kind. DESCRIBE FIELD e_target TYPE type_kind.
flag_class = boolc( type_kind = cl_abap_typedescr=>typekind_oref ). flag_class = boolc( type_kind = cl_abap_typedescr=>typekind_oref ).
IF flag_class = abap_true AND e_target IS INITIAL. IF flag_class = abap_true AND e_target IS INITIAL.
* TRY. lo_refdescr ?= cl_abap_typedescr=>describe_by_data( e_target ).
* lo_refdescr ?= cl_abap_typedescr=>describe_by_data( e_target ). * The result in lv_clsname is still always 'ZCL_EXCEL_STYLE_BORDER',
* CASE lo_refdescr->get_referenced_type( )->get_relative_name( ). * because currently only borders will be passed as unbound references.
* WHEN 'ZCL_EXCEL_STYLE_BORDER'. * But since we want to set a value we have to create an instance.
* Only borders will be passed as unbound references. But since we want to set a value we have to create an instance lv_clsname = lo_refdescr->get_referenced_type( )->get_relative_name( ).
CREATE OBJECT o_border. CREATE OBJECT e_target TYPE (lv_clsname).
e_target = o_border.
** WHEN 'ZCL_EXCEL_...'. " todo, if necessary
* WHEN OTHERS. " should not happen
* ENDCASE.
* CATCH cx_sy_move_cast_error. " should not happen
* ENDTRY.
ENDIF. ENDIF.
descr ?= cl_abap_structdescr=>describe_by_data( i_source ). descr ?= cl_abap_structdescr=>describe_by_data( i_source ).