From b036ad8750ff6c654ab7b63f7fe78692206f0424 Mon Sep 17 00:00:00 2001 From: Bernd <135710507+darnoc312@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:07:48 +0200 Subject: [PATCH] Update zcl_excel_common.clas.abap defined exit when unbound reference (border) in class_to_struct instead "Should not happen" exit --- src/zcl_excel_common.clas.abap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/zcl_excel_common.clas.abap b/src/zcl_excel_common.clas.abap index 75e8b9e..1fd4ccf 100644 --- a/src/zcl_excel_common.clas.abap +++ b/src/zcl_excel_common.clas.abap @@ -1075,6 +1075,9 @@ CLASS zcl_excel_common IMPLEMENTATION. DESCRIBE FIELD i_source TYPE type_kind. flag_class = boolc( type_kind = cl_abap_typedescr=>typekind_oref ). +* Only borders will be passed as unbound references. + CHECK flag_class = abap_false OR i_source IS NOT INITIAL. " Exit if unbound reference + descr ?= cl_abap_structdescr=>describe_by_data( e_target ). LOOP AT descr->components INTO wa_component. @@ -1086,10 +1089,6 @@ CLASS zcl_excel_common IMPLEMENTATION. IF flag_class = abap_false. * source is a structure - use assign component ASSIGN COMPONENT wa_component-name OF STRUCTURE i_source TO . - ELSEIF i_source IS INITIAL. - CLEAR . - CLEAR WITH abap_true. - CONTINUE. ELSE. * then it is an attribute of the class - use different assign then CONCATENATE 'i_source->' wa_component-name INTO attribute_name. @@ -1130,6 +1129,7 @@ CLASS zcl_excel_common IMPLEMENTATION. DESCRIBE FIELD e_target TYPE type_kind. flag_class = boolc( type_kind = cl_abap_typedescr=>typekind_oref ). + IF flag_class = abap_true AND e_target IS INITIAL. * Only borders will be passed as unbound references. But since we want to set a value we have to create an instance CREATE OBJECT o_border.