Merge pull request #592 from gregorwolf/master

700 support #562 and abaplint check
This commit is contained in:
Gregor Wolf 2019-02-11 18:39:27 +01:00 committed by GitHub
commit f3d46100a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 275 additions and 131 deletions

View File

@ -12,6 +12,7 @@
<item>/package.json</item> <item>/package.json</item>
<item>/.travis.yml</item> <item>/.travis.yml</item>
<item>/_config.yml</item> <item>/_config.yml</item>
<item>/abaplint.json</item>
</IGNORE> </IGNORE>
</DATA> </DATA>
</asx:values> </asx:values>

119
abaplint.json Normal file
View File

@ -0,0 +1,119 @@
{
"global": {
"version": "v700",
"skipGeneratedGatewayClasses": true,
"skipGeneratedPersistentClasses": true
},
"rules": {
"7bit_ascii": {
"enabled": false
},
"contains_tab": {
"enabled": false
},
"functional_writing": {
"enabled": false,
"ignoreExceptions": true
},
"line_length": {
"enabled": false,
"length": 120
},
"max_one_statement": {
"enabled": false
},
"parser_error": {
"enabled": true
},
"space_before_colon": {
"enabled": false
},
"colon_missing_space": {
"enabled": false
},
"exit_or_check": {
"enabled": false
},
"line_only_punc": {
"enabled": false,
"ignoreExceptions": true
},
"obsolete_statement": {
"enabled": false,
"refresh": true,
"compute": true,
"add": true,
"subtract": true,
"multiply": true,
"move": true,
"divide": true,
"requested": true
},
"start_at_tab": {
"enabled": false
},
"whitespace_end": {
"enabled": true
},
"exporting": {
"enabled": false
},
"empty_statement": {
"enabled": false
},
"sequential_blank": {
"enabled": false,
"lines": 4
},
"definitions_top": {
"enabled": false
},
"breakpoint": {
"enabled": false
},
"nesting": {
"enabled": false,
"depth": 5
},
"keywords_upper": {
"enabled": false,
"ignoreExceptions": true
},
"cloud_types": {
"enabled": true
},
"method_length": {
"enabled": false,
"statements": 100
},
"mix_returning": {
"enabled": true
},
"method_parameter_names": {
"enabled": false,
"ignoreExceptions": true,
"importing": "^I._.*$",
"returning": "^R._.*$",
"changing": "^C._.*$",
"exporting": "^E._.*$",
"ignoreNames": [
"P_TASK"
]
},
"inline_data_old_versions": {
"enabled": true
},
"local_variable_names": {
"enabled": false,
"expectedData": "^L._.*$",
"expectedConstant": "^LC_.*$",
"expectedFS": "^<L._.*>$"
},
"class_attribute_names": {
"enabled": false,
"ignoreExceptions": true,
"statics": "^G._.*$",
"instance": "^M._.*$"
}
}
}

View File

