mirror of
https://github.com/abap2xlsx/abap2xlsx.git
synced 2025-05-05 07:56:15 +08:00
Update zcl_excel_common.clas.abap
defined exit when unbound reference (border) in class_to_struct instead "Should not happen" exit
This commit is contained in:
parent
6dcfbcf4e3
commit
b036ad8750
|
@ -1075,6 +1075,9 @@ CLASS zcl_excel_common IMPLEMENTATION.
|
||||||
DESCRIBE FIELD i_source TYPE type_kind.
|
DESCRIBE FIELD i_source TYPE type_kind.
|
||||||
flag_class = boolc( type_kind = cl_abap_typedescr=>typekind_oref ).
|
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 ).
|
descr ?= cl_abap_structdescr=>describe_by_data( e_target ).
|
||||||
|
|
||||||
LOOP AT descr->components INTO wa_component.
|
LOOP AT descr->components INTO wa_component.
|
||||||
|
@ -1086,10 +1089,6 @@ CLASS zcl_excel_common IMPLEMENTATION.
|
||||||
IF flag_class = abap_false.
|
IF flag_class = abap_false.
|
||||||
* source is a structure - use assign component
|
* source is a structure - use assign component
|
||||||
ASSIGN COMPONENT wa_component-name OF STRUCTURE i_source TO <attribute>.
|
ASSIGN COMPONENT wa_component-name OF STRUCTURE i_source TO <attribute>.
|
||||||
ELSEIF i_source IS INITIAL.
|
|
||||||
CLEAR <field>.
|
|
||||||
CLEAR <fieldx> WITH abap_true.
|
|
||||||
CONTINUE.
|
|
||||||
ELSE.
|
ELSE.
|
||||||
* then it is an attribute of the class - use different assign then
|
* then it is an attribute of the class - use different assign then
|
||||||
CONCATENATE 'i_source->' wa_component-name INTO attribute_name.
|
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.
|
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.
|
||||||
* Only borders will be passed as unbound references. 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
|
||||||
CREATE OBJECT o_border.
|
CREATE OBJECT o_border.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user