@ -4217,7 +4217,7 @@ CLASS ZCL_EXCEL_WORKSHEET IMPLEMENTATION.
endmethod. endmethod.
method GET_TABLE. METHOD get_table.
*--------------------------------------------------------------------* *--------------------------------------------------------------------*
* Comment D. Rauchenstein * Comment D. Rauchenstein
* With this method, we get a fully functional Excel Upload, which solves * With this method, we get a fully functional Excel Upload, which solves
@ -4230,116 +4230,128 @@ CLASS ZCL_EXCEL_WORKSHEET IMPLEMENTATION.
* CL_EXCEL_READER_2007->ZIF_EXCEL_READER~LOAD_FILE() * CL_EXCEL_READER_2007->ZIF_EXCEL_READER~LOAD_FILE()
*--------------------------------------------------------------------* *--------------------------------------------------------------------*
field-symbols: <LS_LINE> type DATA. FIELD-SYMBOLS: <ls_line> TYPE data.
field-symbols: <LV_VALUE> type DATA. FIELD-SYMBOLS: <lv_value> TYPE data.
data LV_ACTUAL_ROW type INT4. DATA lv_actual_row TYPE int4.
data LV_ACTUAL_COL type INT4. DATA lv_actual_row_string TYPE string.
data LV_ERRORMESSAGE type STRING. DATA lv_actual_col TYPE int4.
data LV_MAX_COL type ZEXCEL_CELL_COLUMN. DATA lv_actual_col_string TYPE string.
data LV_MAX_ROW type INT4. DATA lv_errormessage TYPE string.
data LV_DELTA_COL type INT4. DATA lv_max_col TYPE zexcel_cell_column.
data LV_VALUE type ZEXCEL_CELL_VALUE. DATA lv_max_row TYPE int4.
data LV_RC type SYSUBRC. DATA lv_delta_col TYPE int4.
DATA lv_value TYPE zexcel_cell_value.
DATA lv_rc TYPE sysubrc.
LV_MAX_COL = ME->GET_HIGHEST_COLUMN( ). lv_max_col = me->get_highest_column( ).
LV_MAX_ROW = ME->GET_HIGHEST_ROW( ). lv_max_row = me->get_highest_row( ).
*--------------------------------------------------------------------* *--------------------------------------------------------------------*
* The row counter begins with 1 and should be corrected with the skips * The row counter begins with 1 and should be corrected with the skips
*--------------------------------------------------------------------* *--------------------------------------------------------------------*
LV_ACTUAL_ROW = IV_SKIPPED_ROWS + 1. lv_actual_row = iv_skipped_rows + 1.
LV_ACTUAL_COL = IV_SKIPPED_COLS + 1. lv_actual_col = iv_skipped_cols + 1.
try. TRY.
*--------------------------------------------------------------------* *--------------------------------------------------------------------*
* Check if we the basic features are possible with given "any table" * Check if we the basic features are possible with given "any table"
*--------------------------------------------------------------------* *--------------------------------------------------------------------*
append initial line to ET_TABLE assigning <LS_LINE>. APPEND INITIAL LINE TO et_table ASSIGNING <ls_line>.
if SY-SUBRC <> 0 or <LS_LINE> is not assigned. IF sy-subrc <> 0 OR <ls_line> IS NOT ASSIGNED.
LV_ERRORMESSAGE = 'Error at inserting new Line to internal Table'(002). lv_errormessage = 'Error at inserting new Line to internal Table'(002).
zcx_excel=>raise_text( lv_errormessage ). zcx_excel=>raise_text( lv_errormessage ).
else. ELSE.
LV_DELTA_COL = LV_MAX_COL - IV_SKIPPED_COLS. lv_delta_col = lv_max_col - iv_skipped_cols.
assign component LV_DELTA_COL of structure <LS_LINE> to <LV_VALUE>. ASSIGN COMPONENT lv_delta_col OF STRUCTURE <ls_line> TO <lv_value>.
if SY-SUBRC <> 0 or <LV_VALUE> is not assigned. IF sy-subrc <> 0 OR <lv_value> IS NOT ASSIGNED.
LV_ERRORMESSAGE = 'Internal table has less columns than excel'(003). lv_errormessage = 'Internal table has less columns than excel'(003).
zcx_excel=>raise_text( lv_errormessage ). zcx_excel=>raise_text( lv_errormessage ).
else. ELSE.
*--------------------------------------------------------------------* *--------------------------------------------------------------------*
*now we are ready for handle the table data *now we are ready for handle the table data
*--------------------------------------------------------------------* *--------------------------------------------------------------------*
refresh ET_TABLE. REFRESH et_table.
*--------------------------------------------------------------------* *--------------------------------------------------------------------*
* Handle each Row until end on right side * Handle each Row until end on right side
*--------------------------------------------------------------------* *--------------------------------------------------------------------*
while LV_ACTUAL_ROW <= LV_MAX_ROW . WHILE lv_actual_row <= lv_max_row .
*--------------------------------------------------------------------* *--------------------------------------------------------------------*
* Handle each Column until end on bottom * Handle each Column until end on bottom
* First step is to step back on first column * First step is to step back on first column
*--------------------------------------------------------------------* *--------------------------------------------------------------------*
LV_ACTUAL_COL = IV_SKIPPED_COLS + 1. lv_actual_col = iv_skipped_cols + 1.
unassign <LS_LINE>. UNASSIGN <ls_line>.
append initial line to ET_TABLE assigning <LS_LINE>. APPEND INITIAL LINE TO et_table ASSIGNING <ls_line>.
if SY-SUBRC <> 0 or <LS_LINE> is not assigned. IF sy-subrc <> 0 OR <ls_line> IS NOT ASSIGNED.
LV_ERRORMESSAGE = 'Error at inserting new Line to internal Table'(002). lv_errormessage = 'Error at inserting new Line to internal Table'(002).
zcx_excel=>raise_text( lv_errormessage ). zcx_excel=>raise_text( lv_errormessage ).
endif. ENDIF.
while LV_ACTUAL_COL <= LV_MAX_COL. WHILE lv_actual_col <= lv_max_col.
LV_DELTA_COL = LV_ACTUAL_COL - IV_SKIPPED_COLS. lv_delta_col = lv_actual_col - iv_skipped_cols.
assign component LV_DELTA_COL of structure <LS_LINE> to <LV_VALUE>. ASSIGN COMPONENT lv_delta_col OF STRUCTURE <ls_line> TO <lv_value>.
if SY-SUBRC <> 0. IF sy-subrc <> 0.
LV_ERRORMESSAGE = |{ 'Error at assigning field (Col:'(004) } { LV_ACTUAL_COL } { ' Row:'(005) } { LV_ACTUAL_ROW }|. lv_actual_col_string = lv_actual_col.
lv_actual_row_string = lv_actual_row.
CONCATENATE 'Error at assigning field (Col:'(004) lv_actual_col_string ' Row:'(005) lv_actual_row_string INTO lv_errormessage.
zcx_excel=>raise_text( lv_errormessage ). zcx_excel=>raise_text( lv_errormessage ).
endif. ENDIF.
ME->GET_CELL( me->get_cell(
exporting EXPORTING
IP_COLUMN = LV_ACTUAL_COL " Cell Column ip_column = lv_actual_col " Cell Column
IP_ROW = LV_ACTUAL_ROW " Cell Row ip_row = lv_actual_row " Cell Row
importing IMPORTING
EP_VALUE = LV_VALUE " Cell Value ep_value = lv_value " Cell Value
EP_RC = LV_RC " Return Value of ABAP Statements ep_rc = lv_rc " Return Value of ABAP Statements
). ).
if LV_RC <> 0 IF lv_rc <> 0
and LV_RC <> 4. "No found error means, zero/no value in cell AND lv_rc <> 4. "No found error means, zero/no value in cell
LV_ERRORMESSAGE = |{ 'Error at reading field value (Col:'(007) } { LV_ACTUAL_COL } { ' Row:'(005) } { LV_ACTUAL_ROW }|. lv_actual_col_string = lv_actual_col.
lv_actual_row_string = lv_actual_row.
CONCATENATE 'Error at reading field value (Col:'(007) lv_actual_col_string ' Row:'(005) lv_actual_row_string INTO lv_errormessage.
zcx_excel=>raise_text( lv_errormessage ). zcx_excel=>raise_text( lv_errormessage ).
endif. ENDIF.
<LV_VALUE> = LV_VALUE. <lv_value> = lv_value.
* CATCH zcx_excel. " * CATCH zcx_excel. "
add 1 to LV_ACTUAL_COL. ADD 1 TO lv_actual_col.
endwhile. ENDWHILE.
add 1 to LV_ACTUAL_ROW. ADD 1 TO lv_actual_row.
endwhile. ENDWHILE.
endif. ENDIF.
endif. ENDIF.
catch CX_SY_ASSIGN_CAST_ILLEGAL_CAST. CATCH cx_sy_assign_cast_illegal_cast.
LV_ERRORMESSAGE = |{ 'Error at assigning field (Col:'(004) } { LV_ACTUAL_COL } { ' Row:'(005) } { LV_ACTUAL_ROW }|. lv_actual_col_string = lv_actual_col.
lv_actual_row_string = lv_actual_row.
CONCATENATE 'Error at assigning field (Col:'(004) lv_actual_col_string ' Row:'(005) lv_actual_row_string INTO lv_errormessage.
zcx_excel=>raise_text( lv_errormessage ). zcx_excel=>raise_text( lv_errormessage ).
catch CX_SY_ASSIGN_CAST_UNKNOWN_TYPE. CATCH cx_sy_assign_cast_unknown_type.
LV_ERRORMESSAGE = |{ 'Error at assigning field (Col:'(004) } { LV_ACTUAL_COL } { ' Row:'(005) } { LV_ACTUAL_ROW }|. lv_actual_col_string = lv_actual_col.
lv_actual_row_string = lv_actual_row.
CONCATENATE 'Error at assigning field (Col:'(004) lv_actual_col_string ' Row:'(005) lv_actual_row_string INTO lv_errormessage.
zcx_excel=>raise_text( lv_errormessage ). zcx_excel=>raise_text( lv_errormessage ).
catch CX_SY_ASSIGN_OUT_OF_RANGE. CATCH cx_sy_assign_out_of_range.
LV_ERRORMESSAGE = 'Internal table has less columns than excel'(003). lv_errormessage = 'Internal table has less columns than excel'(003).
zcx_excel=>raise_text( lv_errormessage ). zcx_excel=>raise_text( lv_errormessage ).
catch CX_SY_CONVERSION_ERROR. CATCH cx_sy_conversion_error.
LV_ERRORMESSAGE = |{ 'Error at converting field value (Col:'(006) } { LV_ACTUAL_COL } { ' Row:'(005) } { LV_ACTUAL_ROW }|. lv_actual_col_string = lv_actual_col.
lv_actual_row_string = lv_actual_row.
CONCATENATE 'Error at converting field value (Col:'(006) lv_actual_col_string ' Row:'(005) lv_actual_row_string INTO lv_errormessage.
zcx_excel=>raise_text( lv_errormessage ). zcx_excel=>raise_text( lv_errormessage ).
endtry. ENDTRY.
endmethod. ENDMETHOD.
method GET_TABLES_ITERATOR. method GET_TABLES_ITERATOR.

View File

@ -2298,7 +2298,8 @@ METHOD create_xl_comments.
lo_iterator TYPE REF TO cl_object_collection_iterator, lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_comments TYPE REF TO zcl_excel_comments, lo_comments TYPE REF TO zcl_excel_comments,
lo_comment TYPE REF TO zcl_excel_comment. lo_comment TYPE REF TO zcl_excel_comment.
DATA: lv_rel_id TYPE i. DATA: lv_rel_id TYPE i,
lv_author TYPE string.
DEFINE add_1_val_child_node. DEFINE add_1_val_child_node.
* &1: parent element * &1: parent element
@ -2344,7 +2345,8 @@ METHOD create_xl_comments.
lo_element_author = lo_document->create_simple_element( name = lc_xml_node_author lo_element_author = lo_document->create_simple_element( name = lc_xml_node_author
parent = lo_document ). parent = lo_document ).
lo_element_author->set_value( |{ sy-uname }| ). lv_author = sy-uname.
lo_element_author->set_value( lv_author ).
lo_element_authors->append_child( new_child = lo_element_author ). lo_element_authors->append_child( new_child = lo_element_author ).
lo_element_root->append_child( new_child = lo_element_authors ). lo_element_root->append_child( new_child = lo_element_authors ).
@ -2890,59 +2892,59 @@ method CREATE_XL_DRAWING_ANCHOR.
METHOD create_xl_drawing_for_comments. METHOD create_xl_drawing_for_comments.
** Constant node name ** Constant node name
CONSTANTS: lc_xml_node_xml TYPE string VALUE 'xml', CONSTANTS: lc_xml_node_xml TYPE string VALUE 'xml',
lc_xml_node_ns_v TYPE string VALUE 'urn:schemas-microsoft-com:vml', lc_xml_node_ns_v TYPE string VALUE 'urn:schemas-microsoft-com:vml',
lc_xml_node_ns_o TYPE string VALUE 'urn:schemas-microsoft-com:office:office', lc_xml_node_ns_o TYPE string VALUE 'urn:schemas-microsoft-com:office:office',
lc_xml_node_ns_x TYPE string VALUE 'urn:schemas-microsoft-com:office:excel', lc_xml_node_ns_x TYPE string VALUE 'urn:schemas-microsoft-com:office:excel',
" shapelayout " shapelayout
lc_xml_node_shapelayout TYPE string VALUE 'o:shapelayout', lc_xml_node_shapelayout TYPE string VALUE 'o:shapelayout',
lc_xml_node_idmap TYPE string VALUE 'o:idmap', lc_xml_node_idmap TYPE string VALUE 'o:idmap',
" shapetype " shapetype
lc_xml_node_shapetype TYPE string VALUE 'v:shapetype', lc_xml_node_shapetype TYPE string VALUE 'v:shapetype',
lc_xml_node_stroke TYPE string VALUE 'v:stroke', lc_xml_node_stroke TYPE string VALUE 'v:stroke',
lc_xml_node_path TYPE string VALUE 'v:path', lc_xml_node_path TYPE string VALUE 'v:path',
" shape " shape
lc_xml_node_shape TYPE string VALUE 'v:shape', lc_xml_node_shape TYPE string VALUE 'v:shape',
lc_xml_node_fill TYPE string VALUE 'v:fill', lc_xml_node_fill TYPE string VALUE 'v:fill',
lc_xml_node_shadow TYPE string VALUE 'v:shadow', lc_xml_node_shadow TYPE string VALUE 'v:shadow',
lc_xml_node_textbox TYPE string VALUE 'v:textbox', lc_xml_node_textbox TYPE string VALUE 'v:textbox',
lc_xml_node_div TYPE string VALUE 'div', lc_xml_node_div TYPE string VALUE 'div',
lc_xml_node_clientdata TYPE string VALUE 'x:ClientData', lc_xml_node_clientdata TYPE string VALUE 'x:ClientData',
lc_xml_node_movewithcells TYPE string VALUE 'x:MoveWithCells', lc_xml_node_movewithcells TYPE string VALUE 'x:MoveWithCells',
lc_xml_node_sizewithcells TYPE string VALUE 'x:SizeWithCells', lc_xml_node_sizewithcells TYPE string VALUE 'x:SizeWithCells',
lc_xml_node_anchor TYPE string VALUE 'x:Anchor', lc_xml_node_anchor TYPE string VALUE 'x:Anchor',
lc_xml_node_autofill TYPE string VALUE 'x:AutoFill', lc_xml_node_autofill TYPE string VALUE 'x:AutoFill',
lc_xml_node_row TYPE string VALUE 'x:Row', lc_xml_node_row TYPE string VALUE 'x:Row',
lc_xml_node_column TYPE string VALUE 'x:Column', lc_xml_node_column TYPE string VALUE 'x:Column',
" attributes, " attributes,
lc_xml_attr_vext TYPE string VALUE 'v:ext', lc_xml_attr_vext TYPE string VALUE 'v:ext',
lc_xml_attr_data TYPE string VALUE 'data', lc_xml_attr_data TYPE string VALUE 'data',
lc_xml_attr_id TYPE string VALUE 'id', lc_xml_attr_id TYPE string VALUE 'id',
lc_xml_attr_coordsize TYPE string VALUE 'coordsize', lc_xml_attr_coordsize TYPE string VALUE 'coordsize',
lc_xml_attr_ospt TYPE string VALUE 'o:spt', lc_xml_attr_ospt TYPE string VALUE 'o:spt',
lc_xml_attr_joinstyle TYPE string VALUE 'joinstyle', lc_xml_attr_joinstyle TYPE string VALUE 'joinstyle',
lc_xml_attr_path TYPE string VALUE 'path', lc_xml_attr_path TYPE string VALUE 'path',
lc_xml_attr_gradientshapeok TYPE string VALUE 'gradientshapeok', lc_xml_attr_gradientshapeok TYPE string VALUE 'gradientshapeok',
lc_xml_attr_oconnecttype TYPE string VALUE 'o:connecttype', lc_xml_attr_oconnecttype TYPE string VALUE 'o:connecttype',
lc_xml_attr_type TYPE string VALUE 'type', lc_xml_attr_type TYPE string VALUE 'type',
lc_xml_attr_style TYPE string VALUE 'style', lc_xml_attr_style TYPE string VALUE 'style',
lc_xml_attr_fillcolor TYPE string VALUE 'fillcolor', lc_xml_attr_fillcolor TYPE string VALUE 'fillcolor',
lc_xml_attr_oinsetmode TYPE string VALUE 'o:insetmode', lc_xml_attr_oinsetmode TYPE string VALUE 'o:insetmode',
lc_xml_attr_color TYPE string VALUE 'color', lc_xml_attr_color TYPE string VALUE 'color',
lc_xml_attr_color2 TYPE string VALUE 'color2', lc_xml_attr_color2 TYPE string VALUE 'color2',
lc_xml_attr_on TYPE string VALUE 'on', lc_xml_attr_on TYPE string VALUE 'on',
lc_xml_attr_obscured TYPE string VALUE 'obscured', lc_xml_attr_obscured TYPE string VALUE 'obscured',
lc_xml_attr_objecttype TYPE string VALUE 'ObjectType', lc_xml_attr_objecttype TYPE string VALUE 'ObjectType',
" attributes values " attributes values
lc_xml_attr_val_edit TYPE string VALUE 'edit', lc_xml_attr_val_edit TYPE string VALUE 'edit',
lc_xml_attr_val_rect TYPE string VALUE 'rect', lc_xml_attr_val_rect TYPE string VALUE 'rect',
lc_xml_attr_val_t TYPE string VALUE 't', lc_xml_attr_val_t TYPE string VALUE 't',
lc_xml_attr_val_miter TYPE string VALUE 'miter', lc_xml_attr_val_miter TYPE string VALUE 'miter',
lc_xml_attr_val_auto TYPE string VALUE 'auto', lc_xml_attr_val_auto TYPE string VALUE 'auto',
lc_xml_attr_val_black TYPE string VALUE 'black', lc_xml_attr_val_black TYPE string VALUE 'black',
lc_xml_attr_val_none TYPE string VALUE 'none', lc_xml_attr_val_none TYPE string VALUE 'none',
lc_xml_attr_val_msodir TYPE string VALUE 'mso-direction-alt:auto', lc_xml_attr_val_msodir TYPE string VALUE 'mso-direction-alt:auto',
lc_xml_attr_val_note TYPE string VALUE 'Note'. lc_xml_attr_val_note TYPE string VALUE 'Note'.
DATA: lo_ixml TYPE REF TO if_ixml, DATA: lo_ixml TYPE REF TO if_ixml,
@ -2978,7 +2980,11 @@ METHOD create_xl_drawing_for_comments.
lv_row TYPE zexcel_cell_row, lv_row TYPE zexcel_cell_row,
lv_str_column TYPE zexcel_cell_column_alpha, lv_str_column TYPE zexcel_cell_column_alpha,
lv_column TYPE zexcel_cell_column, lv_column TYPE zexcel_cell_column,
lv_index TYPE i. lv_index TYPE i,
lv_attr_id_index TYPE i,
lv_attr_id TYPE string,
lv_int_value TYPE i,
lv_int_value_string TYPE string.
DATA: lv_rel_id TYPE i. DATA: lv_rel_id TYPE i.
DEFINE add_1_val_child_node. DEFINE add_1_val_child_node.
@ -3072,7 +3078,10 @@ METHOD create_xl_drawing_for_comments.
lo_element_shape = lo_document->create_simple_element( name = lc_xml_node_shape lo_element_shape = lo_document->create_simple_element( name = lc_xml_node_shape
parent = lo_document ). parent = lo_document ).
lo_element_shape->set_attribute_ns( : name = lc_xml_attr_id value = |_x0000_s{ 1024 + lv_index }| ), lv_attr_id_index = 1024 + lv_index.
lv_attr_id = lv_attr_id_index.
CONCATENATE '_x0000_s' lv_attr_id INTO lv_attr_id.
lo_element_shape->set_attribute_ns( : name = lc_xml_attr_id value = lv_attr_id ),
name = lc_xml_attr_type value = '#_x0000_t202' ), name = lc_xml_attr_type value = '#_x0000_t202' ),
name = lc_xml_attr_style value = 'size:auto;width:auto;height:auto;position:absolute;margin-left:117pt;margin-top:172.5pt;z-index:1;visibility:hidden' ), name = lc_xml_attr_style value = 'size:auto;width:auto;height:auto;position:absolute;margin-left:117pt;margin-top:172.5pt;z-index:1;visibility:hidden' ),
name = lc_xml_attr_fillcolor value = '#ffffe1' ), name = lc_xml_attr_fillcolor value = '#ffffe1' ),
@ -3124,13 +3133,15 @@ METHOD create_xl_drawing_for_comments.
lo_element_clientdata->append_child( new_child = lo_element_autofill ). lo_element_clientdata->append_child( new_child = lo_element_autofill ).
lo_element_row = lo_document->create_simple_element( name = lc_xml_node_row lo_element_row = lo_document->create_simple_element( name = lc_xml_node_row
parent = lo_document ). parent = lo_document ).
* lo_element_row->set_value( '12' ). lv_int_value = lv_row - 1.
lo_element_row->set_value( |{ lv_row - 1 }| ). lv_int_value_string = lv_int_value.
lo_element_row->set_value( lv_int_value_string ).
lo_element_clientdata->append_child( new_child = lo_element_row ). lo_element_clientdata->append_child( new_child = lo_element_row ).
lo_element_column = lo_document->create_simple_element( name = lc_xml_node_column lo_element_column = lo_document->create_simple_element( name = lc_xml_node_column
parent = lo_document ). parent = lo_document ).
* lo_element_column->set_value( '1' ). lv_int_value = lv_column - 1.
lo_element_column->set_value( |{ lv_column - 1 }| ). lv_int_value_string = lv_int_value.
lo_element_column->set_value( lv_int_value_string ).
lo_element_clientdata->append_child( new_child = lo_element_column ). lo_element_clientdata->append_child( new_child = lo_element_column ).
lo_element_shape->append_child( new_child = lo_element_clientdata ). lo_element_shape->append_child( new_child = lo_element_clientdata ).

View File

@ -10,7 +10,8 @@ REPORT zdemo_excel_comments.
DATA: lo_excel TYPE REF TO zcl_excel, DATA: lo_excel TYPE REF TO zcl_excel,
lo_worksheet TYPE REF TO zcl_excel_worksheet, lo_worksheet TYPE REF TO zcl_excel_worksheet,
lo_comment TYPE REF TO zcl_excel_comment, lo_comment TYPE REF TO zcl_excel_comment,
lo_hyperlink TYPE REF TO zcl_excel_hyperlink. lo_hyperlink TYPE REF TO zcl_excel_hyperlink,
lv_comment TYPE string.
CONSTANTS: gc_save_file_name TYPE string VALUE 'Comments.xlsx'. CONSTANTS: gc_save_file_name TYPE string VALUE 'Comments.xlsx'.
INCLUDE zdemo_excel_outputopt_incl. INCLUDE zdemo_excel_outputopt_incl.
@ -37,8 +38,8 @@ START-OF-SELECTION.
lo_comment->set_text( ip_ref = 'C18' ip_text = 'Another comment' ). lo_comment->set_text( ip_ref = 'C18' ip_text = 'Another comment' ).
lo_worksheet->add_comment( lo_comment ). lo_worksheet->add_comment( lo_comment ).
lo_comment = lo_excel->add_new_comment( ). lo_comment = lo_excel->add_new_comment( ).
lo_comment->set_text( ip_ref = 'F6' ip_text = |A comment split{ cl_abap_char_utilities=>cr_lf }on 2 lines?| ). CONCATENATE 'A comment split' cl_abap_char_utilities=>cr_lf 'on 2 lines?' INTO lv_comment.
lo_worksheet->add_comment( lo_comment ). lo_comment->set_text( ip_ref = 'F6' ip_text = lv_comment ).
" Second sheet " Second sheet
lo_worksheet = lo_excel->add_new_worksheet( ). lo_worksheet = lo_excel->add_new_worksheet( ).