content
stringlengths 4
1.04M
| input_ids
sequencelengths 2
1.02k
| attention_mask
sequencelengths 2
1.02k
|
---|---|---|
CLASS zcl_dbbr_object_history_tree DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_uitb_content_searcher .
INTERFACES zif_uitb_gui_view.
INTERFACES zif_uitb_gui_control .
ALIASES focus
FOR zif_uitb_gui_control~focus .
ALIASES has_focus
FOR zif_uitb_gui_control~has_focus .
"! <p class="shorttext synchronized" lang="en">CONSTRUCTOR</p>
"!
METHODS constructor
IMPORTING
io_parent_container TYPE REF TO cl_gui_container
io_parent_view TYPE REF TO zif_uitb_gui_composite_view.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_fav_info,
type TYPE ZSAT_FAVMENU_TYPE,
favorite TYPE tabname,
favorite_raw TYPE ZSAT_ENTITY_ID_raw,
description TYPE ddtext,
END OF ty_fav_info .
TYPES:
tt_fav_info TYPE STANDARD TABLE OF ty_fav_info WITH EMPTY KEY .
TYPES:
BEGIN OF ty_node_map,
node_key TYPE tm_nodekey,
entity_id TYPE ZSAT_ENTITY_ID,
entity_type TYPE ZSAT_ENTITY_TYPE,
is_variant TYPE abap_bool,
END OF ty_node_map .
TYPES:
BEGIN OF mty_node_data.
INCLUDE TYPE treemsnod.
TYPES: items TYPE treemcitab.
TYPES: END OF mty_node_data .
TYPES:
BEGIN OF ty_s_variant_data,
variant_id TYPE zdbbr_variant_id,
entity_id TYPE ZSAT_ENTITY_ID,
entity_type TYPE ZSAT_ENTITY_TYPE,
END OF ty_s_variant_data.
CONSTANTS:
BEGIN OF c_context_codes,
delete_list TYPE sy-ucomm VALUE 'DELETE_ALL',
delete_entry TYPE sy-ucomm VALUE 'DELETE',
show_in_object_list TYPE sy-ucomm VALUE 'SHOWINOBJLIST',
start_with_default_variant TYPE sy-ucomm VALUE 'RUNDEFAULTVAR',
refresh TYPE sy-ucomm VALUE 'REFRESH',
full_history_flag TYPE sy-ucomm VALUE 'FULLHISTFLAG',
END OF c_context_codes .
CONSTANTS c_hierarchy_node2 TYPE tv_itmname VALUE 'HIER2' ##NO_TEXT.
DATA mf_global_fav_mode TYPE boolean .
DATA mo_favmenu_f TYPE REF TO zcl_dbbr_favmenu_factory .
DATA mo_parent_container TYPE REF TO cl_gui_container .
DATA mo_query_f TYPE REF TO zcl_dbbr_query_factory .
DATA mo_tree TYPE REF TO zcl_uitb_column_tree_model .
DATA mf_full_history TYPE abap_bool.
DATA mt_node_map TYPE SORTED TABLE OF ty_node_map WITH UNIQUE KEY node_key .
DATA mo_parent_view TYPE REF TO zif_uitb_gui_composite_view.
"! <p class="shorttext synchronized" lang="en">Builds history tree</p>
"!
METHODS build_tree .
"! <p class="shorttext synchronized" lang="en">Clears all nodes from the tree</p>
"!
METHODS clear_nodes
IMPORTING
!if_delete_from_db TYPE abap_bool .
"! <p class="shorttext synchronized" lang="en">Creates the tree model and control</p>
"!
METHODS create_tree .
"! <p class="shorttext synchronized" lang="en">Delete selected nodes</p>
"!
METHODS delete_selected_nodes .
"! <p class="shorttext synchronized" lang="en">Fill toolbar with buttons</p>
"!
METHODS fill_toolbar .
"! <p class="shorttext synchronized" lang="en">Handle function</p>
"!
METHODS handle_function
IMPORTING
!iv_function TYPE ui_func
iv_node_key TYPE tm_nodekey OPTIONAL.
"! <p class="shorttext synchronized" lang="en">Loads history nodes</p>
"!
METHODS load_nodes .
"! <p class="shorttext synchronized" lang="en">Handler for when children are to be loaded lazily</p>
"!
METHODS on_expand_no_children
FOR EVENT expand_no_children OF zif_uitb_tree_model_events
IMPORTING
!ev_node_key .
"! <p class="shorttext synchronized" lang="en">Handler for requesting a context menu for a node</p>
"!
METHODS on_node_context_menu_request
FOR EVENT node_context_menu_request OF zif_uitb_tree_model_events
IMPORTING
!er_menu
!ev_node_key .
"! <p class="shorttext synchronized" lang="en">Handler for when the context menu entry was chosen</p>
"!
METHODS on_node_context_menu_select
FOR EVENT node_context_menu_select OF zif_uitb_tree_model_events
IMPORTING
!ev_fcode
!ev_node_key .
"! <p class="shorttext synchronized" lang="en">Handler for double click on node</p>
"!
METHODS on_node_double_click
FOR EVENT node_double_click OF zif_uitb_tree_model_events
IMPORTING
!ev_node_key .
"! <p class="shorttext synchronized" lang="en">Handler for ENTER key press on node</p>
"!
METHODS on_node_enter_key
FOR EVENT node_keypress OF zif_uitb_tree_model_events
IMPORTING
!ev_key
!ev_node_key .
"! <p class="shorttext synchronized" lang="en">Handler for pressed toolbar button</p>
"!
METHODS on_toolbar_button
FOR EVENT function_selected OF zif_uitb_toolbar_events
IMPORTING
!ev_fcode .
"! <p class="shorttext synchronized" lang="en">Start node with default variant</p>
"!
METHODS start_with_default_variant
IMPORTING
iv_node_key TYPE tm_nodekey.
"! <p class="shorttext synchronized" lang="en">Shows history entry in object browser</p>
"!
METHODS show_in_object_browser
IMPORTING
iv_node_key TYPE tm_nodekey.
ENDCLASS.
CLASS zcl_dbbr_object_history_tree IMPLEMENTATION.
METHOD build_tree.
clear_nodes( if_delete_from_db = abap_false ).
*.. fill tree with saved nodes
load_nodes( ).
focus( ).
ENDMETHOD.
METHOD clear_nodes.
IF if_delete_from_db = abap_true AND
zcl_dbbr_appl_util=>popup_to_confirm(
iv_title = |{ 'Delete all?'(008) }|
iv_query = |{ 'Are you sure you want to delete your full history?'(009) }|
iv_icon_type = 'ICON_QUESTION'
) <> '1'.
RETURN.
ENDIF.
CLEAR mt_node_map.
mo_tree->get_nodes( )->delete_all_nodes( ).
IF if_delete_from_db = abap_true.
mo_favmenu_f->clear_most_used_list( ).
ENDIF.
ENDMETHOD.
METHOD constructor.
mo_parent_container = io_parent_container.
mo_parent_view = io_parent_view.
mo_favmenu_f = NEW #( ).
create_tree( ).
build_tree( ).
ENDMETHOD.
METHOD create_tree.
DATA: lt_events TYPE cntl_simple_events.
CHECK mo_tree IS INITIAL.
mo_tree = NEW zcl_uitb_column_tree_model(
ir_parent = mo_parent_container
if_auto_node_key = abap_true
is_hierarchy_header = VALUE #(
heading = |{ 'Object Name'(002) }|
)
if_with_toolbar = abap_true
iv_selection_mode = cl_tree_model=>node_sel_mode_multiple
).
mo_tree->get_columns( )->add_hierarchy_column( c_hierarchy_node2 ).
fill_toolbar( ).
mo_tree->create_tree_control( ).
DATA(lo_events) = mo_tree->get_events( ).
lo_events->add_key_for_keypress( cl_tree_model=>key_delete ).
*.. set event handler methods to tree control
SET HANDLER:
on_node_context_menu_request FOR lo_events,
on_node_context_menu_select FOR lo_events,
on_node_double_click FOR lo_events,
on_node_enter_key FOR lo_events,
on_expand_no_children FOR lo_events.
ENDMETHOD.
METHOD delete_selected_nodes.
DATA: lt_mostused_to_delete TYPE zcl_dbbr_favmenu_factory=>tt_mostused_k,
lt_nodes_to_delete TYPE treemnotab.
DATA(lt_selected_nodes) = mo_tree->get_selections( )->get_selected_nodes( ).
LOOP AT lt_selected_nodes ASSIGNING FIELD-SYMBOL(<lo_node>).
ASSIGN mt_node_map[ node_key = <lo_node>->mv_node_key ] TO FIELD-SYMBOL(<ls_node_map>).
CHECK: sy-subrc = 0,
<ls_node_map>-is_variant = abap_false.
data(lr_user_data) = <lo_node>->get_user_data( ).
TRY.
DATA(lr_most_used) = CAST zdbbr_mostused( lr_user_data ).
lt_mostused_to_delete = VALUE #(
BASE lt_mostused_to_delete
( username = sy-uname
type = lr_Most_used->type
most_used_entry = lr_most_used->most_used_entry )
).
lt_nodes_to_delete = VALUE #( BASE lt_nodes_to_delete ( <lo_node>->mv_node_key ) ).
DELETE mt_node_map WHERE node_key = <lo_node>->mv_node_key.
CATCH cx_sy_move_cast_error.
CONTINUE.
ENDTRY.
ENDLOOP.
mo_tree->get_nodes( )->delete_nodes( lt_nodes_to_delete ).
mo_favmenu_f->delete_most_used_multiple( lt_mostused_to_delete ).
ENDMETHOD.
METHOD fill_toolbar.
DATA(lo_toolbar) = mo_tree->get_toolbar( ).
lo_toolbar->add_search_buttons( ).
lo_toolbar->add_separator( ).
lo_toolbar->add_button(
iv_fcode = c_context_codes-delete_list
iv_icon = icon_delete
iv_text = |{ 'Delete all'(001) }|
).
lo_toolbar->add_button(
iv_fcode = c_context_codes-refresh
iv_icon = icon_refresh
iv_text = |{ 'Refresh'(003) }|
).
lo_toolbar->add_button(
iv_fcode = c_context_codes-full_history_flag
iv_icon = icon_wd_radio_button_empty
iv_butn_type = cntb_btype_button
iv_text = |{ 'Full History'(006) }|
iv_quickinfo = |{ 'Toggle full history'(007) }|
).
*.. register event handler
SET HANDLER on_toolbar_button FOR lo_toolbar.
ENDMETHOD.
METHOD handle_function.
CASE iv_function.
WHEN c_context_codes-delete_entry.
delete_selected_nodes( ).
WHEN c_context_codes-delete_list.
clear_nodes( if_delete_from_db = abap_true ).
WHEN c_context_codes-full_history_flag.
mf_full_history = xsdbool( mf_full_history = abap_false ).
mo_tree->get_toolbar( )->set_button_icon(
iv_function = c_context_codes-full_history_flag
iv_icon = COND #( WHEN mf_full_history = abap_true THEN icon_wd_radio_button ELSE icon_wd_radio_button_empty )
).
mo_tree->get_toolbar( )->refresh_ui( ).
load_nodes( ).
WHEN c_context_codes-refresh.
load_nodes( ).
WHEN c_context_codes-show_in_object_list.
show_in_object_browser( iv_node_key ).
WHEN c_context_codes-start_with_default_variant.
start_with_default_variant( iv_node_key ).
WHEN zif_uitb_c_toolbar_functions=>find.
zif_uitb_content_searcher~search( ).
WHEN zif_uitb_c_toolbar_functions=>find_more.
zif_uitb_content_searcher~search_next( ).
ENDCASE.
ENDMETHOD.
METHOD load_nodes.
DATA: lv_icon TYPE tv_image,
lt_items TYPE treemcitab.
clear_nodes( if_delete_from_db = abap_false ).
LOOP AT mo_favmenu_f->get_most_used_favorites( if_all = mf_full_history ) ASSIGNING FIELD-SYMBOL(<ls_most_used>).
lv_icon = zcl_dbbr_tree_helper=>get_tree_node_icon( <ls_most_used>-type ).
lt_items = VALUE #(
( item_name = zcl_uitb_column_tree_model=>c_hierarchy_column
class = cl_item_tree_model=>item_class_text
font = cl_item_tree_model=>item_font_prop
text = <ls_most_used>-most_used_entry_raw )
).
IF <ls_most_used>-text IS NOT INITIAL.
lt_items = VALUE #( BASE lt_items
( item_name = c_hierarchy_node2
style = zif_uitb_c_ctm_style=>inverted_gray
font = cl_item_tree_model=>item_font_prop
class = cl_item_tree_model=>item_class_text
text = <ls_most_used>-text )
).
ENDIF.
DATA(lo_history_node) = mo_tree->get_nodes( )->add_node(
if_folder = <ls_most_used>-has_variants
if_expander = <ls_most_used>-has_variants
iv_image = lv_icon
iv_expanded_image = lv_icon
ir_user_data = NEW zdbbr_mostused( <ls_most_used> )
it_item_table = lt_items
).
*.... Fill node map for history entry
mt_node_map = VALUE #( BASE mt_node_map
( node_key = lo_history_node->mv_node_key
entity_id = <ls_most_used>-most_used_entry
entity_type = <ls_most_used>-type
)
).
ENDLOOP.
ENDMETHOD.
METHOD on_expand_no_children.
DATA(lo_node) = mo_tree->get_nodes( )->get_node( ev_node_key ).
data(lr_most_used) = cast zdbbr_mostused( lo_node->get_user_data( ) ).
DATA(lt_variants) = zcl_dbbr_variant_factory=>find_variant_infos_for_type(
iv_entity_id = lr_most_used->most_used_entry
iv_entity_type = lr_most_used->type
).
LOOP AT lt_variants ASSIGNING FIELD-SYMBOL(<ls_variant>).
<ls_variant>-entity_type = lr_most_used->type.
IF <ls_variant>-description IS NOT INITIAL.
DATA(lt_items_for_description) = VALUE treemcitab(
( item_name = c_hierarchy_node2
style = zif_uitb_c_ctm_style=>inverted_gray
font = cl_item_tree_model=>item_font_prop
class = cl_item_tree_model=>item_class_text
text = <ls_variant>-description )
).
ENDIF.
DATA(lo_variant_node) = mo_tree->get_nodes( )->add_node(
iv_relative_node_key = ev_node_key
iv_relationship = cl_list_tree_model=>relat_last_child
iv_image = CONV #( icon_alv_variants )
ir_user_data = new ty_s_variant_data(
variant_id = <ls_variant>-variant_id
entity_id = lr_most_used->most_used_entry
entity_type = <ls_variant>-entity_type
)
it_item_table = VALUE #(
( item_name = mo_tree->c_hierarchy_column
class = cl_item_tree_model=>item_class_text
font = cl_item_tree_model=>item_font_prop
text = <ls_variant>-variant_name )
( LINES OF lt_items_for_description )
)
).
mt_node_map = VALUE #(
BASE mt_node_map
( node_key = lo_variant_node->mv_node_key
entity_id = lr_most_used->most_used_entry
entity_type = <ls_variant>-entity_type
is_variant = abap_true )
).
CLEAR lt_items_for_description.
ENDLOOP.
mo_tree->get_nodes( )->expand_node( ev_node_key ).
ENDMETHOD.
METHOD on_node_context_menu_request.
DATA(lt_selected_nodes) = mo_tree->get_selections( )->get_selected_nodes( ).
er_menu->add_function(
fcode = c_context_codes-delete_entry
text = |{ 'Delete Entry'(004) }|
).
IF lines( lt_selected_nodes ) = 1.
er_menu->add_separator( ).
*.... create new function for running the selected table/script and build_tree the results
er_menu->add_function(
fcode = c_context_codes-start_with_default_variant
text = |{ 'Execute with Default Settings'(005) }|
).
*.... create function for opening favorite in object list
er_menu->add_function(
fcode = c_context_codes-show_in_object_list
text = |{ 'Show in Object Browser'(010) }|
).
ENDIF.
ENDMETHOD.
METHOD on_node_context_menu_select.
handle_function( iv_function = ev_fcode iv_node_key = ev_node_key ).
ENDMETHOD.
METHOD on_node_double_click.
DATA(lo_node) = mo_tree->get_nodes( )->get_node( ev_node_key ).
DATA(lr_user_data) = lo_node->get_user_data( ).
IF lr_user_data IS INITIAL.
RETURN.
ENDIF.
ASSIGN mt_node_map[ node_key = ev_node_key ] TO FIELD-SYMBOL(<ls_node_map>).
IF sy-subrc <> 0.
RETURN.
ENDIF.
IF <ls_node_map>-is_variant = abap_true.
DATA(lr_variant_info) = cast ty_s_variant_data( lr_user_data ).
zcl_dbbr_selscr_nav_events=>raise_variant_entry_chosen(
iv_entity_id = lr_variant_info->entity_id
iv_entity_type = lr_variant_info->entity_type
iv_variant_id = lr_variant_info->variant_id
).
ELSE.
data(lr_most_used_entry) = cast zdbbr_Mostused( lr_user_data ).
zcl_dbbr_selscr_nav_events=>raise_entity_chosen(
iv_entity_id = lr_most_used_entry->most_used_entry
iv_entity_type = lr_most_used_entry->type
).
ENDIF.
ENDMETHOD.
METHOD on_node_enter_key.
IF ev_key = cl_list_tree_model=>key_enter.
on_node_double_click( ev_node_key = ev_node_key ).
ELSEIF ev_key = cl_list_tree_model=>key_delete.
on_node_context_menu_select(
ev_fcode = c_context_codes-delete_entry
ev_node_key = ev_node_key
).
ENDIF.
ENDMETHOD.
METHOD on_toolbar_button.
handle_function( ev_fcode ).
ENDMETHOD.
METHOD show_in_object_browser.
ASSIGN mt_node_map[ node_key = iv_node_key ] TO FIELD-SYMBOL(<ls_node_map>).
CHECK sy-subrc = 0.
IF mo_parent_view IS BOUND.
mo_parent_view->execute_command( NEW zcl_uitb_gui_simple_command(
iv_function = zcl_dbbr_object_navigator=>c_command_id-show_object_list
ir_params = NEW ZSAT_ENTITY( entity_id = <ls_node_map>-entity_id
entity_type = <ls_node_map>-entity_type ) )
).
ENDIF.
ENDMETHOD.
METHOD start_with_default_variant.
DATA: lv_entity_id TYPE ZSAT_ENTITY_ID,
lv_variant TYPE zdbbr_variant_id VALUE zif_dbbr_c_global=>c_dummy_variant,
lv_entity_type TYPE ZSAT_ENTITY_TYPE.
DATA(lo_node) = mo_tree->get_nodes( )->get_node( iv_node_key ).
IF lo_node IS INITIAL.
RETURN.
ENDIF.
ASSIGN mt_node_map[ node_key = lo_node->mv_node_key ] TO FIELD-SYMBOL(<ls_node_map>).
IF sy-subrc <> 0.
RETURN.
ENDIF.
IF <ls_node_map>-is_variant = abap_true.
DATA(lr_variant_info) = cast ty_s_variant_data( lo_node->get_user_data( ) ).
lv_entity_id = lr_variant_info->entity_id.
lv_entity_type = lr_variant_info->entity_type.
lv_variant = lr_variant_info->variant_id.
ELSE.
data(lr_most_used_entry) = cast zdbbr_Mostused( lo_node->get_user_data( ) ).
lv_entity_id = lr_most_used_entry->most_used_entry.
lv_entity_type = lr_most_used_entry->type.
ENDIF.
zcl_dbbr_selscr_nav_events=>raise_variant_entry_chosen(
iv_entity_id = lv_entity_id
iv_entity_type = lv_entity_type
iv_variant_id = lv_variant
if_go_to_result = abap_true
).
ENDMETHOD.
METHOD zif_uitb_content_searcher~search.
DATA(ls_find_result) = mo_tree->get_search( )->find( ).
IF ls_find_result IS NOT INITIAL.
mo_tree->get_selections( )->select_nodes( VALUE #( ( ls_find_result-node_key ) ) ).
ENDIF.
ENDMETHOD.
METHOD zif_uitb_content_searcher~search_next.
DATA(ls_find_result) = mo_tree->get_search( )->find_next( ).
IF ls_find_result IS NOT INITIAL.
mo_tree->get_selections( )->select_nodes( VALUE #( ( ls_find_result-node_key ) ) ).
ENDIF.
ENDMETHOD.
METHOD zif_uitb_gui_control~focus.
mo_tree->zif_uitb_gui_control~focus( ).
ENDMETHOD.
METHOD zif_uitb_gui_control~has_focus.
rf_has_focus = mo_tree->zif_uitb_gui_control~has_focus( ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
9945,
1671,
62,
15252,
62,
23569,
62,
21048,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
5013,
65,
62,
11299,
62,
325,
283,
2044,
764,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
5013,
65,
62,
48317,
62,
1177,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
5013,
65,
62,
48317,
62,
13716,
764,
628,
220,
220,
220,
8355,
43429,
1546,
2962,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
5013,
65,
62,
48317,
62,
13716,
93,
37635,
764,
198,
220,
220,
220,
8355,
43429,
1546,
468,
62,
37635,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
5013,
65,
62,
48317,
62,
13716,
93,
10134,
62,
37635,
764,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
10943,
46126,
1581,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
198,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
8000,
62,
34924,
41876,
4526,
37,
5390,
537,
62,
48317,
62,
34924,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
8000,
62,
1177,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
5013,
65,
62,
48317,
62,
785,
1930,
578,
62,
1177,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
69,
615,
62,
10951,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1168,
50,
1404,
62,
7708,
15996,
1677,
52,
62,
25216,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4004,
220,
220,
220,
220,
41876,
7400,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4004,
62,
1831,
41876,
1168,
50,
1404,
62,
3525,
9050,
62,
2389,
62,
1831,
11,
198,
220,
220,
220,
220,
220,
220,
220,
6764,
220,
41876,
49427,
5239,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
69,
615,
62,
10951,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
256,
83,
62,
69,
615,
62,
10951,
41876,
49053,
9795,
43679,
3963,
1259,
62,
69,
615,
62,
10951,
13315,
38144,
9936,
35374,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
17440,
62,
8899,
11,
198,
220,
220,
220,
220,
220,
220,
220,
10139,
62,
2539,
220,
220,
220,
41876,
256,
76,
62,
17440,
2539,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9312,
62,
312,
220,
220,
41876,
1168,
50,
1404,
62,
3525,
9050,
62,
2389,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9312,
62,
4906,
41876,
1168,
50,
1404,
62,
3525,
9050,
62,
25216,
11,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
25641,
415,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
17440,
62,
8899,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
285,
774,
62,
17440,
62,
7890,
13,
198,
220,
220,
220,
220,
220,
220,
220,
3268,
5097,
52,
7206,
41876,
2054,
5232,
77,
375,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
3709,
41876,
2054,
368,
47992,
397,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
23578,
3963,
285,
774,
62,
17440,
62,
7890,
764,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
82,
62,
25641,
415,
62,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
15304,
62,
312,
220,
41876,
1976,
9945,
1671,
62,
25641,
415,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9312,
62,
312,
220,
220,
41876,
1168,
50,
1404,
62,
3525,
9050,
62,
2389,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9312,
62,
4906,
41876,
1168,
50,
1404,
62,
3525,
9050,
62,
25216,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
82,
62,
25641,
415,
62,
7890,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
22866,
62,
40148,
11,
198,
220,
220,
220,
220,
220,
220,
220,
12233,
62,
4868,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
827,
12,
84,
9503,
26173,
8924,
705,
7206,
2538,
9328,
62,
7036,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
12233,
62,
13000,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
827,
12,
84,
9503,
26173,
8924,
705,
7206,
2538,
9328,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
905,
62,
259,
62,
15252,
62,
4868,
220,
220,
220,
220,
220,
220,
220,
41876,
827,
12,
84,
9503,
26173,
8924,
705,
9693,
3913,
1268,
9864,
41,
45849,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
923,
62,
4480,
62,
12286,
62,
25641,
415,
41876,
827,
12,
84,
9503,
26173,
8924,
705,
49,
4944,
7206,
7708,
6239,
6849,
1503,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
14976,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
827,
12,
84,
9503,
26173,
8924,
705,
2200,
10913,
44011,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
1336,
62,
23569,
62,
32109,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
827,
12,
84,
9503,
26173,
8924,
705,
37,
9994,
39,
8808,
38948,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
22866,
62,
40148,
764,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
71,
959,
9282,
62,
17440,
17,
41876,
31557,
62,
270,
76,
3672,
26173,
8924,
705,
25374,
1137,
17,
6,
22492,
15285,
62,
32541,
13,
198,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
"! @testing /DMO/CL_I_TRAVEL_TUM
"! @testing /DMO/CL_C_TRAVEL_TUM
"! @testing /DMO/CL_FLIGHT_LEGACY02
"! @testing FUGR:/DMO/FLIGHT_TRAVEL_API02
CLASS ltc DEFINITION FINAL INHERITING FROM /dmo/tc_flight_travel_api02 FOR TESTING RISK LEVEL HARMLESS DURATION MEDIUM.
ENDCLASS.
| [
40484,
2488,
33407,
1220,
35,
11770,
14,
5097,
62,
40,
62,
51,
3861,
18697,
62,
51,
5883,
198,
40484,
2488,
33407,
1220,
35,
11770,
14,
5097,
62,
34,
62,
51,
3861,
18697,
62,
51,
5883,
198,
40484,
2488,
33407,
1220,
35,
11770,
14,
5097,
62,
3697,
9947,
62,
2538,
38,
43300,
2999,
198,
40484,
2488,
33407,
376,
7340,
49,
14079,
35,
11770,
14,
3697,
9947,
62,
51,
3861,
18697,
62,
17614,
2999,
198,
31631,
300,
23047,
5550,
20032,
17941,
25261,
3268,
16879,
2043,
2751,
16034,
1220,
67,
5908,
14,
23047,
62,
22560,
62,
35927,
62,
15042,
2999,
7473,
43001,
2751,
45698,
42,
49277,
43638,
5805,
7597,
360,
4261,
6234,
26112,
41796,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_object_doma DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_dd01_text,
ddlanguage TYPE dd01v-ddlanguage,
ddtext TYPE dd01v-ddtext,
END OF ty_dd01_text .
TYPES:
BEGIN OF ty_dd07_text,
valpos TYPE dd07v-valpos,
ddlanguage TYPE dd07v-ddlanguage,
domvalue_l TYPE dd07v-domvalue_l,
domvalue_h TYPE dd07v-domvalue_h,
ddtext TYPE dd07v-ddtext,
domval_ld TYPE dd07v-domval_ld,
domval_hd TYPE dd07v-domval_hd,
END OF ty_dd07_text .
TYPES:
ty_dd01_texts TYPE STANDARD TABLE OF ty_dd01_text .
TYPES:
ty_dd07_texts TYPE STANDARD TABLE OF ty_dd07_text .
CONSTANTS c_longtext_id_doma TYPE dokil-id VALUE 'DO' ##NO_TEXT.
METHODS serialize_texts
IMPORTING
!ii_xml TYPE REF TO zif_abapgit_xml_output
!it_dd07v TYPE dd07v_tab
RAISING
zcx_abapgit_exception .
METHODS deserialize_texts
IMPORTING
!ii_xml TYPE REF TO zif_abapgit_xml_input
!is_dd01v TYPE dd01v
!it_dd07v TYPE dd07v_tab
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS zcl_abapgit_object_doma IMPLEMENTATION.
METHOD deserialize_texts.
DATA: lv_name TYPE ddobjname,
lv_valpos TYPE valpos,
ls_dd01v_tmp TYPE dd01v,
lt_dd07v_tmp TYPE TABLE OF dd07v,
lt_i18n_langs TYPE TABLE OF langu,
lt_dd01_texts TYPE ty_dd01_texts,
lt_dd07_texts TYPE ty_dd07_texts.
FIELD-SYMBOLS: <lv_lang> LIKE LINE OF lt_i18n_langs,
<ls_dd07v> LIKE LINE OF it_dd07v,
<ls_dd01_text> LIKE LINE OF lt_dd01_texts,
<ls_dd07_text> LIKE LINE OF lt_dd07_texts.
lv_name = ms_item-obj_name.
ii_xml->read( EXPORTING iv_name = 'I18N_LANGS'
CHANGING cg_data = lt_i18n_langs ).
ii_xml->read( EXPORTING iv_name = 'DD01_TEXTS'
CHANGING cg_data = lt_dd01_texts ).
ii_xml->read( EXPORTING iv_name = 'DD07_TEXTS'
CHANGING cg_data = lt_dd07_texts ).
SORT lt_i18n_langs.
SORT lt_dd07_texts BY ddlanguage. " Optimization
LOOP AT lt_i18n_langs ASSIGNING <lv_lang>.
" Domain description
ls_dd01v_tmp = is_dd01v.
READ TABLE lt_dd01_texts ASSIGNING <ls_dd01_text> WITH KEY ddlanguage = <lv_lang>.
IF sy-subrc > 0.
zcx_abapgit_exception=>raise( |DD01_TEXTS cannot find lang { <lv_lang> } in XML| ).
ENDIF.
MOVE-CORRESPONDING <ls_dd01_text> TO ls_dd01v_tmp.
" Domain values
lt_dd07v_tmp = it_dd07v.
LOOP AT lt_dd07v_tmp ASSIGNING <ls_dd07v>.
lv_valpos = <ls_dd07v>-valpos.
" it_dd07v was potentially renumbered so lookup by value
READ TABLE lt_dd07_texts ASSIGNING <ls_dd07_text>
WITH KEY ddlanguage = <lv_lang> domvalue_l = <ls_dd07v>-domvalue_l domvalue_h = <ls_dd07v>-domvalue_h.
IF sy-subrc = 0.
MOVE-CORRESPONDING <ls_dd07_text> TO <ls_dd07v>.
<ls_dd07v>-valpos = lv_valpos.
DELETE lt_dd07_texts INDEX sy-tabix. " Optimization
ELSE.
" no translation -> keep entry but clear texts
<ls_dd07v>-ddlanguage = <lv_lang>.
CLEAR: <ls_dd07v>-ddtext, <ls_dd07v>-domval_ld, <ls_dd07v>-domval_hd.
ENDIF.
ENDLOOP.
CALL FUNCTION 'DDIF_DOMA_PUT'
EXPORTING
name = lv_name
dd01v_wa = ls_dd01v_tmp
TABLES
dd07v_tab = lt_dd07v_tmp
EXCEPTIONS
doma_not_found = 1
name_inconsistent = 2
doma_inconsistent = 3
put_failure = 4
put_refused = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD serialize_texts.
DATA: lv_name TYPE ddobjname,
lv_index TYPE i,
ls_dd01v TYPE dd01v,
lt_dd07v TYPE TABLE OF dd07v,
lt_i18n_langs TYPE TABLE OF langu,
lt_dd01_texts TYPE ty_dd01_texts,
lt_dd07_texts TYPE ty_dd07_texts.
FIELD-SYMBOLS: <lv_lang> LIKE LINE OF lt_i18n_langs,
<ls_dd07v> LIKE LINE OF lt_dd07v,
<ls_dd07v_tmp> LIKE LINE OF lt_dd07v,
<ls_dd01_text> LIKE LINE OF lt_dd01_texts,
<ls_dd07_text> LIKE LINE OF lt_dd07_texts.
IF ii_xml->i18n_params( )-main_language_only = abap_true.
RETURN.
ENDIF.
lv_name = ms_item-obj_name.
" Collect additional languages, skip main lang - it was serialized already
SELECT DISTINCT ddlanguage AS langu INTO TABLE lt_i18n_langs
FROM dd01v
WHERE domname = lv_name
AND ddlanguage <> mv_language. "#EC CI_SUBRC
LOOP AT lt_i18n_langs ASSIGNING <lv_lang>.
lv_index = sy-tabix.
CALL FUNCTION 'DDIF_DOMA_GET'
EXPORTING
name = lv_name
langu = <lv_lang>
IMPORTING
dd01v_wa = ls_dd01v
TABLES
dd07v_tab = lt_dd07v
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc <> 0 OR ls_dd01v-ddlanguage IS INITIAL.
DELETE lt_i18n_langs INDEX lv_index. " Don't save this lang
CONTINUE.
ENDIF.
APPEND INITIAL LINE TO lt_dd01_texts ASSIGNING <ls_dd01_text>.
MOVE-CORRESPONDING ls_dd01v TO <ls_dd01_text>.
" Process main language entries and find corresponding translation
LOOP AT it_dd07v ASSIGNING <ls_dd07v> WHERE NOT ddlanguage IS INITIAL.
APPEND INITIAL LINE TO lt_dd07_texts ASSIGNING <ls_dd07_text>.
READ TABLE lt_dd07v ASSIGNING <ls_dd07v_tmp>
WITH KEY ddlanguage = <lv_lang> domvalue_l = <ls_dd07v>-domvalue_l domvalue_h = <ls_dd07v>-domvalue_h.
IF sy-subrc = 0.
MOVE-CORRESPONDING <ls_dd07v_tmp> TO <ls_dd07_text>.
ELSE.
" no translation -> keep entry but clear texts
MOVE-CORRESPONDING <ls_dd07v> TO <ls_dd07_text>.
<ls_dd07_text>-ddlanguage = <lv_lang>.
CLEAR: <ls_dd07_text>-ddtext, <ls_dd07_text>-domval_ld, <ls_dd07_text>-domval_hd.
ENDIF.
ENDLOOP.
ENDLOOP.
SORT lt_i18n_langs ASCENDING.
SORT lt_dd01_texts BY ddlanguage ASCENDING.
SORT lt_dd07_texts BY valpos ASCENDING ddlanguage ASCENDING.
IF lines( lt_i18n_langs ) > 0.
ii_xml->add( iv_name = 'I18N_LANGS'
ig_data = lt_i18n_langs ).
ii_xml->add( iv_name = 'DD01_TEXTS'
ig_data = lt_dd01_texts ).
ii_xml->add( iv_name = 'DD07_TEXTS'
ig_data = lt_dd07_texts ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
SELECT SINGLE as4user FROM dd01l INTO rv_user
WHERE domname = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
IF sy-subrc <> 0.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
IF zif_abapgit_object~exists( ) = abap_false.
RETURN.
ENDIF.
delete_ddic( iv_objtype = 'D'
iv_no_ask_delete_append = abap_true ).
delete_longtexts( c_longtext_id_doma ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
* package SEDD
* package SDIC
* fm TR_TADIR_INTERFACE
* fm RS_CORR_INSERT ?
DATA: lv_name TYPE ddobjname,
ls_dd01v TYPE dd01v,
lt_dd07v TYPE TABLE OF dd07v.
FIELD-SYMBOLS <ls_dd07v> TYPE dd07v.
io_xml->read( EXPORTING iv_name = 'DD01V'
CHANGING cg_data = ls_dd01v ).
io_xml->read( EXPORTING iv_name = 'DD07V_TAB'
CHANGING cg_data = lt_dd07v ).
corr_insert( iv_package = iv_package
ig_object_class = 'DICT' ).
lv_name = ms_item-obj_name. " type conversion
LOOP AT lt_dd07v ASSIGNING <ls_dd07v>.
<ls_dd07v>-domname = lv_name.
<ls_dd07v>-valpos = sy-tabix.
ENDLOOP.
CALL FUNCTION 'DDIF_DOMA_PUT'
EXPORTING
name = lv_name
dd01v_wa = ls_dd01v
TABLES
dd07v_tab = lt_dd07v
EXCEPTIONS
doma_not_found = 1
name_inconsistent = 2
doma_inconsistent = 3
put_failure = 4
put_refused = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
deserialize_texts( ii_xml = io_xml
is_dd01v = ls_dd01v
it_dd07v = lt_dd07v ).
deserialize_longtexts( io_xml ).
zcl_abapgit_objects_activation=>add_item( ms_item ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_domname TYPE dd01l-domname.
SELECT SINGLE domname FROM dd01l INTO lv_domname
WHERE domname = ms_item-obj_name.
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-ddic TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-ddic = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'ESDICT'
iv_argument = |{ ms_item-obj_type }{ ms_item-obj_name }| ).
ENDMETHOD.
METHOD zif_abapgit_object~jump.
jump_se11( ).
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lv_name TYPE ddobjname,
ls_dd01v TYPE dd01v,
lv_masklen TYPE c LENGTH 4,
lt_dd07v TYPE TABLE OF dd07v.
lv_name = ms_item-obj_name.
CALL FUNCTION 'DDIF_DOMA_GET'
EXPORTING
name = lv_name
langu = mv_language
IMPORTING
dd01v_wa = ls_dd01v
TABLES
dd07v_tab = lt_dd07v
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
IF ls_dd01v IS INITIAL.
zcx_abapgit_exception=>raise( |No active version found for { ms_item-obj_type } { ms_item-obj_name }| ).
ENDIF.
CLEAR: ls_dd01v-as4user,
ls_dd01v-as4date,
ls_dd01v-as4time,
ls_dd01v-appexist.
* make sure XML serialization does not dump if the field contains invalid data
* note that this is a N field, so '' is not valid
IF ls_dd01v-authclass = ''.
CLEAR ls_dd01v-authclass.
ENDIF.
lv_masklen = ls_dd01v-masklen.
IF lv_masklen = '' OR NOT lv_masklen CO '0123456789'.
CLEAR ls_dd01v-masklen.
ENDIF.
DELETE lt_dd07v WHERE appval = abap_true.
SORT lt_dd07v BY
valpos ASCENDING
ddlanguage ASCENDING.
io_xml->add( iv_name = 'DD01V'
ig_data = ls_dd01v ).
io_xml->add( iv_name = 'DD07V_TAB'
ig_data = lt_dd07v ).
serialize_texts( ii_xml = io_xml
it_dd07v = lt_dd07v ).
serialize_longtexts( ii_xml = io_xml
iv_longtext_id = c_longtext_id_doma ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
3438,
64,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
1860,
486,
62,
5239,
11,
198,
220,
220,
220,
220,
220,
220,
220,
49427,
16129,
41876,
49427,
486,
85,
12,
1860,
16129,
11,
198,
220,
220,
220,
220,
220,
220,
220,
49427,
5239,
220,
220,
220,
220,
41876,
49427,
486,
85,
12,
1860,
5239,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
1860,
486,
62,
5239,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
1860,
2998,
62,
5239,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1188,
1930,
220,
220,
220,
220,
41876,
49427,
2998,
85,
12,
2100,
1930,
11,
198,
220,
220,
220,
220,
220,
220,
220,
49427,
16129,
41876,
49427,
2998,
85,
12,
1860,
16129,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2401,
8367,
62,
75,
41876,
49427,
2998,
85,
12,
3438,
8367,
62,
75,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2401,
8367,
62,
71,
41876,
49427,
2998,
85,
12,
3438,
8367,
62,
71,
11,
198,
220,
220,
220,
220,
220,
220,
220,
49427,
5239,
220,
220,
220,
220,
41876,
49427,
2998,
85,
12,
1860,
5239,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2401,
2100,
62,
335,
220,
41876,
49427,
2998,
85,
12,
3438,
2100,
62,
335,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2401,
2100,
62,
31298,
220,
41876,
49427,
2998,
85,
12,
3438,
2100,
62,
31298,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
1860,
2998,
62,
5239,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
1860,
486,
62,
5239,
82,
41876,
49053,
9795,
43679,
3963,
1259,
62,
1860,
486,
62,
5239,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
1860,
2998,
62,
5239,
82,
41876,
49053,
9795,
43679,
3963,
1259,
62,
1860,
2998,
62,
5239,
764,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
6511,
5239,
62,
312,
62,
3438,
64,
41876,
466,
34553,
12,
312,
26173,
8924,
705,
18227,
6,
22492,
15285,
62,
32541,
13,
628,
220,
220,
220,
337,
36252,
50,
11389,
1096,
62,
5239,
82,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
19875,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19875,
62,
22915,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
1860,
2998,
85,
41876,
49427,
2998,
85,
62,
8658,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
748,
48499,
1096,
62,
5239,
82,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
19875,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19875,
62,
15414,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
1860,
486,
85,
41876,
49427,
486,
85,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
1860,
2998,
85,
41876,
49427,
2998,
85,
62,
8658,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
3438,
64,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
748,
48499,
1096,
62,
5239,
82,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
3672,
220,
220,
220,
220,
220,
220,
41876,
49427,
26801,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
2100,
1930,
220,
220,
220,
220,
41876,
1188,
1930,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
1860,
486,
85,
62,
22065,
220,
41876,
49427,
486,
85,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
1860,
2998,
85,
62,
22065,
220,
41876,
43679,
3963,
49427,
2998,
85,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
72,
1507,
77,
62,
17204,
82,
41876,
43679,
3963,
2786,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
1860,
486,
62,
5239,
82,
41876,
1259,
62,
1860,
486,
62,
5239,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
1860,
2998,
62,
5239,
82,
41876,
1259,
62,
1860,
2998,
62,
5239,
82,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
6780,
62,
17204,
29,
220,
220,
220,
220,
220,
34178,
48920,
3963,
300,
83,
62,
72,
1507,
77,
62,
17204,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7278,
62,
1860,
2998,
85,
29,
220,
220,
220,
220,
34178,
48920,
3963,
340,
62,
1860,
2998,
85,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7278,
62,
1860,
486,
62,
5239,
29,
34178,
48920,
3963,
300,
83,
62,
1860,
486,
62,
5239,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7278,
62,
1860,
2998,
62,
5239,
29,
34178,
48920,
3963
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*&---------------------------------------------------------------------*
*& Report ZADELE_GENERATE
*&---------------------------------------------------------------------*
*& generate abap code from given structure
*& use it for Adele RFC API, create CDS or other scenarios
*&
*& last change: 04.05.2019
*&---------------------------------------------------------------------*
REPORT zadele_generate.
* -------- inteface
PARAMETERS: p_struc TYPE tabname OBLIGATORY.
PARAMETERS: p_omsi RADIOBUTTON GROUP opti DEFAULT 'X'. " macro commands rfc api
PARAMETERS: p_orst RADIOBUTTON GROUP opti. " struc definition program inline
PARAMETERS: p_odds RADIOBUTTON GROUP opti. " struc definition ddic
PARAMETERS: p_ocds RADIOBUTTON GROUP opti. " struc definition cds style
PARAMETERS: p_orpa RADIOBUTTON GROUP opti. " report params
PARAMETERS: p_orso RADIOBUTTON GROUP opti. " report select options
* -------- global data
DATA: gv_type TYPE string.
DATA: gv_inttype TYPE string.
DATA: gv_comment TYPE string.
* -------- business logig
START-OF-SELECTION.
DATA(lr_type) = cl_abap_typedescr=>describe_by_name( p_struc ).
IF lr_type IS INITIAL.
WRITE: / 'unknown object'.
ELSE.
* get as struc
TRY.
DATA(lr_struc) = CAST cl_abap_structdescr( lr_type ).
CATCH cx_sy_move_cast_error INTO DATA(lx_execption).
WRITE: / 'object is not a table or struc:', p_struc.
RETURN.
ENDTRY.
* get fields
DATA(lt_fields) = lr_struc->get_ddic_field_list( ).
IF lt_fields[] IS INITIAL.
WRITE: / 'No fields?!'.
RETURN.
ENDIF.
* protocol
WRITE: / 'Structure initialized:', p_struc.
ULINE.
* generate output
CASE 'X'.
WHEN p_omsi. " rfc macros
PERFORM output_as_macro_selopt USING lt_fields.
WHEN p_orst. " remote structure
PERFORM output_as_remote_struc USING lt_fields.
WHEN p_odds.
PERFORM output_as_dic_struc USING lt_fields.
WHEN p_ocds.
PERFORM output_as_cds_struc USING lt_fields.
WHEN p_orpa.
PERFORM output_as_report_params USING lt_fields.
WHEN p_orso.
PERFORM output_as_report_selopt USING lt_fields.
WHEN OTHERS.
WRITE: / 'output not implemented yet'.
ENDCASE.
ENDIF.
* ============================ SUB Routines
*&---------------------------------------------------------------------*
*& Form PREPARE_TYPE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_LS_FIELD text
*----------------------------------------------------------------------*
FORM prepare_type USING ps_field TYPE dfies.
CLEAR: gv_type,
gv_inttype,
gv_comment.
gv_type = ps_field-rollname.
DATA(lv_len) = CONV integer( ps_field-leng ).
gv_inttype = |{ ps_field-datatype }{ lv_len }|.
IF gv_type IS INITIAL.
gv_type = gv_inttype.
ENDIF.
gv_comment = |" domain { ps_field-domname }, { ps_field-datatype }({ lv_len }), { ps_field-inttype }({ ps_field-intlen })|.
ENDFORM.
FORM prepare_text USING ps_field TYPE dfies.
CLEAR: gv_type,
gv_inttype,
gv_comment.
gv_type = ps_field-rollname.
DATA(lv_len) = CONV integer( ps_field-leng ).
gv_inttype = |{ ps_field-datatype }{ lv_len }|.
IF gv_type IS INITIAL.
gv_type = gv_inttype.
ENDIF.
gv_comment = |" { ps_field-fieldtext }, { ps_field-rollname }, { ps_field-datatype }({ lv_len }))|.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form OUTPUT_AS_MACRO_SELOPT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_LT_FIELDS text
*----------------------------------------------------------------------*
FORM output_as_macro_selopt USING pt_fields TYPE ddfields.
WRITE: / 'Output Type: macro statemants for Export API'.
LOOP AT pt_fields INTO DATA(ls_field).
WRITE: / | ade_check_selopt { ls_field-fieldname }.|.
ENDLOOP.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form OUTPUT_AS_REMOTE_STRUC
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_LT_FIELDS text
*----------------------------------------------------------------------*
FORM output_as_remote_struc USING pt_fields TYPE ddfields.
WRITE: / 'data: begin of ls_data,'.
LOOP AT pt_fields INTO DATA(ls_field).
PERFORM prepare_type USING ls_field.
WRITE: / | { ls_field-fieldname } type { gv_type }, " { gv_comment }|.
ENDLOOP.
WRITE: / ' end of_ls_data.'.
WRITE: / 'data: lt_data like table of ls_data.'.
ENDFORM.
FORM output_as_dic_struc USING pt_fields TYPE ddfields.
LOOP AT pt_fields INTO DATA(ls_field).
PERFORM prepare_type USING ls_field.
WRITE: / ls_field-fieldname,
sy-vline, "cl_abap_char_utilities=>horizontal_tab,
'type',
sy-vline, "cl_abap_char_utilities=>horizontal_tab,
gv_type.
ENDLOOP.
ENDFORM.
FORM output_as_cds_struc USING pt_fields TYPE ddfields.
WRITE: / |@EndUserText.label : 'generated structure from { p_struc }|.
WRITE: / |@AbapCatalog.enhancementCategory : #EXTENSIBLE_CHARACTER_NUMERIC|.
WRITE: / |define structure XXX | && '{'.
LOOP AT pt_fields INTO DATA(ls_field).
PERFORM prepare_type USING ls_field.
WRITE: / | { ls_field-fieldname } : { gv_type }; // { gv_comment }|.
ENDLOOP.
WRITE: / '}'.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form OUTPUT_AS_REPORT_PARAMS
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> LT_FIELDS
*&---------------------------------------------------------------------*
FORM output_as_report_params USING pt_fields TYPE ddfields.
WRITE: / |TABLES: { p_struc }.|.
LOOP AT pt_fields INTO DATA(ls_field).
PERFORM prepare_text USING ls_field.
DATA(lv_par) = |P_{ ls_field-fieldname }|.
WRITE: / |PARAMETERS: { lv_par } LIKE { p_struc }-{ ls_field-fieldname }. { gv_comment }|.
ENDLOOP.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form OUTPUT_AS_REPORT_SELOPT
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> LT_FIELDS
*&---------------------------------------------------------------------*
FORM output_as_report_selopt USING pt_fields TYPE ddfields.
WRITE: / |TABLES: { p_struc }.|.
LOOP AT pt_fields INTO DATA(ls_field).
PERFORM prepare_text USING ls_field.
DATA(lv_par) = |SO_{ ls_field-fieldname }|.
WRITE: / |SELECT-OPTIONS: { lv_par } FOR { p_struc }-{ ls_field-fieldname }. { gv_comment }|.
ENDLOOP.
ENDFORM.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
1168,
19266,
2538,
62,
35353,
1137,
6158,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
7716,
450,
499,
2438,
422,
1813,
4645,
198,
9,
5,
779,
340,
329,
1215,
11129,
30978,
7824,
11,
2251,
327,
5258,
393,
584,
13858,
198,
9,
5,
198,
9,
5,
938,
1487,
25,
8702,
13,
2713,
13,
23344,
198,
9,
5,
10097,
30934,
9,
198,
2200,
15490,
1976,
671,
293,
62,
8612,
378,
13,
198,
198,
9,
24200,
493,
891,
558,
198,
27082,
2390,
2767,
4877,
25,
279,
62,
19554,
66,
41876,
7400,
3672,
440,
9148,
3528,
1404,
15513,
13,
198,
27082,
2390,
2767,
4877,
25,
279,
62,
3150,
72,
220,
33540,
9399,
47526,
11357,
44441,
2172,
72,
5550,
38865,
705,
55,
4458,
366,
15021,
9729,
374,
16072,
40391,
198,
27082,
2390,
2767,
4877,
25,
279,
62,
29422,
220,
33540,
9399,
47526,
11357,
44441,
2172,
72,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
2874,
66,
6770,
1430,
26098,
198,
27082,
2390,
2767,
4877,
25,
279,
62,
5088,
82,
220,
33540,
9399,
47526,
11357,
44441,
2172,
72,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
2874,
66,
6770,
49427,
291,
198,
27082,
2390,
2767,
4877,
25,
279,
62,
420,
9310,
220,
33540,
9399,
47526,
11357,
44441,
2172,
72,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
2874,
66,
6770,
269,
9310,
3918,
198,
27082,
2390,
2767,
4877,
25,
279,
62,
273,
8957,
220,
33540,
9399,
47526,
11357,
44441,
2172,
72,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
989,
42287,
198,
27082,
2390,
2767,
4877,
25,
279,
62,
273,
568,
220,
33540,
9399,
47526,
11357,
44441,
2172,
72,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
989,
2922,
3689,
628,
198,
9,
24200,
3298,
1366,
198,
26947,
25,
308,
85,
62,
4906,
220,
220,
220,
220,
41876,
4731,
13,
198,
26947,
25,
308,
85,
62,
600,
4906,
220,
41876,
4731,
13,
198,
26947,
25,
308,
85,
62,
23893,
220,
41876,
4731,
13,
628,
198,
9,
24200,
1597,
2604,
328,
198,
2257,
7227,
12,
19238,
12,
46506,
2849,
13,
628,
220,
42865,
7,
14050,
62,
4906,
8,
796,
537,
62,
397,
499,
62,
774,
9124,
3798,
81,
14804,
20147,
4892,
62,
1525,
62,
3672,
7,
279,
62,
19554,
66,
6739,
198,
220,
16876,
300,
81,
62,
4906,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
44423,
25,
1220,
705,
34680,
2134,
4458,
198,
220,
17852,
5188,
13,
198,
9,
651,
355,
2874,
66,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
14050,
62,
19554,
66,
8,
796,
327,
11262,
537,
62,
397,
499,
62,
7249,
20147,
81,
7,
300,
81,
62,
4906,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
1837,
62,
21084,
62,
2701,
62,
18224,
39319,
42865,
7,
75,
87,
62,
18558,
1159,
737,
198,
220,
220,
220,
220,
220,
220,
220,
44423,
25,
1220,
705,
15252,
318,
407,
257,
3084,
393,
2874,
66,
25,
3256,
279,
62,
19554,
66,
13,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
40405,
13,
198,
198,
9,
651,
7032,
198,
220,
220,
220,
42865,
7,
2528,
62,
25747,
8,
796,
300,
81,
62,
19554,
66,
3784,
1136,
62,
1860,
291,
62,
3245,
62,
4868,
7,
6739,
198,
220,
220,
220,
16876,
300,
83,
62,
25747,
21737,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
44423,
25,
1220,
705,
2949,
7032,
12248,
4458,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
198,
9,
8435,
198,
220,
220,
220,
44423,
25,
1220,
705,
1273,
5620,
23224,
25,
3256,
279,
62,
19554,
66,
13,
198,
220,
220,
220,
471,
24027,
13,
198,
198,
9,
7716,
5072,
198,
220,
220,
220,
42001,
705,
55,
4458,
198,
220,
220,
220,
220,
220,
42099,
279,
62,
3150,
72,
13,
366,
374,
16072,
34749,
198,
220,
220,
220,
220,
220,
220,
220,
19878,
21389,
5072,
62,
292,
62,
20285,
305,
62,
741,
8738,
1294,
2751,
300,
83,
62,
25747,
13,
198,
220,
220,
220,
220,
220,
42099,
279,
62,
29422,
13,
366,
6569,
4645,
198,
220,
220,
220,
220,
220,
220,
220,
19878,
21389,
5072,
62,
292,
62,
47960,
62,
19554,
66,
1294,
2751,
300,
83,
62,
25747,
13,
198,
220,
220,
220,
220,
220,
42099,
279,
62,
5088,
82,
13,
198,
220,
220,
220,
220,
220,
220,
220,
19878,
21389,
5072,
62,
292,
62,
67,
291,
62,
19554,
66,
1294,
2751,
300,
83,
62,
25747,
13,
198,
220,
220,
220,
220,
220,
42099,
279,
62,
420,
9310,
13,
198,
220,
220,
220,
220,
220,
220,
220,
19878,
21389,
5072,
62,
292,
62,
66,
9310,
62,
19554,
66,
1294,
2751,
300,
83,
62,
25747,
13,
198,
220,
220,
220,
220,
220,
42099,
279,
62,
273,
8957,
13,
198,
220,
220,
220,
220,
220,
220,
220,
19878,
21389,
5072,
62,
292,
62,
13116,
62,
37266,
1294,
2751,
300,
83,
62,
25747,
13,
198,
220,
220,
220,
220,
220,
42099,
279,
62,
273,
568,
13,
198,
220,
220,
220,
220,
220,
220,
220,
19878,
21389,
5072,
62,
292,
62,
13116,
62,
741,
8738,
1294,
2751,
300,
83,
62,
25747,
13,
198,
220,
220,
220,
220,
220,
42099,
440,
4221,
4877,
13,
198,
220,
220,
220,
220,
220,
220,
220,
44423,
25,
1220,
705,
22915,
407,
9177,
1865,
4458,
198,
220,
220,
220,
23578,
34,
11159,
13,
628,
220,
23578,
5064,
13,
198,
198,
9,
36658,
2559,
18604,
28932,
39602,
1127,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
220,
220,
220,
220,
5178,
220,
22814,
47,
12203,
62,
25216,
198,
9,
5,
10097,
30934,
9,
198,
9,
220,
220,
220,
220,
220,
220,
2420,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
INTERFACE zif_abapgit_persistence PUBLIC.
TYPES:
ty_type TYPE c LENGTH 12 .
TYPES:
ty_value TYPE c LENGTH 12 .
TYPES:
BEGIN OF ty_content,
type TYPE ty_type,
value TYPE ty_value,
data_str TYPE string,
END OF ty_content .
TYPES:
tt_content TYPE SORTED TABLE OF ty_content WITH UNIQUE KEY type value .
TYPES: BEGIN OF ty_local_checksum,
item TYPE zif_abapgit_definitions=>ty_item,
files TYPE zif_abapgit_definitions=>ty_file_signatures_tt,
END OF ty_local_checksum.
TYPES:
BEGIN OF ty_local_settings,
ignore_subpackages TYPE abap_bool,
write_protected TYPE abap_bool,
only_local_objects TYPE abap_bool,
code_inspector_check_variant TYPE sci_chkv,
block_commit TYPE abap_bool,
END OF ty_local_settings.
TYPES: ty_local_checksum_tt TYPE STANDARD TABLE OF ty_local_checksum WITH DEFAULT KEY.
TYPES: BEGIN OF ty_repo_xml,
url TYPE string,
branch_name TYPE string,
sha1 TYPE zif_abapgit_definitions=>ty_sha1,
package TYPE devclass,
created_by TYPE xubname,
created_at TYPE timestampl,
offline TYPE sap_bool,
local_checksums TYPE ty_local_checksum_tt,
dot_abapgit TYPE zif_abapgit_dot_abapgit=>ty_dot_abapgit,
head_branch TYPE string, " HEAD symref of the repo, master branch
local_settings TYPE ty_local_settings,
END OF ty_repo_xml.
TYPES: BEGIN OF ty_repo,
key TYPE zif_abapgit_persistence=>ty_value.
INCLUDE TYPE ty_repo_xml.
TYPES: END OF ty_repo.
TYPES: tt_repo TYPE STANDARD TABLE OF ty_repo WITH DEFAULT KEY.
TYPES: tt_repo_keys TYPE STANDARD TABLE OF ty_repo-key WITH DEFAULT KEY.
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
44731,
13,
628,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
4906,
220,
41876,
269,
406,
49494,
1105,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
8367,
41876,
269,
406,
49494,
1105,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
11299,
11,
198,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
41876,
1259,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
1988,
220,
220,
220,
41876,
1259,
62,
8367,
11,
198,
220,
220,
220,
220,
220,
1366,
62,
2536,
41876,
4731,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
11299,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
256,
83,
62,
11299,
41876,
311,
9863,
1961,
43679,
3963,
1259,
62,
11299,
13315,
4725,
33866,
8924,
35374,
2099,
1988,
764,
628,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
12001,
62,
42116,
388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2378,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3696,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
7753,
62,
12683,
6691,
62,
926,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
12001,
62,
42116,
388,
13,
628,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
12001,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
8856,
62,
7266,
43789,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
3551,
62,
24326,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
691,
62,
12001,
62,
48205,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
2438,
62,
1040,
806,
273,
62,
9122,
62,
25641,
415,
41876,
20681,
62,
354,
74,
85,
11,
198,
220,
220,
220,
220,
220,
2512,
62,
41509,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
12001,
62,
33692,
13,
628,
220,
24412,
47,
1546,
25,
1259,
62,
12001,
62,
42116,
388,
62,
926,
41876,
49053,
9795,
43679,
3963,
1259,
62,
12001,
62,
42116,
388,
13315,
5550,
38865,
35374,
13,
628,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
260,
7501,
62,
19875,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19016,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8478,
62,
3672,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
427,
64,
16,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
26270,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5301,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1614,
4871,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2727,
62,
1525,
220,
220,
220,
220,
220,
41876,
2124,
549,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2727,
62,
265,
220,
220,
220,
220,
220,
41876,
4628,
395,
321,
489,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18043,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
31841,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1957,
62,
42116,
5700,
41876,
1259,
62,
12001,
62,
42116,
388,
62,
926,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16605,
62,
397,
499,
18300,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
14804,
774,
62,
26518,
62,
397,
499,
18300,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1182,
62,
1671,
3702,
220,
220,
220,
220,
41876,
4731,
11,
220,
220,
366,
39837,
5659,
5420,
286,
262,
29924,
11,
4958,
8478,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1957,
62,
33692,
220,
41876,
1259,
62,
12001,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
260,
7501,
62,
19875,
13,
628,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
260,
7501,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1994,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
8367,
13,
198,
220,
220,
220,
220,
220,
3268,
5097,
52,
7206,
41876,
1259,
62,
260,
7501,
62,
19875,
13,
198,
220,
24412,
47,
1546,
25,
23578,
3963,
1259,
62,
260,
7501,
13,
198,
220,
24412,
47,
1546,
25,
256,
83,
62,
260,
7501,
41876,
49053,
9795,
43679,
3963,
1259,
62,
260,
7501,
13315,
5550,
38865,
35374,
13,
198,
220,
24412,
47,
1546,
25,
256,
83,
62,
260,
7501,
62,
13083,
41876,
49053,
9795,
43679,
3963,
1259,
62,
260,
7501,
12,
2539,
13315,
5550,
38865,
35374,
13,
198,
198,
10619,
41358,
49836,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_xml DEFINITION
PUBLIC
ABSTRACT
CREATE PUBLIC .
PUBLIC SECTION.
METHODS:
constructor
IMPORTING iv_filename TYPE string OPTIONAL.
PROTECTED SECTION.
DATA: mi_ixml TYPE REF TO if_ixml,
mi_xml_doc TYPE REF TO if_ixml_document,
ms_metadata TYPE zif_abapgit_definitions=>ty_metadata,
mv_filename TYPE string.
CONSTANTS: c_abapgit_tag TYPE string VALUE 'abapGit' ##NO_TEXT,
c_attr_version TYPE string VALUE 'version' ##NO_TEXT,
c_attr_serializer TYPE string VALUE 'serializer' ##NO_TEXT,
c_attr_serializer_version TYPE string VALUE 'serializer_version' ##NO_TEXT.
METHODS to_xml
IMPORTING iv_normalize TYPE abap_bool DEFAULT abap_true
RETURNING VALUE(rv_xml) TYPE string.
METHODS parse
IMPORTING iv_xml TYPE string
RAISING zcx_abapgit_exception.
PRIVATE SECTION.
METHODS error
IMPORTING ii_parser TYPE REF TO if_ixml_parser
RAISING zcx_abapgit_exception.
METHODS display_version_mismatch
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS zcl_abapgit_xml IMPLEMENTATION.
METHOD constructor.
mi_ixml = cl_ixml=>create( ).
mi_xml_doc = mi_ixml->create_document( ).
mv_filename = iv_filename.
ENDMETHOD.
METHOD display_version_mismatch.
DATA: lv_version TYPE string.
DATA: lv_file TYPE string.
lv_version = |abapGit version: { zif_abapgit_version=>gc_abap_version }|. "#EC NOTEXT
IF mv_filename IS NOT INITIAL.
lv_file = |File: { mv_filename }|. "#EC NOTEXT
ENDIF.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = 'abapGit XML version mismatch' "#EC NOTEXT
txt1 = 'abapGit XML version mismatch' "#EC NOTEXT
txt2 = 'See http://larshp.github.io/abapGit/other-xml-mismatch.html' "#EC NOTEXT
txt3 = lv_version
txt4 = lv_file.
IF mv_filename IS INITIAL.
zcx_abapgit_exception=>raise( 'abapGit XML version mismatch' ). "#EC NOTEXT
ELSE.
zcx_abapgit_exception=>raise( |abapGit XML version mismatch in file { mv_filename }| ). "#EC NOTEXT
ENDIF.
ENDMETHOD.
METHOD error.
DATA: lv_error TYPE i,
lv_column TYPE string,
lv_line TYPE string,
lv_reason TYPE string,
lv_txt1 TYPE string,
lv_txt2 TYPE string,
lv_txt3 TYPE string,
lv_txt4 TYPE string,
lv_times TYPE i,
li_error TYPE REF TO if_ixml_parse_error.
IF ii_parser->num_errors( ) <> 0.
lv_times = ii_parser->num_errors( ).
DO lv_times TIMES.
lv_error = sy-index - 1.
li_error = ii_parser->get_error( lv_error ).
lv_column = li_error->get_column( ).
lv_line = li_error->get_line( ).
lv_reason = li_error->get_reason( ).
IF mv_filename IS NOT INITIAL.
lv_txt1 = |File: { mv_filename }|. "#EC NOTEXT
lv_txt2 = |Column: { lv_column }|. "#EC NOTEXT
lv_txt3 = |Line: { lv_line }|. "#EC NOTEXT
lv_txt4 = lv_reason.
ELSE.
lv_txt1 = |Column: { lv_column }|. "#EC NOTEXT
lv_txt2 = |Line: { lv_line }|. "#EC NOTEXT
lv_txt3 = lv_reason.
CLEAR lv_txt4.
ENDIF.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = 'Error from XML parser' "#EC NOTEXT
txt1 = lv_txt1
txt2 = lv_txt2
txt3 = lv_txt3
txt4 = lv_txt4.
ENDDO.
ENDIF.
IF mv_filename IS INITIAL.
zcx_abapgit_exception=>raise( |Error while parsing XML| ). "#EC NOTEXT
ELSE.
zcx_abapgit_exception=>raise( |Error while parsing XML file { mv_filename }| ). "#EC NOTEXT
ENDIF.
ENDMETHOD.
METHOD parse.
DATA: li_stream_factory TYPE REF TO if_ixml_stream_factory,
li_istream TYPE REF TO if_ixml_istream,
li_element TYPE REF TO if_ixml_element,
li_version TYPE REF TO if_ixml_node,
li_parser TYPE REF TO if_ixml_parser.
ASSERT NOT iv_xml IS INITIAL.
li_stream_factory = mi_ixml->create_stream_factory( ).
li_istream = li_stream_factory->create_istream_string( iv_xml ).
li_parser = mi_ixml->create_parser( stream_factory = li_stream_factory
istream = li_istream
document = mi_xml_doc ).
li_parser->add_strip_space_element( ).
IF li_parser->parse( ) <> 0.
error( li_parser ).
ENDIF.
li_istream->close( ).
li_element = mi_xml_doc->find_from_name_ns( depth = 0 name = c_abapgit_tag ).
li_version = li_element->if_ixml_node~get_attributes(
)->get_named_item_ns( c_attr_version ) ##no_text.
IF li_version->get_value( ) <> zif_abapgit_version=>gc_xml_version.
display_version_mismatch( ).
ENDIF.
* buffer serializer metadata. Git node will be removed lateron
ms_metadata-class = li_element->get_attribute_ns( c_attr_serializer ).
ms_metadata-version = li_element->get_attribute_ns( c_attr_serializer_version ).
ENDMETHOD.
METHOD to_xml.
* will render to codepage UTF-16
DATA: li_ostream TYPE REF TO if_ixml_ostream,
li_renderer TYPE REF TO if_ixml_renderer,
li_streamfactory TYPE REF TO if_ixml_stream_factory.
li_streamfactory = mi_ixml->create_stream_factory( ).
li_ostream = li_streamfactory->create_ostream_cstring( rv_xml ).
li_renderer = mi_ixml->create_renderer( ostream = li_ostream
document = mi_xml_doc ).
li_renderer->set_normalizing( iv_normalize ).
li_renderer->render( ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
19875,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
9564,
18601,
10659,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
34345,
41876,
4731,
39852,
2849,
1847,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
42865,
25,
21504,
62,
844,
4029,
220,
220,
220,
220,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21504,
62,
19875,
62,
15390,
220,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
22897,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13845,
62,
38993,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
38993,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
85,
62,
34345,
41876,
4731,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
269,
62,
397,
499,
18300,
62,
12985,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
397,
499,
38,
270,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
62,
35226,
62,
9641,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
9641,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
62,
35226,
62,
46911,
7509,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
46911,
7509,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
62,
35226,
62,
46911,
7509,
62,
9641,
41876,
4731,
26173,
8924,
705,
46911,
7509,
62,
9641,
6,
22492,
15285,
62,
32541,
13,
628,
220,
220,
220,
337,
36252,
50,
284,
62,
19875,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
11265,
1096,
220,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
19875,
8,
41876,
4731,
13,
628,
220,
220,
220,
337,
36252,
50,
21136,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
19875,
41876,
4731,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
4049,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21065,
62,
48610,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
48610,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
220,
220,
220,
337,
36252,
50,
3359,
62,
9641,
62,
76,
1042,
963,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
19875,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
21504,
62,
844,
4029,
220,
220,
220,
220,
796,
537,
62,
844,
4029,
14804,
17953,
7,
6739,
198,
220,
220,
220,
21504,
62,
19875,
62,
15390,
220,
796,
21504,
62,
844,
4029,
3784,
17953,
62,
22897,
7,
6739,
198,
220,
220,
220,
285,
85,
62,
34345,
796,
21628,
62,
34345,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
3359,
62,
9641,
62,
76,
1042,
963,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
9641,
41876,
4731,
13,
198,
220,
220,
220,
42865,
25,
300,
85,
62,
7753,
220,
220,
220,
41876,
4731,
13,
628,
220,
220,
220,
300,
85,
62,
9641,
796,
930,
397,
499,
38,
270,
2196,
25,
1391,
1976,
361,
62,
397,
499,
18300,
62,
9641,
14804,
36484,
62,
397,
499,
62,
9641,
1782,
91,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
16876,
285,
85,
62,
34345,
3180,
5626,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
300,
85,
62,
7753,
796,
930,
8979,
25,
1391,
285,
85,
62,
34345,
1782,
91,
13,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
47,
3185,
8577,
62,
10468,
62,
1268,
21389,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5259,
417,
796,
705,
397,
499,
38,
270,
23735,
2196,
46318,
6,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
220,
220,
256,
742,
16,
220,
796,
705,
397,
499,
38,
270,
23735,
2196,
46318,
6,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
220,
220,
256,
742,
17,
220,
796,
705,
6214,
2638,
1378,
75,
5406,
79,
13,
12567,
13,
952,
14,
397,
499,
38,
270,
14,
847,
12,
19875,
12,
76,
1042,
963,
13,
6494,
6,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
220,
220,
256,
742,
18,
220,
796,
300,
85,
62,
9641,
198,
220,
220,
220,
220,
220,
220,
220,
256,
742,
19,
220,
796,
300,
85,
62,
7753,
13,
628,
220,
220,
220,
16876,
285,
85,
62,
34345,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
397,
499,
38,
270,
23735,
2196,
46318,
6,
6739,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
930,
397,
499,
38,
270,
23735,
2196,
46318,
287,
2393,
1391,
285,
85,
62,
34345,
1782,
91,
6739,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
4049,
13,
628,
220,
220,
220,
42865
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
interface /HEC1/IF_BOPF_CONFIG_UI_TREE_H
public .
methods DELETE
importing
!IV_NODE_KEY type /BOBF/CONF_KEY
!IV_TREE_TYPE type STRING default /HEC1/IF_CONFIG_CONSTANTS=>GC_TREE_TYPE-DISTRIBUTION .
methods GET_HIERARCHY
returning
value(RT_TREE_HIERARCHY) type /HEC1/T_BOPF_CONFIG_TREE .
methods GET_HIERARCHY_PHASING
returning
value(RT_TREE_HIERARCHY) type /HEC1/T_BOPF_CONFIG_TREE_PHASE .
methods GET_LEAD_SELECTION_NODE_KEY
importing
!IV_TREE_TYPE type STRING default /HEC1/IF_CONFIG_CONSTANTS=>GC_TREE_TYPE-DISTRIBUTION
returning
value(RV_KEY) type /BOBF/CONF_KEY .
methods GET_LEAD_SELECTION_PA_NODE_KEY
importing
!IV_TREE_TYPE type STRING default /HEC1/IF_CONFIG_CONSTANTS=>GC_TREE_TYPE-DISTRIBUTION
returning
value(RV_KEY) type /BOBF/CONF_KEY .
methods GET_LEAD_SELECTION_TREE_KEY
importing
!IV_TREE_TYPE type STRING default /HEC1/IF_CONFIG_CONSTANTS=>GC_TREE_TYPE-DISTRIBUTION
returning
value(RV_KEY) type SYSUUID_C22 .
methods GET_PARENT_KEY
importing
!IV_KEY type SYSUUID_C22
!IV_TREE_TYPE type STRING default /HEC1/IF_CONFIG_CONSTANTS=>GC_TREE_TYPE-DISTRIBUTION
returning
value(RV_PARENT_KEY) type SYSUUID_C22 .
methods GET_SELECTED_NODE_TYPE
returning
value(RV_VALUE) type /HEC1/OBJECT_TYPE .
methods GET_TREE_LINE
importing
!IV_ROW_KEY type SYSUUID_C22
returning
value(RS_LINE) type /HEC1/S_BOPF_CONFIG_TREE .
methods INSERT
importing
!IT_NODE type /HEC1/T_BOPF_CONFIG_DATA2TREE optional .
methods INSERT_PHASING
importing
!IT_NODE type /HEC1/T_BOPF_CONF_2TREE_PHASE optional .
methods LOAD
importing
!IV_CONFID type /HEC1/CONFIG_ID
!IV_CONF_VERSION type /HEC1/CONFIG_VERSION .
methods SET_COLLAPS_FLAG
importing
!IV_INDEX type SYINDEX
!IV_TREE_TYPE type STRING default /HEC1/IF_CONFIG_CONSTANTS=>GC_TREE_TYPE-DISTRIBUTION .
methods SET_EXPAND_FLAG
importing
!IV_INDEX type SYINDEX
!IV_TREE_TYPE type STRING default /HEC1/IF_CONFIG_CONSTANTS=>GC_TREE_TYPE-DISTRIBUTION .
methods SET_LEAD_SELECTION_KEY
importing
!IV_LEAD_SELECTION_KEY type SYTABIX
!IV_TREE_TYPE type STRING default /HEC1/IF_CONFIG_CONSTANTS=>GC_TREE_TYPE-DISTRIBUTION .
methods UPDATE
importing
!IT_NODE type /HEC1/T_BOPF_CONFIG_DATA2TREE .
methods UPDATE_PHASING
importing
!IT_NODE type /HEC1/T_BOPF_CONF_2TREE_PHASE .
methods GET_TREE_LINE_PHASING
importing
!IV_ROW_KEY type SYSUUID_C22
returning
value(RS_LINE) type /HEC1/S_BOPF_CONFIG_TREE_PHASE .
methods SET_PARENTS_EXPANDED
importing
!IV_KEY type CHAR30
!IV_TREE_TYPE type STRING default /HEC1/IF_CONFIG_CONSTANTS=>GC_TREE_TYPE-DISTRIBUTION .
methods SET_COLLAPSE_KEY
importing
!IV_KEY type SYSUUID_C22
!IV_TREE_TYPE type STRING default /HEC1/IF_CONFIG_CONSTANTS=>GC_TREE_TYPE-DISTRIBUTION .
methods SET_EXPAND_KEY
importing
!IV_KEY type SYSUUID_C22
!IV_TREE_TYPE type STRING default /HEC1/IF_CONFIG_CONSTANTS=>GC_TREE_TYPE-DISTRIBUTION .
endinterface.
| [
39994,
1220,
39,
2943,
16,
14,
5064,
62,
33,
3185,
37,
62,
10943,
16254,
62,
10080,
62,
51,
11587,
62,
39,
198,
220,
1171,
764,
628,
198,
220,
5050,
5550,
2538,
9328,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
45,
16820,
62,
20373,
2099,
1220,
8202,
29499,
14,
10943,
37,
62,
20373,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
51,
11587,
62,
25216,
2099,
19269,
2751,
4277,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
10943,
2257,
1565,
4694,
14804,
15916,
62,
51,
11587,
62,
25216,
12,
26288,
5446,
9865,
35354,
764,
198,
220,
5050,
17151,
62,
25374,
1137,
31315,
56,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
14181,
62,
51,
11587,
62,
25374,
1137,
31315,
56,
8,
2099,
1220,
39,
2943,
16,
14,
51,
62,
33,
3185,
37,
62,
10943,
16254,
62,
51,
11587,
764,
198,
220,
5050,
17151,
62,
25374,
1137,
31315,
56,
62,
11909,
1921,
2751,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
14181,
62,
51,
11587,
62,
25374,
1137,
31315,
56,
8,
2099,
1220,
39,
2943,
16,
14,
51,
62,
33,
3185,
37,
62,
10943,
16254,
62,
51,
11587,
62,
11909,
11159,
764,
198,
220,
5050,
17151,
62,
2538,
2885,
62,
46506,
2849,
62,
45,
16820,
62,
20373,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
51,
11587,
62,
25216,
2099,
19269,
2751,
4277,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
10943,
2257,
1565,
4694,
14804,
15916,
62,
51,
11587,
62,
25216,
12,
26288,
5446,
9865,
35354,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
20373,
8,
2099,
1220,
8202,
29499,
14,
10943,
37,
62,
20373,
764,
198,
220,
5050,
17151,
62,
2538,
2885,
62,
46506,
2849,
62,
4537,
62,
45,
16820,
62,
20373,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
51,
11587,
62,
25216,
2099,
19269,
2751,
4277,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
10943,
2257,
1565,
4694,
14804,
15916,
62,
51,
11587,
62,
25216,
12,
26288,
5446,
9865,
35354,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
20373,
8,
2099,
1220,
8202,
29499,
14,
10943,
37,
62,
20373,
764,
198,
220,
5050,
17151,
62,
2538,
2885,
62,
46506,
2849,
62,
51,
11587,
62,
20373,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
51,
11587,
62,
25216,
2099,
19269,
2751,
4277,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
10943,
2257,
1565,
4694,
14804,
15916,
62,
51,
11587,
62,
25216,
12,
26288,
5446,
9865,
35354,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
20373,
8,
2099,
19704,
12564,
27586,
62,
34,
1828,
764,
198,
220,
5050,
17151,
62,
27082,
3525,
62,
20373,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
20373,
2099,
19704,
12564,
27586,
62,
34,
1828,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
51,
11587,
62,
25216,
2099,
19269,
2751,
4277,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
10943,
2257,
1565,
4694,
14804,
15916,
62,
51,
11587,
62,
25216,
12,
26288,
5446,
9865,
35354,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
27082,
3525,
62,
20373,
8,
2099,
19704,
12564,
27586,
62,
34,
1828,
764,
198,
220,
5050,
17151,
62,
46506,
1961,
62,
45,
16820,
62,
25216,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
39488,
8,
2099,
1220,
39,
2943,
16,
14,
9864,
23680,
62,
25216,
764,
198,
220,
5050,
17151,
62,
51,
11587,
62,
24027,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
49,
3913,
62,
20373,
2099,
19704,
12564,
27586,
62,
34,
1828,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
6998,
62,
24027,
8,
2099,
1220,
39,
2943,
16,
14,
50,
62,
33,
3185,
37,
62,
10943,
16254,
62,
51,
11587,
764,
198,
220,
5050,
29194,
17395,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
2043,
62,
45,
16820,
2099,
1220,
39,
2943,
16,
14,
51,
62,
33,
3185,
37,
62,
10943,
16254,
62,
26947,
17,
51,
11587,
11902,
764,
198,
220,
5050,
29194,
17395,
62,
11909,
1921,
2751,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
2043,
62,
45,
16820,
2099,
1220,
39,
2943,
16,
14,
51,
62,
33,
3185,
37,
62,
10943,
37,
62,
17,
51,
11587,
62,
11909,
11159,
11902,
764,
198,
220,
5050,
17579,
2885,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
10943,
37,
2389,
2099,
1220,
39,
2943,
16,
14,
10943,
16254,
62,
2389,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
10943,
37,
62,
43717,
2099,
1220,
39,
2943,
16,
14,
10943,
16254,
62,
43717,
764,
198,
220,
5050,
25823,
62,
8220,
3069,
44580,
62,
38948,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
12115,
6369,
2099,
19704,
12115,
6369,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
51,
11587,
62,
25216,
2099,
19269,
2751,
4277,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
10943,
2257,
1565,
4694,
14804,
15916,
62,
51,
11587,
62,
25216,
12,
26288,
5446,
9865,
35354,
764,
198,
220,
5050,
25823,
62,
49864,
6981,
62,
38948,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
12115,
6369,
2099,
19704,
12115,
6369,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
51,
11587,
62,
25216,
2099,
19269,
2751,
4277,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
10943,
2257,
1565,
4694,
14804,
15916,
62,
51,
11587,
62,
25216,
12,
26288,
5446,
9865,
35354,
764,
198,
220,
5050,
25823,
62,
2538,
2885,
62,
46506,
2849,
62,
20373,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
2538,
2885,
62,
46506,
2849,
62,
20373,
2099,
19704
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ZABAPFIRE_CL_HTTP_UTIL definition
public
final
create public .
public section.
class-methods GET_HTTP_ERROR_MSG
importing
!CODE type I
!PAYLOAD type STRING
!API type STRING
returning
value(RV_MSG) type STRING
raising
ZCX_ABAPFIRE_FIREBASE .
class-methods ABAP_LCC
importing
!IN type STRING
returning
value(OUT) type STRING .
class-methods LCC_ABAP
importing
!IN type STRING
returning
value(OUT) type STRING .
class-methods DESERIALIZE_VALUE
importing
!JSON_VALUE type STRING
!JSON_TYPE type STRING
exporting
value(ABAP_VALUE) type ANY .
class-methods SERIALIZE_VALUE
importing
!ABAP_VALUE type ANY
returning
value(JSON_VALUE) type STRING .
PROTECTED SECTION.
private section.
constants C_BOOL_TYPES type STRING value `\TYPE-POOL=ABAP\TYPE=ABAP_BOOL\TYPE=BOOLEAN\TYPE=BOOLE_D\TYPE=XFELD` ##NO_TEXT.
class-methods XSTRING_TO_STRING
importing
!IN type ANY
returning
value(OUT) type STRING .
class-methods STRING_TO_XSTRING
importing
!IN type STRING
changing
!OUT type ANY .
ENDCLASS.
CLASS ZABAPFIRE_CL_HTTP_UTIL IMPLEMENTATION.
METHOD ABAP_LCC.
DATA: tokens TYPE TABLE OF char128.
FIELD-SYMBOLS:
<token> TYPE any.
CHECK NOT in IS INITIAL.
out = in.
TRANSLATE out TO LOWER CASE.
SPLIT out AT `_` INTO TABLE tokens.
LOOP AT tokens ASSIGNING <token> FROM 2.
TRANSLATE <token>(1) TO UPPER CASE.
ENDLOOP.
CONCATENATE LINES OF tokens INTO out.
ENDMETHOD.
METHOD DESERIALIZE_VALUE.
DATA: l_elem_descr TYPE REF TO cl_abap_elemdescr,
l_string TYPE string,
l_year TYPE n LENGTH 4,
l_month TYPE n LENGTH 2,
l_day TYPE n LENGTH 2,
l_hour TYPE n LENGTH 2,
l_minute TYPE n LENGTH 2,
l_second TYPE n LENGTH 2,
l_decimals TYPE n LENGTH 7,
tk LIKE l_elem_descr->type_kind.
DEFINE escape_string.
REPLACE ALL OCCURRENCES OF `\"` IN &1 WITH `"`.
REPLACE ALL OCCURRENCES OF `\\` IN &1 WITH `\`.
END-OF-DEFINITION.
l_elem_descr ?= cl_abap_typedescr=>describe_by_data( abap_value ).
tk = l_elem_descr->type_kind.
CASE json_type.
WHEN 'string'.
l_string = json_value.
escape_string l_string.
CASE tk.
WHEN cl_abap_typedescr=>typekind_xstring OR
cl_abap_typedescr=>typekind_hex.
string_to_xstring( EXPORTING in = l_string CHANGING out = abap_value ).
WHEN cl_abap_typedescr=>typekind_date.
FIND FIRST OCCURRENCE OF REGEX '(\d{4})-(\d{2})-(\d{2})' IN json_value
SUBMATCHES l_year l_month l_day.
IF sy-subrc EQ 0.
CONCATENATE l_year l_month l_day INTO abap_value.
ENDIF.
WHEN cl_abap_typedescr=>typekind_time.
FIND FIRST OCCURRENCE OF REGEX '(\d{2}):(\d{2}):(\d{2})' IN json_value
SUBMATCHES l_hour l_minute l_second.
IF sy-subrc EQ 0.
CONCATENATE l_hour l_minute l_second INTO abap_value.
ENDIF.
WHEN cl_abap_typedescr=>typekind_packed.
FIND FIRST OCCURRENCE OF REGEX
'(\d{4})-?(\d{2})-?(\d{2})T(\d{2}):?(\d{2}):?(\d{2})(?:[\.,](\d{0,7}))?Z?'
"#EC NOTEXT
IN json_value
SUBMATCHES l_year l_month l_day l_hour l_minute l_second l_decimals.
IF sy-subrc EQ 0.
CONCATENATE l_year l_month l_day
l_hour l_minute l_second '.' l_decimals INTO l_string.
abap_value = l_string.
ENDIF.
WHEN OTHERS.
abap_value = l_string.
ENDCASE.
WHEN 'boolean'.
CASE json_value.
WHEN 'true'.
abap_value = abap_true.
WHEN 'false' OR 'null'. "TODO Manage 3 values boolean
abap_value = abap_false.
ENDCASE.
WHEN 'number'.
abap_value = json_value.
ENDCASE.
ENDMETHOD.
METHOD get_http_error_msg.
TYPES:
BEGIN OF ty_error_array,
domain TYPE string,
reason TYPE string,
message TYPE string,
END OF ty_error_array,
BEGIN OF ty_error_google,
errors TYPE STANDARD TABLE OF ty_error_array
WITH DEFAULT KEY,
code TYPE i,
message TYPE string,
END OF ty_error_google,
BEGIN OF ty_response_google,
error TYPE ty_error_google,
END OF ty_response_google,
BEGIN OF ty_response_firebase,
error TYPE string,
END OF ty_response_firebase.
DATA:
lref_json_deserializer TYPE REF TO zabapfire_cl_json_deserializer,
ls_error_google TYPE ty_response_google,
ls_error_firebase TYPE ty_response_firebase,
lv_code TYPE n LENGTH 4,
lcx_exception TYPE REF TO zcx_abapfire_json.
FIELD-SYMBOLS:
<ls_error> TYPE any,
<message> TYPE any.
lv_code = code.
CASE api.
WHEN 'google'.
ASSIGN ls_error_google TO <ls_error>.
WHEN 'firebase'.
ASSIGN ls_error_firebase TO <ls_error>.
WHEN OTHERS.
CONCATENATE 'HTTP ERROR:' lv_code INTO rv_msg SEPARATED BY space.
RETURN.
ENDCASE.
TRY.
CREATE OBJECT lref_json_deserializer.
CALL METHOD lref_json_deserializer->deserialize
EXPORTING
json = payload
IMPORTING
abap = <ls_error>.
CATCH zcx_abapfire_json INTO lcx_exception.
zcx_abapfire_firebase=>raise( lcx_exception->get_text( ) ).
ENDTRY.
CASE api.
WHEN 'google'. "#EC NOTEXT
ASSIGN COMPONENT 'message'
OF STRUCTURE ls_error_google-error
TO <message>. "#EC NOTEXT
WHEN 'firebase'. "#EC NOTEXT
ASSIGN ls_error_firebase-error TO <message>.
ENDCASE.
IF <message> IS ASSIGNED.
CONCATENATE 'HTTP ERROR:' lv_code <message>
INTO rv_msg SEPARATED BY space.
ENDIF.
ENDMETHOD.
METHOD lcc_abap.
CHECK NOT in IS INITIAL.
out = in.
REPLACE ALL OCCURRENCES OF REGEX `([a-z])([A-Z])`
IN out WITH `$1_$2`. "#EC NOTEXT
TRANSLATE out TO UPPER CASE.
ENDMETHOD.
METHOD SERIALIZE_VALUE.
DATA: l_elem_descr TYPE REF TO cl_abap_elemdescr,
tk LIKE l_elem_descr->type_kind,
an LIKE l_elem_descr->absolute_name,
ol LIKE l_elem_descr->output_length.
DEFINE escape_string.
REPLACE ALL OCCURRENCES OF `\` IN &1 WITH `\\`.
REPLACE ALL OCCURRENCES OF `"` IN &1 WITH `\"`.
END-OF-DEFINITION.
l_elem_descr ?= cl_abap_typedescr=>describe_by_data( abap_value ).
tk = l_elem_descr->type_kind.
an = l_elem_descr->absolute_name.
ol = l_elem_descr->output_length.
CASE tk.
WHEN cl_abap_typedescr=>typekind_float OR
cl_abap_typedescr=>typekind_int OR
cl_abap_typedescr=>typekind_int1 OR
cl_abap_typedescr=>typekind_int2 OR
cl_abap_typedescr=>typekind_packed OR
`8`. "typekind_int8 -> '8' only from 7.40.
IF tk EQ cl_abap_typedescr=>typekind_packed AND
an CP `\TYPE=TIMESTAMP*`.
IF abap_value IS INITIAL.
json_value = `""`.
ELSE.
MOVE abap_value TO json_value.
IF an EQ `\TYPE=TIMESTAMP`.
CONCATENATE `"` json_value(4)
`-` json_value+4(2)
`-` json_value+6(2)
`T` json_value+8(2)
`:` json_value+10(2)
`:` json_value+12(2)
`.0000000Z"` INTO json_value.
ELSEIF an EQ `\TYPE=TIMESTAMPL`.
CONCATENATE `"` json_value(4)
`-` json_value+4(2)
`-` json_value+6(2)
`T` json_value+8(2)
`:` json_value+10(2)
`:` json_value+12(2)
`.` json_value+15(7) `Z"` INTO json_value.
ENDIF.
ENDIF.
ELSEIF abap_value IS INITIAL.
json_value = `0`.
ELSE.
MOVE abap_value TO json_value.
IF abap_value LT 0.
IF tk <> cl_abap_typedescr=>typekind_float. "float: sign is already at the beginning
SHIFT json_value RIGHT CIRCULAR.
ENDIF.
ELSE.
CONDENSE json_value.
ENDIF.
ENDIF.
WHEN cl_abap_typedescr=>typekind_num.
IF abap_value IS INITIAL.
json_value = `0`.
ELSE.
MOVE abap_value TO json_value.
SHIFT json_value LEFT DELETING LEADING ` 0`.
ENDIF.
WHEN cl_abap_typedescr=>typekind_string OR
cl_abap_typedescr=>typekind_csequence OR
cl_abap_typedescr=>typekind_clike.
IF abap_value IS INITIAL.
json_value = `""`.
ELSE.
MOVE abap_value TO json_value.
escape_string json_value.
CONCATENATE `"` json_value `"` INTO json_value.
ENDIF.
WHEN cl_abap_typedescr=>typekind_xstring OR
cl_abap_typedescr=>typekind_hex.
IF abap_value IS INITIAL.
json_value = `""`.
ELSE.
json_value = xstring_to_string( abap_value ).
escape_string json_value.
CONCATENATE `"` json_value `"` INTO json_value.
ENDIF.
WHEN cl_abap_typedescr=>typekind_char.
IF ol EQ 1 AND c_bool_types CS an.
IF abap_value EQ abap_true.
json_value = `true`. "#EC NOTEXT
ELSE.
json_value = `false`. "#EC NOTEXT
ENDIF.
ELSE.
MOVE abap_value TO json_value.
escape_string json_value.
CONCATENATE `"` json_value `"` INTO json_value.
ENDIF.
WHEN cl_abap_typedescr=>typekind_date.
MOVE abap_value TO json_value.
CONCATENATE `"` json_value(4)
`-` json_value+4(2)
`-` json_value+6(2)
`T00:00:00.0000000Z"` INTO json_value.
WHEN cl_abap_typedescr=>typekind_time.
MOVE abap_value TO json_value.
CONCATENATE `"` json_value(2)
`:` json_value+2(2)
`:` json_value+4(2) `"` INTO json_value.
WHEN OTHERS.
IF abap_value IS INITIAL.
json_value = `null`. "#EC NOTEXT
ELSE.
MOVE abap_value TO json_value.
ENDIF.
ENDCASE.
ENDMETHOD.
METHOD STRING_TO_XSTRING.
DATA: l_xstring TYPE xstring.
CALL FUNCTION 'SSFC_BASE64_DECODE'
EXPORTING
b64data = in
IMPORTING
bindata = l_xstring
EXCEPTIONS
OTHERS = 1.
IF sy-subrc IS INITIAL.
MOVE l_xstring TO out.
ELSE.
MOVE in TO out.
ENDIF.
ENDMETHOD.
METHOD XSTRING_TO_STRING.
DATA: l_xstring TYPE xstring.
l_xstring = in.
CALL FUNCTION 'SSFC_BASE64_ENCODE'
EXPORTING
bindata = l_xstring
IMPORTING
b64data = out
EXCEPTIONS
OTHERS = 1.
IF sy-subrc IS NOT INITIAL.
MOVE in TO out.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
6242,
2969,
11674,
2200,
62,
5097,
62,
40717,
62,
3843,
4146,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
1398,
12,
24396,
82,
17151,
62,
40717,
62,
24908,
62,
5653,
38,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
34,
16820,
2099,
314,
198,
220,
220,
220,
220,
220,
5145,
4537,
56,
35613,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
17614,
2099,
19269,
2751,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
5653,
38,
8,
2099,
19269,
2751,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
1168,
34,
55,
62,
6242,
2969,
11674,
2200,
62,
11674,
2200,
33,
11159,
764,
198,
220,
1398,
12,
24396,
82,
9564,
2969,
62,
43,
4093,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
1268,
2099,
19269,
2751,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
12425,
8,
2099,
19269,
2751,
764,
198,
220,
1398,
12,
24396,
82,
406,
4093,
62,
6242,
2969,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
1268,
2099,
19269,
2751,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
12425,
8,
2099,
19269,
2751,
764,
198,
220,
1398,
12,
24396,
82,
22196,
1137,
12576,
35400,
62,
39488,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
40386,
62,
39488,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
40386,
62,
25216,
2099,
19269,
2751,
198,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
1988,
7,
6242,
2969,
62,
39488,
8,
2099,
15529,
764,
198,
220,
1398,
12,
24396,
82,
18871,
12576,
35400,
62,
39488,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
6242,
2969,
62,
39488,
2099,
15529,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
40386,
62,
39488,
8,
2099,
19269,
2751,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
19734,
2665,
13,
628,
220,
38491,
327,
62,
8202,
3535,
62,
9936,
47,
1546,
2099,
19269,
2751,
1988,
4600,
59,
25216,
12,
16402,
3535,
28,
6242,
2969,
59,
25216,
28,
6242,
2969,
62,
8202,
3535,
59,
25216,
28,
33,
6684,
2538,
1565,
59,
25216,
28,
33,
6684,
2538,
62,
35,
59,
25216,
28,
55,
37,
24639,
63,
22492,
15285,
62,
32541,
13,
628,
220,
1398,
12,
24396,
82,
1395,
18601,
2751,
62,
10468,
62,
18601,
2751,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
1268,
2099,
15529,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
12425,
8,
2099,
19269,
2751,
764,
198,
220,
1398,
12,
24396,
82,
19269,
2751,
62,
10468,
62,
55,
18601,
2751,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
1268,
2099,
19269,
2751,
198,
220,
220,
220,
5609,
198,
220,
220,
220,
220,
220,
5145,
12425,
2099,
15529,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
6242,
2969,
11674,
2200,
62,
5097,
62,
40717,
62,
3843,
4146,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
9564,
2969,
62,
43,
4093,
13,
628,
220,
220,
220,
42865,
25,
16326,
41876,
43679,
3963,
1149,
12762,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
30001,
29,
41876,
597,
13,
628,
220,
220,
220,
5870,
25171,
5626,
287,
3180,
3268,
2043,
12576,
13,
628,
220,
220,
220,
503,
796,
287,
13,
198,
220,
220,
220,
48213,
8634,
6158,
503,
5390,
406,
36048,
42001,
13,
628,
220,
220,
220,
46341,
2043,
503,
5161,
4600,
62,
63,
39319,
43679,
16326,
13,
198,
220,
220,
220,
17579,
3185,
5161,
16326,
24994,
3528,
15871,
1279,
30001,
29,
16034,
362,
13,
198,
220,
220,
220,
220,
220,
48213,
8634,
6158,
1279,
30001,
33994,
16,
8,
5390,
471,
10246,
1137,
42001,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
39962,
1404,
1677,
6158,
43277,
1546,
3963,
16326,
39319,
503,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
22196,
1137,
12576,
35400,
62,
39488,
13,
198,
220,
220,
220,
42865,
25,
300,
62,
68,
10671,
62,
20147,
81,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
11129,
9132,
3798,
81,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
62,
8841,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
62,
1941,
220,
220,
220,
220,
220,
220,
41876,
299,
406,
49494,
604,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
62,
8424,
220,
220,
220,
220,
220,
41876,
299,
406,
49494,
362,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
62,
820,
220,
220,
220,
220,
220,
220,
220,
41876,
299,
406,
49494,
362,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
62,
9769,
220,
220,
220,
220,
220,
220,
41876,
299,
406,
49494,
362,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
62,
11374,
220,
220,
220,
220,
41876,
299,
406,
49494,
362,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
62,
12227,
220,
220,
220,
220,
41876,
299,
406,
49494,
362,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
62,
12501,
320,
874,
220,
220,
41876,
299,
406,
49494,
767,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
74,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34178,
300,
62,
68,
10671,
62,
20147,
81,
3784,
4906,
62,
11031,
13,
628,
220,
220,
220,
23449,
8881,
6654,
62,
8841,
13,
198,
220,
220,
220,
220,
220,
45285,
11598,
11096,
440,
4093,
31302,
24181,
1546,
3963,
4600,
7879,
63,
3268,
1222,
16,
13315,
4600,
1,
44646,
198,
220,
220,
220,
220,
220,
45285,
11598,
11096,
440,
4093,
31302,
24181,
1546,
3963,
4600,
6852,
63,
3268,
1222,
16,
13315,
4600,
59,
44646
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_object_enho_class DEFINITION PUBLIC.
PUBLIC SECTION.
METHODS:
constructor
IMPORTING
is_item TYPE zif_abapgit_definitions=>ty_item
io_files TYPE REF TO zcl_abapgit_objects_files.
INTERFACES: zif_abapgit_object_enho.
PROTECTED SECTION.
PRIVATE SECTION.
METHODS:
serialize_includes
IMPORTING
io_class TYPE REF TO cl_enh_tool_class
RAISING
zcx_abapgit_exception,
deserialize_includes
IMPORTING
ii_xml TYPE REF TO zif_abapgit_xml_input
io_class TYPE REF TO cl_enh_tool_class
RAISING
zcx_abapgit_exception.
DATA: ms_item TYPE zif_abapgit_definitions=>ty_item.
DATA: mo_files TYPE REF TO zcl_abapgit_objects_files.
ENDCLASS.
CLASS zcl_abapgit_object_enho_class IMPLEMENTATION.
METHOD constructor.
ms_item = is_item.
mo_files = io_files.
ENDMETHOD.
METHOD deserialize_includes.
DATA: lt_tab_methods TYPE enhnewmeth_tab,
lv_editorder TYPE n LENGTH 3,
lv_methname TYPE seocpdname,
lt_abap TYPE rswsourcet,
lx_enh TYPE REF TO cx_enh_root,
lv_new_em TYPE abap_bool,
lt_files TYPE zif_abapgit_definitions=>ty_files_tt.
FIELD-SYMBOLS: <ls_method> LIKE LINE OF lt_tab_methods,
<ls_file> TYPE zif_abapgit_definitions=>ty_file.
ii_xml->read( EXPORTING iv_name = 'TAB_METHODS'
CHANGING cg_data = lt_tab_methods ).
lv_new_em = abap_false.
lt_files = mo_files->get_files( ).
LOOP AT lt_files ASSIGNING <ls_file>
WHERE filename CS 'enho.em_'.
lv_new_em = abap_true.
EXIT.
ENDLOOP.
SORT lt_tab_methods BY meth_header-editorder.
LOOP AT lt_tab_methods ASSIGNING <ls_method>.
lv_methname = <ls_method>-methkey-cmpname.
IF lv_new_em = abap_true.
lt_abap = mo_files->read_abap( iv_extra = 'em_' && lv_methname ).
ELSE.
" old way
lv_editorder = <ls_method>-meth_header-editorder.
lt_abap = mo_files->read_abap( iv_extra = 'em' && lv_editorder ).
ENDIF.
TRY.
io_class->add_change_new_method_source(
clsname = <ls_method>-methkey-clsname
methname = lv_methname
methsource = lt_abap ).
CATCH cx_enh_mod_not_allowed cx_enh_is_not_enhanceable INTO lx_enh.
zcx_abapgit_exception=>raise( iv_text = 'Error deserializing ENHO method include'
ix_previous = lx_enh ).
ENDTRY.
ENDLOOP.
ENDMETHOD.
METHOD serialize_includes.
DATA: lt_includes TYPE enhnewmeth_tabincl_plus_enha,
lt_source TYPE TABLE OF abaptxt255,
lv_include TYPE programm.
FIELD-SYMBOLS: <ls_include> LIKE LINE OF lt_includes.
lt_includes = io_class->get_enh_method_includes( ).
LOOP AT lt_includes ASSIGNING <ls_include>.
lv_include = io_class->if_enh_tool~get_name( ).
TRANSLATE lv_include USING ' ='.
lv_include+30 = 'EM'.
lv_include+32(8) = <ls_include>-includenr.
CALL FUNCTION 'RPY_PROGRAM_READ'
EXPORTING
program_name = lv_include
with_includelist = abap_false
with_lowercase = abap_true
TABLES
source_extended = lt_source
EXCEPTIONS
cancelled = 1
not_found = 2
permission_error = 3
OTHERS = 4.
IF sy-subrc = 0.
mo_files->add_abap( iv_extra = |EM_{ <ls_include>-cpdname }|
it_abap = lt_source ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD zif_abapgit_object_enho~deserialize.
DATA: lo_enh_class TYPE REF TO cl_enh_tool_class,
lt_owr TYPE enhmeth_tabkeys,
lt_pre TYPE enhmeth_tabkeys,
lt_post TYPE enhmeth_tabkeys,
lt_source TYPE rswsourcet,
li_tool TYPE REF TO if_enh_tool,
lv_shorttext TYPE string,
lv_class TYPE seoclsname,
lv_enhname TYPE enhname,
lv_package TYPE devclass.
ii_xml->read( EXPORTING iv_name = 'SHORTTEXT'
CHANGING cg_data = lv_shorttext ).
ii_xml->read( EXPORTING iv_name = 'OWR_METHODS'
CHANGING cg_data = lt_owr ).
ii_xml->read( EXPORTING iv_name = 'PRE_METHODS'
CHANGING cg_data = lt_pre ).
ii_xml->read( EXPORTING iv_name = 'POST_METHODS'
CHANGING cg_data = lt_post ).
ii_xml->read( EXPORTING iv_name = 'CLASS'
CHANGING cg_data = lv_class ).
lt_source = mo_files->read_abap( ).
lv_enhname = ms_item-obj_name.
lv_package = iv_package.
TRY.
cl_enh_factory=>create_enhancement(
EXPORTING
enhname = lv_enhname
enhtype = ''
enhtooltype = cl_enh_tool_class=>tooltype
IMPORTING
enhancement = li_tool
CHANGING
devclass = lv_package ).
lo_enh_class ?= li_tool.
lo_enh_class->if_enh_object_docu~set_shorttext( lv_shorttext ).
lo_enh_class->set_class( lv_class ).
lo_enh_class->set_owr_methods( version = 'I'
owr_methods = lt_owr ).
lo_enh_class->set_pre_methods( version = 'I'
pre_methods = lt_pre ).
lo_enh_class->set_post_methods( version = 'I'
post_methods = lt_post ).
lo_enh_class->set_eimp_include( version = 'I'
eimp_source = lt_source ).
zcl_abapgit_object_enho_clif=>deserialize(
io_xml = ii_xml
io_clif = lo_enh_class ).
deserialize_includes(
ii_xml = ii_xml
io_class = lo_enh_class ).
lo_enh_class->if_enh_object~save( run_dark = abap_true ).
lo_enh_class->if_enh_object~unlock( ).
CATCH cx_enh_root.
zcx_abapgit_exception=>raise( 'error deserializing ENHO class' ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object_enho~serialize.
DATA: lo_enh_class TYPE REF TO cl_enh_tool_class,
lt_owr TYPE enhmeth_tabkeys,
lt_pre TYPE enhmeth_tabkeys,
lt_post TYPE enhmeth_tabkeys,
lt_source TYPE rswsourcet,
lv_class TYPE seoclsname,
lv_shorttext TYPE string.
lo_enh_class ?= ii_enh_tool.
lv_shorttext = lo_enh_class->if_enh_object_docu~get_shorttext( ).
lt_owr = lo_enh_class->get_owr_methods( ).
lt_pre = lo_enh_class->get_pre_methods( ).
lt_post = lo_enh_class->get_post_methods( ).
lt_source = lo_enh_class->get_eimp_include( ).
lo_enh_class->get_class( IMPORTING class_name = lv_class ).
ii_xml->add( iv_name = 'TOOL'
ig_data = ii_enh_tool->get_tool( ) ).
ii_xml->add( ig_data = lv_shorttext
iv_name = 'SHORTTEXT' ).
ii_xml->add( iv_name = 'CLASS'
ig_data = lv_class ).
ii_xml->add( iv_name = 'OWR_METHODS'
ig_data = lt_owr ).
ii_xml->add( iv_name = 'PRE_METHODS'
ig_data = lt_pre ).
ii_xml->add( iv_name = 'POST_METHODS'
ig_data = lt_post ).
mo_files->add_abap( lt_source ).
zcl_abapgit_object_enho_clif=>serialize(
io_xml = ii_xml
io_files = mo_files
io_clif = lo_enh_class ).
serialize_includes( lo_enh_class ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
62,
4871,
5550,
20032,
17941,
44731,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
9186,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
16624,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16624,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
1976,
361,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
11389,
1096,
62,
42813,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
4871,
41876,
4526,
37,
5390,
537,
62,
16550,
62,
25981,
62,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
748,
48499,
1096,
62,
42813,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21065,
62,
19875,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19875,
62,
15414,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
4871,
41876,
4526,
37,
5390,
537,
62,
16550,
62,
25981,
62,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
42865,
25,
13845,
62,
9186,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
13,
198,
220,
220,
220,
42865,
25,
6941,
62,
16624,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16624,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
62,
4871,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
13845,
62,
9186,
796,
318,
62,
9186,
13,
198,
220,
220,
220,
6941,
62,
16624,
796,
33245,
62,
16624,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
748,
48499,
1096,
62,
42813,
13,
628,
220,
220,
220,
42865,
25,
300,
83,
62,
8658,
62,
24396,
82,
41876,
5881,
3605,
76,
2788,
62,
8658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
19312,
2875,
220,
220,
41876,
299,
406,
49494,
513,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
76,
2788,
3672,
220,
220,
220,
41876,
384,
420,
30094,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
397,
499,
220,
220,
220,
220,
220,
220,
220,
41876,
374,
2032,
82,
454,
66,
316,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
87,
62,
16550,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
43213,
62,
16550,
62,
15763,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
3605,
62,
368,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
16624,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
62,
926,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
24396,
29,
34178,
48920,
3963,
300,
83,
62,
8658,
62,
24396,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7278,
62,
7753,
29,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
7753,
13,
628,
220,
220,
220,
21065,
62,
19875,
3784,
961,
7,
7788,
15490,
2751,
21628,
62,
3672,
796,
705,
5603,
33,
62,
49273,
50,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
269,
70,
62,
7890,
796,
300,
83,
62,
8658,
62,
24396,
82,
6739,
628,
220,
220,
220,
300,
85,
62,
3605,
62,
368,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
300,
83,
62,
16624,
796,
6941,
62,
16624,
3784,
1136,
62,
16624,
7,
6739,
198,
220,
220,
220,
17579,
3185,
5161,
300,
83,
62,
16624,
24994,
3528,
15871,
1279,
7278,
62,
7753,
29,
198,
220,
220,
220,
220,
220,
220,
220,
33411,
29472,
9429,
705,
268,
8873,
13,
368,
62,
4458,
198,
220,
220,
220,
220,
220,
300,
85,
62,
3605,
62,
368,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
7788,
2043,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
311,
9863,
300,
83,
62,
8658,
62,
24396,
82,
11050,
11248,
62,
25677,
12,
19312,
2875,
13,
198,
220,
220,
220,
17579,
3185,
5161,
300,
83,
62,
8658,
62,
24396,
82,
24994,
3528,
15871,
1279,
7278,
62,
24396,
28401,
628,
220,
220,
220,
220,
220,
300,
85,
62,
76,
2788,
3672,
796,
1279,
7278,
62,
24396,
29,
12,
76,
2788,
2539,
12,
48991,
3672,
13,
198,
220,
220,
220,
220,
220,
16876,
300,
85,
62,
3605,
62,
368,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
397,
499,
796,
6941,
62,
16624,
3784,
961,
62,
397,
499,
7,
21628,
62,
26086,
796,
705,
368,
62,
6,
11405,
300,
85,
62,
76,
2788,
3672,
6739,
198,
220,
220,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ZCA_ZAVE_STUDENT_P definition
public
inheriting from ZCB_ZAVE_STUDENT_P
final
create private .
public section.
class-data AGENT type ref to ZCA_ZAVE_STUDENT_P read-only .
class-methods CLASS_CONSTRUCTOR .
protected section.
private section.
ENDCLASS.
CLASS ZCA_ZAVE_STUDENT_P IMPLEMENTATION.
method CLASS_CONSTRUCTOR.
***BUILD 090501
************************************************************************
* Purpose : Initialize the 'class'.
*
* Version : 2.0
*
* Precondition : -
*
* Postcondition : Singleton is created.
*
* OO Exceptions : -
*
* Implementation : -
*
************************************************************************
* Changelog:
* - 1999-09-20 : (OS) Initial Version
* - 2000-03-06 : (BGR) 2.0 modified REGISTER_CLASS_AGENT
************************************************************************
* GENERATED: Do not modify
************************************************************************
create object AGENT.
call method AGENT->REGISTER_CLASS_AGENT
exporting
I_CLASS_NAME = 'ZCL_ZAVE_STUDENT_P'
I_CLASS_AGENT_NAME = 'ZCA_ZAVE_STUDENT_P'
I_CLASS_GUID = '00505692515B1ED892A8D094BF05B98E'
I_CLASS_AGENT_GUID = '00505692515B1ED892A8D0AE1BEFF98E'
I_AGENT = AGENT
I_STORAGE_LOCATION = 'ZAVE_FPM_STUD'
I_CLASS_AGENT_VERSION = '2.0'.
"CLASS_CONSTRUCTOR
endmethod.
ENDCLASS.
| [
4871,
1168,
8141,
62,
34892,
6089,
62,
2257,
8322,
3525,
62,
47,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
1168,
23199,
62,
34892,
6089,
62,
2257,
8322,
3525,
62,
47,
198,
220,
2457,
198,
220,
2251,
2839,
764,
198,
198,
11377,
2665,
13,
628,
220,
1398,
12,
7890,
13077,
3525,
2099,
1006,
284,
1168,
8141,
62,
34892,
6089,
62,
2257,
8322,
3525,
62,
47,
1100,
12,
8807,
764,
628,
220,
1398,
12,
24396,
82,
42715,
62,
10943,
46126,
1581,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
8141,
62,
34892,
6089,
62,
2257,
8322,
3525,
62,
47,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
2446,
42715,
62,
10943,
46126,
1581,
13,
198,
8162,
19499,
26761,
7769,
2713,
486,
198,
17174,
17174,
4557,
198,
9,
32039,
220,
220,
220,
220,
220,
220,
220,
1058,
20768,
1096,
262,
705,
4871,
4458,
198,
9,
198,
9,
10628,
220,
220,
220,
220,
220,
220,
220,
1058,
362,
13,
15,
198,
9,
198,
9,
3771,
31448,
220,
220,
1058,
532,
198,
9,
198,
9,
2947,
31448,
220,
1058,
5573,
10565,
318,
2727,
13,
198,
9,
198,
9,
440,
46,
1475,
11755,
220,
1058,
532,
198,
9,
198,
9,
46333,
1058,
532,
198,
9,
198,
17174,
17174,
4557,
198,
9,
609,
8368,
519,
25,
198,
9,
532,
7358,
12,
2931,
12,
1238,
220,
220,
1058,
357,
2640,
8,
20768,
10628,
198,
9,
532,
4751,
12,
3070,
12,
3312,
220,
220,
1058,
357,
33,
10761,
8,
362,
13,
15,
9518,
23337,
41517,
62,
31631,
62,
4760,
3525,
198,
17174,
17174,
4557,
198,
9,
24700,
1137,
11617,
25,
2141,
407,
13096,
198,
17174,
17174,
4557,
628,
220,
2251,
2134,
13077,
3525,
13,
628,
220,
869,
2446,
13077,
3525,
3784,
31553,
41517,
62,
31631,
62,
4760,
3525,
198,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
314,
62,
31631,
62,
20608,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
57,
5097,
62,
34892,
6089,
62,
2257,
8322,
3525,
62,
47,
6,
198,
220,
220,
220,
220,
220,
314,
62,
31631,
62,
4760,
3525,
62,
20608,
220,
220,
220,
796,
705,
57,
8141,
62,
34892,
6089,
62,
2257,
8322,
3525,
62,
47,
6,
198,
220,
220,
220,
220,
220,
314,
62,
31631,
62,
38,
27586,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
405,
31654,
3388,
1495,
1314,
33,
16,
1961,
4531,
17,
32,
23,
35,
2931,
19,
29499,
2713,
33,
4089,
36,
6,
198,
220,
220,
220,
220,
220,
314,
62,
31631,
62,
4760,
3525,
62,
38,
27586,
220,
220,
220,
796,
705,
405,
31654,
3388,
1495,
1314,
33,
16,
1961,
4531,
17,
32,
23,
35,
15,
14242,
16,
12473,
5777,
4089,
36,
6,
198,
220,
220,
220,
220,
220,
314,
62,
4760,
3525,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
13077,
3525,
198,
220,
220,
220,
220,
220,
314,
62,
2257,
1581,
11879,
62,
29701,
6234,
220,
220,
220,
796,
705,
34892,
6089,
62,
5837,
44,
62,
2257,
8322,
6,
198,
220,
220,
220,
220,
220,
314,
62,
31631,
62,
4760,
3525,
62,
43717,
796,
705,
17,
13,
15,
4458,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
31631,
62,
10943,
46126,
1581,
198,
220,
886,
24396,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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YPE etobj_ver
iv_object_type TYPE etobj_type
io_download TYPE REF TO cl_apl_ecatt_download
RETURNING
VALUE(rv_xml_stream) TYPE xstring
RAISING
zcx_abapgit_exception,
download_data
IMPORTING
ii_template_over_all TYPE REF TO if_ixml_document
RETURNING
VALUE(rv_xml_stream) TYPE xstring,
upload_data_from_stream
IMPORTING
iv_xml_stream TYPE xstring
RETURNING
VALUE(ri_template_over_all) TYPE REF TO if_ixml_document
RAISING
cx_ecatt_apl_xml.
PROTECTED SECTION.
PRIVATE SECTION.
CONSTANTS:
co_xml TYPE i VALUE 1. " downport of if_apl_ecatt_xml=>co_xml
ENDCLASS.
CLASS zcl_abapgit_ecatt_helper IMPLEMENTATION.
METHOD build_xml_of_object.
" downport of CL_APL_ECATT_DOWNLOAD=>BUILD_XML_OF_OBJECT
DATA: lo_load_help_dummy TYPE REF TO cl_apl_ecatt_load_help,
lx_ecatt TYPE REF TO cx_ecatt_apl,
lv_text TYPE string,
li_download TYPE REF TO zif_abapgit_ecatt_download.
"download method will create the xml stream
"note: it's the redefined download( ) of each object type specific download, which is called
TRY.
CREATE OBJECT lo_load_help_dummy
EXPORTING
im_maintain_function = ''.
io_download->download( im_object_name = iv_object_name
im_object_version = iv_object_version
im_object_type = iv_object_type
im_load_help = lo_load_help_dummy ).
CATCH cx_ecatt_apl INTO lx_ecatt.
lv_text = lx_ecatt->get_text( ).
zcx_abapgit_exception=>raise( lv_text ).
" note, exception cx_ecatt_ui_attachment doesn't exist in 702
CATCH cx_ecatt.
"will never be raised from download, when called with mv_generate_xml_no_download = 'X'.
ENDTRY.
li_download ?= io_download.
rv_xml_stream = li_download->get_xml_stream( ).
ENDMETHOD.
METHOD download_data.
DATA:
lo_xml TYPE REF TO cl_apl_ecatt_xml.
TRY.
CALL METHOD cl_apl_ecatt_xml=>('CREATE') " doesn't exist in 702
EXPORTING
im_type = co_xml
RECEIVING
re_xml = lo_xml.
lo_xml->set_attributes( im_dom = ii_template_over_all ).
lo_xml->get_attributes( IMPORTING ex_xml = rv_xml_stream ).
CATCH cx_ecatt_apl_xml.
RETURN.
ENDTRY.
ENDMETHOD.
METHOD upload_data_from_stream.
DATA:
lo_xml TYPE REF TO cl_apl_ecatt_xml,
lv_xstr TYPE xstring,
li_nc_xmlref_typ TYPE REF TO if_ixml_node_collection,
li_n_xmlref_typ TYPE REF TO if_ixml_node,
lv_index TYPE i VALUE 0,
lv_count TYPE i.
lv_xstr = iv_xml_stream.
CALL METHOD cl_apl_ecatt_xml=>('CREATE') " doesn't exist in 702
EXPORTING
im_type = co_xml
RECEIVING
re_xml = lo_xml.
* whitespace stripping needs a namespace
* remove white spaces only at the time of upload
lo_xml->stream_to_dom( im_xstream = lv_xstr
im_ignore_white_space = 'X'
im_uri = cl_apl_xml_const=>schema_uri ).
lo_xml->get_attributes( IMPORTING ex_dom = ri_template_over_all ).
* MD: Workaround, because nodes starting with "XML" are not allowed
li_nc_xmlref_typ ?= ri_template_over_all->get_elements_by_tag_name_ns( 'XMLREF_TYP' ). "#EC NOTEXT
CALL METHOD li_nc_xmlref_typ->('GET_LENGTH') " downport
RECEIVING
rval = lv_count.
WHILE lv_index < lv_count.
li_n_xmlref_typ = li_nc_xmlref_typ->get_item( lv_index ).
li_n_xmlref_typ->set_name( 'X-MLREF_TYP' ).
lv_index = lv_index + 1.
ENDWHILE.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
721,
1078,
62,
2978,
525,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
25,
198,
220,
220,
220,
220,
220,
1382,
62,
19875,
62,
1659,
62,
15252,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
15252,
62,
3672,
220,
220,
220,
220,
220,
220,
41876,
2123,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
15252,
62,
9641,
220,
220,
220,
41876,
2123,
26801,
62,
332,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
15252,
62,
4906,
220,
220,
220,
220,
220,
220,
41876,
2123,
26801,
62,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
15002,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
537,
62,
64,
489,
62,
721,
1078,
62,
15002,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
19875,
62,
5532,
8,
41876,
2124,
8841,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
628,
220,
220,
220,
220,
220,
4321,
62,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21065,
62,
28243,
62,
2502,
62,
439,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
22897,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
19875,
62,
5532,
8,
41876,
2124,
8841,
11,
628,
220,
220,
220,
220,
220,
9516,
62,
7890,
62,
6738,
62,
5532,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
19875,
62,
5532,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
2124,
8841,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
28243,
62,
2502,
62,
439,
8,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
22897,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
721,
1078,
62,
64,
489,
62,
19875,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
763,
62,
19875,
41876,
1312,
26173,
8924,
352,
13,
366,
866,
634,
286,
611,
62,
64,
489,
62,
721,
1078,
62,
19875,
14804,
1073,
62,
19875,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
721,
1078,
62,
2978,
525,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1382,
62,
19875,
62,
1659,
62,
15252,
13,
628,
220,
220,
220,
366,
866,
634,
286,
7852,
62,
2969,
43,
62,
2943,
17139,
62,
41925,
35613,
14804,
19499,
26761,
62,
55,
5805,
62,
19238,
62,
9864,
23680,
628,
220,
220,
220,
42865,
25,
2376,
62,
2220,
62,
16794,
62,
67,
13513,
41876,
4526,
37,
5390,
537,
62,
64,
489,
62,
721,
1078,
62,
2220,
62,
16794,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
87,
62,
721,
1078,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
43213,
62,
721,
1078,
62,
64,
489,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
5239,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7649,
62,
15002,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
721,
1078,
62,
15002,
13,
628,
220,
220,
220,
366,
15002,
2446,
481,
2251,
262,
35555,
4269,
198,
220,
220,
220,
366,
11295,
25,
340,
338,
262,
2266,
18156,
4321,
7,
1267,
286,
1123,
2134,
2099,
2176,
4321,
11,
543,
318,
1444,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
2376,
62,
2220,
62,
16794,
62,
67,
13513,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
545,
62,
76,
32725,
62,
8818,
796,
705,
4458,
628,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
15002,
3784,
15002,
7,
545,
62,
15252,
62,
3672,
220,
220,
220,
796,
21628,
62,
15252,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
545,
62,
15252,
62,
9641,
796,
21628,
62,
15252,
62,
9641,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
545,
62,
15252,
62,
4906,
220,
220,
220,
796,
21628,
62,
15252,
62,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
545,
62,
2220,
62,
16794,
220,
220,
220,
220,
220,
796,
2376,
62,
2220,
62,
16794,
62,
67,
13513,
6739,
628,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
721,
1078,
62,
64,
489,
39319,
300,
87,
62,
721,
1078,
13,
198,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
5239,
796,
300,
87,
62,
721,
1078,
3784,
1136,
62,
5239,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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MLESS.
PRIVATE SECTION.
DATA: mt_new TYPE TABLE OF string,
mt_old TYPE TABLE OF string,
mt_expected TYPE zif_abapgit_definitions=>ty_diffs_tt,
ms_expected LIKE LINE OF mt_expected.
METHODS: setup.
METHODS: test.
METHODS:
diff01 FOR TESTING,
diff02 FOR TESTING,
diff03 FOR TESTING,
diff04 FOR TESTING,
diff05 FOR TESTING,
diff06 FOR TESTING.
ENDCLASS.
CLASS ltcl_diff IMPLEMENTATION.
DEFINE _new.
APPEND &1 TO mt_new.
END-OF-DEFINITION.
DEFINE _old.
APPEND &1 TO mt_old.
END-OF-DEFINITION.
DEFINE _expected.
CLEAR ms_expected.
ms_expected-new_num = &1.
ms_expected-new = &2.
ms_expected-result = &3.
ms_expected-old_num = &4.
ms_expected-old = &5.
APPEND ms_expected TO mt_expected.
END-OF-DEFINITION.
METHOD setup.
CLEAR mt_new.
CLEAR mt_old.
CLEAR mt_expected.
ENDMETHOD.
METHOD test.
DATA: lv_new TYPE string,
lv_xnew TYPE xstring,
lv_old TYPE string,
lv_xold TYPE xstring,
lo_diff TYPE REF TO zcl_abapgit_diff,
lt_diff TYPE zif_abapgit_definitions=>ty_diffs_tt.
FIELD-SYMBOLS: <ls_diff> LIKE LINE OF lt_diff.
CONCATENATE LINES OF mt_new INTO lv_new SEPARATED BY zif_abapgit_definitions=>gc_newline.
CONCATENATE LINES OF mt_old INTO lv_old SEPARATED BY zif_abapgit_definitions=>gc_newline.
lv_xnew = zcl_abapgit_convert=>string_to_xstring_utf8( lv_new ).
lv_xold = zcl_abapgit_convert=>string_to_xstring_utf8( lv_old ).
CREATE OBJECT lo_diff
EXPORTING
iv_new = lv_xnew
iv_old = lv_xold.
lt_diff = lo_diff->get( ).
LOOP AT lt_diff ASSIGNING <ls_diff>.
CLEAR <ls_diff>-short.
ENDLOOP.
cl_abap_unit_assert=>assert_equals( act = lt_diff
exp = mt_expected ).
ENDMETHOD.
METHOD diff01.
* insert
_new 'A'.
" " NEW " STATUS " OLD
_expected 1 'A' zif_abapgit_definitions=>c_diff-insert '' ''.
test( ).
ENDMETHOD.
METHOD diff02.
* identical
_new 'A'.
_old 'A'.
" " NEW " STATUS " OLD
_expected 1 'A' '' 1 'A'.
test( ).
ENDMETHOD.
METHOD diff03.
* delete
_old 'A'.
" " NEW " STATUS " OLD
_expected '' '' zif_abapgit_definitions=>c_diff-delete 1 'A'.
test( ).
ENDMETHOD.
METHOD diff04.
* update
_new 'A+'.
_old 'A'.
" " NEW " STATUS " OLD
_expected 1 'A+' zif_abapgit_definitions=>c_diff-update 1 'A'.
test( ).
ENDMETHOD.
METHOD diff05.
* identical
_new 'A'.
_new 'B'.
_old 'A'.
_old 'B'.
" " NEW " STATUS " OLD
_expected 1 'A' '' 1 'A'.
_expected 2 'B' '' 2 'B'.
test( ).
ENDMETHOD.
METHOD diff06.
_new 'A'.
_new 'B'.
_new 'inserted'.
_new 'C'.
_new 'D update'.
_old 'A'.
_old 'B'.
_old 'C'.
_old 'D'.
" " NEW " STATUS " OLD
_expected 1 'A' '' 1 'A'.
_expected 2 'B' '' 2 'B'.
_expected 3 'inserted' zif_abapgit_definitions=>c_diff-insert '' ''.
_expected 4 'C' '' 3 'C'.
_expected 5 'D update' zif_abapgit_definitions=>c_diff-update 4 'D'.
test( ).
ENDMETHOD.
ENDCLASS.
| [
198,
31631,
300,
83,
565,
62,
26069,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
45079,
62,
3605,
220,
220,
220,
220,
220,
41876,
43679,
3963,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45079,
62,
727,
220,
220,
220,
220,
220,
41876,
43679,
3963,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45079,
62,
40319,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
67,
10203,
62,
926,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13845,
62,
40319,
34178,
48920,
3963,
45079,
62,
40319,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
9058,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
1332,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
814,
486,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
814,
2999,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
814,
3070,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
814,
3023,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
814,
2713,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
814,
3312,
7473,
43001,
2751,
13,
198,
198,
10619,
31631,
13,
628,
198,
31631,
300,
83,
565,
62,
26069,
30023,
2538,
10979,
6234,
13,
628,
220,
23449,
8881,
4808,
3605,
13,
198,
220,
220,
220,
43504,
10619,
1222,
16,
5390,
45079,
62,
3605,
13,
198,
220,
23578,
12,
19238,
12,
7206,
20032,
17941,
13,
628,
220,
23449,
8881,
4808,
727,
13,
198,
220,
220,
220,
43504,
10619,
1222,
16,
5390,
45079,
62,
727,
13,
198,
220,
23578,
12,
19238,
12,
7206,
20032,
17941,
13,
628,
220,
23449,
8881,
4808,
40319,
13,
198,
220,
220,
220,
30301,
1503,
13845,
62,
40319,
13,
198,
220,
220,
220,
13845,
62,
40319,
12,
3605,
62,
22510,
796,
1222,
16,
13,
198,
220,
220,
220,
13845,
62,
40319,
12,
3605,
220,
220,
220,
220,
796,
1222,
17,
13,
198,
220,
220,
220,
13845,
62,
40319,
12,
20274,
220,
796,
1222,
18,
13,
198,
220,
220,
220,
13845,
62,
40319,
12,
727,
62,
22510,
796,
1222,
19,
13,
198,
220,
220,
220,
13845,
62,
40319,
12,
727,
220,
220,
220,
220,
796,
1222,
20,
13,
198,
220,
220,
220,
43504,
10619,
13845,
62,
40319,
5390,
45079,
62,
40319,
13,
198,
220,
23578,
12,
19238,
12,
7206,
20032,
17941,
13,
628,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
30301,
1503,
45079,
62,
3605,
13,
198,
220,
220,
220,
30301,
1503,
45079,
62,
727,
13,
198,
220,
220,
220,
30301,
1503,
45079,
62,
40319,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
3605,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
87,
3605,
41876,
2124,
8841,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
727,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
87,
727,
41876,
2124,
8841,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
26069,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26069,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
26069,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
67,
10203,
62,
926,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
26069,
29,
34178,
48920,
3963,
300,
83,
62,
26069,
13,
628,
198,
220,
220,
220,
39962,
1404,
1677,
6158,
43277,
1546,
3963,
45079,
62,
3605,
39319,
300,
85,
62,
3605,
7946,
27082,
11617,
11050,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
36484,
62,
3605,
1370,
13,
198,
220,
220,
220,
39962,
1404,
1677,
6158,
43277,
1546,
3963,
45079,
62,
727,
39319,
300,
85,
62,
727,
7946,
27082,
11617,
11050,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
36484,
62,
3605,
1370,
13,
628,
220,
220,
220,
300,
85,
62,
87,
3605,
796,
1976,
565,
62,
397,
499,
18300,
62,
1102,
1851,
14804,
8841,
62,
1462,
62,
87,
8841,
62,
40477,
23,
7,
300,
85,
62,
3605,
6739,
198,
220,
220,
220,
300,
85,
62,
87,
727,
796,
1976,
565,
62,
397,
499,
18300,
62,
1102,
1851,
14804,
8841,
62,
1462,
62,
87,
8841,
62,
40477,
23,
7,
300,
85,
62,
727,
6739,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
2376,
62,
26069,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3605,
796,
300,
85,
62,
87,
3605,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
727,
796,
300,
85,
62,
87,
727,
13,
628,
220,
220,
220,
300,
83,
62,
26069,
796,
2376,
62,
26069,
3784,
1136,
7,
6739,
628,
220,
220,
220,
17579,
3185,
5161,
300,
83,
62,
26069,
24994,
3528,
15871,
1279,
7278,
62,
26069,
28401,
198,
220,
220,
220,
220,
220,
30301,
1503,
1279,
7278,
62,
26069,
29,
12,
19509,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
719,
796,
300,
83,
62,
26069,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
45079,
62,
40319,
6739,
628,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
814,
486,
13,
198,
198,
9,
7550,
198,
220,
220,
220,
4808,
3605,
705,
32,
4458,
628,
220,
220,
220,
366,
220,
220,
220,
220,
220,
220,
220,
220,
366,
12682,
220,
366,
15486,
2937,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
440,
11163,
198,
220,
220
] | [
1,
1,
1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cl_abapgit_object_xslt DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
PROTECTED SECTION.
PRIVATE SECTION.
METHODS:
get
RETURNING VALUE(ro_xslt) TYPE REF TO cl_o2_api_xsltdesc
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_XSLT IMPLEMENTATION.
METHOD get.
DATA: lv_name TYPE cxsltdesc.
lv_name = ms_item-obj_name.
cl_o2_api_xsltdesc=>load(
EXPORTING
p_xslt_desc = lv_name
IMPORTING
p_obj = ro_xslt
EXCEPTIONS
not_existing = 1
permission_failure = 2
OTHERS = 3 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from cl_o2_api_xsltdesc=>load' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
DATA: lo_xslt TYPE REF TO cl_o2_api_xsltdesc,
ls_attributes TYPE o2xsltattr.
lo_xslt = get( ).
lo_xslt->get_attributes(
RECEIVING
p_attributes = ls_attributes
EXCEPTIONS
object_invalid = 1
xsltdesc_deleted = 2
OTHERS = 3 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
rv_user = ls_attributes-changedby.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lo_xslt TYPE REF TO cl_o2_api_xsltdesc,
lv_name TYPE cxsltdesc.
lv_name = ms_item-obj_name.
cl_o2_api_xsltdesc=>load(
EXPORTING
p_xslt_desc = lv_name
IMPORTING
p_obj = lo_xslt
EXCEPTIONS
error_occured = 1
not_existing = 2
permission_failure = 3
version_not_found = 4
OTHERS = 5 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from cl_o2_api_xsltdesc=>load' ).
ENDIF.
lo_xslt->set_changeable( abap_true ).
lo_xslt->delete( ).
lo_xslt->save( ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_source TYPE string,
lo_xslt TYPE REF TO cl_o2_api_xsltdesc,
lv_len TYPE i,
ls_attributes TYPE o2xsltattr.
IF zif_abapgit_object~exists( ) = abap_true.
zif_abapgit_object~delete( iv_package ).
ENDIF.
io_xml->read( EXPORTING iv_name = 'ATTRIBUTES'
CHANGING cg_data = ls_attributes ).
ls_attributes-devclass = iv_package.
lv_source = mo_files->read_string( iv_extra = 'source'
iv_ext = 'xml' ).
* workaround: somewhere additional linefeeds are added
lv_len = strlen( lv_source ) - 2.
IF lv_source+lv_len(2) = cl_abap_char_utilities=>cr_lf.
lv_source = lv_source(lv_len).
ENDIF.
cl_o2_api_xsltdesc=>create_new_from_string(
EXPORTING
p_source = lv_source
p_attr = ls_attributes
IMPORTING
p_obj = lo_xslt
EXCEPTIONS
action_cancelled = 1
error_occured = 2
not_authorized = 3
object_already_existing = 4
undefined_name = 5
OTHERS = 6 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from XSLT new, { sy-subrc }| ).
ENDIF.
lo_xslt->save(
EXCEPTIONS
action_cancelled = 1
error_occured = 2
object_invalid = 3
object_not_changeable = 4
permission_failure = 5
OTHERS = 6 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from XSLT save, { sy-subrc }| ).
ENDIF.
lo_xslt->activate(
EXCEPTIONS
generate_error = 1
storage_error = 2
syntax_errors = 3
* xtc_not_available = 4 downport/upport, does not exist in 751
OTHERS = 5 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from XSLT activate, { sy-subrc }| ).
ENDIF.
lo_xslt->set_changeable( abap_false ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_name TYPE cxsltdesc.
lv_name = ms_item-obj_name.
rv_bool = cl_o2_api_xsltdesc=>exists( lv_name ).
rv_bool = boolc( rv_bool = '1' ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ms_item-obj_name
object_type = ms_item-obj_type.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lo_xslt TYPE REF TO cl_o2_api_xsltdesc,
lv_source TYPE string,
ls_attributes TYPE o2xsltattr.
lo_xslt = get( ).
ls_attributes = lo_xslt->get_attributes( ).
CLEAR: ls_attributes-author,
ls_attributes-createdon,
ls_attributes-changedby,
ls_attributes-changedon,
ls_attributes-devclass.
io_xml->add( iv_name = 'ATTRIBUTES'
ig_data = ls_attributes ).
lv_source = lo_xslt->get_source_string( ).
mo_files->add_string( iv_extra = 'source'
iv_ext = 'xml'
iv_string = lv_source ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
34223,
2528,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
651,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
305,
62,
34223,
2528,
8,
41876,
4526,
37,
5390,
537,
62,
78,
17,
62,
15042,
62,
34223,
2528,
20147,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
55,
8634,
51,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
651,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
3672,
41876,
269,
34223,
2528,
20147,
13,
628,
198,
220,
220,
220,
300,
85,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
537,
62,
78,
17,
62,
15042,
62,
34223,
2528,
20147,
14804,
2220,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
34223,
2528,
62,
20147,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
3672,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
26801,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
686,
62,
34223,
2528,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
407,
62,
25687,
220,
220,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
7170,
62,
32165,
495,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
513,
6739,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
18224,
422,
537,
62,
78,
17,
62,
15042,
62,
34223,
2528,
20147,
14804,
2220,
6,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
40985,
62,
1525,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
34223,
2528,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
537,
62,
78,
17,
62,
15042,
62,
34223,
2528,
20147,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
1078,
7657,
41876,
267,
17,
34223,
2528,
35226,
13,
628,
220,
220,
220,
2376,
62,
34223,
2528,
796,
651,
7,
6739,
198,
220,
220,
220,
2376,
62,
34223,
2528,
3784,
1136,
62,
1078,
7657,
7,
198,
220,
220,
220,
220,
220,
19644,
36,
3824,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
1078,
7657,
220,
220,
220,
220,
796,
43979,
62,
1078,
7657,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
259,
12102,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
82,
2528,
20147,
62,
2934,
33342,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
513,
6739,
628,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
62,
83,
3064,
7,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
374,
85,
62,
7220,
796,
43979,
62,
1078,
7657,
12,
40985,
1525,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
33678,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
34223,
2528,
41876,
4526,
37,
5390,
537,
62,
78,
17,
62,
15042,
62,
34223,
2528,
20147,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
3672,
41876,
269,
34223,
2528,
20147,
13,
628,
198,
220,
220,
220,
300,
85,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
537,
62,
78,
17,
62,
15042,
62,
34223,
2528,
20147,
14804,
2220,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
34223,
2528,
62,
20147,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
3672,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
26801,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
2376,
62,
34223,
2528,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
62,
13966,
1522,
220,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
407,
62,
25687,
220,
220,
220,
220,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
7170,
62,
32165,
495,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
2196,
62,
1662,
62,
9275,
220,
796,
604,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
642,
6739,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
18224,
422,
537,
62,
78,
17,
62,
15042
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS y_check_comment_usage DEFINITION PUBLIC INHERITING FROM y_check_base CREATE PUBLIC.
PUBLIC SECTION.
METHODS constructor.
PROTECTED SECTION.
METHODS inspect_statements REDEFINITION.
METHODS inspect_tokens REDEFINITION.
PRIVATE SECTION.
DATA abs_statement_number TYPE i VALUE 0.
DATA comment_number TYPE i VALUE 0.
DATA is_function_module TYPE abap_bool.
METHODS get_percentage_of_comments RETURNING VALUE(result) TYPE int4.
METHODS check_result IMPORTING structure TYPE sstruc.
METHODS is_code_disabled IMPORTING structure TYPE sstruc
statement TYPE sstmnt
RETURNING VALUE(result) TYPE abap_bool.
ENDCLASS.
CLASS y_check_comment_usage IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
settings-prio = c_note.
settings-threshold = 10.
settings-documentation = |{ c_docs_path-checks }comment-usage.md|.
relevant_statement_types = VALUE #( ( scan_struc_stmnt_type-class_definition )
( scan_struc_stmnt_type-class_implementation )
( scan_struc_stmnt_type-interface )
( scan_struc_stmnt_type-form )
( scan_struc_stmnt_type-function )
( scan_struc_stmnt_type-module ) ).
set_check_message( 'Percentage of comments must be lower than &3% of the productive code! (&2%>=&3%) (&1 lines found)' ).
ENDMETHOD.
METHOD inspect_statements.
abs_statement_number = 0.
comment_number = 0.
super->inspect_statements( structure ).
check_result( structure ).
ENDMETHOD.
METHOD inspect_tokens.
DATA(code_disabled) = is_code_disabled( statement = statement
structure = structure ).
IF code_disabled = abap_true.
RETURN.
ENDIF.
IF statement-to EQ statement-from.
abs_statement_number = abs_statement_number + 1.
ELSE.
abs_statement_number = abs_statement_number + ( statement-to - statement-from ).
ENDIF.
LOOP AT ref_scan_manager->tokens ASSIGNING FIELD-SYMBOL(<token>)
FROM statement-from TO statement-to
WHERE type EQ scan_token_type-comment.
IF strlen( <token>-str ) GE 2 AND NOT
( <token>-str+0(2) EQ |*"| OR
<token>-str+0(2) EQ |"!| OR
<token>-str+0(2) EQ |##| OR
<token>-str+0(2) EQ |*?| OR
<token>-str+0(2) EQ |"?| OR
( strlen( <token>-str ) GE 3 AND <token>-str+0(3) EQ |"#E| ) OR
<token>-str CP '"' && object_name && '*.' ). "#EC CI_MAGIC
comment_number = comment_number + 1.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD check_result.
DATA(percentage_of_comments) = get_percentage_of_comments( ).
DATA(statement_for_message) = ref_scan_manager->statements[ structure-stmnt_from ].
DATA(check_configuration) = detect_check_configuration( error_count = percentage_of_comments
statement = statement_for_message ).
IF check_configuration IS INITIAL.
RETURN.
ENDIF.
raise_error( statement_level = statement_for_message-level
statement_index = structure-stmnt_from
statement_from = statement_for_message-from
error_priority = check_configuration-prio
parameter_01 = |{ comment_number }|
parameter_02 = |{ percentage_of_comments }|
parameter_03 = |{ check_configuration-threshold }| ).
ENDMETHOD.
METHOD get_percentage_of_comments.
DATA percentage TYPE decfloat16.
percentage = ( comment_number / abs_statement_number ) * 100.
result = round( val = percentage
dec = 0
mode = cl_abap_math=>round_down ).
ENDMETHOD.
METHOD is_code_disabled.
CHECK structure-stmnt_type EQ scan_struc_stmnt_type-function.
IF get_token_abs( statement-from ) EQ if_kaizen_keywords_c=>gc_function.
is_function_module = abap_true.
ELSEIF get_token_abs( statement-from ) EQ if_kaizen_keywords_c=>gc_endfunction.
is_function_module = abap_false.
ENDIF.
result = xsdbool( is_function_module EQ abap_false ).
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
62,
9122,
62,
23893,
62,
26060,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
331,
62,
9122,
62,
8692,
29244,
6158,
44731,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
23772,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
10104,
62,
14269,
3196,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
10104,
62,
83,
482,
641,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
2352,
62,
26090,
62,
17618,
41876,
1312,
26173,
8924,
657,
13,
198,
220,
220,
220,
42865,
2912,
62,
17618,
41876,
1312,
26173,
8924,
657,
13,
198,
220,
220,
220,
42865,
318,
62,
8818,
62,
21412,
41876,
450,
499,
62,
30388,
13,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
25067,
496,
62,
1659,
62,
15944,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
493,
19,
13,
628,
220,
220,
220,
337,
36252,
50,
2198,
62,
20274,
30023,
9863,
2751,
4645,
41876,
264,
19554,
66,
13,
628,
220,
220,
220,
337,
36252,
50,
318,
62,
8189,
62,
47730,
30023,
9863,
2751,
4645,
220,
220,
220,
220,
41876,
264,
19554,
66,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2643,
220,
220,
220,
220,
41876,
264,
301,
76,
429,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
331,
62,
9122,
62,
23893,
62,
26060,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
6739,
628,
220,
220,
220,
6460,
12,
3448,
78,
796,
269,
62,
11295,
13,
198,
220,
220,
220,
6460,
12,
400,
10126,
796,
838,
13,
198,
220,
220,
220,
6460,
12,
22897,
341,
796,
930,
90,
269,
62,
31628,
62,
6978,
12,
42116,
1782,
23893,
12,
26060,
13,
9132,
91,
13,
628,
220,
220,
220,
5981,
62,
26090,
62,
19199,
796,
26173,
8924,
1303,
7,
357,
9367,
62,
19554,
66,
62,
301,
76,
429,
62,
4906,
12,
4871,
62,
46758,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
9367,
62,
19554,
66,
62,
301,
76,
429,
62,
4906,
12,
4871,
62,
320,
32851,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
9367,
62,
19554,
66,
62,
301,
76,
429,
62,
4906,
12,
39994,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
9367,
62,
19554,
66,
62,
301,
76,
429,
62,
4906,
12,
687,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
9367,
62,
19554,
66,
62,
301,
76,
429,
62,
4906,
12,
8818,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
9367,
62,
19554,
66,
62,
301,
76,
429,
62,
4906,
12,
21412,
1267,
6739,
628,
220,
220,
220,
900,
62,
9122,
62,
20500,
7,
705,
31905,
496,
286,
3651,
1276,
307,
2793,
621,
1222,
18,
4,
286,
262,
12973,
2438,
0,
35494,
17,
4,
29,
28,
5,
18,
4407,
35494,
16,
3951,
1043,
33047,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
10104,
62,
14269,
3196,
13,
198,
220,
220,
220,
2352,
62,
26090,
62,
17618,
796,
657,
13,
198,
220,
220,
220,
2912,
62,
17618,
796,
657,
13,
628,
220,
220,
220,
2208,
3784,
1040,
806,
62,
14269,
3196,
7,
4645,
6739,
628,
220,
220,
220,
2198,
62,
20274,
7,
4645,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
10104,
62,
83,
482,
641,
13,
198,
220,
220,
220,
42865,
7,
8189,
62,
47730,
8,
796,
318,
62,
8189,
62,
47730,
7,
2643,
796,
2643,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4645,
796,
4645,
6739,
628,
220,
220,
220,
16876,
2438,
62,
47730,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
16876,
2643,
12,
1462,
36529,
2643,
12,
6738,
13,
198,
220,
220,
220,
220,
220,
2352,
62,
26090,
62,
17618,
796,
2352,
62,
26090,
62,
17618,
1343,
352,
13,
198,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
2352,
62,
26090,
62,
17618,
796,
2352,
62,
26090,
62,
17618,
1343,
357,
2643,
12,
1462,
532,
2643,
12,
6738,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
17579,
3185,
5161,
1006,
62,
35836,
62,
37153,
3784,
83,
482,
641,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
30001,
43734,
198,
220,
220,
220,
16034,
2643,
12,
6738,
5390,
2643,
12,
1462,
198,
220,
220,
220,
33411,
2099
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
"! <h1>API for Getting a Travel</h1>
"!
"! <p>
"! Function module to get a single Travel instance with all related Bookings and
"! Booking Supplements related to the importing Travel ID.
"! </p>
"!
"!
"! @parameter iv_travel_id | Travel ID
"! @parameter iv_include_buffer | Include any changes that have not yet been committed
"! @parameter es_travel | Travel Data like /DMO/TRAVEL00 related to the importing Travel ID
"! @parameter et_booking | Table of Bookings like /DMO/BOOKING00 related to the importing Travel ID
"! @parameter et_booking_supplement | Table of Booking Supplements like /DMO/BOOK_SUP_00 related to the importing Travel ID
"! @parameter et_messages | Table of occurred messages
"!
FUNCTION /DMO/FLIGHT_TRAVEL_READ00.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IV_TRAVEL_ID) TYPE /DMO/TRAVEL_ID00
*" REFERENCE(IV_INCLUDE_BUFFER) TYPE ABAP_BOOLEAN DEFAULT
*" ABAP_TRUE
*" EXPORTING
*" REFERENCE(ES_TRAVEL) TYPE /DMO/TRAVEL00
*" REFERENCE(ET_BOOKING) TYPE /DMO/IF_FLIGHT_LEGACY00=>TT_BOOKING
*" REFERENCE(ET_BOOKING_SUPPLEMENT) TYPE
*" /DMO/IF_FLIGHT_LEGACY00=>TT_BOOKING_SUPPLEMENT
*" REFERENCE(ET_MESSAGES) TYPE /DMO/IF_FLIGHT_LEGACY00=>TT_MESSAGE
*"----------------------------------------------------------------------
CLEAR es_travel.
CLEAR et_booking.
CLEAR et_booking_supplement.
CLEAR et_messages.
/dmo/cl_flight_legacy00=>get_instance( )->get_travel( EXPORTING iv_travel_id = iv_travel_id
iv_include_buffer = iv_include_buffer
IMPORTING es_travel = es_travel
et_booking = et_booking
et_booking_supplement = et_booking_supplement
et_messages = DATA(lt_messages) ).
/dmo/cl_flight_legacy00=>get_instance( )->convert_messages( EXPORTING it_messages = lt_messages
IMPORTING et_messages = et_messages ).
ENDFUNCTION.
| [
40484,
1279,
71,
16,
29,
17614,
329,
18067,
257,
13524,
3556,
71,
16,
29,
198,
40484,
198,
40484,
1279,
79,
29,
198,
40484,
15553,
8265,
284,
651,
257,
2060,
13524,
4554,
351,
477,
3519,
4897,
654,
290,
198,
40484,
4897,
278,
8105,
3639,
3519,
284,
262,
33332,
13524,
4522,
13,
198,
40484,
7359,
79,
29,
198,
40484,
198,
40484,
198,
40484,
2488,
17143,
2357,
21628,
62,
35927,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
13524,
4522,
198,
40484,
2488,
17143,
2357,
21628,
62,
17256,
62,
22252,
220,
220,
220,
220,
930,
40348,
597,
2458,
326,
423,
407,
1865,
587,
5364,
198,
40484,
2488,
17143,
2357,
1658,
62,
35927,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
13524,
6060,
588,
1220,
35,
11770,
14,
51,
3861,
18697,
405,
3519,
284,
262,
33332,
13524,
4522,
198,
40484,
2488,
17143,
2357,
2123,
62,
2070,
278,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
8655,
286,
4897,
654,
588,
1220,
35,
11770,
14,
39453,
2751,
405,
3519,
284,
262,
33332,
13524,
4522,
198,
40484,
2488,
17143,
2357,
2123,
62,
2070,
278,
62,
18608,
1732,
930,
8655,
286,
4897,
278,
8105,
3639,
588,
1220,
35,
11770,
14,
39453,
62,
40331,
62,
405,
3519,
284,
262,
33332,
13524,
4522,
198,
40484,
2488,
17143,
2357,
2123,
62,
37348,
1095,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
8655,
286,
5091,
6218,
198,
40484,
198,
42296,
4177,
2849,
1220,
35,
11770,
14,
3697,
9947,
62,
51,
3861,
18697,
62,
15675,
405,
13,
198,
9,
1,
10097,
23031,
198,
9,
1,
9,
1,
14565,
26491,
25,
198,
9,
1,
220,
30023,
9863,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
3824,
62,
51,
3861,
18697,
62,
2389,
8,
41876,
220,
1220,
35,
11770,
14,
51,
3861,
18697,
62,
2389,
405,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
3824,
62,
1268,
5097,
52,
7206,
62,
19499,
45746,
8,
41876,
220,
9564,
2969,
62,
33,
6684,
2538,
1565,
5550,
38865,
198,
9,
1,
220,
220,
220,
220,
220,
220,
9564,
2969,
62,
5446,
8924,
198,
9,
1,
220,
7788,
15490,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
1546,
62,
51,
3861,
18697,
8,
41876,
220,
1220,
35,
11770,
14,
51,
3861,
18697,
405,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
2767,
62,
39453,
2751,
8,
41876,
220,
1220,
35,
11770,
14,
5064,
62,
3697,
9947,
62,
2538,
38,
43300,
405,
14804,
15751,
62,
39453,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
2767,
62,
39453,
2751,
62,
40331,
16437,
10979,
8,
41876,
198,
9,
1,
220,
220,
220,
220,
220,
220,
220,
1220,
35,
11770,
14,
5064,
62,
3697,
9947,
62,
2538,
38,
43300,
405,
14804,
15751,
62,
39453,
2751,
62,
40331,
16437,
10979,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
2767,
62,
44,
1546,
4090,
48075,
8,
41876,
220,
1220,
35,
11770,
14,
5064,
62,
3697,
9947,
62,
2538,
38,
43300,
405,
14804,
15751,
62,
44,
1546,
4090,
8264,
198,
9,
1,
10097,
23031,
198,
220,
30301,
1503,
1658,
62,
35927,
13,
198,
220,
30301,
1503,
2123,
62,
2070,
278,
13,
198,
220,
30301,
1503,
2123,
62,
2070,
278,
62,
18608,
1732,
13,
198,
220,
30301,
1503,
2123,
62,
37348,
1095,
13,
628,
220,
1220,
67,
5908,
14,
565,
62,
22560,
62,
1455,
1590,
405,
14804,
1136,
62,
39098,
7,
1267,
3784,
1136,
62,
35927,
7,
7788,
15490,
2751,
21628,
62,
35927,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
35927,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
17256,
62,
22252,
220,
220,
220,
220,
796,
21628,
62,
17256,
62,
22252,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
1658,
62,
35927,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
1658,
62,
35927,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2123,
62,
2070,
278,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
2123,
62,
2070,
278,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2123,
62,
2070,
278,
62,
18608,
1732,
796,
2123,
62,
2070,
278,
62,
18608,
1732,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2123,
62,
37348,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*******************************************************************
* System-defined Include-files. *
*******************************************************************
INCLUDE LZABAKTOP. " Global Data
INCLUDE LZABAKUXX. " Function Modules
*******************************************************************
* User-defined Include-files (if necessary). *
*******************************************************************
* INCLUDE LZABAKF... " Subroutines
* INCLUDE LZABAKO... " PBO-Modules
* INCLUDE LZABAKI... " PAI-Modules
* INCLUDE LZABAKE... " Events
* INCLUDE LZABAKP... " Local class implement.
* INCLUDE LZABAKT99. " ABAP Unit tests
| [
17174,
17174,
8162,
198,
9,
220,
220,
4482,
12,
23211,
40348,
12,
16624,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
17174,
17174,
8162,
198,
220,
3268,
5097,
52,
7206,
406,
34892,
4339,
42,
35222,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8060,
6060,
198,
220,
3268,
5097,
52,
7206,
406,
34892,
4339,
42,
52,
8051,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
15553,
3401,
5028,
198,
198,
17174,
17174,
8162,
198,
9,
220,
220,
11787,
12,
23211,
40348,
12,
16624,
357,
361,
3306,
737,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
17174,
17174,
8162,
198,
9,
3268,
5097,
52,
7206,
406,
34892,
4339,
42,
37,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3834,
81,
448,
1127,
198,
9,
3268,
5097,
52,
7206,
406,
34892,
4339,
22328,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
350,
8202,
12,
5841,
5028,
198,
9,
3268,
5097,
52,
7206,
406,
34892,
4339,
37845,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8147,
40,
12,
5841,
5028,
198,
9,
3268,
5097,
52,
7206,
406,
34892,
4339,
7336,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
18715,
198,
9,
3268,
5097,
52,
7206,
406,
34892,
4339,
42,
47,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
10714,
1398,
3494,
13,
198,
9,
3268,
5097,
52,
7206,
406,
34892,
4339,
42176,
2079,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9564,
2969,
11801,
5254,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ltd_clean_code_manager DEFINITION FOR TESTING.
PUBLIC SECTION.
INTERFACES: y_if_clean_code_manager.
ENDCLASS.
CLASS ltd_clean_code_manager IMPLEMENTATION.
METHOD y_if_clean_code_manager~read_check_customizing.
result = VALUE #( ( apply_on_testcode = abap_true apply_on_productive_code = abap_true prio = 'E' threshold = 0 )
( apply_on_testcode = abap_true apply_on_productive_code = abap_true prio = 'W' threshold = 1 ) ).
ENDMETHOD.
METHOD y_if_clean_code_manager~calculate_obj_creation_date.
result = '19000101'.
ENDMETHOD.
ENDCLASS.
CLASS ltd_ref_scan_manager DEFINITION FOR TESTING INHERITING FROM y_scan_manager_double.
PUBLIC SECTION.
METHODS:
set_data_for_ok,
set_data_for_error,
set_pseudo_comment_ok.
ENDCLASS.
CLASS ltd_ref_scan_manager IMPLEMENTATION.
METHOD set_data_for_ok.
inject_code( VALUE #(
( 'REPORT ut_test.' )
( 'CLASS lcl_classname DEFINITION.' )
( ' PUBLIC SECTION.' )
( ' METHODS empty.' )
( 'ENDCLASS.' )
( 'CLASS lcl_classname IMPLEMENTATION.' )
( ' METHOD empty.' )
( ' DATA str TYPE c.' )
( ' ENDMETHOD.' )
( 'ENDCLASS.' )
) ).
ENDMETHOD.
METHOD set_data_for_error.
inject_code( VALUE #(
( 'REPORT ut_test.' )
( 'CLASS lcl_classname DEFINITION.' )
( ' PUBLIC SECTION.' )
( ' METHODS empty.' )
( 'ENDCLASS.' )
( 'CLASS lcl_classname IMPLEMENTATION.' )
( ' METHOD empty.' )
( '* comment' )
( ' "comment' )
( ' ENDMETHOD.' )
( 'ENDCLASS.' )
( 'START-OF-SELECTION.' )
( 'FORM name.' )
( 'ENDFORM.' )
( 'MODULE mod.' )
( 'ENDMODULE.' )
) ).
ENDMETHOD.
METHOD set_pseudo_comment_ok.
inject_code( VALUE #(
( 'REPORT ut_test.' )
( 'CLASS lcl_classname DEFINITION.' )
( ' PUBLIC SECTION.' )
( ' METHODS empty.' )
( 'ENDCLASS.' )
( 'CLASS lcl_classname IMPLEMENTATION.' )
( ' METHOD empty.' )
( ' ENDMETHOD. "#EC EMPTY_PROCEDURE' )
( 'ENDCLASS.' )
( 'START-OF-SELECTION.' )
( 'FORM name.' )
( 'ENDFORM. "#EC EMPTY_PROCEDURE' )
( 'MODULE mod.' )
( 'ENDMODULE. "#EC EMPTY_PROCEDURE' )
) ).
ENDMETHOD.
ENDCLASS.
CLASS ltd_clean_code_exemption_no DEFINITION FOR TESTING
INHERITING FROM y_exemption_handler.
PUBLIC SECTION.
METHODS: is_object_exempted REDEFINITION.
ENDCLASS.
CLASS ltd_clean_code_exemption_no IMPLEMENTATION.
METHOD is_object_exempted.
RETURN.
ENDMETHOD.
ENDCLASS.
CLASS local_test_class DEFINITION FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT.
PRIVATE SECTION.
DATA: cut TYPE REF TO y_check_empty_procedures,
ref_scan_manager_double TYPE REF TO ltd_ref_scan_manager.
METHODS:
setup,
assert_errors IMPORTING err_cnt TYPE i,
assert_pseudo_comments IMPORTING pc_cnt TYPE i,
is_bound FOR TESTING,
cut_ok FOR TESTING,
cut_error FOR TESTING,
pseudo_comment_ok FOR TESTING.
ENDCLASS.
CLASS y_check_empty_procedures DEFINITION LOCAL FRIENDS local_test_class.
CLASS local_test_class IMPLEMENTATION.
METHOD setup.
cut = NEW y_check_empty_procedures( ).
ref_scan_manager_double = NEW ltd_ref_scan_manager( ).
cut->ref_scan_manager ?= ref_scan_manager_double.
cut->clean_code_manager = NEW ltd_clean_code_manager( ).
cut->clean_code_exemption_handler = NEW ltd_clean_code_exemption_no( ).
cut->attributes_maintained = abap_true.
ENDMETHOD.
METHOD is_bound.
cl_abap_unit_assert=>assert_bound(
EXPORTING
act = cut ).
ENDMETHOD.
METHOD cut_ok.
ref_scan_manager_double->set_data_for_ok( ).
cut->run( ).
assert_errors( 0 ).
assert_pseudo_comments( 0 ).
ENDMETHOD.
METHOD cut_error.
ref_scan_manager_double->set_data_for_error( ).
cut->run( ).
assert_errors( 3 ).
assert_pseudo_comments( 0 ).
ENDMETHOD.
METHOD pseudo_comment_ok.
ref_scan_manager_double->set_pseudo_comment_ok( ).
cut->run( ).
assert_errors( 0 ).
assert_pseudo_comments( 3 ).
ENDMETHOD.
METHOD assert_errors.
cl_abap_unit_assert=>assert_equals(
EXPORTING
act = cut->statistics->get_number_errors( )
exp = err_cnt ).
ENDMETHOD.
METHOD assert_pseudo_comments.
cl_abap_unit_assert=>assert_equals(
EXPORTING
act = cut->statistics->get_number_pseudo_comments( )
exp = pc_cnt ).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
8671,
62,
27773,
62,
8189,
62,
37153,
5550,
20032,
17941,
7473,
43001,
2751,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
331,
62,
361,
62,
27773,
62,
8189,
62,
37153,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
8671,
62,
27773,
62,
8189,
62,
37153,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
331,
62,
361,
62,
27773,
62,
8189,
62,
37153,
93,
961,
62,
9122,
62,
23144,
2890,
13,
198,
220,
220,
220,
1255,
796,
26173,
8924,
1303,
7,
357,
4174,
62,
261,
62,
9288,
8189,
796,
450,
499,
62,
7942,
4174,
62,
261,
62,
27781,
62,
8189,
796,
450,
499,
62,
7942,
1293,
78,
796,
705,
36,
6,
11387,
796,
657,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
4174,
62,
261,
62,
9288,
8189,
796,
450,
499,
62,
7942,
4174,
62,
261,
62,
27781,
62,
8189,
796,
450,
499,
62,
7942,
1293,
78,
796,
705,
54,
6,
11387,
796,
352,
1267,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
331,
62,
361,
62,
27773,
62,
8189,
62,
37153,
93,
9948,
3129,
378,
62,
26801,
62,
38793,
62,
4475,
13,
198,
220,
220,
220,
1255,
796,
705,
1129,
18005,
486,
4458,
198,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
8671,
62,
5420,
62,
35836,
62,
37153,
5550,
20032,
17941,
7473,
43001,
2751,
3268,
16879,
2043,
2751,
16034,
331,
62,
35836,
62,
37153,
62,
23352,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
900,
62,
7890,
62,
1640,
62,
482,
11,
198,
220,
220,
220,
220,
220,
900,
62,
7890,
62,
1640,
62,
18224,
11,
198,
220,
220,
220,
220,
220,
900,
62,
7752,
12003,
62,
23893,
62,
482,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
8671,
62,
5420,
62,
35836,
62,
37153,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
900,
62,
7890,
62,
1640,
62,
482,
13,
198,
220,
220,
220,
8677,
62,
8189,
7,
26173,
8924,
1303,
7,
198,
220,
220,
220,
357,
705,
2200,
15490,
3384,
62,
9288,
2637,
1267,
628,
220,
220,
220,
357,
705,
31631,
300,
565,
62,
4871,
3672,
5550,
20032,
17941,
2637,
1267,
198,
220,
220,
220,
357,
705,
44731,
44513,
2637,
1267,
198,
220,
220,
220,
357,
705,
220,
337,
36252,
50,
6565,
2637,
1267,
198,
220,
220,
220,
357,
705,
10619,
31631,
2637,
1267,
628,
220,
220,
220,
357,
705,
31631,
300,
565,
62,
4871,
3672,
30023,
2538,
10979,
6234,
2637,
1267,
198,
220,
220,
220,
357,
705,
337,
36252,
6565,
2637,
1267,
198,
220,
220,
220,
357,
705,
220,
42865,
965,
41876,
269,
2637,
1267,
198,
220,
220,
220,
357,
705,
23578,
49273,
2637,
1267,
198,
220,
220,
220,
357,
705,
10619,
31631,
2637,
1267,
198,
220,
220,
220,
1267,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
900,
62,
7890,
62,
1640,
62,
18224,
13,
198,
220,
220,
220,
8677,
62,
8189,
7,
26173,
8924,
1303,
7,
198,
220,
220,
220,
357,
705,
2200,
15490,
3384,
62,
9288,
2637,
1267,
628,
220,
220,
220,
357,
705,
31631,
300,
565,
62,
4871,
3672,
5550,
20032,
17941,
2637,
1267,
198,
220,
220,
220,
357,
705,
44731,
44513,
2637,
1267,
198,
220,
220,
220,
357,
705,
220,
337,
36252,
50,
6565,
2637,
1267,
198,
220,
220,
220,
357,
705,
10619,
31631,
2637,
1267,
628,
220,
220,
220,
357,
705,
31631,
300,
565,
62,
4871,
3672,
30023,
2538,
10979,
6234,
2637,
1267,
198,
220,
220,
220,
357,
705,
337,
36252,
6565,
2637,
1267,
198,
220,
220,
220,
357,
705,
9,
2912,
6,
1267,
198,
220,
220,
220,
357,
705,
220,
366,
23893,
6,
1267,
198,
220,
220,
220,
357,
705,
23578,
49273,
2637,
1267,
198,
220,
220,
220,
357,
705,
10619,
31631,
2637,
1267,
628,
220,
220,
220,
357,
705,
2257,
7227,
12,
19238,
12,
46506,
2849,
2637,
1267,
628,
220,
220,
220,
357,
705,
21389,
1438,
2637,
1267,
198,
220,
220,
220,
357,
705,
1677,
8068,
1581,
44,
2637,
1267,
628,
220,
220,
220,
357,
705,
33365,
24212,
953,
2637,
1267,
198,
220,
220,
220,
357,
705,
10619,
33365,
24212,
2637,
1267,
198,
220,
220,
220,
1267,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
900,
62,
7752,
12003,
62,
23893,
62,
482,
13,
198,
220,
220,
220,
8677,
62,
8189,
7,
26173,
8924,
1303,
7,
198,
220,
220,
220,
357,
705,
2200,
15490,
3384,
62,
9288,
2637,
1267,
628,
220,
220,
220,
357,
705,
31631,
300,
565,
62,
4871,
3672,
5550,
20032,
17941,
2637,
1267,
198,
220,
220,
220,
357,
705,
44731,
44513,
2637,
1267,
198,
220,
220,
220,
357,
705,
220,
337,
36252,
50,
6565,
2637,
1267,
198,
220,
220,
220,
357,
705,
10619,
31631,
2637,
1267,
628,
220,
220,
220,
357,
705,
31631,
300,
565,
62,
4871,
3672,
30023,
2538,
10979,
6234,
2637,
1267,
198,
220,
220,
220,
357,
705,
337,
36252,
6565,
2637,
1267,
198,
220,
220,
220,
357,
705,
23578,
49273,
13,
25113,
2943,
38144,
9936,
62,
4805,
4503,
1961,
11335,
6,
1267,
198,
220,
220,
220,
357,
705,
10619,
31631,
2637,
1267,
628,
220,
220,
220,
357,
705,
2257,
7227,
12,
19238,
12,
46506,
2849,
2637,
1267,
628,
220,
220,
220,
357,
705,
21389,
1438,
2637,
1267,
198,
220,
220,
220,
357,
705,
1677,
8068,
1581,
44,
13,
25113,
2943,
38144,
9936,
62,
4805,
4503,
1961,
11335,
6,
1267,
628,
220,
220,
220,
357,
705,
33365,
24212,
953,
2637,
1267,
198,
220,
220,
220,
357,
705,
10619,
33365,
24212,
13,
25113,
2943,
38144,
9936,
62,
4805,
4503,
1961,
11335,
6,
1267,
198,
220,
220,
220,
1267,
6739,
198,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
8671,
62,
27773,
62,
8189,
62,
1069,
11221,
62,
3919,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
3268,
16879,
2043,
2751,
16034,
331,
62,
1069,
11221,
62,
30281,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
318,
62,
15252,
62,
42679,
276,
23848,
36,
20032,
17941,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_review DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS release
IMPORTING
!iv_trkorr TYPE trkorr
RAISING
cx_static_check .
PROTECTED SECTION.
TYPES:
BEGIN OF ty_tadir,
pgmid TYPE tadir-pgmid,
object TYPE tadir-object,
obj_name TYPE tadir-obj_name,
END OF ty_tadir .
TYPES:
ty_tadir_tt TYPE STANDARD TABLE OF ty_tadir WITH EMPTY KEY .
CONSTANTS gc_workbench TYPE e070-trfunction VALUE 'K' ##NO_TEXT.
CONSTANTS gc_development TYPE e070-trfunction VALUE 'S' ##NO_TEXT.
METHODS create_branch_if_missing
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo_online
!iv_branch_name TYPE string
RAISING
cx_static_check .
METHODS create_http_client
RETURNING
VALUE(ri_client) TYPE REF TO if_http_client
RAISING
zcx_abapgit_exception .
METHODS create_pr_if_missing
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo_online
!iv_branch_name TYPE string
!iv_request TYPE trkorr
RAISING
cx_static_check .
METHODS create_pull_request
IMPORTING
!iv_url TYPE string
!iv_branch_name TYPE string
!iv_request TYPE trkorr
!iv_base TYPE string
RAISING
cx_static_check .
METHODS find_abapgit_repo
IMPORTING
!it_tadir TYPE ty_tadir_tt
RETURNING
VALUE(ro_repo) TYPE REF TO zcl_abapgit_repo_online
RAISING
cx_static_check .
METHODS list_objects
IMPORTING
!iv_request TYPE trkorr
RETURNING
VALUE(rt_tadir) TYPE ty_tadir_tt .
METHODS push_changes
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo_online
!iv_task TYPE trkorr
!it_objects TYPE ty_tadir_tt
!iv_branch_name TYPE string
RAISING
zcx_abapgit_exception .
METHODS release_request
IMPORTING
!iv_request TYPE trkorr
!io_repo TYPE REF TO zcl_abapgit_repo_online
RAISING
cx_static_check .
METHODS release_task
IMPORTING
!iv_task TYPE trkorr
!io_repo TYPE REF TO zcl_abapgit_repo_online
!it_objects TYPE ty_tadir_tt
!iv_request TYPE trkorr
RAISING
cx_static_check .
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ABAPGIT_REVIEW IMPLEMENTATION.
METHOD create_branch_if_missing.
DATA(lv_full_name) = |{ zif_abapgit_definitions=>c_git_branch-heads_prefix }{ iv_branch_name }|.
DATA(lo_branches) = zcl_abapgit_git_transport=>branches( io_repo->get_url( ) ).
TRY.
lo_branches->find_by_name( lv_full_name ).
CATCH zcx_abapgit_exception.
* branch not found, create it, based on HEAD
DATA(ls_head) = lo_branches->find_by_name( lo_branches->get_head_symref( ) ).
io_repo->create_branch(
iv_name = lv_full_name
iv_from = ls_head-sha1 ).
ENDTRY.
ENDMETHOD.
METHOD create_http_client.
DATA lv_url TYPE string VALUE 'https://api.github.com'.
DATA lo_proxy_configuration TYPE REF TO zcl_abapgit_proxy_config.
ri_client = zcl_abapgit_exit=>get_instance( )->create_http_client( lv_url ).
IF ri_client IS INITIAL.
lo_proxy_configuration = NEW #( ).
cl_http_client=>create_by_url(
EXPORTING
url = lv_url
ssl_id = zcl_abapgit_exit=>get_instance( )->get_ssl_id( )
proxy_host = lo_proxy_configuration->get_proxy_url( lv_url )
proxy_service = lo_proxy_configuration->get_proxy_port( lv_url )
IMPORTING
client = ri_client ).
ENDIF.
ENDMETHOD.
METHOD create_pr_if_missing.
* todo, there must be commits on the branch for it to be possible to create the PR
DATA(lo_branches) = zcl_abapgit_git_transport=>branches( io_repo->get_url( ) ).
DATA(ls_head) = lo_branches->find_by_name( lo_branches->get_head_symref( ) ).
SELECT SINGLE @abap_true FROM zagr_created_prs
INTO @DATA(lv_created)
WHERE trkorr = @iv_request. "#EC CI_SUBRC
IF lv_created = abap_false.
create_pull_request(
iv_url = io_repo->get_url( )
iv_request = iv_request
iv_base = ls_head-display_name
iv_branch_name = iv_branch_name ).
ENDIF.
ENDMETHOD.
METHOD create_pull_request.
FIND REGEX 'https:\/\/github\.com\/([-\d\w]+)\/([-\d\w]+)(\.git)?'
IN iv_url SUBMATCHES DATA(lv_owner) DATA(lv_repo).
IF sy-subrc <> 0.
RETURN.
ENDIF.
DATA(li_github) = CAST zif_githubcom( NEW zcl_githubcom( create_http_client( ) ) ).
DATA(ls_created) = li_github->pulls_create(
owner = lv_owner
repo = lv_repo
body = VALUE #(
title = |{ sy-sysid } - { iv_request }|
head = iv_branch_name
base = iv_base
maintainer_can_modify = abap_true
draft = abap_false
issue = cl_abap_math=>max_int4
body = |{ sy-sysid } - { iv_request }| ) ).
IF ls_created-number IS NOT INITIAL.
DATA(ls_pr) = VALUE zagr_created_prs(
trkorr = iv_request
pr = ls_created-number
url = ls_created-html_url ).
INSERT zagr_created_prs FROM @ls_pr.
ASSERT sy-subrc = 0.
ENDIF.
ENDMETHOD.
METHOD find_abapgit_repo.
IF lines( it_tadir ) = 0.
RETURN.
ENDIF.
SELECT DISTINCT devclass FROM tadir INTO TABLE @DATA(lt_packages)
FOR ALL ENTRIES IN @it_tadir
WHERE pgmid = @it_tadir-pgmid
AND object = @it_tadir-object
AND obj_name = @it_tadir-obj_name. "#EC CI_SUBRC
DATA(lt_repos) = zcl_abapgit_repo_srv=>get_instance( )->list( ).
LOOP AT lt_packages INTO DATA(lv_package).
DATA(lt_supers) = zcl_abapgit_factory=>get_sap_package( lv_package-devclass )->list_superpackages( ).
LOOP AT lt_supers INTO DATA(lv_super).
LOOP AT lt_repos INTO DATA(lo_repo).
IF lo_repo->is_offline( ) = abap_true.
CONTINUE.
ELSEIF lo_repo->get_package( ) = lv_super.
IF ro_repo IS INITIAL.
ro_repo ?= lo_repo.
ELSEIF ro_repo->get_package( ) = lo_repo->get_package( ).
CONTINUE.
ELSE.
ASSERT 0 = 'the transport spans multiple repos'.
ENDIF.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDLOOP.
ENDMETHOD.
METHOD list_objects.
SELECT trkorr FROM e070
INTO TABLE @DATA(lt_e070)
WHERE strkorr = @iv_request
ORDER BY PRIMARY KEY.
IF sy-subrc <> 0.
RETURN.
ENDIF.
SELECT pgmid, object, obj_name FROM e071
INTO TABLE @DATA(lt_e071)
FOR ALL ENTRIES IN @lt_e070
WHERE trkorr = @lt_e070-trkorr. "#EC CI_SUBRC
SORT lt_e071 BY pgmid object obj_name.
DELETE ADJACENT DUPLICATES FROM lt_e071 COMPARING pgmid object obj_name.
LOOP AT lt_e071 INTO DATA(ls_list).
IF ls_list-pgmid = 'R3TR'.
APPEND CORRESPONDING #( ls_list ) TO rt_tadir.
ELSE.
DATA(ls_tadir) = cl_wb_object_type=>get_tadir_from_limu(
p_object = ls_list-object
p_obj_name = ls_list-obj_name ).
APPEND CORRESPONDING #( ls_tadir ) TO rt_tadir.
ENDIF.
ENDLOOP.
SORT rt_tadir BY pgmid object obj_name.
DELETE ADJACENT DUPLICATES FROM rt_tadir COMPARING pgmid object obj_name.
ENDMETHOD.
METHOD push_changes.
io_repo->select_branch( |refs/heads/{ iv_branch_name }| ).
DATA(ls_files) = zcl_abapgit_factory=>get_stage_logic( )->get( io_repo ).
DATA(lt_file_status) = zcl_abapgit_file_status=>status( io_repo ).
DATA(lo_stage) = NEW zcl_abapgit_stage( ).
LOOP AT lt_file_status ASSIGNING FIELD-SYMBOL(<ls_status>)
WHERE match <> abap_true AND obj_type IS NOT INITIAL.
* the object must be part of the task's request
IF NOT line_exists( it_objects[ object = <ls_status>-obj_type obj_name = <ls_status>-obj_name ] ).
CONTINUE.
ENDIF.
CASE <ls_status>-lstate.
WHEN zif_abapgit_definitions=>c_state-deleted.
lo_stage->rm( iv_path = <ls_status>-path
iv_filename = <ls_status>-filename ).
WHEN OTHERS.
DATA(lv_data) = ls_files-local[ file-filename = <ls_status>-filename
file-path = <ls_status>-path ]-file-data.
lo_stage->add( iv_path = <ls_status>-path
iv_filename = <ls_status>-filename
iv_data = lv_data ).
ENDCASE.
ENDLOOP.
IF lo_stage->count( ) > 0.
io_repo->push(
is_comment = VALUE #(
committer = VALUE #( name = 'name' email = 'name@localhost' )
author = VALUE #( name = 'name' email = 'name@localhost' )
comment = iv_task )
io_stage = lo_stage ).
ENDIF.
ENDMETHOD.
METHOD release.
SELECT SINGLE strkorr, trfunction FROM e070 INTO @DATA(ls_e070) WHERE trkorr = @iv_trkorr.
IF sy-subrc <> 0 OR ( ls_e070-trfunction <> gc_workbench AND ls_e070-trfunction <> gc_development ).
RETURN.
ENDIF.
IF ls_e070-strkorr IS NOT INITIAL.
DATA(lv_request) = ls_e070-strkorr.
ELSE.
lv_request = iv_trkorr.
ENDIF.
DATA(lt_objects) = list_objects( lv_request ).
IF lines( lt_objects ) = 0.
RETURN.
ENDIF.
DATA(lo_repo) = find_abapgit_repo( lt_objects ).
IF lo_repo IS INITIAL OR lo_repo->get_url( ) NP '*github.com*'.
RETURN.
ENDIF.
IF ls_e070-strkorr IS NOT INITIAL.
release_task(
iv_task = iv_trkorr
it_objects = lt_objects
iv_request = lv_request
io_repo = lo_repo ).
ELSE.
release_request(
iv_request = iv_trkorr
io_repo = lo_repo ).
ENDIF.
ENDMETHOD.
METHOD release_request.
* call github api to check if PR is merged
SELECT SINGLE pr FROM zagr_created_prs INTO @DATA(lv_pr)
WHERE trkorr = @iv_request.
IF sy-subrc <> 0.
RETURN.
ENDIF.
FIND REGEX 'https:\/\/github\.com\/([-\d\w]+)\/([-\d\w]+)(\.git)?'
IN io_repo->get_url( ) SUBMATCHES DATA(lv_owner) DATA(lv_repo).
ASSERT sy-subrc = 0.
DATA(li_github) = CAST zif_githubcom( NEW zcl_githubcom( create_http_client( ) ) ).
DATA(ls_pr) = li_github->pulls_get(
owner = lv_owner
repo = lv_repo
pull_number = lv_pr ).
IF ls_pr-state = 'open'.
zcx_abapgit_exception=>raise( |PR #{ lv_pr } must be merged before the request can be released| ).
ENDIF.
ENDMETHOD.
METHOD release_task.
DATA(lv_branch_name) = |{ iv_request }|.
create_branch_if_missing(
io_repo = io_repo
iv_branch_name = lv_branch_name ).
push_changes(
io_repo = io_repo
it_objects = it_objects
iv_task = iv_task
iv_branch_name = lv_branch_name ).
create_pr_if_missing(
io_repo = io_repo
iv_request = iv_request
iv_branch_name = lv_branch_name ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
19023,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
2650,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
2213,
74,
38890,
41876,
491,
74,
38890,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
12708,
62,
9122,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
83,
324,
343,
11,
198,
220,
220,
220,
220,
220,
220,
220,
23241,
13602,
220,
220,
220,
41876,
36264,
343,
12,
6024,
13602,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
220,
220,
41876,
36264,
343,
12,
15252,
11,
198,
220,
220,
220,
220,
220,
220,
220,
26181,
62,
3672,
41876,
36264,
343,
12,
26801,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
83,
324,
343,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
83,
324,
343,
62,
926,
41876,
49053,
9795,
43679,
3963,
1259,
62,
83,
324,
343,
13315,
38144,
9936,
35374,
764,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
308,
66,
62,
1818,
26968,
41876,
304,
43509,
12,
2213,
8818,
26173,
8924,
705,
42,
6,
22492,
15285,
62,
32541,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
308,
66,
62,
31267,
41876,
304,
43509,
12,
2213,
8818,
26173,
8924,
705,
50,
6,
22492,
15285,
62,
32541,
13,
628,
220,
220,
220,
337,
36252,
50,
2251,
62,
1671,
3702,
62,
361,
62,
45688,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
260,
7501,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
1671,
3702,
62,
3672,
41876,
4731,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
12708,
62,
9122,
764,
198,
220,
220,
220,
337,
36252,
50,
2251,
62,
4023,
62,
16366,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
16366,
8,
41876,
4526,
37,
5390,
611,
62,
4023,
62,
16366,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
2251,
62,
1050,
62,
361,
62,
45688,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
260,
7501,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
1671,
3702,
62,
3672,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
25927,
220,
220,
220,
220,
41876,
491,
74,
38890,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
12708,
62,
9122,
764,
198,
220,
220,
220,
337,
36252,
50,
2251,
62,
31216,
62,
25927,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
6371,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
1671,
3702,
62,
3672,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
25927,
220,
220,
220,
220,
41876,
491,
74,
38890,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8692,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
12708,
62,
9122,
764,
198,
220,
220,
220,
337,
36252,
50,
1064,
62,
397,
499,
18300,
62,
260,
7501,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
83,
324,
343,
220,
220,
220,
220,
220,
41876,
1259,
62,
83,
324,
343,
62,
926,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
260,
7501,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
12708,
62,
9122,
764,
198,
220,
220,
220,
337,
36252,
50,
1351,
62,
48205,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
25927,
220,
220,
220,
220,
41876,
491,
74,
38890,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
83,
324,
343,
8,
41876,
1259,
62,
83,
324,
343,
62,
926,
764,
198,
220,
220,
220,
337,
36252,
50,
4574,
62,
36653,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
260,
7501,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
35943,
220,
220,
220,
220,
220,
220,
220,
41876,
491,
74,
38890,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
48205,
220,
220,
220,
220,
41876,
1259,
62,
83,
324,
343,
62,
926,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
1671,
3702,
62,
3672,
41876,
4731,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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_object TYPE balsubobj OPTIONAL
i_external_id TYPE balnrext OPTIONAL
i_retention_parameters TYPE /usi/bal_retention_parameters
i_context TYPE bal_s_cont OPTIONAL
i_params TYPE bal_s_parm OPTIONAL
RETURNING
VALUE(r_result) TYPE REF TO /usi/if_bal_log_dao
RAISING
/usi/cx_bal_root.
METHODS get_data_container_collection
RETURNING
VALUE(r_result) TYPE REF TO /usi/if_bal_data_cont_coll_dao.
ENDINTERFACE.
| [
41358,
49836,
1220,
385,
72,
14,
361,
62,
6893,
62,
6404,
1362,
62,
67,
5488,
62,
69,
9548,
198,
220,
44731,
764,
198,
220,
337,
36252,
50,
651,
62,
6404,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
1312,
62,
6404,
62,
15252,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
3652,
26801,
62,
67,
198,
220,
220,
220,
220,
220,
1312,
62,
7266,
62,
15252,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
275,
874,
549,
26801,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
1312,
62,
22615,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
3652,
77,
260,
742,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
1312,
62,
1186,
1463,
62,
17143,
7307,
41876,
1220,
385,
72,
14,
6893,
62,
1186,
1463,
62,
17143,
7307,
198,
220,
220,
220,
220,
220,
1312,
62,
22866,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
3652,
62,
82,
62,
3642,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
1312,
62,
37266,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
3652,
62,
82,
62,
79,
1670,
39852,
2849,
1847,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
62,
20274,
8,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1220,
385,
72,
14,
361,
62,
6893,
62,
6404,
62,
67,
5488,
198,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
1220,
385,
72,
14,
66,
87,
62,
6893,
62,
15763,
13,
628,
220,
337,
36252,
50,
651,
62,
7890,
62,
34924,
62,
43681,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4526,
37,
5390,
1220,
385,
72,
14,
361,
62,
6893,
62,
7890,
62,
3642,
62,
26000,
62,
67,
5488,
13,
198,
10619,
41358,
49836,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_html_toolbar DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
METHODS:
constructor
IMPORTING
iv_id TYPE string OPTIONAL,
add
IMPORTING
iv_txt TYPE string
io_sub TYPE REF TO zcl_abapgit_html_toolbar OPTIONAL
iv_typ TYPE c DEFAULT zif_abapgit_html=>c_action_type-sapevent
iv_act TYPE string OPTIONAL
iv_ico TYPE string OPTIONAL
iv_cur TYPE abap_bool OPTIONAL
iv_opt TYPE c OPTIONAL
iv_chk TYPE abap_bool DEFAULT abap_undefined
iv_aux TYPE string OPTIONAL
iv_id TYPE string OPTIONAL
iv_title TYPE string OPTIONAL,
count
RETURNING VALUE(rv_count) TYPE i,
render
IMPORTING
iv_right TYPE abap_bool OPTIONAL
iv_sort TYPE abap_bool OPTIONAL
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html,
render_as_droplist
IMPORTING
iv_label TYPE string
iv_right TYPE abap_bool OPTIONAL
iv_sort TYPE abap_bool OPTIONAL
iv_corner TYPE abap_bool OPTIONAL
iv_action TYPE string OPTIONAL
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_item,
txt TYPE string,
act TYPE string,
ico TYPE string,
sub TYPE REF TO zcl_abapgit_html_toolbar,
opt TYPE char1,
typ TYPE char1,
cur TYPE abap_bool,
chk TYPE abap_bool,
aux TYPE string,
id TYPE string,
title TYPE string,
END OF ty_item.
TYPES tt_items TYPE STANDARD TABLE OF ty_item.
DATA: mt_items TYPE tt_items,
mv_id TYPE string.
METHODS:
render_items
IMPORTING
iv_sort TYPE abap_bool OPTIONAL
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html.
ENDCLASS.
CLASS ZCL_ABAPGIT_HTML_TOOLBAR IMPLEMENTATION.
METHOD add.
DATA ls_item TYPE ty_item.
ASSERT iv_typ = zif_abapgit_html=>c_action_type-separator " sep doesn't have action
OR iv_typ = zif_abapgit_html=>c_action_type-onclick " click may have no action (assigned in JS)
OR iv_typ = zif_abapgit_html=>c_action_type-dummy " dummy may have no action
OR iv_act IS INITIAL AND io_sub IS NOT INITIAL
OR iv_act IS NOT INITIAL AND io_sub IS INITIAL. " Only one supplied
ASSERT NOT ( iv_chk <> abap_undefined AND io_sub IS NOT INITIAL ).
ls_item-txt = iv_txt.
ls_item-act = iv_act.
ls_item-ico = iv_ico.
ls_item-sub = io_sub.
ls_item-opt = iv_opt.
ls_item-typ = iv_typ.
ls_item-cur = iv_cur.
ls_item-chk = iv_chk.
ls_item-aux = iv_aux.
ls_item-id = iv_id.
ls_item-title = iv_title.
APPEND ls_item TO mt_items.
ENDMETHOD.
METHOD constructor.
mv_id = iv_id.
ENDMETHOD.
METHOD count.
rv_count = lines( mt_items ).
ENDMETHOD.
METHOD render.
DATA: lv_class TYPE string.
CREATE OBJECT ro_html.
lv_class = 'nav-container' ##NO_TEXT.
IF iv_right = abap_true.
lv_class = lv_class && ' float-right'.
ENDIF.
ro_html->add( |<div class="{ lv_class }">| ).
ro_html->add( render_items( iv_sort = iv_sort ) ).
ro_html->add( '</div>' ).
ENDMETHOD.
METHOD render_as_droplist.
DATA: lv_class TYPE string.
CREATE OBJECT ro_html.
lv_class = 'nav-container' ##NO_TEXT.
IF iv_right = abap_true.
lv_class = lv_class && ' float-right'.
ENDIF.
IF iv_corner = abap_true.
lv_class = lv_class && ' corner'.
ENDIF.
ro_html->add( |<div class="{ lv_class }">| ).
ro_html->add( '<ul><li>' ).
ro_html->add_a( iv_txt = iv_label
iv_typ = zif_abapgit_html=>c_action_type-sapevent
iv_act = iv_action ).
ro_html->add( '<div class="minizone"></div>' ).
ro_html->add( render_items( iv_sort = iv_sort ) ).
ro_html->add( '</li></ul>' ).
ro_html->add( '</div>' ).
ENDMETHOD.
METHOD render_items.
DATA: lv_class TYPE string,
lv_icon TYPE string,
lv_id TYPE string,
lv_check TYPE string,
lv_aux TYPE string,
lv_has_icons TYPE abap_bool.
FIELD-SYMBOLS <ls_item> LIKE LINE OF mt_items.
CREATE OBJECT ro_html.
IF iv_sort = abap_true.
SORT mt_items BY txt ASCENDING AS TEXT.
ENDIF.
" Check has icons or check boxes
LOOP AT mt_items ASSIGNING <ls_item> WHERE ico IS NOT INITIAL OR chk <> abap_undefined.
lv_has_icons = abap_true.
lv_class = ' class="with-icons"'.
EXIT.
ENDLOOP.
IF mv_id IS NOT INITIAL.
lv_id = | id="{ mv_id }"|.
ENDIF.
ro_html->add( |<ul{ lv_id }{ lv_class }>| ).
" Render items
LOOP AT mt_items ASSIGNING <ls_item>.
CLEAR: lv_class, lv_icon.
IF <ls_item>-typ = zif_abapgit_html=>c_action_type-separator.
ro_html->add( |<li class="separator">{ <ls_item>-txt }</li>| ).
CONTINUE.
ENDIF.
IF lv_has_icons = abap_true.
IF <ls_item>-chk = abap_true.
lv_icon = zcl_abapgit_html=>icon( 'check/blue' ).
lv_check = ' data-check="X"'.
ELSEIF <ls_item>-chk = abap_false.
lv_icon = zcl_abapgit_html=>icon( 'check/grey' ).
lv_check = ' data-check=""'.
ELSE. " abap_undefined -> not a check box
lv_icon = zcl_abapgit_html=>icon( <ls_item>-ico ).
ENDIF.
ENDIF.
IF <ls_item>-cur = abap_true.
lv_class = ' class="current-menu-item"'.
ENDIF.
IF <ls_item>-aux IS NOT INITIAL.
lv_aux = | data-aux="{ <ls_item>-aux }"|.
ENDIF.
ro_html->add( |<li{ lv_class }{ lv_check }{ lv_aux }>| ).
IF <ls_item>-sub IS INITIAL.
ro_html->add_a( iv_txt = lv_icon && <ls_item>-txt
iv_typ = <ls_item>-typ
iv_act = <ls_item>-act
iv_id = <ls_item>-id
iv_opt = <ls_item>-opt
iv_title = <ls_item>-title ).
ELSE.
ro_html->add_a( iv_txt = lv_icon && <ls_item>-txt
iv_typ = zif_abapgit_html=>c_action_type-dummy
iv_act = ''
iv_id = <ls_item>-id
iv_opt = <ls_item>-opt
iv_title = <ls_item>-title ).
ro_html->add( <ls_item>-sub->render_items( iv_sort ) ).
ENDIF.
ro_html->add( '</li>' ).
ENDLOOP.
ro_html->add( '</ul>' ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
25981,
5657,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
312,
41876,
4731,
39852,
2849,
1847,
11,
198,
220,
220,
220,
220,
220,
751,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
14116,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
7266,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
25981,
5657,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
28004,
220,
220,
41876,
269,
220,
220,
220,
220,
220,
220,
220,
220,
5550,
38865,
1976,
361,
62,
397,
499,
18300,
62,
6494,
14804,
66,
62,
2673,
62,
4906,
12,
82,
1758,
1151,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
529,
220,
220,
41876,
4731,
220,
220,
220,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3713,
220,
220,
41876,
4731,
220,
220,
220,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
22019,
220,
220,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
8738,
220,
220,
41876,
269,
220,
220,
220,
220,
220,
220,
220,
220,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
354,
74,
220,
220,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
917,
18156,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
14644,
220,
220,
41876,
4731,
220,
220,
220,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
312,
220,
220,
220,
41876,
4731,
220,
220,
220,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
7839,
41876,
4731,
220,
220,
220,
39852,
2849,
1847,
11,
198,
220,
220,
220,
220,
220,
954,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
9127,
8,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
8543,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3506,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
30619,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
6494,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
11,
198,
220,
220,
220,
220,
220,
8543,
62,
292,
62,
22285,
489,
396,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
18242,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3506,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
30619,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10215,
1008,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
2673,
220,
220,
220,
220,
220,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
6494,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
9186,
11,
198,
220,
220,
220,
220,
220,
220,
220,
256,
742,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
719,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
3713,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
850,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
25981,
5657,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2172,
220,
220,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2170,
220,
220,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1090,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
442,
74,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
27506,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4686,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3670,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
9186,
13,
628,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
23814,
41876,
49053,
9795,
43679,
3963,
1259,
62,
9186,
13,
628,
220,
220,
220,
42865,
25,
45079,
62,
23814,
41876,
256,
83,
62,
23814,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
85,
62,
312,
220,
220,
220,
41876,
4731,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
8543,
62,
23814,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS /hec1/cl_config_det_app_server DEFINITION
PUBLIC
INHERITING FROM /hec1/cl_lib_d_superclass
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
PROTECTED SECTION.
METHODS execute
REDEFINITION .
METHODS execute_tree
REDEFINITION .
PRIVATE SECTION.
DATA mr_act_param TYPE REF TO data .
DATA mr_act_param1 TYPE REF TO data .
DATA mr_act_param_app_node TYPE REF TO data .
DATA mr_act_param_datac TYPE REF TO data .
DATA mr_act_param_dlvy TYPE REF TO data .
DATA mr_act_param_phasing TYPE REF TO data .
DATA mr_act_param_server TYPE REF TO data .
DATA mr_act_param_server_pc TYPE REF TO data .
DATA mr_act_param_app_backup TYPE REF TO data .
METHODS determine_app_node
IMPORTING
!is_ctx TYPE /bobf/s_frw_ctx_det
!it_key TYPE /bobf/t_frw_key
!io_read TYPE REF TO /bobf/if_frw_read
!io_modify TYPE REF TO /bobf/if_frw_modify
EXPORTING
!eo_message TYPE REF TO /bobf/if_frw_message
!et_failed_key TYPE /bobf/t_frw_key
RAISING
/bobf/cx_frw .
METHODS determine_app_node_cr
IMPORTING
!is_ctx TYPE /bobf/s_frw_ctx_det
!it_key TYPE /bobf/t_frw_key
!io_read TYPE REF TO /bobf/if_frw_read
!io_modify TYPE REF TO /bobf/if_frw_modify
EXPORTING
!eo_message TYPE REF TO /bobf/if_frw_message
!et_failed_key TYPE /bobf/t_frw_key
RAISING
/bobf/cx_frw .
METHODS determine_app_server
IMPORTING
!is_ctx TYPE /bobf/s_frw_ctx_det
!it_key TYPE /bobf/t_frw_key
!io_read TYPE REF TO /bobf/if_frw_read
!io_modify TYPE REF TO /bobf/if_frw_modify
EXPORTING
!eo_message TYPE REF TO /bobf/if_frw_message
!et_failed_key TYPE /bobf/t_frw_key
RAISING
/bobf/cx_frw .
METHODS determine_app_server_cr
IMPORTING
!is_ctx TYPE /bobf/s_frw_ctx_det
!it_key TYPE /bobf/t_frw_key
!io_read TYPE REF TO /bobf/if_frw_read
!io_modify TYPE REF TO /bobf/if_frw_modify
EXPORTING
!eo_message TYPE REF TO /bobf/if_frw_message
!et_failed_key TYPE /bobf/t_frw_key
RAISING
/bobf/cx_frw .
METHODS determine_app_server_instance
IMPORTING
!is_ctx TYPE /bobf/s_frw_ctx_det
!it_key TYPE /bobf/t_frw_key
!io_read TYPE REF TO /bobf/if_frw_read
!io_modify TYPE REF TO /bobf/if_frw_modify
EXPORTING
!eo_message TYPE REF TO /bobf/if_frw_message
!et_failed_key TYPE /bobf/t_frw_key
RAISING
/bobf/cx_frw .
METHODS determine_app_server_inst_cr
IMPORTING
!is_ctx TYPE /bobf/s_frw_ctx_det
!it_key TYPE /bobf/t_frw_key
!io_read TYPE REF TO /bobf/if_frw_read
!io_modify TYPE REF TO /bobf/if_frw_modify
EXPORTING
!eo_message TYPE REF TO /bobf/if_frw_message
!et_failed_key TYPE /bobf/t_frw_key
RAISING
/bobf/cx_frw .
METHODS determine_app_server_pc_cr
IMPORTING
!is_ctx TYPE /bobf/s_frw_ctx_det
!it_key TYPE /bobf/t_frw_key
!io_read TYPE REF TO /bobf/if_frw_read
!io_modify TYPE REF TO /bobf/if_frw_modify
EXPORTING
!eo_message TYPE REF TO /bobf/if_frw_message
!et_failed_key TYPE /bobf/t_frw_key
RAISING
/bobf/cx_frw .
METHODS determine_app_server_perf_cat
IMPORTING
!is_ctx TYPE /bobf/s_frw_ctx_det
!it_key TYPE /bobf/t_frw_key
!io_read TYPE REF TO /bobf/if_frw_read
!io_modify TYPE REF TO /bobf/if_frw_modify
EXPORTING
!eo_message TYPE REF TO /bobf/if_frw_message
!et_failed_key TYPE /bobf/t_frw_key
RAISING
/bobf/cx_frw .
METHODS determine_app_storage
IMPORTING
!is_ctx TYPE /bobf/s_frw_ctx_det
!it_key TYPE /bobf/t_frw_key
!io_read TYPE REF TO /bobf/if_frw_read
!io_modify TYPE REF TO /bobf/if_frw_modify
EXPORTING
!eo_message TYPE REF TO /bobf/if_frw_message
!et_failed_key TYPE /bobf/t_frw_key
RAISING
/bobf/cx_frw .
METHODS determine_app_storage_cr
IMPORTING
!is_ctx TYPE /bobf/s_frw_ctx_det
!it_key TYPE /bobf/t_frw_key
!io_read TYPE REF TO /bobf/if_frw_read
!io_modify TYPE REF TO /bobf/if_frw_modify
EXPORTING
!eo_message TYPE REF TO /bobf/if_frw_message
!et_failed_key TYPE /bobf/t_frw_key
RAISING
/bobf/cx_frw .
METHODS determine_app_storage_amount
IMPORTING
!is_ctx TYPE /bobf/s_frw_ctx_det
!it_key TYPE /bobf/t_frw_key
!io_read TYPE REF TO /bobf/if_frw_read
!io_modify TYPE REF TO /bobf/if_frw_modify
EXPORTING
!eo_message TYPE REF TO /bobf/if_frw_message
!et_failed_key TYPE /bobf/t_frw_key
RAISING
/bobf/cx_frw .
METHODS determine_app_storage_amoun_cr
IMPORTING
!is_ctx TYPE /bobf/s_frw_ctx_det
!it_key TYPE /bobf/t_frw_key
!io_read TYPE REF TO /bobf/if_frw_read
!io_modify TYPE REF TO /bobf/if_frw_modify
EXPORTING
!eo_message TYPE REF TO /bobf/if_frw_message
!et_failed_key TYPE /bobf/t_frw_key
RAISING
/bobf/cx_frw .
METHODS determine_app_storage_backup
IMPORTING
!is_ctx TYPE /bobf/s_frw_ctx_det
!it_key TYPE /bobf/t_frw_key
!io_read TYPE REF TO /bobf/if_frw_read
!io_modify TYPE REF TO /bobf/if_frw_modify
EXPORTING
!eo_message TYPE REF TO /bobf/if_frw_message
!et_failed_key TYPE /bobf/t_frw_key
RAISING
/bobf/cx_frw .
METHODS determine_app_storage_backu_cr
IMPORTING
!is_ctx TYPE /bobf/s_frw_ctx_det
!it_key TYPE /bobf/t_frw_key
!io_read TYPE REF TO /bobf/if_frw_read
!io_modify TYPE REF TO /bobf/if_frw_modify
EXPORTING
!eo_message TYPE REF TO /bobf/if_frw_message
!et_failed_key TYPE /bobf/t_frw_key
RAISING
/bobf/cx_frw .
ENDCLASS.
CLASS /HEC1/CL_CONFIG_DET_APP_SERVER IMPLEMENTATION.
METHOD determine_app_node.
DATA: lt_app_serv_inst TYPE /hec1/t_data_app_serv_inst_ct,
lt_app_node TYPE /hec1/t_data_app_node_ct,
lt_app_node_before TYPE /hec1/t_data_app_node_ct,
lt_node_key TYPE /bobf/t_frw_key,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_app_serv_pc TYPE /hec1/t_data_app_serv_pc_ct,
lt_act_param TYPE /hec1/t_act_create_app_spc,
lt_act_param_node TYPE /hec1/t_act_update_app_node,
lt_act_param_phasing TYPE TABLE OF /hec1/s_act_phase_inherit.
CLEAR: eo_message,
et_failed_key.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_node ).
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING ev_root_key = DATA(lv_root_key)
er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
TRY.
CASE is_ctx-det_key.
" ***************************************************************************
" Create mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_node-create.
" Get App server instance node (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_node-to_parent
IMPORTING et_data = lt_app_serv_inst ).
"-----------------------------------
" App master node
"-----------------------------------
LOOP AT lt_app_node
REFERENCE INTO DATA(lr_app_node)
WHERE hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master.
lr_app_node->hec_delete_visible = abap_false.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
DATA(lv_inst_status) = COND /hec1/config_instance_status( WHEN lr_app_node->hec_app_srv_perf_cat_qty IS NOT INITIAL AND
lr_app_node->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_node->hec_instance_status.
lr_app_node->hec_instance_status = lv_inst_status.
DATA(lv_data_changed) = abap_true.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_serv_inst[ key = lr_app_node->parent_key ] TO FIELD-SYMBOL(<fs_app_serv_inst>).
IF <fs_app_serv_inst> IS ASSIGNED.
IF <fs_app_serv_inst>-hec_operating_sys_guid IS NOT INITIAL AND
<fs_app_serv_inst>-hec_app_cluster_type_value IS NOT INITIAL AND
<fs_app_serv_inst>-hec_row_selectable = abap_true.
DATA(lv_release) = abap_true.
ENDIF.
ENDIF.
IF lr_app_node->hec_row_selectable <> lv_release AND
lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master.
lr_app_node->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Fill action table for create
" App server performance category
"-----------------------------------
IF NOT ( lr_app_node->hec_server_required = abap_false AND
lr_app_node->hec_effort_required = abap_false ).
INSERT VALUE #( key = lr_app_node->key
parent_key = lr_app_node->parent_key
hec_app_srv_perf_cat_qty = lr_app_node->hec_app_srv_perf_cat_qty ) INTO TABLE lt_act_param.
ENDIF.
"-----------------------------------
" Modify App server node
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_node->key
is_data = lr_app_node ).
ENDIF.
UNASSIGN <fs_app_serv_inst>.
CLEAR: lv_inst_status,
lv_release,
lv_data_changed.
ENDLOOP.
"-----------------------------------
" App standby node
"-----------------------------------
LOOP AT lt_app_node
REFERENCE INTO lr_app_node
WHERE hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-standby.
lr_app_node->hec_delete_visible = abap_false.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_node->hec_app_srv_perf_cat_qty IS NOT INITIAL AND
lr_app_node->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_node->hec_instance_status.
lr_app_node->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Release selection standby node
"-----------------------------------
" Check master node is complete configered
" ( including sub nodes: server performance category and storage amount )
DATA(lv_complete) = /hec1/cl_bopf_config_validat_h=>check_master_node_is_complete( iv_is_app_server = abap_true
iv_check_rule = /hec1/if_bopf_constants=>gc_check_rule-node
is_ctx = is_ctx
it_key = VALUE #( ( key = lr_app_node->key ) )
io_read = io_read ).
IF ( lv_complete = abap_true AND
lr_app_node->hec_row_selectable = abap_false ) OR
( lv_complete = abap_false AND
lr_app_node->hec_row_selectable = abap_true ).
lr_app_node->hec_row_selectable = COND #( WHEN lv_complete = abap_true
THEN abap_true
ELSE abap_false ).
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify App server node
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_node->key
is_data = lr_app_node ).
ENDIF.
CLEAR: lv_inst_status,
lv_complete,
lv_data_changed.
ENDLOOP.
"-----------------------------------
" Set create App server performance
" category action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_spc( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_spc )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
" ***************************************************************************
" Update mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_node-update.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_before_image = abap_true
IMPORTING et_data = lt_app_node_before ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( ( key = lv_root_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase ).
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_node-app_server_perform_cat
IMPORTING et_data = lt_app_serv_pc ).
LOOP AT lt_app_node REFERENCE INTO lr_app_node.
ASSIGN lt_app_node_before[ key = lr_app_node->key ] TO FIELD-SYMBOL(<fs_app_node_before>).
IF <fs_app_node_before> IS ASSIGNED.
"-----------------------------------
" App server performance category added
"-----------------------------------
IF <fs_app_node_before>-hec_app_srv_perf_cat_qty < lr_app_node->hec_app_srv_perf_cat_qty.
CASE lr_app_node->hec_app_clust_node_type_value.
WHEN /hec1/if_config_constants=>gc_app_clust_node_type-master.
"-----------------------------------
" Fill action table for create
" App server performance category
"-----------------------------------
INSERT VALUE #( key = lr_app_node->key
parent_key = lr_app_node->parent_key
hec_app_srv_perf_cat_qty = lr_app_node->hec_app_srv_perf_cat_qty - <fs_app_node_before>-hec_app_srv_perf_cat_qty ) INTO TABLE lt_act_param.
" Success message
/hec1/cl_config_helper=>set_message( EXPORTING iv_textid = /hec1/cx_bopf_config=>new_serv_perf_cat_added
iv_severity = /bobf/cm_frw=>co_severity_success
iv_attr1 = CONV #( lr_app_node->hec_app_srv_perf_cat_qty -
<fs_app_node_before>-hec_app_srv_perf_cat_qty )
CHANGING co_message = eo_message ).
" Set flag for deleting sub nodes of standby node
IF lr_app_node->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_node->hec_master_default = abap_true.
lv_data_changed = abap_true.
DATA(lv_delete_ha_subnode) = abap_true.
ENDIF.
ENDCASE.
ELSEIF <fs_app_node_before>-hec_app_srv_perf_cat_qty > lr_app_node->hec_app_srv_perf_cat_qty
AND lr_app_node->hec_app_srv_perf_cat_qty < lines( VALUE /hec1/t_data_app_serv_pc_ct( FOR app_serv_pc IN lt_app_serv_pc
WHERE ( parent_key = lr_app_node->key )
( app_serv_pc ) ) ).
DATA(lv_attr_name) = /hec1/if_configuration_c=>sc_node_attribute-app_node-hec_app_srv_perf_cat_qty.
" Error message
/hec1/cl_config_helper=>set_message( EXPORTING iv_textid = /hec1/cx_bopf_config=>object_no_not_higher
is_origin_location = VALUE #( node_key = is_ctx-node_key
key = lr_app_node->key
attributes = VALUE #( ( lv_attr_name ) ) )
CHANGING co_message = eo_message ).
" Set node number to value before update
lr_app_node->hec_app_srv_perf_cat_qty = <fs_app_node_before>-hec_app_srv_perf_cat_qty.
lv_data_changed = abap_true.
ENDIF. " IF ls_app_node_old-hec_app_srv_perf_cat_qty < ls_app_node-hec_app_srv_perf_cat_qty.
"-----------------------------------
" Phase has changed - update phase
" and inherit phase assignment
"-----------------------------------
IF lr_app_node->hec_phase_guid <> <fs_app_node_before>-hec_phase_guid.
IF lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_node->hec_master_default = abap_true.
APPEND VALUE #( hec_node_key = is_ctx-node_key
hec_bopf_key = lr_app_node->key
hec_phase_guid_new = lr_app_node->hec_phase_guid
hec_phase_guid_old = <fs_app_node_before>-hec_phase_guid ) TO lt_act_param_phasing.
ENDIF.
lr_app_node->hec_phase_changed = abap_true.
lv_data_changed = abap_true.
" Set flag for deleting subnodes of standby node
IF lr_app_node->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha.
lv_delete_ha_subnode = abap_true.
ENDIF.
ENDIF. "phasing changed
ENDIF. "IF <fs_app_node_before> IS ASSIGNED.
"-----------------------------------
" Set HA Info value/description
" for standby node only
"-----------------------------------
IF lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-standby AND
lr_app_node->hec_ha_inf_prov_date <> <fs_app_node_before>-hec_ha_inf_prov_date AND
lr_app_node->hec_ha_inf_prov_date IS NOT INITIAL.
CLEAR: lr_app_node->hec_ha_info_guid,
lr_app_node->hec_ha_category_value,
lr_app_node->hec_ha_category_descr,
lr_app_node->hec_spc_inst_feature_value,
lr_app_node->hec_spc_inst_feature_descr.
SELECT SINGLE *
FROM /HEC1/I_AppNodeHAInfoBasic
WHERE hec_app_clust_node_type_guid = @lr_app_node->hec_app_clust_node_type_guid AND
hec_app_clnt_hai_val_start <= @lr_app_node->hec_ha_inf_prov_date AND
hec_app_clnt_hai_val_end >= @lr_app_node->hec_ha_inf_prov_date
INTO @DATA(ls_ha_info).
IF ls_ha_info IS NOT INITIAL.
lr_app_node->hec_ha_info_guid = ls_ha_info-hec_app_clnt_hai_guid.
lr_app_node->hec_ha_category_value = ls_ha_info-hec_app_clnt_hai_cat_value.
lr_app_node->hec_ha_category_descr = ls_ha_info-hec_app_clnt_hai_cat_descr.
lr_app_node->hec_spc_inst_feature_value = ls_ha_info-hec_app_clnt_hai_sif_value.
lr_app_node->hec_spc_inst_feature_descr = ls_ha_info-hec_app_clnt_hai_sif_descr.
lv_data_changed = abap_true.
ENDIF.
ENDIF. " IF lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-standby AND...
"-----------------------------------
" Set HA Type Provisioning Date and
" dependencies (standby node only)
"-----------------------------------
IF lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-standby AND
lr_app_node->hec_ha_type_prov_date <> <fs_app_node_before>-hec_ha_type_prov_date AND
lr_app_node->hec_ha_type_prov_date IS NOT INITIAL.
CLEAR: lr_app_node->hec_ha_type_guid,
lr_app_node->hec_ha_type_value,
lr_app_node->hec_ha_type_descr,
lr_app_node->hec_ha_type_curr_suppstat_guid,
lr_app_node->hec_ha_type_curr_suppstat_val,
lr_app_node->hec_ha_type_curr_suppstat_desc.
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /HEC1/I_AppNodeTyWithAssocPa
WHERE hec_app_clust_node_type_guid = @lr_app_node->hec_app_clust_node_type_guid AND
hec_app_clnt_hat_sust_valstart <= @lr_app_node->hec_ha_type_prov_date AND
hec_app_clnt_hat_sust_val_end >= @lr_app_node->hec_ha_type_prov_date
INTO TABLE @DATA(lt_ha_type).
ASSIGN lt_ha_type[ hec_app_clnt_hat_sust_value = '02' ] TO FIELD-SYMBOL(<fs_ha_type>).
IF <fs_ha_type> IS ASSIGNED.
lr_app_node->hec_ha_type_guid = <fs_ha_type>-hec_app_clnt_ha_type_guid.
lr_app_node->hec_ha_type_value = <fs_ha_type>-hec_app_clnt_ha_type_value.
lr_app_node->hec_ha_type_descr = <fs_ha_type>-hec_app_clnt_ha_type_descr.
lr_app_node->hec_ha_type_curr_suppstat_guid = <fs_ha_type>-hec_app_clnt_ha_type_sust_guid.
lr_app_node->hec_ha_type_curr_suppstat_val = <fs_ha_type>-hec_app_clnt_hat_sust_value.
lr_app_node->hec_ha_type_curr_suppstat_desc = <fs_ha_type>-hec_app_clnt_hat_sust_descr.
IF lr_app_node->hec_ha_type_init_suppstat_guid IS INITIAL.
lr_app_node->hec_ha_type_init_suppstat_guid = <fs_ha_type>-hec_app_clnt_ha_type_sust_guid.
lr_app_node->hec_ha_type_init_suppstat_val = <fs_ha_type>-hec_app_clnt_hat_sust_value.
lr_app_node->hec_ha_type_init_suppstat_desc = <fs_ha_type>-hec_app_clnt_hat_sust_descr.
ENDIF.
lv_data_changed = abap_true.
ENDIF. " IF <fs_ha_type> IS ASSIGNED.
ENDIF. " IF lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-standby AND...
"-----------------------------------
" Set HA Type (standby node only)
"-----------------------------------
IF lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-standby AND
lr_app_node->hec_ha_type_guid <> <fs_app_node_before>-hec_ha_type_guid AND
lr_app_node->hec_ha_type_prov_date = <fs_app_node_before>-hec_ha_type_prov_date AND
lr_app_node->hec_ha_type_prov_date IS NOT INITIAL AND
lr_app_node->hec_ha_type_guid IS NOT INITIAL.
CLEAR: lr_app_node->hec_ha_type_value,
lr_app_node->hec_ha_type_descr,
lr_app_node->hec_ha_type_curr_suppstat_guid,
lr_app_node->hec_ha_type_curr_suppstat_val,
lr_app_node->hec_ha_type_curr_suppstat_desc.
SELECT SINGLE * "#EC CI_ALL_FIELDS_NEEDED
FROM /HEC1/I_AppNodeTyWithAssocPa
WHERE hec_app_clust_node_type_guid = @lr_app_node->hec_app_clust_node_type_guid AND
hec_app_clnt_ha_type_guid = @lr_app_node->hec_ha_type_guid AND
hec_app_clnt_hat_sust_valstart <= @lr_app_node->hec_ha_type_prov_date AND
hec_app_clnt_hat_sust_val_end >= @lr_app_node->hec_ha_type_prov_date
INTO @DATA(ls_ha_type).
IF ls_ha_type IS NOT INITIAL.
lr_app_node->hec_ha_type_guid = ls_ha_type-hec_app_clnt_ha_type_guid.
lr_app_node->hec_ha_type_value = ls_ha_type-hec_app_clnt_ha_type_value.
lr_app_node->hec_ha_type_descr = ls_ha_type-hec_app_clnt_ha_type_descr.
lr_app_node->hec_ha_type_curr_suppstat_guid = ls_ha_type-hec_app_clnt_ha_type_sust_guid.
lr_app_node->hec_ha_type_curr_suppstat_val = ls_ha_type-hec_app_clnt_hat_sust_value.
lr_app_node->hec_ha_type_curr_suppstat_desc = ls_ha_type-hec_app_clnt_hat_sust_descr.
ENDIF.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_node->hec_app_srv_perf_cat_qty IS NOT INITIAL AND
lr_app_node->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_node->hec_instance_status.
lr_app_node->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Fill action table for delete
" App server standby node subnodes
" or relase standby node
"-----------------------------------
IF lr_app_node->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_node->hec_master_default = abap_true AND
lv_data_changed = abap_true.
IF NOT line_exists( lt_act_param_node[ key = lr_app_node->key ] ).
INSERT VALUE #( key = lr_app_node->key
parent_key = lr_app_node->parent_key
do_release_ha_node = COND #( WHEN lr_app_node->hec_instance_status = /hec1/if_config_constants=>gc_instance_status-complete AND
<fs_app_node_before>-hec_instance_status = /hec1/if_config_constants=>gc_instance_status-incomplete
THEN abap_true
ELSE abap_false )
do_delete_ha_subnode = COND #( WHEN lr_app_node->hec_instance_status = /hec1/if_config_constants=>gc_instance_status-incomplete OR
lv_delete_ha_subnode = abap_true
THEN abap_true
ELSE abap_false ) ) INTO TABLE lt_act_param_node.
ENDIF.
ENDIF. " IF lr_app_serv_perf_cat->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha
"-----------------------------------
" Modify App server node
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_node->key
is_data = lr_app_node ).
ENDIF.
CLEAR: lv_inst_status,
lv_data_changed,
lv_attr_name,
lv_delete_ha_subnode.
UNASSIGN <fs_app_node_before>.
ENDLOOP.
"-----------------------------------
" Set create App server performance
" category action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_spc( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_spc )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
"-----------------------------------
" Set Update Phasing
" to general
"-----------------------------------
IF lt_act_param_phasing IS NOT INITIAL.
me->mr_act_param_phasing = NEW /hec1/t_act_phase_inherit( lt_act_param_phasing ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = it_key
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-inherit_phase_assignment )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_phasing ).
ENDIF.
"-----------------------------------
" Set update App node action to
" general
"-----------------------------------
IF lt_act_param_node IS NOT INITIAL.
CLEAR me->mr_act_param_app_node.
me->mr_act_param_app_node = NEW /hec1/t_act_update_app_node( lt_act_param_node ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_node )
it_key = VALUE #( FOR wa_act_node IN lt_act_param_node
( key = wa_act_node-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_app_node ).
ENDIF.
" ***************************************************************************
" Update mode after app server
" instance update
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_node-update_after_server_inst.
" Get App server instance
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_node-to_parent
IMPORTING et_data = lt_app_serv_inst ).
LOOP AT lt_app_node REFERENCE INTO lr_app_node.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_serv_inst[ key = lr_app_node->parent_key ] TO <fs_app_serv_inst>.
IF <fs_app_serv_inst> IS ASSIGNED.
IF <fs_app_serv_inst>-hec_operating_sys_guid IS NOT INITIAL AND
<fs_app_serv_inst>-hec_app_cluster_type_value IS NOT INITIAL AND
<fs_app_serv_inst>-hec_row_selectable = abap_true.
lv_release = abap_true.
ENDIF.
ENDIF.
IF lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_node->hec_row_selectable <> lv_release.
lr_app_node->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Release instance for selection
" ( standby node)
"-----------------------------------
IF lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-standby AND
lr_app_node->hec_row_selectable <> lv_release.
IF lv_release = abap_false AND
lr_app_node->hec_row_selectable = abap_true.
lr_app_node->hec_row_selectable = abap_false.
lv_data_changed = abap_true.
ELSE.
" Check master node is complete configered
" ( including sub nodes: server performance category and storage amount )
lv_complete = /hec1/cl_bopf_config_validat_h=>check_master_node_is_complete( iv_is_app_server = abap_true
iv_check_rule = /hec1/if_bopf_constants=>gc_check_rule-node
is_ctx = is_ctx
it_key = VALUE #( ( key = lr_app_node->key ) )
io_read = io_read ).
IF lv_complete = abap_true.
lr_app_node->hec_row_selectable = abap_true.
lv_data_changed = abap_true.
ENDIF.
ENDIF. " IF lv_release = abap_false AND...
ENDIF. " IF lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-standby AND...
"-----------------------------------
" Update App server cluster type
"-----------------------------------
IF lr_app_node->hec_app_cluster_type_value <> <fs_app_serv_inst>-hec_app_cluster_type_value.
lr_app_node->hec_app_cluster_type_value = <fs_app_serv_inst>-hec_app_cluster_type_value.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify App node
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_node->key
is_data = lr_app_node ).
ENDIF.
UNASSIGN <fs_app_serv_inst>.
CLEAR: lv_release,
lv_complete,
lv_data_changed.
ENDLOOP.
ENDCASE.
CATCH /bobf/cx_frw. " Exception class
ENDTRY.
ENDMETHOD.
METHOD determine_app_server.
DATA: lt_app_server TYPE /hec1/t_data_app_serv_ct,
lt_app_serv_perf_cat TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_storage TYPE /hec1/t_data_app_storage_ct,
lt_line TYPE TABLE OF string,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_app_server_before TYPE /hec1/t_data_app_serv_ct,
lt_act_param TYPE /hec1/t_act_create_app_storage,
lt_act_param_storage TYPE /bobf/t_frw_key,
lt_act_param_server TYPE /hec1/t_act_update_app_server,
lt_act_param_dlvy TYPE /hec1/t_act_update_dlvy_unit,
lt_act_param_datac TYPE /hec1/t_act_update_datacenter,
lt_act_param_serv_pc TYPE /hec1/t_act_update_app_serv_pc,
lt_act_param_phasing TYPE TABLE OF /hec1/s_act_phase_inherit.
CLEAR: eo_message,
et_failed_key.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_server ).
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING ev_root_key = DATA(lv_root_key)
er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
TRY.
CASE is_ctx-det_key.
" ***************************************************************************
" Create mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server-create.
" Get App server performance category node (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server-to_parent
IMPORTING et_data = lt_app_serv_perf_cat ).
LOOP AT lt_app_server
REFERENCE INTO DATA(lr_app_server)
WHERE hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master.
"-----------------------------------
" Set Value List Quantity
"-----------------------------------
lr_app_server->hec_ip_server_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_server(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_infra_provider_guid = lr_dlvy_unit->hec_inf_provider_guid
iv_sec_datacenter_guid = VALUE #( lt_datacenter[ hec_node_datacenter = lr_app_server->hec_tier_datacenter_guid ]-hec_sec_datacenter_guid OPTIONAL )
iv_srv_perf_cat_guid = VALUE #( lt_app_serv_perf_cat[ key = lr_app_server->parent_key ]-hec_srv_perf_cat_guid OPTIONAL ) ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
lr_app_server->hec_delete_visible = abap_false.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
DATA(lv_inst_status) = COND /hec1/config_instance_status( WHEN lr_app_server->hec_ip_server_guid IS NOT INITIAL AND
lr_app_server->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_server->hec_instance_status.
lr_app_server->hec_instance_status = lv_inst_status.
DATA(lv_data_changed) = abap_true.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_serv_perf_cat[ key = lr_app_server->parent_key ] TO FIELD-SYMBOL(<fs_app_serv_perf_cat>).
IF <fs_app_serv_perf_cat> IS ASSIGNED.
IF <fs_app_serv_perf_cat>-hec_srv_perf_cat_guid IS NOT INITIAL AND
<fs_app_serv_perf_cat>-hec_row_selectable = abap_true.
DATA(lv_release) = abap_true.
ENDIF.
ENDIF.
IF lv_release <> lr_app_server->hec_row_selectable.
lr_app_server->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Fill action table for create
" App server storage
"-----------------------------------
INSERT VALUE #( key = lr_app_server->key
parent_key = lr_app_server->parent_key
hec_pricing_included = abap_false ) INTO TABLE lt_act_param.
"-----------------------------------
" Modify
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_server->key
is_data = lr_app_server ).
ENDIF.
UNASSIGN <fs_app_serv_perf_cat>.
CLEAR: lv_inst_status,
lv_data_changed,
lv_release.
ENDLOOP.
"-----------------------------------
" Set create App server storage
" action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_storage( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_storage )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
" ***************************************************************************
" Update mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server-update.
" Get Before image
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_before_image = abap_true
IMPORTING et_data = lt_app_server_before ).
" Get App server performance category (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server-to_parent
IMPORTING et_data = lt_app_serv_perf_cat ).
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server-app_storage
IMPORTING et_data = lt_app_storage ).
" Get Phases
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( ( key = lv_root_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase ).
LOOP AT lt_app_server REFERENCE INTO lr_app_server.
ASSIGN lt_app_server_before[ key = lr_app_server->key ] TO FIELD-SYMBOL(<fs_app_server_before>).
IF <fs_app_server_before> IS ASSIGNED.
"-----------------------------------
" Split DB server infrastructure
" provider server GUID
"-----------------------------------
IF lr_app_server->hec_ip_server_guid CA ';'.
SPLIT lr_app_server->hec_ip_server_guid
AT ';'
INTO TABLE lt_line.
LOOP AT lt_line ASSIGNING FIELD-SYMBOL(<fs_line>).
CASE sy-tabix.
WHEN 1.
lr_app_server->hec_ip_server_guid = <fs_line>.
WHEN 2.
DATA(lv_inf_provider_guid) = <fs_line>.
WHEN 3.
DATA(lv_datacenter_guid) = <fs_line>.
ENDCASE.
ENDLOOP.
"-----------------------------------
" Fill action table for update
" delivery unit
"-----------------------------------
IF lr_dlvy_unit->hec_inf_provider_guid IS INITIAL.
INSERT VALUE #( key = lr_dlvy_unit->key
parent_key = lr_dlvy_unit->parent_key
hec_inf_provider_guid = lv_inf_provider_guid ) INTO TABLE lt_act_param_dlvy.
ENDIF.
"-----------------------------------
" Fill action table for update
" data center
"-----------------------------------
TRY.
DATA(ls_datacenter) = lt_datacenter[ hec_node_datacenter = lr_app_server->hec_tier_datacenter_guid ].
IF ls_datacenter-hec_datacenter_guid IS INITIAL.
INSERT VALUE #( key = ls_datacenter-key
parent_key = ls_datacenter-parent_key
hec_datacenter_fdt_guid = lv_datacenter_guid ) INTO TABLE lt_act_param_datac.
*
"-----------------------------------
" Fill action table for update
" App node pricing
"-----------------------------------
INSERT VALUE #( key = lr_app_server->parent_key
do_update_pricing = abap_true ) INTO TABLE lt_act_param_serv_pc.
ENDIF. " IF ls_datacenter-hec_datacenter_guid IS INITIAL.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF ls_app_server-hec_ds_ip_server_guid CA ';'.
"-----------------------------------
" App server has changed
"-----------------------------------
IF lr_app_server->hec_ip_server_guid IS NOT INITIAL AND
lr_app_server->hec_ip_server_guid <> <fs_app_server_before>-hec_ip_server_guid.
IF lv_inf_provider_guid IS NOT INITIAL.
lr_dlvy_unit->hec_inf_provider_guid = lv_inf_provider_guid.
ENDIF.
IF lr_app_server->hec_sec_datacenter_guid IS INITIAL AND
lv_datacenter_guid IS NOT INITIAL.
lr_app_server->hec_sec_datacenter_guid = lv_datacenter_guid.
lv_data_changed = abap_true.
ENDIF.
SELECT SINGLE *
FROM /hec1/i_serverbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_infra_provider_guid = @lr_dlvy_unit->hec_inf_provider_guid AND
hec_sec_datacenter_guid = @lr_app_server->hec_sec_datacenter_guid AND
hec_ip_server_guid = @lr_app_server->hec_ip_server_guid
INTO @DATA(ls_server).
IF ls_server IS NOT INITIAL.
lr_app_server->hec_ip_server_descr = ls_server-hec_ip_server_descr.
lr_app_server->hec_ip_server_guid = ls_server-hec_ip_server_guid.
lr_app_server->hec_host_type_descr = ls_server-hec_srv_host_type_descr.
lr_app_server->hec_host_type_value = ls_server-hec_srv_host_type_value.
lr_app_server->hec_srv_ram_size = ls_server-hec_srv_ram_size.
lr_app_server->hec_srv_cpu_size = ls_server-hec_srv_cpu_size.
lr_app_server->hec_sec_datacenter_guid = ls_server-hec_sec_datacenter_guid.
lr_app_server->hec_srv_main_storage_qty = ls_server-hec_srv_main_storage_qty.
lr_app_server->hec_tree_descr = ls_server-hec_ip_server_descr. "#EC CI_FLDEXT_OK[2215424]
lr_app_server->hec_as_flavour = ls_server-hec_srv_flavour.
lr_app_server->hec_saps = ls_server-hec_saps.
lr_app_server->hec_approval_needed = ls_server-hec_approval_needed.
lv_data_changed = abap_true.
" Set Value List Quantity
lr_app_server->hec_ip_server_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_server(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_infra_provider_guid = lr_dlvy_unit->hec_inf_provider_guid
iv_sec_datacenter_guid = VALUE #( lt_datacenter[ hec_node_datacenter = lr_app_server->hec_tier_datacenter_guid ]-hec_sec_datacenter_guid OPTIONAL )
iv_srv_perf_cat_guid = VALUE #( lt_app_serv_perf_cat[ key = lr_app_server->parent_key ]-hec_srv_perf_cat_guid OPTIONAL ) ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
"-------------------------
" Get App server pricing
"-------------------------
SELECT SINGLE hec_cb_pricing_lb_guid
FROM /hec1/i_serverlbbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_sec_datacenter_guid = @lr_app_server->hec_sec_datacenter_guid AND
hec_infra_provider_guid = @lr_dlvy_unit->hec_inf_provider_guid AND
hec_ip_server_guid = @lr_app_server->hec_ip_server_guid
INTO @DATA(lv_lb_guid).
IF lv_lb_guid IS NOT INITIAL.
SELECT SINGLE * FROM /hec1/c_cbp_lb "#EC CI_ALL_FIELDS_NEEDED
INTO @DATA(ls_pricing)
WHERE hec_price_lb = @lv_lb_guid.
lr_app_server->* = CORRESPONDING #( BASE ( lr_app_server->* ) ls_pricing ).
ENDIF.
"-----------------------------------
" Fill action table for update
" App server storage
"-----------------------------------
LOOP AT lt_app_storage REFERENCE INTO DATA(lr_app_storage)
WHERE parent_key = lr_app_server->key.
INSERT VALUE #( key = lr_app_storage->key ) INTO TABLE lt_act_param_storage.
ENDLOOP.
ENDIF. " IF ls_server IS NOT INITIAL.
ENDIF. " IF ls_app_server-hec_as_ip_server_guid IS NOT INITIAL AND...
"-----------------------------------
" Value List Quanitty
"-----------------------------------
" HEC_AS_BACKUPSLA_VALUE
IF lr_app_server->hec_as_backupsla_value <> <fs_app_server_before>-hec_as_backupsla_value.
lr_app_server->hec_as_backupsla_vlqt = COND #( WHEN 1 < lines( /rbp/cl_fpm_utilities=>get_characteristic_values( CONV #( 'HEC_AS_BACKUPSLA_VALUE' ) ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
ENDIF.
" HEC_AS_BACKUPSLA_FILE_VALUE
IF lr_app_server->hec_as_backupsla_file_value <> <fs_app_server_before>-hec_as_backupsla_file_value.
lr_app_server->hec_as_backupsla_file_vlqt = COND #( WHEN 1 < lines( /rbp/cl_fpm_utilities=>get_characteristic_values( CONV #( 'HEC_AS_BACKUPSLA_FILE_VALUE' ) ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
ENDIF.
"-----------------------------------
" Phase has changed -
" update phase and inherit phase assignment
"-----------------------------------
IF lr_app_server->hec_phase_guid NE <fs_app_server_before>-hec_phase_guid.
" Only for default master node
IF lr_app_server->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_server->hec_app_node_default = abap_true.
APPEND VALUE #( hec_node_key = is_ctx-node_key
hec_bopf_key = lr_app_server->key
hec_phase_guid_new = lr_app_server->hec_phase_guid
hec_phase_guid_old = <fs_app_server_before>-hec_phase_guid ) TO lt_act_param_phasing.
ENDIF.
lr_app_server->hec_phase_changed = abap_true.
lv_data_changed = abap_true.
ENDIF. "phasing changed
ENDIF. " if <fs_app_server_before> is assigned.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_server->hec_ip_server_guid IS NOT INITIAL AND
lr_app_server->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_server->hec_instance_status.
lr_app_server->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_server->key
is_data = lr_app_server ).
ENDIF.
UNASSIGN: <fs_line>,
<fs_app_server_before>.
CLEAR: lv_inf_provider_guid,
lv_datacenter_guid,
lv_lb_guid,
lv_inst_status,
lv_data_changed,
ls_server,
ls_pricing,
lt_line.
ENDLOOP.
"-----------------------------------
" Set update delivery unit action to
" general
"-----------------------------------
IF lt_act_param_dlvy IS NOT INITIAL.
CLEAR me->mr_act_param_dlvy.
me->mr_act_param_dlvy = NEW /hec1/t_act_update_dlvy_unit( lt_act_param_dlvy ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-delivery_unit )
it_key = VALUE #( FOR wa_act_dlvy IN lt_act_param_dlvy
( key = wa_act_dlvy-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_delivery_unit )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_dlvy ).
ENDIF.
"-----------------------------------
" Set update data center action to
" general
"-----------------------------------
IF lt_act_param_datac IS NOT INITIAL.
CLEAR me->mr_act_param_datac.
me->mr_act_param_datac = NEW /hec1/t_act_update_datacenter( lt_act_param_datac ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-datacenter )
it_key = VALUE #( FOR wa_act_datac IN lt_act_param_datac
( key = wa_act_datac-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_datacenter )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_datac ).
ENDIF.
"-----------------------------------
" Set App Server PC action to
" general
"-----------------------------------
IF lt_act_param_serv_pc IS NOT INITIAL.
me->mr_act_param_server_pc = NEW /hec1/t_act_update_app_serv_pc( lt_act_param_serv_pc ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_server_perform_cat )
it_key = VALUE #( FOR wa_act_spc IN lt_act_param_serv_pc
( key = wa_act_spc-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_server_perf_cat )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_server_pc ).
ENDIF.
"-----------------------------------
" Set update App Storage action to
" general
"-----------------------------------
IF lt_act_param_storage IS NOT INITIAL.
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_storage )
it_key = lt_act_param_storage
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_storage )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation ).
ENDIF.
"-----------------------------------
" Set update phase action to general
"-----------------------------------
IF lt_act_param_phasing IS NOT INITIAL.
me->mr_act_param_phasing = NEW /hec1/t_act_phase_inherit( lt_act_param_phasing ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = it_key
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-inherit_phase_assignment )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_phasing ).
ENDIF.
" ***************************************************************************
" Update mode after app server
" performance category update
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server-update_after_serv_perf_cat.
" Get App server performance category (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server-to_parent
IMPORTING et_data = lt_app_serv_perf_cat ).
LOOP AT lt_app_server REFERENCE INTO lr_app_server.
ASSIGN lt_app_serv_perf_cat[ key = lr_app_server->parent_key ] TO <fs_app_serv_perf_cat>.
IF <fs_app_serv_perf_cat> IS ASSIGNED.
IF <fs_app_serv_perf_cat>-hec_srv_perf_cat_guid IS NOT INITIAL AND
<fs_app_serv_perf_cat>-hec_row_selectable = abap_true.
lv_release = abap_true.
ENDIF.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
IF lv_release <> lr_app_server->hec_row_selectable.
lr_app_server->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Update App server cluster type
"-----------------------------------
IF lr_app_server->hec_app_cluster_type_value <> <fs_app_serv_perf_cat>-hec_app_cluster_type_value.
lr_app_server->hec_app_cluster_type_value = <fs_app_serv_perf_cat>-hec_app_cluster_type_value.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_server->key
is_data = lr_app_server ).
ENDIF.
UNASSIGN <fs_app_serv_perf_cat>.
CLEAR: lv_release,
lv_data_changed.
ENDLOOP. " LOOP AT lt_app_server
ENDCASE.
CATCH /bobf/cx_frw. " Exception class
ENDTRY.
ENDMETHOD.
METHOD determine_app_server_instance.
DATA: lt_app_serv_inst TYPE /hec1/t_data_app_serv_inst_ct,
lt_app_serv_inst_before TYPE /hec1/t_data_app_serv_inst_ct,
lt_app_serv_inst_pertier TYPE /hec1/t_data_app_serv_inst_ct,
lt_app_node TYPE /hec1/t_data_app_node_ct,
lt_tier TYPE /hec1/t_data_tier_ct,
lt_act_param TYPE /hec1/t_act_create_app_node,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_act_param_phasing TYPE TABLE OF /hec1/s_act_phase_inherit.
CLEAR: eo_message,
et_failed_key.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_serv_inst ).
" Get tier
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_instance-to_parent
IMPORTING et_data = lt_tier
et_target_key = DATA(lt_tier_key) ).
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING ev_root_key = DATA(lv_root_key)
er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
TRY.
CASE is_ctx-det_key.
" ***************************************************************************
" Create mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_instance-create.
LOOP AT lt_app_serv_inst REFERENCE INTO DATA(lr_app_serv_inst).
"-----------------------------------
" Set Value List Quantity
"-----------------------------------
" App Server Instance
lr_app_serv_inst->hec_sol_tier_stack_si_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_server_instance(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_sol_tier_stack_guid = lr_app_serv_inst->hec_sol_tier_stack_guid
iv_srv_inst_rel_value = lr_app_serv_inst->hec_srv_inst_rel_value
iv_solution_guid = lr_app_serv_inst->hec_solution_guid
iv_is_app_server = abap_true ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
" Operating System
lr_app_serv_inst->hec_sol_apsi_oper_sys_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_app_operating_system(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
" Cluster Type
lr_app_serv_inst->hec_sol_apsi_clusttyp_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_app_cluster_type(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
lr_app_serv_inst->hec_delete_visible = COND #( WHEN lr_app_serv_inst->hec_default_app_server_inst = abap_true
THEN abap_false
ELSE abap_true ).
"-----------------------------------
" Check instance status and switch
"-----------------------------------
DATA(lv_inst_status) = COND /hec1/config_instance_status( WHEN lr_app_serv_inst->hec_sol_tier_stack_si_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_clusttyp_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_serv_inst->hec_instance_status.
lr_app_serv_inst->hec_instance_status = lv_inst_status.
DATA(lv_data_changed) = abap_true.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_tier[ key = lr_app_serv_inst->parent_key ] TO FIELD-SYMBOL(<fs_tier>).
IF <fs_tier> IS ASSIGNED.
IF <fs_tier>-hec_tier_descr IS NOT INITIAL AND
<fs_tier>-hec_tier_type_value IS NOT INITIAL AND
<fs_tier>-hec_tier_impl_type_value IS NOT INITIAL.
DATA(lv_release) = abap_true.
ENDIF.
ENDIF.
IF lv_release <> lr_app_serv_inst->hec_row_selectable.
lr_app_serv_inst->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Fill action table for
" create App node
"-----------------------------------
IF lr_app_serv_inst->hec_sol_tier_stack_si_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_clusttyp_guid IS NOT INITIAL.
INSERT VALUE #( key = lr_app_serv_inst->key
parent_key = lr_app_serv_inst->parent_key
hec_app_cluster_type_value = SWITCH #( lr_app_serv_inst->hec_app_cluster_type_value
WHEN /hec1/if_config_constants=>gc_app_clust_node-none
THEN /hec1/if_config_constants=>gc_app_clust_node-none
WHEN /hec1/if_config_constants=>gc_app_clust_node-ha
THEN /hec1/if_config_constants=>gc_app_clust_node-ha
ELSE /hec1/if_config_constants=>gc_app_clust_node-none )
hec_default_app_server = SWITCH #( lr_app_serv_inst->hec_default_app_server_inst
WHEN abap_true
THEN abap_true
ELSE abap_false ) ) INTO TABLE lt_act_param.
ENDIF.
"-----------------------------------
" Modify App server instance
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_serv_inst->key
is_data = lr_app_serv_inst ).
ENDIF.
UNASSIGN <fs_tier>.
CLEAR: lv_inst_status,
lv_release,
lv_data_changed.
ENDLOOP.
"-----------------------------------
" Set create App server node
" action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_node( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
" ***************************************************************************
" Update mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_instance-update.
" Get data before update
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_before_image = abap_true
IMPORTING et_data = lt_app_serv_inst_before ).
" Get app ndde
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_instance-app_node
IMPORTING et_data = lt_app_node ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( ( key = lv_root_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase ).
" Get all app server instances per tier
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-tier
it_key = lt_tier_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-tier-app_server_instance
IMPORTING et_data = lt_app_serv_inst_pertier ).
"-----------------------------------
" Get App server instance data
"-----------------------------------
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_appservinstancenobasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid
INTO TABLE @DATA(lt_app_serv_inst_no).
"-----------------------------------
" Get App server operating system
"-----------------------------------
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_appopersystembasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid
INTO TABLE @DATA(lt_app_operating_sys).
"-----------------------------------
" Get App server cluster type
"-----------------------------------
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_appclustertypebasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid
INTO TABLE @DATA(lt_cluster_type).
LOOP AT lt_app_serv_inst REFERENCE INTO lr_app_serv_inst.
ASSIGN lt_app_serv_inst_before[ key = lr_app_serv_inst->key ] TO FIELD-SYMBOL(<fs_serv_inst_before>).
IF <fs_serv_inst_before> IS ASSIGNED.
" Can this value change? TODO
lr_app_serv_inst->hec_delete_visible = COND #( WHEN lr_app_serv_inst->hec_default_app_server_inst = abap_true
THEN abap_false
ELSE abap_true ).
"-----------------------------------
" Update operating system
"-----------------------------------
IF <fs_serv_inst_before>-hec_sol_apsi_oper_sys_guid IS INITIAL AND
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid IS NOT INITIAL.
TRY.
DATA(ls_operating_sys) = lt_app_operating_sys[ hec_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid
hec_sol_apsi_oper_sys_guid = lr_app_serv_inst->hec_sol_apsi_oper_sys_guid ].
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid = ls_operating_sys-hec_sol_apsi_oper_sys_guid.
lr_app_serv_inst->hec_operating_sys_guid = ls_operating_sys-hec_operating_sys_guid.
lr_app_serv_inst->hec_operating_sys_value = ls_operating_sys-hec_operating_sys_value.
lr_app_serv_inst->hec_operating_sys_descr = ls_operating_sys-hec_operating_sys_descr.
lr_app_serv_inst->hec_os_support_stat_value = ls_operating_sys-hec_os_support_stat_value.
lr_app_serv_inst->hec_os_support_stat_descr = ls_operating_sys-hec_os_support_stat_descr.
lv_data_changed = abap_true.
"-----------------------------------
" Value List Quanitty
"-----------------------------------
" Operating System
IF lr_app_serv_inst->hec_sol_apsi_oper_sys_guid <> <fs_serv_inst_before>-hec_sol_apsi_oper_sys_guid.
lr_app_serv_inst->hec_sol_apsi_oper_sys_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_app_operating_system(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
ENDIF.
" HEC_ASI_PATCH_LEVEL_VALUE
IF lr_app_serv_inst->hec_asi_patch_level_value <> <fs_serv_inst_before>-hec_asi_patch_level_value.
lr_app_serv_inst->hec_asi_patch_level_vlqt = COND #( WHEN 1 < lines( /rbp/cl_fpm_utilities=>get_characteristic_values( CONV #( 'HEC_ASI_PATCH_LEVEL_VALUE' ) ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
ENDIF.
" HEC_ASI_OPSYS_IMAGE_VAL
IF lr_app_serv_inst->hec_asi_opsys_image_val <> <fs_serv_inst_before>-hec_asi_opsys_image_val.
lr_app_serv_inst->hec_asi_opsys_image_vlqt = COND #( WHEN 1 < lines( /rbp/cl_fpm_utilities=>get_characteristic_values( CONV #( 'HEC_ASI_OPSYS_IMAGE_VAL' ) ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
ENDIF.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
CLEAR ls_operating_sys.
ENDIF. " IF <fs_serv_inst_before>-hec_asi_operating_sys_guid IS INITIAL AND...
"-----------------------------------
" Update App server instance GUID
"-----------------------------------
IF <fs_serv_inst_before>-hec_sol_tier_stack_si_guid IS INITIAL AND
lr_app_serv_inst->hec_sol_tier_stack_si_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_default_app_server_inst = abap_false.
TRY.
DATA(ls_server_inst_no) = lt_app_serv_inst_no[ hec_sol_tier_stack_guid = lr_app_serv_inst->hec_sol_tier_stack_guid
hec_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid ].
DATA(ls_cluster_type) = lt_cluster_type[ hec_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid
hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-none ].
lr_app_serv_inst->* = CORRESPONDING #( BASE ( lr_app_serv_inst->* ) ls_server_inst_no EXCEPT hec_srv_inst_rel_value
hec_srv_inst_rel_descr ).
lr_app_serv_inst->* = CORRESPONDING #( BASE ( lr_app_serv_inst->* ) ls_cluster_type ).
lr_app_serv_inst->hec_backup_relev_value = ls_server_inst_no-hec_backup_relevance.
lr_app_serv_inst->hec_tree_descr = ls_server_inst_no-hec_sol_tier_asi_descr.
lv_data_changed = abap_true.
" Set Value List Quantity - App Server Instance
lr_app_serv_inst->hec_sol_tier_stack_si_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_server_instance(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_sol_tier_stack_guid = lr_app_serv_inst->hec_sol_tier_stack_guid
iv_srv_inst_rel_value = lr_app_serv_inst->hec_srv_inst_rel_value
iv_solution_guid = lr_app_serv_inst->hec_solution_guid
iv_is_app_server = abap_true ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
" Set Value List Quantity - Cluster Type
lr_app_serv_inst->hec_sol_apsi_clusttyp_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_app_cluster_type(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
" Same app server exist, then operating system
" has to be set same as the existing app server
" is set
DATA(lt_filter) = VALUE /hec1/t_filter_app_serv_inst( ( hec_node_solution = lr_app_serv_inst->hec_node_solution
hec_node_tier = lr_app_serv_inst->hec_node_tier ) ).
DATA(lt_filter_app_serv_inst) = FILTER #( lt_app_serv_inst_pertier IN lt_filter WHERE hec_node_solution = hec_node_solution AND
hec_node_tier = hec_node_tier ).
" Delete current app server instacne
DELETE lt_filter_app_serv_inst
WHERE hec_node_app_serv_inst = lr_app_serv_inst->hec_node_app_serv_inst.
ASSIGN lt_filter_app_serv_inst[ hec_sol_tier_stack_guid = lr_app_serv_inst->hec_sol_tier_stack_guid
hec_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid ] TO FIELD-SYMBOL(<fs_app_server_inst>). "#EC CI_SORTSEQ
IF <fs_app_server_inst> IS ASSIGNED.
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid = <fs_app_server_inst>-hec_sol_apsi_oper_sys_guid.
lr_app_serv_inst->hec_operating_sys_guid = <fs_app_server_inst>-hec_operating_sys_guid.
lr_app_serv_inst->hec_operating_sys_value = <fs_app_server_inst>-hec_operating_sys_value.
lr_app_serv_inst->hec_operating_sys_descr = <fs_app_server_inst>-hec_operating_sys_descr.
lr_app_serv_inst->hec_os_support_stat_value = <fs_app_server_inst>-hec_os_support_stat_value.
lr_app_serv_inst->hec_os_support_stat_descr = <fs_app_server_inst>-hec_os_support_stat_descr.
ENDIF.
IF lr_app_serv_inst->hec_sol_apsi_oper_sys_guid IS INITIAL.
" Is only one operating system available, it
" can be set directly
DATA(lt_operating_sys) = VALUE /hec1/t_apm_app_operating_sys( FOR wa IN lt_app_operating_sys
WHERE ( hec_sol_tier_stack_si_guid = ls_server_inst_no-hec_sol_tier_stack_value )
( CORRESPONDING #( wa ) ) ).
IF lines( lt_operating_sys ) = 1.
DATA(ls_oper_sys) = lt_operating_sys[ 1 ].
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid = ls_oper_sys-hec_sol_apsi_oper_sys_guid.
lr_app_serv_inst->hec_operating_sys_guid = ls_oper_sys-hec_operating_sys_guid.
lr_app_serv_inst->hec_operating_sys_value = ls_oper_sys-hec_operating_sys_value.
lr_app_serv_inst->hec_operating_sys_descr = ls_oper_sys-hec_operating_sys_descr.
lr_app_serv_inst->hec_os_support_stat_value = ls_oper_sys-hec_os_support_stat_value.
lr_app_serv_inst->hec_os_support_stat_descr = ls_oper_sys-hec_os_support_stat_descr.
ENDIF. " IF lines( lt_app_oper_sys ) = 1.
ENDIF. " IF ls_app_server_inst-hec_asi_operating_sys_guid IS INITIAL.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF ls_app_server_inst_old-hec_app_srv_guid IS INITIAL AND
"-----------------------------------
" Phase has changed -
" update phase and inherit phase assignment
"-----------------------------------
IF lr_app_serv_inst->hec_phase_guid NE <fs_serv_inst_before>-hec_phase_guid.
APPEND VALUE #( hec_node_key = is_ctx-node_key
hec_bopf_key = lr_app_serv_inst->key
hec_phase_guid_new = lr_app_serv_inst->hec_phase_guid
hec_phase_guid_old = <fs_serv_inst_before>-hec_phase_guid ) TO lt_act_param_phasing.
lr_app_serv_inst->hec_phase_changed = abap_true.
lv_data_changed = abap_true.
ENDIF. "phasing changed
ENDIF." IF <fs_serv_inst_before> IS ASSIGNED.
"-----------------------------------
" Fill action table for
" create App node
"-----------------------------------
IF lr_app_serv_inst->hec_sol_tier_stack_si_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_clusttyp_guid IS NOT INITIAL AND
NOT line_exists( lt_app_node[ parent_key = lr_app_serv_inst->key ] ).
INSERT VALUE #( key = lr_app_serv_inst->key
parent_key = lr_app_serv_inst->parent_key
hec_app_cluster_type_value = SWITCH #( lr_app_serv_inst->hec_app_cluster_type_value
WHEN /hec1/if_config_constants=>gc_app_clust_node-none
THEN /hec1/if_config_constants=>gc_app_clust_node-none
WHEN /hec1/if_config_constants=>gc_app_clust_node-ha
THEN /hec1/if_config_constants=>gc_app_clust_node-ha
ELSE /hec1/if_config_constants=>gc_app_clust_node-none )
hec_default_app_server = SWITCH #( lr_app_serv_inst->hec_default_app_server_inst
WHEN abap_true
THEN abap_true
ELSE abap_false ) ) INTO TABLE lt_act_param.
ENDIF.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_serv_inst->hec_sol_tier_stack_si_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_clusttyp_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_serv_inst->hec_instance_status.
lr_app_serv_inst->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify App server instance
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_serv_inst->key
is_data = lr_app_serv_inst ).
ENDIF.
CLEAR: lv_inst_status,
lv_data_changed,
ls_server_inst_no,
ls_cluster_type,
ls_oper_sys,
ls_operating_sys,
lt_filter,
lt_filter_app_serv_inst,
lt_operating_sys.
UNASSIGN <fs_serv_inst_before>.
ENDLOOP.
"-----------------------------------
" Update Phasing
"-----------------------------------
IF lt_act_param_phasing IS NOT INITIAL.
me->mr_act_param_phasing = NEW /hec1/t_act_phase_inherit( lt_act_param_phasing ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = it_key
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-inherit_phase_assignment )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_phasing ).
ENDIF.
"-----------------------------------
" Set create App server node
" action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_node( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
" ***************************************************************************
" " Update mode after tier update
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_instance-update_after_tier.
LOOP AT lt_app_serv_inst REFERENCE INTO lr_app_serv_inst.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_tier[ key = lr_app_serv_inst->parent_key ] TO <fs_tier>.
IF <fs_tier> IS ASSIGNED.
IF <fs_tier>-hec_tier_descr IS NOT INITIAL AND
<fs_tier>-hec_tier_type_value IS NOT INITIAL AND
<fs_tier>-hec_tier_impl_type_value IS NOT INITIAL.
lv_release = abap_true.
ENDIF.
ENDIF.
IF lv_release <> lr_app_serv_inst->hec_row_selectable.
lr_app_serv_inst->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify App server instance
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_serv_inst->key
is_data = lr_app_serv_inst ).
ENDIF.
UNASSIGN <fs_tier>.
CLEAR: lv_release,
lv_data_changed.
ENDLOOP.
ENDCASE.
CATCH /bobf/cx_frw. " Exception class
ENDTRY.
ENDMETHOD.
METHOD determine_app_server_perf_cat.
DATA: lt_app_serv_perf_cat TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_serv_perf_cat_before TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_serv_perf_cat_pernode TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_node TYPE /hec1/t_data_app_node_ct,
lt_app_serv_inst TYPE /hec1/t_data_app_serv_inst_ct,
lt_app_server TYPE /hec1/t_data_app_serv_ct,
lt_app_storage_qty TYPE /hec1/t_data_app_storageqty_ct,
lt_act_param TYPE /hec1/t_act_create_app_qty,
lt_act_param_server_key TYPE /bobf/t_frw_key,
lt_act_param_server TYPE /hec1/t_act_update_app_server,
lt_act_param_node TYPE /hec1/t_act_update_app_node,
lt_act_param_succ TYPE /hec1/t_act_set_success_predec,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_act_param_phasing TYPE TABLE OF /hec1/s_act_phase_inherit,
lt_range TYPE RANGE OF string.
CLEAR: eo_message,
et_failed_key.
"-----------------------------------
" Get data
"-----------------------------------
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_serv_perf_cat ).
" Get App node (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-to_parent
IMPORTING et_data = lt_app_node ).
" Get landscape( APM GUID), delivery unit and data center
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING ev_root_key = DATA(lv_root_key)
er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
TRY.
CASE is_ctx-det_key.
" ***************************************************************************
" Create mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_perform_cat-create.
" Get for each App master node
" the App server performance category
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_node
it_key = VALUE #( FOR wa_node IN lt_app_node
( key = wa_node-key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_node-app_server_perform_cat
IMPORTING et_data = lt_app_serv_perf_cat_pernode ).
LOOP AT lt_app_serv_perf_cat
REFERENCE INTO DATA(lr_app_serv_perf_cat)
WHERE hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master.
"-----------------------------------
" Set Value List Quantity
"-----------------------------------
lr_app_serv_perf_cat->hec_srv_perf_cat_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_server_perf_cat(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_inf_provider_guid = lr_dlvy_unit->hec_inf_provider_guid
iv_sec_datacenter_guid = VALUE #( lt_datacenter[ hec_node_datacenter = lr_app_serv_perf_cat->hec_tier_datacenter_guid ]-hec_sec_datacenter_guid OPTIONAL )
iv_is_app_server = abap_true ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
lr_app_serv_perf_cat->hec_delete_visible = abap_true.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
DATA(lv_inst_status) = COND /hec1/config_instance_status( WHEN lr_app_serv_perf_cat->hec_srv_perf_cat_guid IS NOT INITIAL AND
lr_app_serv_perf_cat->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_serv_perf_cat->hec_instance_status.
lr_app_serv_perf_cat->hec_instance_status = lv_inst_status.
DATA(lv_data_changed) = abap_true.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_node[ key = lr_app_serv_perf_cat->parent_key ] TO FIELD-SYMBOL(<fs_app_node>).
IF <fs_app_node> IS ASSIGNED.
IF <fs_app_node>-hec_app_srv_perf_cat_qty IS NOT INITIAL AND
<fs_app_node>-hec_row_selectable = abap_true.
DATA(lv_release) = abap_true.
ENDIF.
ENDIF.
IF lv_release <> lr_app_serv_perf_cat->hec_row_selectable.
lr_app_serv_perf_cat->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Fill action table for create
" App server storage amount
"-----------------------------------
IF NOT lr_app_serv_perf_cat->hec_server_required = abap_false.
INSERT VALUE #( key = lr_app_serv_perf_cat->key
parent_key = lr_app_serv_perf_cat->parent_key
hec_storage_amount_qty = lr_app_serv_perf_cat->hec_storage_qty ) INTO TABLE lt_act_param.
ENDIF.
"-----------------------------------
" Fill action table for setting
" App server performance category
" successor/predecessor
"-----------------------------------
DATA(lv_node_count) = REDUCE i( INIT x = 0
FOR <l> IN lt_app_serv_perf_cat_pernode WHERE ( parent_key = lr_app_serv_perf_cat->parent_key )
NEXT x = x + 1 ).
IF NOT line_exists( lt_act_param_succ[ key = lr_app_serv_perf_cat->parent_key ] ) AND lv_node_count > 1.
TRY.
INSERT VALUE #( key = lr_app_serv_perf_cat->parent_key
parent_key = lt_app_node[ key = lr_app_serv_perf_cat->parent_key ]-parent_key
hec_no_children_node = lv_node_count ) INTO TABLE lt_act_param_succ.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
"-----------------------------------
" Modify App server storage amount
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_serv_perf_cat->key
is_data = lr_app_serv_perf_cat ).
ENDIF.
UNASSIGN <fs_app_node>.
CLEAR: lv_inst_status,
lv_data_changed,
lv_release,
lv_node_count.
ENDLOOP. " LOOP AT lt_app_serv_perf_cat REFERENCE INTO lr_app_serv_perf_cat.
"-----------------------------------
" Set successor/predecessor action
" to GENERAL
"-----------------------------------
IF lt_act_param_succ IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_set_success_predec( lt_act_param_succ ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_node
assoc_key = /hec1/if_configuration_c=>sc_association-app_node-app_server_perform_cat )
it_key = VALUE #( FOR wa_act_succ IN lt_act_param_succ
( key = wa_act_succ-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-set_success_predec )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
"-----------------------------------
" Set create App server storage
" amount and create App server
" action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_qty( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_qty )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_server )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation ).
ENDIF.
" ***************************************************************************
" Update mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_perform_cat-update.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_before_image = abap_true
IMPORTING et_data = lt_app_serv_perf_cat_before ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( ( key = lv_root_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase ).
" Get App Node
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-to_parent
IMPORTING et_target_key = DATA(lt_app_node_key)
et_data = lt_app_node ).
" Get App server instance
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_node
it_key = lt_app_node_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_node-to_parent
IMPORTING et_data = lt_app_serv_inst ).
" Get App Server
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-app_server
IMPORTING et_data = lt_app_server
et_target_key = DATA(lt_app_server_key) ).
" Get App Storage Qty
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-app_storage_amount
IMPORTING et_data = lt_app_storage_qty ).
"-----------------------------------
" Get server performance category
"-----------------------------------
DATA(lt_range_table) = VALUE /hec1/t_selection_range( FOR wa_spc IN lt_app_serv_perf_cat
( option = /hec1/if_config_constants=>gc_range_option-eq
sign = /hec1/if_config_constants=>gc_range_sign-i
low = wa_spc-hec_srv_perf_cat_guid ) ).
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_appservperfcatbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_srv_perf_cat_guid IN @lt_range_table
INTO TABLE @DATA(lt_serv_perf_cat).
"-----------------------------------
" Get server
"-----------------------------------
CLEAR lt_range_table.
lt_range_table = VALUE /hec1/t_selection_range( FOR wa IN lt_app_serv_perf_cat
( option = /hec1/if_config_constants=>gc_range_option-eq
sign = /hec1/if_config_constants=>gc_range_sign-i
low = wa-hec_srv_perf_cat_guid ) ).
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_serverbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_srv_perf_cat_guid IN @lt_range_table
INTO TABLE @DATA(lt_server_data).
LOOP AT lt_app_serv_perf_cat REFERENCE INTO lr_app_serv_perf_cat.
ASSIGN lt_app_serv_perf_cat_before[ key = lr_app_serv_perf_cat->key ] TO FIELD-SYMBOL(<fs_app_serv_perf_cat_before>).
IF <fs_app_serv_perf_cat_before> IS ASSIGNED.
"-----------------------------------
" App server performance category
" has changed
"-----------------------------------
IF lr_app_serv_perf_cat->hec_srv_perf_cat_guid IS NOT INITIAL AND
lr_app_serv_perf_cat->hec_srv_perf_cat_guid <> <fs_app_serv_perf_cat_before>-hec_srv_perf_cat_guid.
" Set server RAM class and CPU
TRY.
DATA(ls_serv_perf_cat) = lt_serv_perf_cat[ hec_srv_perf_cat_guid = lr_app_serv_perf_cat->hec_srv_perf_cat_guid ].
lr_app_serv_perf_cat->hec_srv_perf_cat_descr = ls_serv_perf_cat-hec_srv_perf_cat_descr.
lr_app_serv_perf_cat->hec_srv_ram_class = ls_serv_perf_cat-hec_srv_ram_class.
lr_app_serv_perf_cat->hec_srv_cpu_class = ls_serv_perf_cat-hec_srv_cpu_class.
lr_app_serv_perf_cat->hec_tree_descr = ls_serv_perf_cat-hec_srv_perf_cat_descr. "#EC CI_FLDEXT_OK[2215424]
lv_data_changed = abap_true.
" Set Value List Quantity
lr_app_serv_perf_cat->hec_srv_perf_cat_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_server_perf_cat(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_inf_provider_guid = lr_dlvy_unit->hec_inf_provider_guid
iv_sec_datacenter_guid = VALUE #( lt_datacenter[ hec_node_datacenter = lr_app_serv_perf_cat->hec_tier_datacenter_guid ]-hec_sec_datacenter_guid OPTIONAL )
iv_is_app_server = abap_true ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
IF lr_app_serv_perf_cat->hec_effort_required = abap_true.
" Get effort time based legoblock GUID
SELECT hec_ram_condition_op,
hec_ram_condition,
hec_timebased_effort_bb_guid
FROM /hec1/i_appservnodetbbbbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_apst_clustty_clustnty_guid = @lr_app_serv_perf_cat->hec_apst_clustty_clustnty_guid AND
hec_tier_cat_value = @lr_app_serv_perf_cat->hec_tier_cat_value
INTO TABLE @DATA(lt_timebased_bb).
LOOP AT lt_timebased_bb ASSIGNING FIELD-SYMBOL(<fs_timebased_bb>).
DATA(lv_option) = SWITCH ddoption( <fs_timebased_bb>-hec_ram_condition_op
WHEN '<' THEN 'LT'
WHEN '>' THEN 'GT'
WHEN '=' THEN 'EQ'
WHEN '<=' THEN 'LE'
WHEN '>=' THEN 'GE' ).
INSERT VALUE #( sign = 'I'
option = lv_option
low = <fs_timebased_bb>-hec_ram_condition ) INTO TABLE lt_range.
IF lr_app_serv_perf_cat->hec_srv_ram_class IN lt_range.
DATA(lv_effort_bb_guid) = <fs_timebased_bb>-hec_timebased_effort_bb_guid.
EXIT. " >>>>>>>
ENDIF.
ENDLOOP.
IF lv_effort_bb_guid IS NOT INITIAL.
" Get the pricing
DATA(ls_price) = /hec1/cl_config_helper=>do_price_validation( iv_node_key = is_ctx-node_key
it_key = VALUE #( ( key = lr_app_serv_perf_cat->key ) )
io_read = io_read
iv_effort_bb_guid = lv_effort_bb_guid
iv_tier_is_dr_node = lr_app_serv_perf_cat->hec_tier_is_dr_node
iv_dr_operating_mode = lr_app_serv_perf_cat->hec_dr_oper_mode_value ).
lr_app_serv_perf_cat->price = CORRESPONDING #( ls_price ).
ENDIF.
ENDIF. " IF lr_app_serv_perf_cat->hec_effort_required = abap_true.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
TRY.
DATA(lv_datacenter_guid) = lt_datacenter[ hec_node_datacenter = lr_app_serv_perf_cat->hec_tier_datacenter_guid ]-hec_datacenter_guid.
DATA(lt_server) = /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_server( iv_apm_guid = lr_landscape->hec_apm_guid
iv_infra_provider_guid = lr_dlvy_unit->hec_inf_provider_guid
iv_sec_datacenter_guid = lv_datacenter_guid
iv_srv_perf_cat_guid = lr_app_serv_perf_cat->hec_srv_perf_cat_guid ).
"-----------------------------------
" Fill action table for Update
" App server
"-----------------------------------
IF lines( lt_server ) = 1.
INSERT VALUE #( key = lt_app_server[ parent_key = lr_app_serv_perf_cat->key ]-key
parent_key = lr_app_serv_perf_cat->key
hec_ip_server_guid = lt_server[ 1 ]-value
do_update_app_server = abap_true ) INTO TABLE lt_act_param_server.
ENDIF.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
CLEAR: lv_datacenter_guid,
lt_server.
ENDIF. " IF lr_app_serv_perf_cat->hec_srv_perf_cat_guid IS NOT INITIAL AND...
"-----------------------------------
" App server storage is added
"-----------------------------------
IF lr_app_serv_perf_cat->hec_storage_qty > <fs_app_serv_perf_cat_before>-hec_storage_qty.
"-----------------------------------
" Fill action table for create
" App server storage amount
"-----------------------------------
INSERT VALUE #( key = lr_app_serv_perf_cat->key
parent_key = lr_app_serv_perf_cat->parent_key
hec_storage_amount_qty = lr_app_serv_perf_cat->hec_storage_qty - <fs_app_serv_perf_cat_before>-hec_storage_qty ) INTO TABLE lt_act_param.
"-----------------------------------
" Fill action table for create
" App server storage
"-----------------------------------
TRY.
" App Storage is added without any parameters necessary
INSERT CORRESPONDING #( lt_app_server[ parent_key = lr_app_serv_perf_cat->key ] ) INTO TABLE lt_act_param_server_key.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
" Success message
/hec1/cl_config_helper=>set_message( EXPORTING iv_textid = /hec1/cx_bopf_config=>new_storage_added
iv_severity = /bobf/cm_frw=>co_severity_success
iv_attr1 = CONV #( lr_app_serv_perf_cat->hec_storage_qty -
<fs_app_serv_perf_cat_before>-hec_storage_qty )
CHANGING co_message = eo_message ).
" Set flag for deleting subnodes of standby node
IF lr_app_serv_perf_cat->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_serv_perf_cat->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_serv_perf_cat->hec_app_node_default = abap_true.
lv_data_changed = abap_true.
DATA(lv_delete_ha_subnode) = abap_true.
ENDIF.
ELSEIF lr_app_serv_perf_cat->hec_storage_qty < <fs_app_serv_perf_cat_before>-hec_storage_qty
AND lr_app_serv_perf_cat->hec_storage_qty < lines( VALUE /hec1/t_data_app_storageqty_ct( FOR app_storage_qty IN lt_app_storage_qty
WHERE ( parent_key = lr_app_serv_perf_cat->key )
( app_storage_qty ) ) ).
DATA(lv_attr_name) = /hec1/if_configuration_c=>sc_node_attribute-app_server_perform_cat-hec_storage_qty.
" Error message
/hec1/cl_config_helper=>set_message( EXPORTING iv_textid = /hec1/cx_bopf_config=>object_no_not_higher
is_origin_location = VALUE #( node_key = is_ctx-node_key
key = lr_app_serv_perf_cat->key
attributes = VALUE #( ( lv_attr_name ) ) )
CHANGING co_message = eo_message ).
" Set node number to value before update
lr_app_serv_perf_cat->hec_storage_qty = <fs_app_serv_perf_cat_before>-hec_storage_qty.
lv_data_changed = abap_true.
ENDIF. " IF ls_db_server_perf_cat-hec_dsp_storage_qty > ls_db_server_perf_cat_old-hec_dsp_storage_qty.
"-----------------------------------
" Phase has changed -
" update phase and inherit phase assignment
"-----------------------------------
IF lr_app_serv_perf_cat->hec_phase_guid NE <fs_app_serv_perf_cat_before>-hec_phase_guid.
" Only for default master node
IF lr_app_serv_perf_cat->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_serv_perf_cat->hec_app_node_default = abap_true.
APPEND VALUE #( hec_node_key = is_ctx-node_key
hec_bopf_key = lr_app_serv_perf_cat->key
hec_phase_guid_new = lr_app_serv_perf_cat->hec_phase_guid
hec_phase_guid_old = <fs_app_serv_perf_cat_before>-hec_phase_guid ) TO lt_act_param_phasing.
ENDIF.
lr_app_serv_perf_cat->hec_phase_changed = abap_true.
lv_data_changed = abap_true.
" Set flag for deleting subnodes of standby node
IF lr_app_serv_perf_cat->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_serv_perf_cat->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_serv_perf_cat->hec_app_node_default = abap_true.
lv_delete_ha_subnode = abap_true.
ENDIF.
ENDIF. "phasing changed
ENDIF. "if <fs_app_serv_perf_cat> is assigned.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_serv_perf_cat->hec_srv_perf_cat_guid IS NOT INITIAL AND
lr_app_serv_perf_cat->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_serv_perf_cat->hec_instance_status.
lr_app_serv_perf_cat->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Fill action table for delete
" App server standby node subnodes
" or relase standby node
"-----------------------------------
IF lr_app_serv_perf_cat->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_serv_perf_cat->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_serv_perf_cat->hec_app_node_default = abap_true AND
lv_data_changed = abap_true.
IF NOT line_exists( lt_act_param_node[ key = lr_app_serv_perf_cat->parent_key ] ).
TRY.
INSERT VALUE #( key = lr_app_serv_perf_cat->parent_key
parent_key = lt_app_node[ key = lr_app_serv_perf_cat->parent_key ]-parent_key
do_release_ha_node = COND #( WHEN lr_app_serv_perf_cat->hec_instance_status = /hec1/if_config_constants=>gc_instance_status-complete AND
<fs_app_serv_perf_cat_before>-hec_instance_status = /hec1/if_config_constants=>gc_instance_status-incomplete
THEN abap_true
ELSE abap_false )
do_delete_ha_subnode = COND #( WHEN lr_app_serv_perf_cat->hec_instance_status = /hec1/if_config_constants=>gc_instance_status-incomplete OR
lv_delete_ha_subnode = abap_true
THEN abap_true
ELSE abap_false ) ) INTO TABLE lt_act_param_node.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
ENDIF. " IF lr_app_serv_perf_cat->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha
"-----------------------------------
" Modify App server performance
" category
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_serv_perf_cat->key
is_data = lr_app_serv_perf_cat ).
ENDIF.
CLEAR: lv_inst_status,
lv_data_changed,
lv_delete_ha_subnode,
lv_attr_name,
lv_option,
lv_effort_bb_guid,
ls_serv_perf_cat,
ls_price,
lt_range,
lt_timebased_bb.
UNASSIGN <fs_app_serv_perf_cat_before>.
ENDLOOP.
"-----------------------------------
" Set Create App Server amount
" and Storage action to
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_qty( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_qty )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_server )
it_key = VALUE #( FOR wa_act_serv IN lt_act_param_server_key
( key = wa_act_serv-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_storage )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation ).
ENDIF. "lt_act_param is not initial
"-----------------------------------
" Set update App Server action to
" general
"-----------------------------------
IF lt_act_param_server IS NOT INITIAL.
CLEAR me->mr_act_param_server.
me->mr_act_param_server = NEW /hec1/t_act_update_app_server( lt_act_param_server ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act_server IN lt_act_param_server
( key = wa_act_server-parent_key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_server )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_server ).
ENDIF.
"-----------------------------------
" Update Phasing
"-----------------------------------
IF lt_act_param_phasing IS NOT INITIAL.
me->mr_act_param_phasing = NEW /hec1/t_act_phase_inherit( lt_act_param_phasing ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = it_key
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-inherit_phase_assignment )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_phasing ).
ENDIF.
"-----------------------------------
" Set update App node action to
" general
"-----------------------------------
IF lt_act_param_node IS NOT INITIAL.
CLEAR me->mr_act_param_app_node.
me->mr_act_param_app_node = NEW /hec1/t_act_update_app_node( lt_act_param_node ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_node )
it_key = VALUE #( FOR wa_act_node IN lt_act_param_node
( key = wa_act_node-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_app_node ).
ENDIF.
" ***************************************************************************
" Update mode after app node update
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_perform_cat-update_after_node.
LOOP AT lt_app_serv_perf_cat REFERENCE INTO lr_app_serv_perf_cat.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_node[ key = lr_app_serv_perf_cat->parent_key ] TO <fs_app_node>.
IF <fs_app_node> IS ASSIGNED.
IF <fs_app_node>-hec_app_srv_perf_cat_qty > 0 AND
<fs_app_node>-hec_row_selectable = abap_true.
lv_release = abap_true.
ENDIF.
ENDIF.
IF lv_release <> lr_app_serv_perf_cat->hec_row_selectable.
lr_app_serv_perf_cat->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Update App server cluster type
"-----------------------------------
IF lr_app_serv_perf_cat->hec_app_cluster_type_value <> <fs_app_node>-hec_app_cluster_type_value.
lr_app_serv_perf_cat->hec_app_cluster_type_value = <fs_app_node>-hec_app_cluster_type_value.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify App server performance
" category
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_serv_perf_cat->key
is_data = lr_app_serv_perf_cat ).
ENDIF.
UNASSIGN <fs_app_node>.
CLEAR: lv_release,
lv_data_changed.
ENDLOOP. " LOOP AT lt_app_serv_perf_cat
ENDCASE.
CATCH /bobf/cx_frw. " Exception class
ENDTRY.
ENDMETHOD.
METHOD determine_app_storage.
DATA: lt_app_server TYPE /hec1/t_data_app_serv_ct,
lt_app_storage TYPE /hec1/t_data_app_storage_ct,
lt_app_storage_perserver TYPE /hec1/t_data_app_storage_ct,
lt_app_storage_before TYPE /hec1/t_data_app_storage_ct,
lt_app_storage_succ TYPE /hec1/t_data_app_storage_ct,
lt_app_serv_perf_cat TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_storage_qty TYPE /hec1/t_data_app_storageqty_ct,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_app_backup TYPE /hec1/t_data_app_backup_ct,
lt_act_param TYPE /hec1/t_act_create_app_backup,
lt_act_param_storage TYPE /bobf/t_frw_key,
lt_act_param_phasing TYPE TABLE OF /hec1/s_act_phase_inherit.
CLEAR: eo_message,
et_failed_key.
"-----------------------------------
" Get data
"-----------------------------------
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_storage ).
" Get App server (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_storage-to_parent
IMPORTING et_data = lt_app_server ).
" Get landscape( APM GUID), delivery unit and data center
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING ev_root_key = DATA(lv_root_key)
er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
TRY.
CASE is_ctx-det_key.
" ***************************************************************************
" Create mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage-create.
" Get for each App server the App storage
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server
it_key = VALUE #( FOR wa_serv IN lt_app_server
( key = wa_serv-key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server-app_storage
IMPORTING et_data = lt_app_storage_perserver ).
LOOP AT lt_app_storage
REFERENCE INTO DATA(lr_app_storage)
WHERE hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master.
"-----------------------------------
" Set Value List Quantity
"-----------------------------------
lr_app_storage->hec_ip_storage_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_storage(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_infra_provider_guid = lr_dlvy_unit->hec_inf_provider_guid
iv_sec_datacenter_guid = VALUE #( lt_datacenter[ hec_node_datacenter = lr_app_storage->hec_tier_datacenter_guid ]-hec_sec_datacenter_guid OPTIONAL ) ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
lr_app_storage->hec_delete_visible = abap_false.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
DATA(lv_inst_status) = COND /hec1/config_instance_status( WHEN lr_app_storage->hec_ip_storage_guid IS NOT INITIAL AND
lr_app_storage->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_storage->hec_instance_status.
lr_app_storage->hec_instance_status = lv_inst_status.
DATA(lv_data_changed) = abap_true.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_server[ key = lr_app_storage->parent_key ] TO FIELD-SYMBOL(<fs_app_server>).
IF <fs_app_server> IS ASSIGNED.
IF <fs_app_server>-hec_ip_server_guid IS NOT INITIAL AND
<fs_app_server>-hec_row_selectable = abap_true.
DATA(lv_release) = abap_true.
ENDIF.
ENDIF.
IF lv_release <> lr_app_storage->hec_row_selectable.
lr_app_storage->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Fill action table for create
" App server storage backup
"-----------------------------------
IF lr_app_storage->hec_backup_relev_value = '01'. " mandantory
INSERT VALUE #( key = lr_app_storage->key
parent_key = lr_app_storage->parent_key
hec_backup_qty = lr_app_storage->hec_backup_qty ) INTO TABLE lt_act_param.
ENDIF.
"-----------------------------------
" Fill action table for setting
" App server storage
" successor/predecessor
"-----------------------------------
DATA(lv_node_count) = REDUCE i( INIT x = 0
FOR <l> IN lt_app_storage_perserver WHERE ( parent_key = lr_app_storage->parent_key )
NEXT x = x + 1 ).
IF NOT line_exists( lt_act_param_storage[ key = lr_app_storage->key ] ) AND lv_node_count > 1.
TRY.
INSERT VALUE #( key = lr_app_storage->key ) INTO TABLE lt_act_param_storage.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
"-----------------------------------
" Modify App server storage
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_storage->key
is_data = lr_app_storage ).
ENDIF.
UNASSIGN <fs_app_server>.
CLEAR: lv_inst_status,
lv_data_changed,
lv_release,
lv_node_count.
ENDLOOP.
"-----------------------------------
" Set create App server storage
" backup action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_backup( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_backup )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
"-----------------------------------
" Set update App storage action
" to GENERAL
"-----------------------------------
IF lt_act_param_storage IS NOT INITIAL.
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_storage )
it_key = lt_act_param_storage
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_storage )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation ).
ENDIF.
" ***************************************************************************
" Update mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage-update.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_before_image = abap_true
IMPORTING et_data = lt_app_storage_before ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( ( key = lv_root_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase ).
" Get App server (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_storage-to_parent
IMPORTING et_data = lt_app_server ).
" Get Backup
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_storage-app_storage_backup
IMPORTING et_data = lt_app_backup ).
LOOP AT lt_app_storage REFERENCE INTO lr_app_storage.
ASSIGN lt_app_storage_before[ key = lr_app_storage->key ] TO FIELD-SYMBOL(<fs_app_storage_before>).
IF <fs_app_storage_before> IS ASSIGNED.
"-----------------------------------
" App storage IP GUID has changed
"-----------------------------------
IF lr_app_storage->hec_ip_storage_guid IS NOT INITIAL AND
lr_app_storage->hec_ip_storage_guid <> <fs_app_storage_before>-hec_ip_storage_guid.
" since this is the parent there can only be one entry
TRY.
DATA(ls_app_server) = lt_app_server[ key = lr_app_storage->parent_key ].
CATCH cx_sy_itab_line_not_found.
ENDTRY.
SELECT SINGLE *
FROM /hec1/i_storagelbbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_sec_datacenter_guid = @ls_app_server-hec_sec_datacenter_guid AND
hec_infra_provider_guid = @lr_dlvy_unit->hec_inf_provider_guid AND
hec_ip_storage_guid = @lr_app_storage->hec_ip_storage_guid
INTO @DATA(ls_storage).
SELECT SINGLE * FROM /hec1/c_cbp_lb "#EC CI_ALL_FIELDS_NEEDED
INTO @DATA(ls_pricing)
WHERE hec_price_lb = @ls_storage-hec_cb_pricing_lb_guid.
lr_app_storage->* = CORRESPONDING #( BASE ( lr_app_storage->* ) ls_pricing ).
lr_app_storage->hec_ip_storage_guid = ls_storage-hec_ip_storage_guid.
lr_app_storage->hec_storage_descr = ls_storage-hec_storage_descr.
lr_app_storage->hec_month_price_fee = lr_app_storage->hec_storage_quantity * lr_app_storage->hec_month_price_eur.
lr_app_storage->hec_tree_descr = ls_storage-hec_storage_descr. "#EC CI_FLDEXT_OK[2215424]
lv_data_changed = abap_true.
" Set Value List Quantity
lr_app_storage->hec_ip_storage_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_storage(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_infra_provider_guid = lr_dlvy_unit->hec_inf_provider_guid
iv_sec_datacenter_guid = VALUE #( lt_datacenter[ hec_node_datacenter = lr_app_storage->hec_tier_datacenter_guid ]-hec_sec_datacenter_guid OPTIONAL ) ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
ENDIF. "ip storage has changed
"-----------------------------------
" App storage amount has changed
"-----------------------------------
IF lr_app_storage->hec_storage_quantity IS NOT INITIAL AND
lr_app_storage->hec_storage_quantity <> <fs_app_storage_before>-hec_storage_quantity.
lr_app_storage->hec_month_price_fee = lr_app_storage->hec_storage_quantity * lr_app_storage->hec_month_price_eur.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" App storage backup quantity is added
"-----------------------------------
IF lr_app_storage->hec_backup_qty > <fs_app_storage_before>-hec_backup_qty.
INSERT VALUE #( key = lr_app_storage->key
parent_key = lr_app_storage->parent_key
hec_backup_qty = lr_app_storage->hec_backup_qty - <fs_app_storage_before>-hec_backup_qty ) INTO TABLE lt_act_param.
" Success message
/hec1/cl_config_helper=>set_message( EXPORTING iv_textid = /hec1/cx_bopf_config=>new_backup_added
iv_severity = /bobf/cm_frw=>co_severity_success
iv_attr1 = CONV #( lr_app_storage->hec_backup_qty -
<fs_app_storage_before>-hec_backup_qty )
CHANGING co_message = eo_message ).
ELSEIF lr_app_storage->hec_backup_qty < <fs_app_storage_before>-hec_backup_qty
AND lr_app_storage->hec_backup_qty < lines( VALUE /hec1/t_data_app_backup_ct( FOR app_backup IN lt_app_backup
WHERE ( parent_key = lr_app_storage->key )
( app_backup ) ) ).
DATA(lv_attr_name) = /hec1/if_configuration_c=>sc_node_attribute-solution-hec_tier_qty_nprod_level.
" Error message
/hec1/cl_config_helper=>set_message( EXPORTING iv_textid = /hec1/cx_bopf_config=>object_no_not_higher
is_origin_location = VALUE #( node_key = is_ctx-node_key
key = lr_app_storage->key
attributes = VALUE #( ( lv_attr_name ) ) )
CHANGING co_message = eo_message ).
" Set node number to value before update
lr_app_storage->hec_backup_qty = <fs_app_storage_before>-hec_backup_qty.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Phase has changed - update phase and inherit phase assignment
"-----------------------------------
IF lr_app_storage->hec_phase_guid NE <fs_app_storage_before>-hec_phase_guid.
" Only for default master node
IF lr_app_storage->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_storage->hec_app_node_default = abap_true.
APPEND VALUE #( hec_node_key = is_ctx-node_key
hec_bopf_key = lr_app_storage->key
hec_phase_guid_new = lr_app_storage->hec_phase_guid
hec_phase_guid_old = <fs_app_storage_before>-hec_phase_guid ) TO lt_act_param_phasing.
ENDIF.
lr_app_storage->hec_phase_changed = abap_true.
lv_data_changed = abap_true.
ENDIF. "phasing changed
ENDIF. "if <fs_app_storage_before> is assigned.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_storage->hec_ip_storage_guid IS NOT INITIAL AND
lr_app_storage->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_storage->hec_instance_status.
lr_app_storage->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_storage->key
is_data = lr_app_storage ).
ENDIF.
CLEAR: lv_inst_status,
lv_data_changed,
ls_app_server,
ls_pricing,
ls_storage.
UNASSIGN <fs_app_storage_before>.
ENDLOOP.
"-----------------------------------
" Set create App server storage
" backup action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_backup( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_backup )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
"-----------------------------------
" Update Phasing
"-----------------------------------
IF lt_act_param_phasing IS NOT INITIAL.
me->mr_act_param_phasing = NEW /hec1/t_act_phase_inherit( lt_act_param_phasing ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = it_key
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-inherit_phase_assignment )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_phasing ).
ENDIF.
" ***************************************************************************
" Update mode after server update
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage-update_after_server.
LOOP AT lt_app_storage REFERENCE INTO lr_app_storage.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_server[ key = lr_app_storage->parent_key ] TO <fs_app_server>.
IF <fs_app_server> IS ASSIGNED.
IF <fs_app_server>-hec_ip_server_guid IS NOT INITIAL AND
<fs_app_server>-hec_row_selectable = abap_true.
lv_release = abap_true.
ENDIF.
ENDIF.
IF lr_app_storage->hec_row_selectable <> lv_release.
lr_app_storage->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Update App server cluster type
"-----------------------------------
IF lr_app_storage->hec_app_cluster_type_value <> <fs_app_server>-hec_app_cluster_type_value.
lr_app_storage->hec_app_cluster_type_value = <fs_app_server>-hec_app_cluster_type_value.
lv_data_changed = abap_true.
ENDIF.
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_storage->key
is_data = lr_app_storage ).
ENDIF.
UNASSIGN <fs_app_server>.
CLEAR: lv_release,
lv_data_changed.
ENDLOOP. " LOOP AT lt_app_storage
ENDCASE.
CATCH /bobf/cx_frw. " Exception class
ENDTRY.
ENDMETHOD.
METHOD determine_app_storage_amount.
DATA: lt_app_storage_qty TYPE /hec1/t_data_app_storageqty_ct,
lt_app_storage_qty_per_spc TYPE /hec1/t_data_app_storageqty_ct,
lt_app_serv_perf_cat TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_node TYPE /hec1/t_data_app_node_ct,
lt_app_storage_qty_before TYPE /hec1/t_data_app_storageqty_ct,
lt_app_server TYPE /hec1/t_data_app_serv_ct,
lt_app_storage TYPE /hec1/t_data_app_storage_ct,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_app_storage_qty_succ TYPE /hec1/t_data_app_storageqty_ct,
lt_act_param_node TYPE /hec1/t_act_update_app_node,
lt_act_param_storage TYPE /bobf/t_frw_key,
lt_act_param_succ TYPE /hec1/t_act_set_success_predec,
lt_act_param_phasing TYPE TABLE OF /hec1/s_act_phase_inherit.
CLEAR: eo_message,
et_failed_key.
"-----------------------------------
" Get data
"-----------------------------------
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_storage_qty ).
" Get App server performance category (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_storage_amount-to_parent
IMPORTING et_data = lt_app_serv_perf_cat ).
" Get landscape( APM GUID), delivery unit and data center
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING ev_root_key = DATA(lv_root_key)
er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
TRY.
CASE is_ctx-det_key.
" ***************************************************************************
" Create mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_amount-create.
" Get for each App server performance category
" the App storage amounts
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
it_key = VALUE #( FOR wa_spc IN lt_app_serv_perf_cat
( key = wa_spc-key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-app_storage_amount
IMPORTING et_data = lt_app_storage_qty_per_spc ).
LOOP AT lt_app_storage_qty
REFERENCE INTO DATA(lr_app_storage_qty)
WHERE hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master.
lr_app_storage_qty->hec_delete_visible = abap_true.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
DATA(lv_inst_status) = COND /hec1/config_instance_status( WHEN lr_app_storage_qty->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_storage_qty->hec_instance_status.
lr_app_storage_qty->hec_instance_status = lv_inst_status.
DATA(lv_data_changed) = abap_true.
" If standby node exist
IF lr_app_storage_qty->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_storage_qty->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_storage_qty->hec_app_node_default = abap_true AND
lr_app_storage_qty->hec_instance_status = /hec1/if_config_constants=>gc_instance_status-complete.
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = VALUE #( ( key = lr_app_storage_qty->key ) )
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-app_storage_amount-to_def_master_node
IMPORTING et_target_key = DATA(lt_key) ).
IF NOT line_exists( lt_act_param_node[ key = lt_key[ 1 ]-key ] ).
TRY.
INSERT VALUE #( key = lt_key[ 1 ]-key
do_release_ha_node = abap_true ) INTO TABLE lt_act_param_node.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
ENDIF.
ENDIF. " IF lv_inst_status <> lr_app_storage_qty->hec_instance_status.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_serv_perf_cat[ key = lr_app_storage_qty->parent_key ] TO FIELD-SYMBOL(<fs_app_serv_perf_cat>).
IF <fs_app_serv_perf_cat> IS ASSIGNED.
IF <fs_app_serv_perf_cat>-hec_srv_perf_cat_guid IS NOT INITIAL AND
<fs_app_serv_perf_cat>-hec_row_selectable = abap_true.
DATA(lv_release) = abap_true.
ENDIF.
ENDIF.
IF lv_release <> lr_app_storage_qty->hec_row_selectable.
lr_app_storage_qty->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Fill action table for setting
" App server storage amount
" successor/predecessor
"-----------------------------------
DATA(lv_node_count) = REDUCE i( INIT x = 0
FOR <l> IN lt_app_storage_qty_per_spc WHERE ( parent_key = lr_app_storage_qty->parent_key )
NEXT x = x + 1 ).
IF NOT line_exists( lt_act_param_succ[ key = lr_app_storage_qty->parent_key ] ) AND lv_node_count > 1.
TRY.
INSERT VALUE #( key = lr_app_storage_qty->parent_key
parent_key = lt_app_serv_perf_cat[ key = lr_app_storage_qty->parent_key ]-parent_key
hec_no_children_node = lv_node_count ) INTO TABLE lt_act_param_succ.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
"-----------------------------------
" Modify App storage amount
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_storage_qty->key
is_data = lr_app_storage_qty ).
ENDIF.
UNASSIGN <fs_app_serv_perf_cat>.
CLEAR: lv_inst_status,
lv_data_changed,
lv_release,
lv_node_count.
ENDLOOP.
"-----------------------------------
" Set update App node action to
" general
"-----------------------------------
IF lt_act_param_node IS NOT INITIAL.
CLEAR me->mr_act_param_app_node.
me->mr_act_param_app_node = NEW /hec1/t_act_update_app_node( lt_act_param_node ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_node )
it_key = VALUE #( FOR wa_act_node IN lt_act_param_node
( key = wa_act_node-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_app_node ).
ENDIF.
"-----------------------------------
" Set successor/predecessor action
" to GENERAL
"-----------------------------------
IF lt_act_param_succ IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_set_success_predec( lt_act_param_succ ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
assoc_key = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-app_storage_amount )
it_key = VALUE #( FOR wa_act_succ IN lt_act_param_succ
( key = wa_act_succ-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-set_success_predec )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
" ***************************************************************************
" Update mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_amount-update.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_before_image = abap_true
IMPORTING et_data = lt_app_storage_qty_before ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( ( key = lv_root_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase ).
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_association = /hec1/if_configuration_c=>sc_association-app_storage_amount-to_parent
IMPORTING et_target_key = DATA(lt_app_serv_pc_key) ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
it_key = lt_app_serv_pc_key
iv_association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-app_server
IMPORTING et_target_key = DATA(lt_app_serv_key)
et_key_link = DATA(lt_perf_cat_to_serv_link) ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server
it_key = lt_app_serv_key
iv_association = /hec1/if_configuration_c=>sc_association-app_server-app_storage
IMPORTING et_target_key = DATA(lt_app_storage_key)
et_key_link = DATA(lt_serv_to_storage_link)
et_data = lt_app_storage ).
LOOP AT lt_app_storage_qty REFERENCE INTO lr_app_storage_qty.
ASSIGN lt_app_storage_qty_before[ key = lr_app_storage_qty->key ] TO FIELD-SYMBOL(<fs_app_storage_qty_before>).
IF <fs_app_storage_qty_before> IS ASSIGNED.
"-----------------------------------
" Physical, virtual or additional storage
" has changed
"-----------------------------------
IF lr_app_storage_qty->hec_asq_main_stor_qty_virtual <> <fs_app_storage_qty_before>-hec_asq_main_stor_qty_virtual OR
lr_app_storage_qty->hec_asq_additional_stor_qty <> <fs_app_storage_qty_before>-hec_asq_additional_stor_qty OR
lr_app_storage_qty->hec_successor_guid <> <fs_app_storage_qty_before>-hec_successor_guid OR
lr_app_storage_qty->hec_predecessor_guid <> <fs_app_storage_qty_before>-hec_predecessor_guid.
lr_app_storage_qty->hec_tree_descr = |{ lr_app_storage_qty->hec_asq_main_stor_qty_virtual } + { lr_app_storage_qty->hec_asq_additional_stor_qty } [GiB] |.
lv_data_changed = abap_true.
" Storage needs to be adjusted
LOOP AT lt_serv_to_storage_link REFERENCE INTO DATA(lr_serv_to_storage_link)
WHERE source_key = lt_perf_cat_to_serv_link[ source_key = lr_app_storage_qty->parent_key ]-target_key.
INSERT VALUE #( key = lr_serv_to_storage_link->target_key ) INTO TABLE lt_act_param_storage.
ENDLOOP.
" Set flag for deleting subnodes of standby node
IF lr_app_storage_qty->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_storage_qty->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_storage_qty->hec_app_node_default = abap_true.
DATA(lv_delete_ha_subnode) = abap_true.
ENDIF.
ENDIF. "storage changed
"-----------------------------------
" Phasing has changed
"-----------------------------------
IF lr_app_storage_qty->hec_phase_guid NE <fs_app_storage_qty_before>-hec_phase_guid.
APPEND VALUE #( hec_node_key = is_ctx-node_key
hec_bopf_key = lr_app_storage_qty->key
hec_phase_guid_new = lr_app_storage_qty->hec_phase_guid
hec_phase_guid_old = <fs_app_storage_qty_before>-hec_phase_guid ) TO lt_act_param_phasing.
lr_app_storage_qty->hec_phase_changed = abap_true.
lv_data_changed = abap_true.
" Set flag for deleting subnodes of standby node
IF lr_app_storage_qty->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_storage_qty->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_storage_qty->hec_app_node_default = abap_true.
lv_delete_ha_subnode = abap_true.
ENDIF.
ENDIF. "phasing changed
ENDIF. " if <fs_app_storage_qty_before> is assigned
" end of before <-> after comparison
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_storage_qty->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_storage_qty->hec_instance_status.
lr_app_storage_qty->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Fill action table for delete
" App server standby node subnodes
" or relase standby node
"-----------------------------------
IF lr_app_storage_qty->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_storage_qty->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_storage_qty->hec_app_node_default = abap_true AND
lv_data_changed = abap_true.
" Only one master node per storage amount can exist
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = VALUE #( ( key = lr_app_storage_qty->key ) )
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-app_storage_amount-to_def_master_node
IMPORTING et_target_key = lt_key ).
IF NOT line_exists( lt_act_param_node[ key = lt_key[ 1 ]-key ] ).
TRY.
INSERT VALUE #( key = lt_key[ 1 ]-key
parent_key = space
do_release_ha_node = COND #( WHEN lr_app_storage_qty->hec_instance_status = /hec1/if_config_constants=>gc_instance_status-complete AND
<fs_app_storage_qty_before>-hec_instance_status = /hec1/if_config_constants=>gc_instance_status-incomplete
THEN abap_true
ELSE abap_false )
do_delete_ha_subnode = COND #( WHEN lr_app_storage_qty->hec_instance_status = /hec1/if_config_constants=>gc_instance_status-incomplete OR
lv_delete_ha_subnode = abap_true
THEN abap_true
ELSE abap_false ) ) INTO TABLE lt_act_param_node.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
ENDIF. " IF lr_app_serv_perf_cat->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha
"-----------------------------------
" Modify
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_storage_qty->key
is_data = lr_app_storage_qty ).
ENDIF.
UNASSIGN <fs_app_storage_qty_before>.
CLEAR: lv_inst_status,
lv_data_changed,
lv_delete_ha_subnode,
lt_key.
ENDLOOP. "LOOP AT lt_app_storage_qty REFERENCE INTO lr_app_storage_qty.
"-----------------------------------
" Set update App Storage action to
" general
"-----------------------------------
IF lt_act_param_storage IS NOT INITIAL.
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_storage )
it_key = lt_act_param_storage
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_storage )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation ). .
ENDIF.
"-----------------------------------
" Update Phasing
"-----------------------------------
IF lt_act_param_phasing IS NOT INITIAL.
me->mr_act_param_phasing = NEW /hec1/t_act_phase_inherit( lt_act_param_phasing ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = it_key
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-inherit_phase_assignment )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_phasing ).
ENDIF.
"-----------------------------------
" Set update App node action to
" general
"-----------------------------------
IF lt_act_param_node IS NOT INITIAL.
CLEAR me->mr_act_param_app_node.
me->mr_act_param_app_node = NEW /hec1/t_act_update_app_node( lt_act_param_node ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_node )
it_key = VALUE #( FOR wa_act_node IN lt_act_param_node
( key = wa_act_node-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_app_node ).
ENDIF.
" ***************************************************************************
" Update mode after app server
" performance category update
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_amount-update_after_serv_perf_cat.
LOOP AT lt_app_storage_qty REFERENCE INTO lr_app_storage_qty.
ASSIGN lt_app_serv_perf_cat[ key = lr_app_storage_qty->parent_key ] TO <fs_app_serv_perf_cat>.
IF <fs_app_serv_perf_cat> IS ASSIGNED.
IF <fs_app_serv_perf_cat>-hec_srv_perf_cat_guid IS NOT INITIAL AND
<fs_app_serv_perf_cat>-hec_row_selectable = abap_true.
lv_release = abap_true.
ENDIF.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
* IF lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
IF lr_app_storage_qty->hec_row_selectable <> lv_release.
lr_app_storage_qty->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
* " Release instance for selection( standby node)
* IF lr_app_storage_qty->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-standby AND
* me->check_standby_node_is_released( iv_is_app_server = abap_true
* iv_check_rule = /hec1/if_bopf_constants=>gc_check_rule-storage_amount
* is_ctx = is_ctx
* it_key = it_key
* io_read = io_read
* io_modify = io_modify ) = abap_true.
*
* IF lr_app_node->hec_row_selectable <> lv_release.
* lr_app_node->hec_row_selectable = lv_release.
* lv_data_changed = abap_true.
* ENDIF.
* ENDIF.
" Update App server cluster type
IF lr_app_storage_qty->hec_app_cluster_type_value <> <fs_app_serv_perf_cat>-hec_app_cluster_type_value.
lr_app_storage_qty->hec_app_cluster_type_value = <fs_app_serv_perf_cat>-hec_app_cluster_type_value.
lv_data_changed = abap_true.
ENDIF.
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_storage_qty->key
is_data = lr_app_storage_qty ).
ENDIF.
UNASSIGN <fs_app_serv_perf_cat>.
CLEAR: lv_release,
lv_data_changed.
ENDLOOP. " LOOP AT lt_app_storage_qty
ENDCASE.
CATCH /bobf/cx_frw. " Exception class
ENDTRY.
ENDMETHOD.
METHOD determine_app_storage_backup.
DATA: lt_app_backup_before TYPE /hec1/t_data_app_backup_ct,
lt_app_backup TYPE /hec1/t_data_app_backup_ct,
lt_app_backup_perstorage TYPE /hec1/t_data_app_backup_ct,
lt_app_storage TYPE /hec1/t_data_app_storage_ct,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_act_param_succ TYPE /hec1/t_act_set_success_predec,
lt_act_param_phasing TYPE TABLE OF /hec1/s_act_phase_inherit.
CLEAR: eo_message,
et_failed_key.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_backup ).
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING ev_root_key = DATA(lv_root_key)
er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
TRY.
CASE is_ctx-det_key.
" ***************************************************************************
" Create mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_backup-create.
" Get App server storage (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_storage_backup-to_parent
IMPORTING et_data = lt_app_storage ).
" Get for each App storage the App backup
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_storage
it_key = VALUE #( FOR wa_node IN lt_app_storage
( key = wa_node-key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_storage-app_storage_backup
IMPORTING et_data = lt_app_backup_perstorage ).
LOOP AT lt_app_backup
REFERENCE INTO DATA(lr_app_backup)
WHERE hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master.
"-----------------------------------
" Set Value List Quantity
"-----------------------------------
lr_app_backup->hec_backup_class_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_backup(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_tier_category_value = lr_app_backup->hec_tier_cat_value
iv_is_app_backup = abap_true ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
lr_app_backup->hec_delete_visible = abap_true.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
DATA(lv_inst_status) = COND /hec1/config_instance_status( WHEN lr_app_backup->hec_backup_class_guid IS NOT INITIAL AND
lr_app_backup->hec_backup_size IS NOT INITIAL AND
lr_app_backup->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_backup->hec_instance_status.
lr_app_backup->hec_instance_status = lv_inst_status.
DATA(lv_data_changed) = abap_true.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_storage[ key = lr_app_backup->parent_key ] TO FIELD-SYMBOL(<fs_app_storage>).
IF <fs_app_storage> IS ASSIGNED.
IF <fs_app_storage>-hec_ip_storage_guid IS NOT INITIAL AND
<fs_app_storage>-hec_row_selectable = abap_true.
DATA(lv_release) = abap_true.
ENDIF.
UNASSIGN <fs_app_storage>.
ENDIF.
IF lv_release <> lr_app_backup->hec_row_selectable.
lr_app_backup->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Fill action table for setting
" App server storage backup
" successor/predecessor
"-----------------------------------
DATA(lv_node_count) = REDUCE i( INIT x = 0
FOR <l> IN lt_app_backup_perstorage WHERE ( parent_key = lr_app_backup->parent_key )
NEXT x = x + 1 ).
IF NOT line_exists( lt_act_param_succ[ key = lr_app_backup->parent_key ] ) AND lv_node_count > 1.
TRY.
INSERT VALUE #( key = lr_app_backup->parent_key
parent_key = lt_app_storage[ key = lr_app_backup->parent_key ]-parent_key
hec_no_children_node = lv_node_count ) INTO TABLE lt_act_param_succ.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
"-----------------------------------
" Modify
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_backup->key
is_data = lr_app_backup ).
ENDIF.
CLEAR: lv_inst_status,
lv_data_changed,
lv_release,
lv_node_count.
ENDLOOP.
"-----------------------------------
" Set successor/predecessor action
" to GENERAL
"-----------------------------------
IF lt_act_param_succ IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_set_success_predec( lt_act_param_succ ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_storage
assoc_key = /hec1/if_configuration_c=>sc_association-app_storage-app_storage_backup )
it_key = VALUE #( FOR wa_act_succ IN lt_act_param_succ
( key = wa_act_succ-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-set_success_predec )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
" ***************************************************************************
" Update mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_backup-update.
" Data before update
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_before_image = abap_true
IMPORTING et_data = lt_app_backup_before ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( ( key = lv_root_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase ).
" Get App Storage
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-app_storage_backup-to_parent
IMPORTING et_target_key = DATA(lt_app_storage_key)
et_data = lt_app_storage ).
LOOP AT lt_app_backup REFERENCE INTO lr_app_backup.
ASSIGN lt_app_backup_before[ key = lr_app_backup->key ] TO FIELD-SYMBOL(<fs_app_backup_before>).
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_backup->hec_backup_class_guid IS NOT INITIAL AND
lr_app_backup->hec_backup_size IS NOT INITIAL AND
lr_app_backup->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_backup->hec_instance_status.
lr_app_backup->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
IF <fs_app_backup_before> IS ASSIGNED.
"-----------------------------------
" Backup GUID has changed
"-----------------------------------
IF lr_app_backup->hec_backup_class_guid IS NOT INITIAL AND
lr_app_backup->hec_backup_class_guid <> <fs_app_backup_before>-hec_backup_class_guid.
" Get backup class and backup class pricing
/hec1/cl_config_action_helper=>/hec1/if_bopf_action_helper~get_backup_class_and_price( EXPORTING is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( ( key = lr_app_backup->key ) )
iv_app_server = abap_true
iv_tier_category_value = lr_app_backup->hec_tier_cat_value
iv_tier_datacenter_guid = lr_app_backup->hec_tier_datacenter_guid
iv_backup_class_guid = lr_app_backup->hec_backup_class_guid
io_read = io_read
IMPORTING es_backup_class = DATA(ls_backup_class)
es_backup_pricing = DATA(ls_backup_pricing) ).
lr_app_backup->price = CORRESPONDING #( ls_backup_pricing ).
lr_app_backup->hec_backup_class_guid = ls_backup_class-hec_backup_class_guid.
lr_app_backup->hec_backup_class_descr = ls_backup_class-hec_backup_class_descr.
lr_app_backup->hec_tree_descr = ls_backup_class-hec_backup_class_descr. "#EC CI_FLDEXT_OK[2215424]
lr_app_backup->hec_backup_month_price_fee = lr_app_backup->hec_backup_size * lr_app_backup->hec_month_price_eur.
lv_data_changed = abap_true.
" Set Value List Quantity
lr_app_backup->hec_backup_class_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_backup(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_tier_category_value = lr_app_backup->hec_tier_cat_value
iv_is_app_backup = abap_true ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
ENDIF. " IF <fs_app_backup_before>-hec_backup_class_guid IS NOT INITIAL AND...
"-----------------------------------
" Backup size has changed
"-----------------------------------
IF lr_app_backup->hec_backup_size IS NOT INITIAL AND
lr_app_backup->hec_backup_size <> <fs_app_backup_before>-hec_backup_size.
lr_app_backup->hec_backup_month_price_fee = lr_app_backup->hec_backup_size * lr_app_backup->hec_month_price_eur.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Phase has changed
"-----------------------------------
IF lr_app_backup->hec_phase_guid NE <fs_app_backup_before>-hec_phase_guid.
" Only for default master node
IF lr_app_backup->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_backup->hec_app_node_default = abap_true.
APPEND VALUE #( hec_node_key = is_ctx-node_key
hec_bopf_key = lr_app_backup->key
hec_phase_guid_new = lr_app_backup->hec_phase_guid
hec_phase_guid_old = <fs_app_backup_before>-hec_phase_guid ) TO lt_act_param_phasing.
ENDIF.
lr_app_backup->hec_phase_changed = abap_true.
lv_data_changed = abap_true.
ENDIF. "phasing changed
ENDIF. "IF <fs_app_backup_before> IS ASSIGNED.
"-----------------------------------
" Modify App backup
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_backup->key
is_data = lr_app_backup ).
ENDIF.
UNASSIGN <fs_app_backup_before>.
CLEAR: lv_inst_status,
lv_data_changed,
ls_backup_class,
ls_backup_pricing.
ENDLOOP.
"-----------------------------------
" Update Phasing
"-----------------------------------
IF lt_act_param_phasing IS NOT INITIAL.
me->mr_act_param_phasing = NEW /hec1/t_act_phase_inherit( lt_act_param_phasing ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = it_key
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-inherit_phase_assignment )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_phasing ).
ENDIF.
" ***************************************************************************
" Update mode after storage update
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_backup-update_after_storage.
" Get App server storage (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_storage_backup-to_parent
IMPORTING et_data = lt_app_storage ).
LOOP AT lt_app_backup REFERENCE INTO lr_app_backup.
ASSIGN lt_app_storage[ key = lr_app_backup->parent_key ] TO <fs_app_storage>.
IF <fs_app_storage> IS ASSIGNED.
"-----------------------------------
" Release instance for selection
"-----------------------------------
IF <fs_app_storage>-hec_ip_storage_guid IS NOT INITIAL AND
<fs_app_storage>-hec_row_selectable = abap_true.
lv_release = abap_true.
ENDIF.
IF lv_release <> lr_app_backup->hec_row_selectable.
lr_app_backup->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Update App server cluster type
"-----------------------------------
IF lr_app_backup->hec_app_cluster_type_value <> <fs_app_storage>-hec_app_cluster_type_value.
lr_app_backup->hec_app_cluster_type_value = <fs_app_storage>-hec_app_cluster_type_value.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify App storage backup
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_backup->key
is_data = lr_app_backup ).
ENDIF.
ENDIF. " IF <fs_app_storage> IS ASSIGNED.
UNASSIGN <fs_app_storage>.
CLEAR: lv_data_changed,
lv_release.
ENDLOOP.
ENDCASE.
CATCH /bobf/cx_frw. " Exception class
ENDTRY.
ENDMETHOD.
METHOD execute.
CLEAR: eo_message,
et_failed_key.
DATA(ls_root) = /hec1/cl_config_helper=>get_root_node( iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
io_modify = io_modify ).
TRY.
CASE is_ctx-det_key.
" **********************************
" Determine App server instance node
" **********************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_instance-create OR
/hec1/if_configuration_c=>sc_determination-app_server_instance-update OR
/hec1/if_configuration_c=>sc_determination-app_server_instance-update_after_tier.
CASE ls_root-hec_contract_status.
WHEN /hec1/if_config_constants=>gc_contract_status-initial.
" Initial Deal
me->determine_app_server_instance( EXPORTING is_ctx = is_ctx " Context Information for Determinations
it_key = it_key " Key Table
io_read = io_read " Interface to Reading Data
io_modify = io_modify " Interface to Change Data
IMPORTING eo_message = eo_message " Message Object
et_failed_key = et_failed_key ). " Key Table
WHEN /hec1/if_config_constants=>gc_contract_status-change_request.
" Change Request
me->determine_app_server_inst_cr( EXPORTING is_ctx = is_ctx " Context Information for Determinations
it_key = it_key " Key Table
io_read = io_read " Interface to Reading Data
io_modify = io_modify " Interface to Change Data
IMPORTING eo_message = eo_message " Message Object
et_failed_key = et_failed_key ). " Key Table
ENDCASE. "ls_root-hec_contract_status.
" **********************************
" Determine App node
" **********************************
WHEN /hec1/if_configuration_c=>sc_determination-app_node-create OR
/hec1/if_configuration_c=>sc_determination-app_node-update OR
/hec1/if_configuration_c=>sc_determination-app_node-update_after_server_inst.
CASE ls_root-hec_contract_status.
WHEN /hec1/if_config_constants=>gc_contract_status-initial.
" Initial Deal
me->determine_app_node( EXPORTING is_ctx = is_ctx " Context Information for Determinations
it_key = it_key " Key Table
io_read = io_read " Interface to Reading Data
io_modify = io_modify " Interface to Change Data
IMPORTING eo_message = eo_message " Message Object
et_failed_key = et_failed_key ). " Key Table
WHEN /hec1/if_config_constants=>gc_contract_status-change_request.
" Change Request
me->determine_app_node_cr( EXPORTING is_ctx = is_ctx " Context Information for Determinations
it_key = it_key " Key Table
io_read = io_read " Interface to Reading Data
io_modify = io_modify " Interface to Change Data
IMPORTING eo_message = eo_message " Message Object
et_failed_key = et_failed_key ). " Key Table
ENDCASE. "ls_root-hec_contract_status.
" **********************************
" Determine App server performance
" category node
" **********************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_perform_cat-create OR
/hec1/if_configuration_c=>sc_determination-app_server_perform_cat-update OR
/hec1/if_configuration_c=>sc_determination-app_server_perform_cat-update_after_node.
CASE ls_root-hec_contract_status.
WHEN /hec1/if_config_constants=>gc_contract_status-initial.
" Initial Deal
me->determine_app_server_perf_cat( EXPORTING is_ctx = is_ctx " Context Information for Determinations
it_key = it_key " Key Table
io_read = io_read " Interface to Reading Data
io_modify = io_modify " Interface to Change Data
IMPORTING eo_message = eo_message " Message Object
et_failed_key = et_failed_key ). " Key Table
WHEN /hec1/if_config_constants=>gc_contract_status-change_request.
" Change Request
me->determine_app_server_pc_cr( EXPORTING is_ctx = is_ctx " Context Information for Determinations
it_key = it_key " Key Table
io_read = io_read " Interface to Reading Data
io_modify = io_modify " Interface to Change Data
IMPORTING eo_message = eo_message " Message Object
et_failed_key = et_failed_key ). " Key Table
ENDCASE. "ls_root-hec_contract_status.
" **********************************
" Determine App storage amount
" **********************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_amount-create OR
/hec1/if_configuration_c=>sc_determination-app_storage_amount-update OR
/hec1/if_configuration_c=>sc_determination-app_storage_amount-update_after_serv_perf_cat.
CASE ls_root-hec_contract_status.
WHEN /hec1/if_config_constants=>gc_contract_status-initial.
" Initial Deal
me->determine_app_storage_amount( EXPORTING is_ctx = is_ctx " Context Information for Determinations
it_key = it_key " Key Table
io_read = io_read " Interface to Reading Data
io_modify = io_modify " Interface to Change Data
IMPORTING eo_message = eo_message " Message Object
et_failed_key = et_failed_key ). " Key Table
WHEN /hec1/if_config_constants=>gc_contract_status-change_request.
" Change Request
me->determine_app_storage_amoun_cr( EXPORTING is_ctx = is_ctx " Context Information for Determinations
it_key = it_key " Key Table
io_read = io_read " Interface to Reading Data
io_modify = io_modify " Interface to Change Data
IMPORTING eo_message = eo_message " Message Object
et_failed_key = et_failed_key ). " Key Table
ENDCASE. "ls_root-hec_contract_status.
" **********************************
" Determine App server
" **********************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server-create OR
/hec1/if_configuration_c=>sc_determination-app_server-update OR
/hec1/if_configuration_c=>sc_determination-app_server-update_after_serv_perf_cat.
CASE ls_root-hec_contract_status.
WHEN /hec1/if_config_constants=>gc_contract_status-initial.
" Initial Deal
me->determine_app_server( EXPORTING is_ctx = is_ctx " Context Information for Determinations
it_key = it_key " Key Table
io_read = io_read " Interface to Reading Data
io_modify = io_modify " Interface to Change Data
IMPORTING eo_message = eo_message " Message Object
et_failed_key = et_failed_key ). " Key Table
WHEN /hec1/if_config_constants=>gc_contract_status-change_request.
" Change Request
me->determine_app_server_cr( EXPORTING is_ctx = is_ctx " Context Information for Determinations
it_key = it_key " Key Table
io_read = io_read " Interface to Reading Data
io_modify = io_modify " Interface to Change Data
IMPORTING eo_message = eo_message " Message Object
et_failed_key = et_failed_key ). " Key Table
ENDCASE. "ls_root-hec_contract_status.
" **********************************
" Determine App storage
" **********************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage-create OR
/hec1/if_configuration_c=>sc_determination-app_storage-update OR
/hec1/if_configuration_c=>sc_determination-app_storage-update_after_server.
CASE ls_root-hec_contract_status.
WHEN /hec1/if_config_constants=>gc_contract_status-initial.
" Initial Deal
me->determine_app_storage( EXPORTING is_ctx = is_ctx " Context Information for Determinations
it_key = it_key " Key Table
io_read = io_read " Interface to Reading Data
io_modify = io_modify " Interface to Change Data
IMPORTING eo_message = eo_message " Message Object
et_failed_key = et_failed_key ). " Key Table
WHEN /hec1/if_config_constants=>gc_contract_status-change_request.
" Change Request
me->determine_app_storage_cr( EXPORTING is_ctx = is_ctx " Context Information for Determinations
it_key = it_key " Key Table
io_read = io_read " Interface to Reading Data
io_modify = io_modify " Interface to Change Data
IMPORTING eo_message = eo_message " Message Object
et_failed_key = et_failed_key ). " Key Table
ENDCASE. "ls_root-hec_contract_status.
" **********************************
" Determine App storage backup
" **********************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_backup-create OR
/hec1/if_configuration_c=>sc_determination-app_storage_backup-update OR
/hec1/if_configuration_c=>sc_determination-app_storage_backup-update_after_storage.
CASE ls_root-hec_contract_status.
WHEN /hec1/if_config_constants=>gc_contract_status-initial.
" Initial Deal
me->determine_app_storage_backup( EXPORTING is_ctx = is_ctx " Context Information for Determinations
it_key = it_key " Key Table
io_read = io_read " Interface to Reading Data
io_modify = io_modify " Interface to Change Data
IMPORTING eo_message = eo_message " Message Object
et_failed_key = et_failed_key ). " Key Table
WHEN /hec1/if_config_constants=>gc_contract_status-change_request.
" Change Request
me->determine_app_storage_backu_cr( EXPORTING is_ctx = is_ctx " Context Information for Determinations
it_key = it_key " Key Table
io_read = io_read " Interface to Reading Data
io_modify = io_modify " Interface to Change Data
IMPORTING eo_message = eo_message " Message Object
et_failed_key = et_failed_key ). " Key Table
ENDCASE. "ls_root-hec_contract_status.
ENDCASE.
CATCH /bobf/cx_frw. " Exception class
ENDTRY.
ENDMETHOD.
METHOD execute_tree.
" **************************************************************************************************************************************************
" Attention!!!!!!
" This is only a temporary solution, because this is
" a mix between UI logic and BOPF logic. Normally no
" UI logic has to be set into a BOPF object. But at
" the moment there is the problem, that the Application
" is not running with FBI, therefore we can't control
" the tree about the FBI feeder class
" **************************************************************************************************************************************************
DATA lr_data TYPE REF TO data.
FIELD-SYMBOLS <lt_data> TYPE ANY TABLE.
/bobf/cl_frw_factory=>get_configuration( is_ctx-bo_key )->get_node( EXPORTING iv_node_key = is_ctx-node_key IMPORTING es_node = DATA(ls_node) ).
DATA(lo_tabledescr) = CAST cl_abap_tabledescr( cl_abap_tabledescr=>describe_by_name( ls_node-data_table_type ) ).
CREATE DATA lr_data TYPE HANDLE lo_tabledescr.
ASSIGN lr_data->* TO <lt_data>.
IF sy-subrc = 0.
io_read->retrieve(
EXPORTING
iv_node = is_ctx-node_key
it_key = it_key
IMPORTING
et_data = <lt_data> ).
ENDIF.
IF <lt_data> IS NOT ASSIGNED OR <lt_data> IS INITIAL.
RETURN.
ENDIF.
CASE is_ctx-det_key.
" **********************************
" Determine App server instance node
" **********************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_instance-create.
/hec1/cl_bopf_config_ui_tree_h=>get_instance( )->/hec1/if_bopf_config_ui_tree_h~insert( VALUE #( FOR wa_app_serv_inst IN CORRESPONDING /hec1/t_data_app_serv_inst_ct( <lt_data> )
( VALUE #( parent_node_key = wa_app_serv_inst-parent_key
node_key = wa_app_serv_inst-key
hec_instance_status = wa_app_serv_inst-hec_instance_status
hec_tree_descr = wa_app_serv_inst-hec_tree_descr
hec_row_selectable = wa_app_serv_inst-hec_row_selectable
hec_obj_type = /hec1/if_config_constants=>gc_tree_child-app_serv_inst
hec_phase_guid = wa_app_serv_inst-hec_phase_guid
hec_delete_visible = wa_app_serv_inst-hec_delete_visible
crea_date_time = wa_app_serv_inst-crea_date_time
change_request = wa_app_serv_inst-change_request ) ) ) ).
WHEN /hec1/if_configuration_c=>sc_determination-app_server_instance-update
OR /hec1/if_configuration_c=>sc_determination-app_server_instance-update_after_tier.
/hec1/cl_bopf_config_ui_tree_h=>get_instance( )->/hec1/if_bopf_config_ui_tree_h~update( VALUE #( FOR wa_app_serv_inst IN CORRESPONDING /hec1/t_data_app_serv_inst_ct( <lt_data> )
( VALUE #( parent_node_key = wa_app_serv_inst-parent_key
node_key = wa_app_serv_inst-key
hec_instance_status = wa_app_serv_inst-hec_instance_status
hec_tree_descr = wa_app_serv_inst-hec_tree_descr
hec_row_selectable = wa_app_serv_inst-hec_row_selectable
hec_obj_type = /hec1/if_config_constants=>gc_tree_child-app_serv_inst
hec_phase_guid = wa_app_serv_inst-hec_phase_guid
hec_delete_visible = wa_app_serv_inst-hec_delete_visible
change_request = wa_app_serv_inst-change_request ) ) ) ).
" **********************************
" Determine App node
" **********************************
WHEN /hec1/if_configuration_c=>sc_determination-app_node-create.
/hec1/cl_bopf_config_ui_tree_h=>get_instance( )->/hec1/if_bopf_config_ui_tree_h~insert( VALUE #( FOR wa_app_node IN CORRESPONDING /hec1/t_data_app_node_ct( <lt_data> )
( VALUE #( parent_node_key = wa_app_node-parent_key
node_key = wa_app_node-key
hec_instance_status = wa_app_node-hec_instance_status
hec_tree_descr = wa_app_node-hec_tree_descr
hec_row_selectable = wa_app_node-hec_row_selectable
hec_obj_type = /hec1/if_config_constants=>gc_tree_child-app_node
hec_phase_guid = wa_app_node-hec_phase_guid
hec_delete_visible = wa_app_node-hec_delete_visible
crea_date_time = wa_app_node-crea_date_time
hec_sort_order = SWITCH #( wa_app_node-hec_app_clust_node_type_value
WHEN /hec1/if_config_constants=>gc_db_clust_node_type-master
THEN 1
WHEN /hec1/if_config_constants=>gc_db_clust_node_type-standby
THEN 2
WHEN /hec1/if_config_constants=>gc_db_clust_node_type-worker
THEN 3 )
change_request = wa_app_node-change_request ) ) ) ).
WHEN /hec1/if_configuration_c=>sc_determination-app_node-update
OR /hec1/if_configuration_c=>sc_determination-app_node-update_after_server_inst.
/hec1/cl_bopf_config_ui_tree_h=>get_instance( )->/hec1/if_bopf_config_ui_tree_h~update( VALUE #( FOR wa_app_node IN CORRESPONDING /hec1/t_data_app_node_ct( <lt_data> )
( VALUE #( parent_node_key = wa_app_node-parent_key
node_key = wa_app_node-key
hec_instance_status = wa_app_node-hec_instance_status
hec_tree_descr = wa_app_node-hec_tree_descr
hec_row_selectable = wa_app_node-hec_row_selectable
hec_obj_type = /hec1/if_config_constants=>gc_tree_child-app_node
hec_phase_guid = wa_app_node-hec_phase_guid
hec_delete_visible = wa_app_node-hec_delete_visible
hec_sort_order = SWITCH #( wa_app_node-hec_app_clust_node_type_value
WHEN /hec1/if_config_constants=>gc_app_clust_node_type-master
THEN 1
WHEN /hec1/if_config_constants=>gc_app_clust_node_type-standby
THEN 2
WHEN /hec1/if_config_constants=>gc_app_clust_node_type-worker
THEN 3 )
change_request = wa_app_node-change_request ) ) ) ).
" **********************************
" Determine App server performance
" category node
" **********************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_perform_cat-create.
/hec1/cl_bopf_config_ui_tree_h=>get_instance( )->/hec1/if_bopf_config_ui_tree_h~insert( VALUE #( FOR wa_app_serv_pc IN CORRESPONDING /hec1/t_data_app_serv_pc_ct( <lt_data> )
( VALUE #( parent_node_key = wa_app_serv_pc-parent_key
node_key = wa_app_serv_pc-key
hec_instance_status = wa_app_serv_pc-hec_instance_status
hec_tree_descr = wa_app_serv_pc-hec_tree_descr
hec_row_selectable = wa_app_serv_pc-hec_row_selectable
hec_obj_type = /hec1/if_config_constants=>gc_tree_child-app_serv_pc
hec_phase_guid = wa_app_serv_pc-hec_phase_guid
hec_delete_visible = wa_app_serv_pc-hec_delete_visible
hec_successor_guid = wa_app_serv_pc-hec_successor_guid
crea_date_time = wa_app_serv_pc-crea_date_time
change_request = wa_app_serv_pc-change_request ) ) ) ).
WHEN /hec1/if_configuration_c=>sc_determination-app_server_perform_cat-update
OR /hec1/if_configuration_c=>sc_determination-app_server_perform_cat-update_after_node.
/hec1/cl_bopf_config_ui_tree_h=>get_instance( )->/hec1/if_bopf_config_ui_tree_h~update( VALUE #( FOR wa_app_serv_pc IN CORRESPONDING /hec1/t_data_app_serv_pc_ct( <lt_data> )
( VALUE #( parent_node_key = wa_app_serv_pc-parent_key
node_key = wa_app_serv_pc-key
hec_instance_status = wa_app_serv_pc-hec_instance_status
hec_tree_descr = wa_app_serv_pc-hec_tree_descr
hec_row_selectable = wa_app_serv_pc-hec_row_selectable
hec_obj_type = /hec1/if_config_constants=>gc_tree_child-app_serv_pc
hec_phase_guid = wa_app_serv_pc-hec_phase_guid
hec_delete_visible = wa_app_serv_pc-hec_delete_visible
hec_successor_guid = wa_app_serv_pc-hec_successor_guid
change_request = wa_app_serv_pc-change_request ) ) ) ).
" **********************************
" Determine App storage amount
" **********************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_amount-create.
/hec1/cl_bopf_config_ui_tree_h=>get_instance( )->/hec1/if_bopf_config_ui_tree_h~insert( VALUE #( FOR wa_app_storage_qty IN CORRESPONDING /hec1/t_data_app_storageqty_ct( <lt_data> )
( VALUE #( parent_node_key = wa_app_storage_qty-parent_key
node_key = wa_app_storage_qty-key
hec_instance_status = wa_app_storage_qty-hec_instance_status
hec_tree_descr = wa_app_storage_qty-hec_tree_descr
hec_row_selectable = wa_app_storage_qty-hec_row_selectable
hec_obj_type = /hec1/if_config_constants=>gc_tree_child-app_storage_qty
hec_phase_guid = wa_app_storage_qty-hec_phase_guid
hec_delete_visible = wa_app_storage_qty-hec_delete_visible
hec_successor_guid = wa_app_storage_qty-hec_successor_guid
crea_date_time = wa_app_storage_qty-crea_date_time
change_request = wa_app_storage_qty-change_request ) ) ) ).
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_amount-update
OR /hec1/if_configuration_c=>sc_determination-app_storage_amount-update_after_serv_perf_cat.
/hec1/cl_bopf_config_ui_tree_h=>get_instance( )->/hec1/if_bopf_config_ui_tree_h~update( VALUE #( FOR wa_app_storage_qty IN CORRESPONDING /hec1/t_data_app_storageqty_ct( <lt_data> )
( VALUE #( parent_node_key = wa_app_storage_qty-parent_key
node_key = wa_app_storage_qty-key
hec_instance_status = wa_app_storage_qty-hec_instance_status
hec_tree_descr = wa_app_storage_qty-hec_tree_descr
hec_row_selectable = wa_app_storage_qty-hec_row_selectable
hec_obj_type = /hec1/if_config_constants=>gc_tree_child-app_storage_qty
hec_phase_guid = wa_app_storage_qty-hec_phase_guid
hec_delete_visible = wa_app_storage_qty-hec_delete_visible
hec_successor_guid = wa_app_storage_qty-hec_successor_guid
change_request = wa_app_storage_qty-change_request ) ) ) ).
" **********************************
" Determine App server
" **********************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server-create.
/hec1/cl_bopf_config_ui_tree_h=>get_instance( )->/hec1/if_bopf_config_ui_tree_h~insert( VALUE #( FOR wa_app_server IN CORRESPONDING /hec1/t_data_app_serv_ct( <lt_data> )
( VALUE #( parent_node_key = wa_app_server-parent_key
node_key = wa_app_server-key
hec_instance_status = wa_app_server-hec_instance_status
hec_tree_descr = wa_app_server-hec_tree_descr
hec_row_selectable = wa_app_server-hec_row_selectable
hec_obj_type = /hec1/if_config_constants=>gc_tree_child-app_server
hec_phase_guid = wa_app_server-hec_phase_guid
hec_delete_visible = wa_app_server-hec_delete_visible
crea_date_time = wa_app_server-crea_date_time
change_request = wa_app_server-change_request ) ) ) ).
WHEN /hec1/if_configuration_c=>sc_determination-app_server-update
OR /hec1/if_configuration_c=>sc_determination-app_server-update_after_serv_perf_cat.
/hec1/cl_bopf_config_ui_tree_h=>get_instance( )->/hec1/if_bopf_config_ui_tree_h~update( VALUE #( FOR wa_app_server IN CORRESPONDING /hec1/t_data_app_serv_ct( <lt_data> )
( VALUE #( parent_node_key = wa_app_server-parent_key
node_key = wa_app_server-key
hec_instance_status = wa_app_server-hec_instance_status
hec_tree_descr = wa_app_server-hec_tree_descr
hec_row_selectable = wa_app_server-hec_row_selectable
hec_obj_type = /hec1/if_config_constants=>gc_tree_child-app_server
hec_phase_guid = wa_app_server-hec_phase_guid
hec_delete_visible = wa_app_server-hec_delete_visible
change_request = wa_app_server-change_request ) ) ) ).
" **********************************
" Determine App storage
" **********************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage-create.
/hec1/cl_bopf_config_ui_tree_h=>get_instance( )->/hec1/if_bopf_config_ui_tree_h~insert( VALUE #( FOR wa_app_storage IN CORRESPONDING /hec1/t_data_app_storage_ct( <lt_data> )
( VALUE #( parent_node_key = wa_app_storage-parent_key
node_key = wa_app_storage-key
hec_instance_status = wa_app_storage-hec_instance_status
hec_tree_descr = wa_app_storage-hec_tree_descr
hec_row_selectable = wa_app_storage-hec_row_selectable
hec_obj_type = /hec1/if_config_constants=>gc_tree_child-app_storage
hec_phase_guid = wa_app_storage-hec_phase_guid
hec_delete_visible = wa_app_storage-hec_delete_visible
hec_successor_guid = wa_app_storage-hec_successor_guid
crea_date_time = wa_app_storage-crea_date_time
change_request = wa_app_storage-change_request ) ) ) ).
WHEN /hec1/if_configuration_c=>sc_determination-app_storage-update
OR /hec1/if_configuration_c=>sc_determination-app_storage-update_after_server.
/hec1/cl_bopf_config_ui_tree_h=>get_instance( )->/hec1/if_bopf_config_ui_tree_h~update( VALUE #( FOR wa_app_storage IN CORRESPONDING /hec1/t_data_app_storage_ct( <lt_data> )
( VALUE #( parent_node_key = wa_app_storage-parent_key
node_key = wa_app_storage-key
hec_instance_status = wa_app_storage-hec_instance_status
hec_tree_descr = wa_app_storage-hec_tree_descr
hec_row_selectable = wa_app_storage-hec_row_selectable
hec_obj_type = /hec1/if_config_constants=>gc_tree_child-app_storage
hec_phase_guid = wa_app_storage-hec_phase_guid
hec_delete_visible = wa_app_storage-hec_delete_visible
hec_successor_guid = wa_app_storage-hec_successor_guid
change_request = wa_app_storage-change_request ) ) ) ).
" **********************************
" Determine App storage backup
" **********************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_backup-create.
/hec1/cl_bopf_config_ui_tree_h=>get_instance( )->/hec1/if_bopf_config_ui_tree_h~insert( VALUE #( FOR wa_s IN CORRESPONDING /hec1/t_data_app_backup_ct( <lt_data> )
( VALUE #( parent_node_key = wa_s-parent_key
node_key = wa_s-key
hec_instance_status = wa_s-hec_instance_status
hec_tree_descr = wa_s-hec_tree_descr
hec_row_selectable = wa_s-hec_row_selectable
hec_obj_type = /hec1/if_config_constants=>gc_tree_child-app_backup
hec_phase_guid = wa_s-hec_phase_guid
hec_delete_visible = wa_s-hec_delete_visible
hec_successor_guid = wa_s-hec_successor_guid
crea_date_time = wa_s-crea_date_time
change_request = wa_s-change_request ) ) ) ).
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_backup-update
OR /hec1/if_configuration_c=>sc_determination-app_storage_backup-update_after_storage.
/hec1/cl_bopf_config_ui_tree_h=>get_instance( )->/hec1/if_bopf_config_ui_tree_h~update( VALUE #( FOR wa_s IN CORRESPONDING /hec1/t_data_app_backup_ct( <lt_data> )
( VALUE #( parent_node_key = wa_s-parent_key
node_key = wa_s-key
hec_instance_status = wa_s-hec_instance_status
hec_tree_descr = wa_s-hec_tree_descr
hec_row_selectable = wa_s-hec_row_selectable
hec_obj_type = /hec1/if_config_constants=>gc_tree_child-app_backup
hec_phase_guid = wa_s-hec_phase_guid
hec_delete_visible = wa_s-hec_delete_visible
hec_successor_guid = wa_s-hec_successor_guid
change_request = wa_s-change_request ) ) ) ).
ENDCASE.
ENDMETHOD.
METHOD determine_app_node_cr.
DATA: lt_app_serv_inst TYPE /hec1/t_data_app_serv_inst_ct,
lt_app_node TYPE /hec1/t_data_app_node_ct,
lt_app_node_before TYPE /hec1/t_data_app_node_ct,
lt_node_key TYPE /bobf/t_frw_key,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_app_serv_pc TYPE /hec1/t_data_app_serv_pc_ct,
lt_act_param TYPE /hec1/t_act_create_app_spc,
lt_act_param_node TYPE /hec1/t_act_update_app_node,
lt_act_param_phasing TYPE TABLE OF /hec1/s_act_phase_inherit.
CLEAR: eo_message,
et_failed_key.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_node ).
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING ev_root_key = DATA(lv_root_key)
er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
TRY.
CASE is_ctx-det_key.
" ***************************************************************************
" Create mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_node-create.
" Get App server instance node (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_node-to_parent
IMPORTING et_data = lt_app_serv_inst ).
"-----------------------------------
" App master node
"-----------------------------------
LOOP AT lt_app_node
REFERENCE INTO DATA(lr_app_node)
WHERE hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master.
lr_app_node->hec_delete_visible = abap_false.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
DATA(lv_inst_status) = COND /hec1/config_instance_status( WHEN lr_app_node->hec_app_srv_perf_cat_qty IS NOT INITIAL AND
lr_app_node->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_node->hec_instance_status.
lr_app_node->hec_instance_status = lv_inst_status.
DATA(lv_data_changed) = abap_true.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_serv_inst[ key = lr_app_node->parent_key ] TO FIELD-SYMBOL(<fs_app_serv_inst>).
IF <fs_app_serv_inst> IS ASSIGNED.
IF <fs_app_serv_inst>-hec_operating_sys_guid IS NOT INITIAL AND
<fs_app_serv_inst>-hec_app_cluster_type_value IS NOT INITIAL AND
<fs_app_serv_inst>-hec_row_selectable = abap_true.
DATA(lv_release) = abap_true.
ENDIF.
ENDIF.
IF lr_app_node->hec_row_selectable <> lv_release AND
lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master.
lr_app_node->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"------------------------------------------
" Set CR related fields from the ROOT node
"------------------------------------------
DATA(lv_cr_data_changed) = /hec1/cl_config_helper=>SET_CR_RELATED_FIELDS(
EXPORTING
is_ctx = is_ctx
it_key = it_key
io_read = io_read
io_modify = io_modify
iv_mod_type = /hec1/if_config_constants=>gc_comp_mod_type-added
is_node_data = lr_app_node
iv_set_apm = abap_true
iv_clear_phase = abap_true
).
IF lv_data_changed = abap_false.
lv_data_changed = lv_cr_data_changed.
ENDIF.
"-----------------------------------
" Fill action table for create
" App server performance category
"-----------------------------------
IF NOT ( lr_app_node->hec_server_required = abap_false AND
lr_app_node->hec_effort_required = abap_false ).
INSERT VALUE #( key = lr_app_node->key
parent_key = lr_app_node->parent_key
hec_app_srv_perf_cat_qty = lr_app_node->hec_app_srv_perf_cat_qty ) INTO TABLE lt_act_param.
ENDIF.
"-----------------------------------
" Modify App server node
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_node->key
is_data = lr_app_node ).
ENDIF.
UNASSIGN <fs_app_serv_inst>.
CLEAR: lv_inst_status,
lv_release,
lv_data_changed.
ENDLOOP.
"-----------------------------------
" App standby node
"-----------------------------------
LOOP AT lt_app_node
REFERENCE INTO lr_app_node
WHERE hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-standby.
lr_app_node->hec_delete_visible = abap_false.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_node->hec_app_srv_perf_cat_qty IS NOT INITIAL AND
lr_app_node->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_node->hec_instance_status.
lr_app_node->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Release selection standby node
"-----------------------------------
" Check master node is complete configered
" ( including sub nodes: server performance category and storage amount )
DATA(lv_complete) = /hec1/cl_bopf_config_validat_h=>check_master_node_is_complete( iv_is_app_server = abap_true
iv_check_rule = /hec1/if_bopf_constants=>gc_check_rule-node
is_ctx = is_ctx
it_key = VALUE #( ( key = lr_app_node->key ) )
io_read = io_read ).
IF ( lv_complete = abap_true AND
lr_app_node->hec_row_selectable = abap_false ) OR
( lv_complete = abap_false AND
lr_app_node->hec_row_selectable = abap_true ).
lr_app_node->hec_row_selectable = COND #( WHEN lv_complete = abap_true
THEN abap_true
ELSE abap_false ).
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify App server node
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_node->key
is_data = lr_app_node ).
ENDIF.
CLEAR: lv_inst_status,
lv_complete,
lv_data_changed.
ENDLOOP.
"-----------------------------------
" Set create App server performance
" category action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_spc( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_spc )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
" ***************************************************************************
" Update mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_node-update.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_before_image = abap_true
IMPORTING et_data = lt_app_node_before ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( ( key = lv_root_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase ).
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_node-app_server_perform_cat
IMPORTING et_data = lt_app_serv_pc ).
LOOP AT lt_app_node REFERENCE INTO lr_app_node.
ASSIGN lt_app_node_before[ key = lr_app_node->key ] TO FIELD-SYMBOL(<fs_app_node_before>).
IF <fs_app_node_before> IS ASSIGNED.
"-----------------------------------
" App server performance category added
"-----------------------------------
IF <fs_app_node_before>-hec_app_srv_perf_cat_qty < lr_app_node->hec_app_srv_perf_cat_qty.
CASE lr_app_node->hec_app_clust_node_type_value.
WHEN /hec1/if_config_constants=>gc_app_clust_node_type-master.
"-----------------------------------
" Fill action table for create
" App server performance category
"-----------------------------------
INSERT VALUE #( key = lr_app_node->key
parent_key = lr_app_node->parent_key
hec_app_srv_perf_cat_qty = lr_app_node->hec_app_srv_perf_cat_qty - <fs_app_node_before>-hec_app_srv_perf_cat_qty ) INTO TABLE lt_act_param.
" Success message
/hec1/cl_config_helper=>set_message( EXPORTING iv_textid = /hec1/cx_bopf_config=>new_serv_perf_cat_added
iv_severity = /bobf/cm_frw=>co_severity_success
iv_attr1 = CONV #( lr_app_node->hec_app_srv_perf_cat_qty -
<fs_app_node_before>-hec_app_srv_perf_cat_qty )
CHANGING co_message = eo_message ).
" Set flag for deleting subnodes of standby node
IF lr_app_node->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_node->hec_master_default = abap_true.
lv_data_changed = abap_true.
DATA(lv_delete_ha_subnode) = abap_true.
ENDIF.
ENDCASE.
ELSEIF <fs_app_node_before>-hec_app_srv_perf_cat_qty > lr_app_node->hec_app_srv_perf_cat_qty
AND lr_app_node->hec_app_srv_perf_cat_qty < lines( VALUE /hec1/t_data_app_serv_pc_ct( FOR app_serv_pc IN lt_app_serv_pc
WHERE ( parent_key = lr_app_node->key )
( app_serv_pc ) ) ).
DATA(lv_attr_name) = /hec1/if_configuration_c=>sc_node_attribute-app_node-hec_app_srv_perf_cat_qty.
" Error message
/hec1/cl_config_helper=>set_message( EXPORTING iv_textid = /hec1/cx_bopf_config=>object_no_not_higher
is_origin_location = VALUE #( node_key = is_ctx-node_key
key = lr_app_node->key
attributes = VALUE #( ( lv_attr_name ) ) )
CHANGING co_message = eo_message ).
" Set node number to value before update
lr_app_node->hec_app_srv_perf_cat_qty = <fs_app_node_before>-hec_app_srv_perf_cat_qty.
lv_data_changed = abap_true.
ENDIF. " IF ls_app_node_old-hec_app_srv_perf_cat_qty < ls_app_node-hec_app_srv_perf_cat_qty.
"-----------------------------------
" Phase has changed - update phase
" and inherit phase assignment
"-----------------------------------
IF lr_app_node->hec_phase_guid <> <fs_app_node_before>-hec_phase_guid.
IF lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_node->hec_master_default = abap_true.
APPEND VALUE #( hec_node_key = is_ctx-node_key
hec_bopf_key = lr_app_node->key
hec_phase_guid_new = lr_app_node->hec_phase_guid
hec_phase_guid_old = <fs_app_node_before>-hec_phase_guid ) TO lt_act_param_phasing.
ENDIF.
lr_app_node->hec_phase_changed = abap_true.
lv_data_changed = abap_true.
" Set flag for deleting subnodes of standby node
IF lr_app_node->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha.
lv_delete_ha_subnode = abap_true.
ENDIF.
ENDIF. "phasing changed
ENDIF. "IF <fs_app_node_before> IS ASSIGNED.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_node->hec_app_srv_perf_cat_qty IS NOT INITIAL AND
lr_app_node->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_node->hec_instance_status.
lr_app_node->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Fill action table for delete
" App server standby node subnodes
" or relase standby node
"-----------------------------------
IF lr_app_node->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_node->hec_master_default = abap_true AND
lv_data_changed = abap_true.
IF NOT line_exists( lt_act_param_node[ key = lr_app_node->key ] ).
INSERT VALUE #( key = lr_app_node->key
parent_key = lr_app_node->parent_key
do_release_ha_node = COND #( WHEN lr_app_node->hec_instance_status = /hec1/if_config_constants=>gc_instance_status-complete AND
<fs_app_node_before>-hec_instance_status = /hec1/if_config_constants=>gc_instance_status-incomplete
THEN abap_true
ELSE abap_false )
do_delete_ha_subnode = COND #( WHEN lr_app_node->hec_instance_status = /hec1/if_config_constants=>gc_instance_status-incomplete OR
lv_delete_ha_subnode = abap_true
THEN abap_true
ELSE abap_false ) ) INTO TABLE lt_act_param_node.
ENDIF.
ENDIF. " IF lr_app_serv_perf_cat->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha
"-----------------------------------
" Modify App server node
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_node->key
is_data = lr_app_node ).
ENDIF.
CLEAR: lv_inst_status,
lv_data_changed,
lv_attr_name,
lv_delete_ha_subnode.
UNASSIGN <fs_app_node_before>.
ENDLOOP.
"-----------------------------------
" Set create App server performance
" ategory action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_spc( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_spc )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
"-----------------------------------
" Set Update Phasing
" to general
"-----------------------------------
IF lt_act_param_phasing IS NOT INITIAL.
me->mr_act_param_phasing = NEW /hec1/t_act_phase_inherit( lt_act_param_phasing ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = it_key
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-inherit_phase_assignment )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_phasing ).
ENDIF.
"-----------------------------------
" Set update App node action to
" general
"-----------------------------------
IF lt_act_param_node IS NOT INITIAL.
CLEAR me->mr_act_param_app_node.
me->mr_act_param_app_node = NEW /hec1/t_act_update_app_node( lt_act_param_node ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_node )
it_key = VALUE #( FOR wa_act_node IN lt_act_param_node
( key = wa_act_node-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_app_node ).
ENDIF.
" ***************************************************************************
" Update mode after app server
" instance update
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_node-update_after_server_inst.
" Get App server instance
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_node-to_parent
IMPORTING et_data = lt_app_serv_inst ).
LOOP AT lt_app_node REFERENCE INTO lr_app_node.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_serv_inst[ key = lr_app_node->parent_key ] TO <fs_app_serv_inst>.
IF <fs_app_serv_inst> IS ASSIGNED.
IF <fs_app_serv_inst>-hec_operating_sys_guid IS NOT INITIAL AND
<fs_app_serv_inst>-hec_app_cluster_type_value IS NOT INITIAL AND
<fs_app_serv_inst>-hec_row_selectable = abap_true.
lv_release = abap_true.
ENDIF.
ENDIF.
IF lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_node->hec_row_selectable <> lv_release.
lr_app_node->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Release instance for selection
" ( standby node)
"-----------------------------------
IF lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-standby AND
lr_app_node->hec_row_selectable <> lv_release.
IF lv_release = abap_false AND
lr_app_node->hec_row_selectable = abap_true.
lr_app_node->hec_row_selectable = abap_false.
lv_data_changed = abap_true.
ELSE.
" Check master node is complete configered
" ( including sub nodes: server performance category and storage amount )
lv_complete = /hec1/cl_bopf_config_validat_h=>check_master_node_is_complete( iv_is_app_server = abap_true
iv_check_rule = /hec1/if_bopf_constants=>gc_check_rule-node
is_ctx = is_ctx
it_key = VALUE #( ( key = lr_app_node->key ) )
io_read = io_read ).
IF lv_complete = abap_true.
lr_app_node->hec_row_selectable = abap_true.
lv_data_changed = abap_true.
ENDIF.
ENDIF. " IF lv_release = abap_false AND...
ENDIF. " IF lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-standby AND...
"-----------------------------------
" Update App server cluster type
"-----------------------------------
IF lr_app_node->hec_app_cluster_type_value <> <fs_app_serv_inst>-hec_app_cluster_type_value.
lr_app_node->hec_app_cluster_type_value = <fs_app_serv_inst>-hec_app_cluster_type_value.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify App node
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_node->key
is_data = lr_app_node ).
ENDIF.
UNASSIGN <fs_app_serv_inst>.
CLEAR: lv_release,
lv_complete,
lv_data_changed.
ENDLOOP.
ENDCASE.
CATCH /bobf/cx_frw. " Exception class
ENDTRY.
ENDMETHOD.
METHOD determine_app_server_cr.
DATA: lt_app_server TYPE /hec1/t_data_app_serv_ct,
lt_app_serv_perf_cat TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_storage TYPE /hec1/t_data_app_storage_ct,
lt_line TYPE TABLE OF string,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_app_server_before TYPE /hec1/t_data_app_serv_ct,
lt_act_param TYPE /hec1/t_act_create_app_storage,
lt_act_param_storage TYPE /bobf/t_frw_key,
lt_act_param_server TYPE /hec1/t_act_update_app_server,
lt_act_param_dlvy TYPE /hec1/t_act_update_dlvy_unit,
lt_act_param_datac TYPE /hec1/t_act_update_datacenter,
lt_act_param_serv_pc TYPE /hec1/t_act_update_app_serv_pc,
lt_act_param_phasing TYPE TABLE OF /hec1/s_act_phase_inherit.
CLEAR: eo_message,
et_failed_key.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_server ).
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING ev_root_key = DATA(lv_root_key)
er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
TRY.
CASE is_ctx-det_key.
" ***************************************************************************
" Create mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server-create.
" Get App server performance category node (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server-to_parent
IMPORTING et_data = lt_app_serv_perf_cat ).
LOOP AT lt_app_server
REFERENCE INTO DATA(lr_app_server)
WHERE hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master.
"-----------------------------------
" Set Value List Quantity
"-----------------------------------
lr_app_server->hec_ip_server_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_server(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_infra_provider_guid = lr_dlvy_unit->hec_inf_provider_guid
iv_sec_datacenter_guid = VALUE #( lt_datacenter[ hec_node_datacenter = lr_app_server->hec_tier_datacenter_guid ]-hec_sec_datacenter_guid OPTIONAL )
iv_srv_perf_cat_guid = VALUE #( lt_app_serv_perf_cat[ key = lr_app_server->parent_key ]-hec_srv_perf_cat_guid OPTIONAL ) ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
lr_app_server->hec_delete_visible = abap_false.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
DATA(lv_inst_status) = COND /hec1/config_instance_status( WHEN lr_app_server->hec_ip_server_guid IS NOT INITIAL AND
lr_app_server->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_server->hec_instance_status.
lr_app_server->hec_instance_status = lv_inst_status.
DATA(lv_data_changed) = abap_true.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_serv_perf_cat[ key = lr_app_server->parent_key ] TO FIELD-SYMBOL(<fs_app_serv_perf_cat>).
IF <fs_app_serv_perf_cat> IS ASSIGNED.
IF <fs_app_serv_perf_cat>-hec_srv_perf_cat_guid IS NOT INITIAL AND
<fs_app_serv_perf_cat>-hec_row_selectable = abap_true.
DATA(lv_release) = abap_true.
ENDIF.
ENDIF.
IF lv_release <> lr_app_server->hec_row_selectable.
lr_app_server->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"------------------------------------------
" Set CR related fields from the ROOT node
"------------------------------------------
DATA(lv_cr_data_changed) = /hec1/cl_config_helper=>SET_CR_RELATED_FIELDS(
EXPORTING
is_ctx = is_ctx
it_key = it_key
io_read = io_read
io_modify = io_modify
iv_mod_type = /hec1/if_config_constants=>gc_comp_mod_type-added
is_node_data = lr_app_server
iv_set_apm = abap_true
iv_clear_phase = abap_true
).
IF lv_data_changed = abap_false.
lv_data_changed = lv_cr_data_changed.
ENDIF.
"-----------------------------------
" Fill action table for create
" App server storage
"-----------------------------------
INSERT VALUE #( key = lr_app_server->key
parent_key = lr_app_server->parent_key
hec_pricing_included = abap_false ) INTO TABLE lt_act_param.
"-----------------------------------
" Modify
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_server->key
is_data = lr_app_server ).
ENDIF.
UNASSIGN <fs_app_serv_perf_cat>.
CLEAR: lv_inst_status,
lv_data_changed,
lv_release.
ENDLOOP.
"-----------------------------------
" Set create App server storage
" action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_storage( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_storage )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
" ***************************************************************************
" Update mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server-update.
" Get Before image
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_before_image = abap_true
IMPORTING et_data = lt_app_server_before ).
" Get App server performance category (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server-to_parent
IMPORTING et_data = lt_app_serv_perf_cat ).
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server-app_storage
IMPORTING et_data = lt_app_storage ).
" Get Phases
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( ( key = lv_root_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase ).
LOOP AT lt_app_server REFERENCE INTO lr_app_server.
ASSIGN lt_app_server_before[ key = lr_app_server->key ] TO FIELD-SYMBOL(<fs_app_server_before>).
IF <fs_app_server_before> IS ASSIGNED.
"-----------------------------------
" Split DB server infrastructure
" provider server GUID
"-----------------------------------
IF lr_app_server->hec_ip_server_guid CA ';'.
SPLIT lr_app_server->hec_ip_server_guid
AT ';'
INTO TABLE lt_line.
LOOP AT lt_line ASSIGNING FIELD-SYMBOL(<fs_line>).
CASE sy-tabix.
WHEN 1.
lr_app_server->hec_ip_server_guid = <fs_line>.
WHEN 2.
DATA(lv_inf_provider_guid) = <fs_line>.
WHEN 3.
DATA(lv_datacenter_guid) = <fs_line>.
ENDCASE.
ENDLOOP.
"-----------------------------------
" Fill action table for update
" delivery unit
"-----------------------------------
IF lr_dlvy_unit->hec_inf_provider_guid IS INITIAL.
INSERT VALUE #( key = lr_dlvy_unit->key
parent_key = lr_dlvy_unit->parent_key
hec_inf_provider_guid = lv_inf_provider_guid ) INTO TABLE lt_act_param_dlvy.
ENDIF.
"-----------------------------------
" Fill action table for update
" data center
"-----------------------------------
TRY.
DATA(ls_datacenter) = lt_datacenter[ hec_node_datacenter = lr_app_server->hec_tier_datacenter_guid ].
IF ls_datacenter-hec_datacenter_guid IS INITIAL.
INSERT VALUE #( key = ls_datacenter-key
parent_key = ls_datacenter-parent_key
hec_datacenter_fdt_guid = lv_datacenter_guid ) INTO TABLE lt_act_param_datac.
*
"-----------------------------------
" Fill action table for update
" App node pricing
"-----------------------------------
INSERT VALUE #( key = lr_app_server->parent_key
do_update_pricing = abap_true ) INTO TABLE lt_act_param_serv_pc.
ENDIF. " IF ls_datacenter-hec_datacenter_guid IS INITIAL.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF ls_app_server-hec_ds_ip_server_guid CA ';'.
"-----------------------------------
" App server has changed
"-----------------------------------
IF lr_app_server->hec_ip_server_guid IS NOT INITIAL AND
lr_app_server->hec_ip_server_guid <> <fs_app_server_before>-hec_ip_server_guid.
IF lv_inf_provider_guid IS NOT INITIAL.
lr_dlvy_unit->hec_inf_provider_guid = lv_inf_provider_guid.
ENDIF.
IF lr_app_server->hec_sec_datacenter_guid IS INITIAL AND
lv_datacenter_guid IS NOT INITIAL.
lr_app_server->hec_sec_datacenter_guid = lv_datacenter_guid.
lv_data_changed = abap_true.
ENDIF.
SELECT SINGLE *
FROM /hec1/i_serverbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_infra_provider_guid = @lr_dlvy_unit->hec_inf_provider_guid AND
hec_sec_datacenter_guid = @lr_app_server->hec_sec_datacenter_guid AND
hec_ip_server_guid = @lr_app_server->hec_ip_server_guid
INTO @DATA(ls_server).
IF ls_server IS NOT INITIAL.
lr_app_server->hec_ip_server_descr = ls_server-hec_ip_server_descr.
lr_app_server->hec_ip_server_guid = ls_server-hec_ip_server_guid.
lr_app_server->hec_host_type_descr = ls_server-hec_srv_host_type_descr.
lr_app_server->hec_host_type_value = ls_server-hec_srv_host_type_value.
lr_app_server->hec_srv_ram_size = ls_server-hec_srv_ram_size.
lr_app_server->hec_srv_cpu_size = ls_server-hec_srv_cpu_size.
lr_app_server->hec_sec_datacenter_guid = ls_server-hec_sec_datacenter_guid.
lr_app_server->hec_srv_main_storage_qty = ls_server-hec_srv_main_storage_qty.
lr_app_server->hec_tree_descr = ls_server-hec_ip_server_descr. "#EC CI_FLDEXT_OK[2215424]
lr_app_server->hec_as_flavour = ls_server-hec_srv_flavour.
lr_app_server->hec_saps = ls_server-hec_saps.
lr_app_server->hec_approval_needed = ls_server-hec_approval_needed.
lv_data_changed = abap_true.
" Set Value List Quantity
lr_app_server->hec_ip_server_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_server(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_infra_provider_guid = lr_dlvy_unit->hec_inf_provider_guid
iv_sec_datacenter_guid = VALUE #( lt_datacenter[ hec_node_datacenter = lr_app_server->hec_tier_datacenter_guid ]-hec_sec_datacenter_guid OPTIONAL )
iv_srv_perf_cat_guid = VALUE #( lt_app_serv_perf_cat[ key = lr_app_server->parent_key ]-hec_srv_perf_cat_guid OPTIONAL ) ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
"-------------------------
" Get App server pricing
"-------------------------
SELECT SINGLE hec_cb_pricing_lb_guid
FROM /hec1/i_serverlbbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_sec_datacenter_guid = @lr_app_server->hec_sec_datacenter_guid AND
hec_infra_provider_guid = @lr_dlvy_unit->hec_inf_provider_guid AND
hec_ip_server_guid = @lr_app_server->hec_ip_server_guid
INTO @DATA(lv_lb_guid).
IF lv_lb_guid IS NOT INITIAL.
SELECT SINGLE * FROM /hec1/c_cbp_lb "#EC CI_ALL_FIELDS_NEEDED
INTO @DATA(ls_pricing)
WHERE hec_price_lb = @lv_lb_guid.
lr_app_server->* = CORRESPONDING #( BASE ( lr_app_server->* ) ls_pricing ).
ENDIF.
"-----------------------------------
" Fill action table for update
" App server storage
"-----------------------------------
LOOP AT lt_app_storage REFERENCE INTO DATA(lr_app_storage)
WHERE parent_key = lr_app_server->key.
INSERT VALUE #( key = lr_app_storage->key ) INTO TABLE lt_act_param_storage.
ENDLOOP.
ENDIF. " IF ls_server IS NOT INITIAL.
ENDIF. " IF ls_app_server-hec_as_ip_server_guid IS NOT INITIAL AND...
"-----------------------------------
" Phase has changed -
" update phase and inherit phase assignment
"-----------------------------------
IF lr_app_server->hec_phase_guid NE <fs_app_server_before>-hec_phase_guid.
" Only for default master node
IF lr_app_server->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_server->hec_app_node_default = abap_true.
APPEND VALUE #( hec_node_key = is_ctx-node_key
hec_bopf_key = lr_app_server->key
hec_phase_guid_new = lr_app_server->hec_phase_guid
hec_phase_guid_old = <fs_app_server_before>-hec_phase_guid ) TO lt_act_param_phasing.
ENDIF.
lr_app_server->hec_phase_changed = abap_true.
lv_data_changed = abap_true.
ENDIF. "phasing changed
ENDIF. " if <fs_app_server_before> is assigned.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_server->hec_ip_server_guid IS NOT INITIAL AND
lr_app_server->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_server->hec_instance_status.
lr_app_server->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_server->key
is_data = lr_app_server ).
ENDIF.
UNASSIGN: <fs_line>,
<fs_app_server_before>.
CLEAR: lv_inf_provider_guid,
lv_datacenter_guid,
lv_lb_guid,
lv_inst_status,
lv_data_changed,
ls_server,
ls_pricing,
lt_line.
ENDLOOP.
"-----------------------------------
" Set update delivery unit action to
" general
"-----------------------------------
IF lt_act_param_dlvy IS NOT INITIAL.
CLEAR me->mr_act_param_dlvy.
me->mr_act_param_dlvy = NEW /hec1/t_act_update_dlvy_unit( lt_act_param_dlvy ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-delivery_unit )
it_key = VALUE #( FOR wa_act_dlvy IN lt_act_param_dlvy
( key = wa_act_dlvy-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_delivery_unit )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_dlvy ).
ENDIF.
"-----------------------------------
" Set update data center action to
" general
"-----------------------------------
IF lt_act_param_datac IS NOT INITIAL.
CLEAR me->mr_act_param_datac.
me->mr_act_param_datac = NEW /hec1/t_act_update_datacenter( lt_act_param_datac ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-datacenter )
it_key = VALUE #( FOR wa_act_datac IN lt_act_param_datac
( key = wa_act_datac-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_datacenter )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_datac ).
ENDIF.
"-----------------------------------
" Set App Server PC action to
" general
"-----------------------------------
IF lt_act_param_serv_pc IS NOT INITIAL.
me->mr_act_param_server_pc = NEW /hec1/t_act_update_app_serv_pc( lt_act_param_serv_pc ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_server_perform_cat )
it_key = VALUE #( FOR wa_act_spc IN lt_act_param_serv_pc
( key = wa_act_spc-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_server_perf_cat )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_server_pc ).
ENDIF.
"-----------------------------------
" Set update App Storage action to
" general
"-----------------------------------
IF lt_act_param_storage IS NOT INITIAL.
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_storage )
it_key = lt_act_param_storage
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_storage )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation ).
ENDIF.
"-----------------------------------
" Set update phase action to general
"-----------------------------------
IF lt_act_param_phasing IS NOT INITIAL.
me->mr_act_param_phasing = NEW /hec1/t_act_phase_inherit( lt_act_param_phasing ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = it_key
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-inherit_phase_assignment )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_phasing ).
ENDIF.
" ***************************************************************************
" Update mode after app server
" performance category update
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server-update_after_serv_perf_cat.
" Get App server performance category (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server-to_parent
IMPORTING et_data = lt_app_serv_perf_cat ).
LOOP AT lt_app_server REFERENCE INTO lr_app_server.
ASSIGN lt_app_serv_perf_cat[ key = lr_app_server->parent_key ] TO <fs_app_serv_perf_cat>.
IF <fs_app_serv_perf_cat> IS ASSIGNED.
IF <fs_app_serv_perf_cat>-hec_srv_perf_cat_guid IS NOT INITIAL AND
<fs_app_serv_perf_cat>-hec_row_selectable = abap_true.
lv_release = abap_true.
ENDIF.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
IF lv_release <> lr_app_server->hec_row_selectable.
lr_app_server->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Update App server cluster type
"-----------------------------------
IF lr_app_server->hec_app_cluster_type_value <> <fs_app_serv_perf_cat>-hec_app_cluster_type_value.
lr_app_server->hec_app_cluster_type_value = <fs_app_serv_perf_cat>-hec_app_cluster_type_value.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_server->key
is_data = lr_app_server ).
ENDIF.
UNASSIGN <fs_app_serv_perf_cat>.
CLEAR: lv_release,
lv_data_changed.
ENDLOOP. " LOOP AT lt_app_server
ENDCASE.
CATCH /bobf/cx_frw. " Exception class
ENDTRY.
ENDMETHOD.
METHOD determine_app_server_inst_cr.
DATA: lt_app_serv_inst TYPE /hec1/t_data_app_serv_inst_ct,
lt_app_serv_inst_before TYPE /hec1/t_data_app_serv_inst_ct,
lt_app_serv_inst_pertier TYPE /hec1/t_data_app_serv_inst_ct,
lt_app_node TYPE /hec1/t_data_app_node_ct,
lt_tier TYPE /hec1/t_data_tier_ct,
lt_act_param TYPE /hec1/t_act_create_app_node,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_act_param_phasing TYPE TABLE OF /hec1/s_act_phase_inherit.
CLEAR: eo_message,
et_failed_key.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_serv_inst ).
" Get tier
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_instance-to_parent
IMPORTING et_data = lt_tier
et_target_key = DATA(lt_tier_key) ).
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING ev_root_key = DATA(lv_root_key)
er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
TRY.
CASE is_ctx-det_key.
" ***************************************************************************
" Create mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_instance-create.
LOOP AT lt_app_serv_inst REFERENCE INTO DATA(lr_app_serv_inst).
"-----------------------------------
" Set Value List Quantity
"-----------------------------------
" App Server Instance
lr_app_serv_inst->hec_sol_tier_stack_si_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_server_instance(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_sol_tier_stack_guid = lr_app_serv_inst->hec_sol_tier_stack_guid
iv_srv_inst_rel_value = lr_app_serv_inst->hec_srv_inst_rel_value
iv_solution_guid = lr_app_serv_inst->hec_solution_guid
iv_is_app_server = abap_true ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
" Operating System
lr_app_serv_inst->hec_sol_apsi_oper_sys_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_app_operating_system(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
" Cluster Type
lr_app_serv_inst->hec_sol_apsi_clusttyp_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_app_cluster_type(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
lr_app_serv_inst->hec_delete_visible = COND #( WHEN lr_app_serv_inst->hec_default_app_server_inst = abap_true
THEN abap_false
ELSE abap_true ).
"-----------------------------------
" Check instance status and switch
"-----------------------------------
DATA(lv_inst_status) = COND /hec1/config_instance_status( WHEN lr_app_serv_inst->hec_sol_tier_stack_si_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_clusttyp_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_serv_inst->hec_instance_status.
lr_app_serv_inst->hec_instance_status = lv_inst_status.
DATA(lv_data_changed) = abap_true.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_tier[ key = lr_app_serv_inst->parent_key ] TO FIELD-SYMBOL(<fs_tier>).
IF <fs_tier> IS ASSIGNED.
IF <fs_tier>-hec_tier_descr IS NOT INITIAL AND
<fs_tier>-hec_tier_type_value IS NOT INITIAL AND
<fs_tier>-hec_tier_impl_type_value IS NOT INITIAL.
DATA(lv_release) = abap_true.
ENDIF.
ENDIF.
IF lv_release <> lr_app_serv_inst->hec_row_selectable.
lr_app_serv_inst->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"------------------------------------------
" Set CR related fields from the ROOT node
"------------------------------------------
DATA(lv_cr_data_changed) = /hec1/cl_config_helper=>SET_CR_RELATED_FIELDS(
EXPORTING
is_ctx = is_ctx
it_key = it_key
io_read = io_read
io_modify = io_modify
iv_mod_type = /hec1/if_config_constants=>gc_comp_mod_type-added
is_node_data = lr_app_serv_inst
iv_set_apm = abap_true
iv_clear_phase = abap_true
).
IF lv_data_changed = abap_false.
lv_data_changed = lv_cr_data_changed.
ENDIF.
"-----------------------------------
" Fill action table for
" create App node
"-----------------------------------
IF lr_app_serv_inst->hec_sol_tier_stack_si_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_clusttyp_guid IS NOT INITIAL.
INSERT VALUE #( key = lr_app_serv_inst->key
parent_key = lr_app_serv_inst->parent_key
hec_app_cluster_type_value = SWITCH #( lr_app_serv_inst->hec_app_cluster_type_value
WHEN /hec1/if_config_constants=>gc_app_clust_node-none
THEN /hec1/if_config_constants=>gc_app_clust_node-none
WHEN /hec1/if_config_constants=>gc_app_clust_node-ha
THEN /hec1/if_config_constants=>gc_app_clust_node-ha
ELSE /hec1/if_config_constants=>gc_app_clust_node-none )
hec_default_app_server = SWITCH #( lr_app_serv_inst->hec_default_app_server_inst
WHEN abap_true
THEN abap_true
ELSE abap_false ) ) INTO TABLE lt_act_param.
ENDIF.
"-----------------------------------
" Modify App server instance
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_serv_inst->key
is_data = lr_app_serv_inst ).
ENDIF.
UNASSIGN <fs_tier>.
CLEAR: lv_inst_status,
lv_release,
lv_data_changed.
ENDLOOP.
"-----------------------------------
" Set create App server node
" action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_node( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
" ***************************************************************************
" Update mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_instance-update.
" Get data before update
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_before_image = abap_true
IMPORTING et_data = lt_app_serv_inst_before ).
" Get app ndde
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_instance-app_node
IMPORTING et_data = lt_app_node ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( ( key = lv_root_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase ).
" Get all app server instances per tier
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-tier
it_key = lt_tier_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-tier-app_server_instance
IMPORTING et_data = lt_app_serv_inst_pertier ).
"-----------------------------------
" Get App server instance data
"-----------------------------------
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_appservinstancenobasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid
INTO TABLE @DATA(lt_app_serv_inst_no).
"-----------------------------------
" Get App server operating system
"-----------------------------------
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_appopersystembasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid
INTO TABLE @DATA(lt_app_operating_sys).
"-----------------------------------
" Get App server cluster type
"-----------------------------------
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_appclustertypebasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid
INTO TABLE @DATA(lt_cluster_type).
LOOP AT lt_app_serv_inst REFERENCE INTO lr_app_serv_inst.
ASSIGN lt_app_serv_inst_before[ key = lr_app_serv_inst->key ] TO FIELD-SYMBOL(<fs_serv_inst_before>).
IF <fs_serv_inst_before> IS ASSIGNED.
" Can this value change? TODO
lr_app_serv_inst->hec_delete_visible = COND #( WHEN lr_app_serv_inst->hec_default_app_server_inst = abap_true
THEN abap_false
ELSE abap_true ).
"-----------------------------------
" Update operating system
"-----------------------------------
IF <fs_serv_inst_before>-hec_sol_apsi_oper_sys_guid IS INITIAL AND
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid IS NOT INITIAL.
TRY.
DATA(ls_operating_sys) = lt_app_operating_sys[ hec_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid
hec_sol_apsi_oper_sys_guid = lr_app_serv_inst->hec_sol_apsi_oper_sys_guid ].
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid = ls_operating_sys-hec_sol_apsi_oper_sys_guid.
lr_app_serv_inst->hec_operating_sys_guid = ls_operating_sys-hec_operating_sys_guid.
lr_app_serv_inst->hec_operating_sys_value = ls_operating_sys-hec_operating_sys_value.
lr_app_serv_inst->hec_operating_sys_descr = ls_operating_sys-hec_operating_sys_descr.
lr_app_serv_inst->hec_os_support_stat_value = ls_operating_sys-hec_os_support_stat_value.
lr_app_serv_inst->hec_os_support_stat_descr = ls_operating_sys-hec_os_support_stat_descr.
lv_data_changed = abap_true.
" Set Value List Quantity - Operating System
lr_app_serv_inst->hec_sol_apsi_oper_sys_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_app_operating_system(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
CATCH cx_sy_itab_line_not_found.
ENDTRY.
CLEAR ls_operating_sys.
ENDIF. " IF <fs_serv_inst_before>-hec_asi_operating_sys_guid IS INITIAL AND...
"-----------------------------------
" Update App server instance GUID
"-----------------------------------
IF <fs_serv_inst_before>-hec_sol_tier_stack_si_guid IS INITIAL AND
lr_app_serv_inst->hec_sol_tier_stack_si_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_default_app_server_inst = abap_false.
TRY.
DATA(ls_server_inst_no) = lt_app_serv_inst_no[ hec_sol_tier_stack_guid = lr_app_serv_inst->hec_sol_tier_stack_guid
hec_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid ].
DATA(ls_cluster_type) = lt_cluster_type[ hec_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid
hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-none ].
lr_app_serv_inst->* = CORRESPONDING #( BASE ( lr_app_serv_inst->* ) ls_server_inst_no EXCEPT hec_srv_inst_rel_value
hec_srv_inst_rel_descr ).
lr_app_serv_inst->* = CORRESPONDING #( BASE ( lr_app_serv_inst->* ) ls_cluster_type ).
lr_app_serv_inst->hec_backup_relev_value = ls_server_inst_no-hec_backup_relevance.
lr_app_serv_inst->hec_tree_descr = ls_server_inst_no-hec_sol_tier_asi_descr.
lv_data_changed = abap_true.
" Set Value List Quantity - App Server Instance
lr_app_serv_inst->hec_sol_tier_stack_si_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_server_instance(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_sol_tier_stack_guid = lr_app_serv_inst->hec_sol_tier_stack_guid
iv_srv_inst_rel_value = lr_app_serv_inst->hec_srv_inst_rel_value
iv_solution_guid = lr_app_serv_inst->hec_solution_guid
iv_is_app_server = abap_true ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
" Set Value List Quantity - Cluster Type
lr_app_serv_inst->hec_sol_apsi_clusttyp_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_app_cluster_type(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
" Same app server exist, then operating system
" has to be set same as the existing app server
" is set
DATA(lt_filter) = VALUE /hec1/t_filter_app_serv_inst( ( hec_node_solution = lr_app_serv_inst->hec_node_solution
hec_node_tier = lr_app_serv_inst->hec_node_tier ) ).
DATA(lt_filter_app_serv_inst) = FILTER #( lt_app_serv_inst_pertier IN lt_filter WHERE hec_node_solution = hec_node_solution AND
hec_node_tier = hec_node_tier ).
" Delete current app server instacne
DELETE lt_filter_app_serv_inst
WHERE hec_node_app_serv_inst = lr_app_serv_inst->hec_node_app_serv_inst.
ASSIGN lt_filter_app_serv_inst[ hec_sol_tier_stack_guid = lr_app_serv_inst->hec_sol_tier_stack_guid
hec_sol_tier_stack_si_guid = lr_app_serv_inst->hec_sol_tier_stack_si_guid ] TO FIELD-SYMBOL(<fs_app_server_inst>). "#EC CI_SORTSEQ
IF <fs_app_server_inst> IS ASSIGNED.
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid = <fs_app_server_inst>-hec_sol_apsi_oper_sys_guid.
lr_app_serv_inst->hec_operating_sys_guid = <fs_app_server_inst>-hec_operating_sys_guid.
lr_app_serv_inst->hec_operating_sys_value = <fs_app_server_inst>-hec_operating_sys_value.
lr_app_serv_inst->hec_operating_sys_descr = <fs_app_server_inst>-hec_operating_sys_descr.
lr_app_serv_inst->hec_os_support_stat_value = <fs_app_server_inst>-hec_os_support_stat_value.
lr_app_serv_inst->hec_os_support_stat_descr = <fs_app_server_inst>-hec_os_support_stat_descr.
ENDIF.
IF lr_app_serv_inst->hec_sol_apsi_oper_sys_guid IS INITIAL.
" Is only one operating system available, it
" can be set directly
DATA(lt_operating_sys) = VALUE /hec1/t_apm_app_operating_sys( FOR wa IN lt_app_operating_sys
WHERE ( hec_sol_tier_stack_si_guid = ls_server_inst_no-hec_sol_tier_stack_value )
( CORRESPONDING #( wa ) ) ).
IF lines( lt_operating_sys ) = 1.
DATA(ls_oper_sys) = lt_operating_sys[ 1 ].
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid = ls_oper_sys-hec_sol_apsi_oper_sys_guid.
lr_app_serv_inst->hec_operating_sys_guid = ls_oper_sys-hec_operating_sys_guid.
lr_app_serv_inst->hec_operating_sys_value = ls_oper_sys-hec_operating_sys_value.
lr_app_serv_inst->hec_operating_sys_descr = ls_oper_sys-hec_operating_sys_descr.
lr_app_serv_inst->hec_os_support_stat_value = ls_oper_sys-hec_os_support_stat_value.
lr_app_serv_inst->hec_os_support_stat_descr = ls_oper_sys-hec_os_support_stat_descr.
ENDIF. " IF lines( lt_app_oper_sys ) = 1.
ENDIF. " IF ls_app_server_inst-hec_asi_operating_sys_guid IS INITIAL.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF ls_app_server_inst_old-hec_app_srv_guid IS INITIAL AND
"-----------------------------------
" Phase has changed -
" update phase and inherit phase assignment
"-----------------------------------
IF lr_app_serv_inst->hec_phase_guid NE <fs_serv_inst_before>-hec_phase_guid.
APPEND VALUE #( hec_node_key = is_ctx-node_key
hec_bopf_key = lr_app_serv_inst->key
hec_phase_guid_new = lr_app_serv_inst->hec_phase_guid
hec_phase_guid_old = <fs_serv_inst_before>-hec_phase_guid ) TO lt_act_param_phasing.
lr_app_serv_inst->hec_phase_changed = abap_true.
lv_data_changed = abap_true.
ENDIF. "phasing changed
ENDIF." IF <fs_serv_inst_before> IS ASSIGNED.
"-----------------------------------
" Fill action table for
" create App node
"-----------------------------------
IF lr_app_serv_inst->hec_sol_tier_stack_si_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_clusttyp_guid IS NOT INITIAL AND
NOT line_exists( lt_app_node[ parent_key = lr_app_serv_inst->key ] ).
INSERT VALUE #( key = lr_app_serv_inst->key
parent_key = lr_app_serv_inst->parent_key
hec_app_cluster_type_value = SWITCH #( lr_app_serv_inst->hec_app_cluster_type_value
WHEN /hec1/if_config_constants=>gc_app_clust_node-none
THEN /hec1/if_config_constants=>gc_app_clust_node-none
WHEN /hec1/if_config_constants=>gc_app_clust_node-ha
THEN /hec1/if_config_constants=>gc_app_clust_node-ha
ELSE /hec1/if_config_constants=>gc_app_clust_node-none )
hec_default_app_server = SWITCH #( lr_app_serv_inst->hec_default_app_server_inst
WHEN abap_true
THEN abap_true
ELSE abap_false ) ) INTO TABLE lt_act_param.
ENDIF.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_serv_inst->hec_sol_tier_stack_si_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_oper_sys_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_sol_apsi_clusttyp_guid IS NOT INITIAL AND
lr_app_serv_inst->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_serv_inst->hec_instance_status.
lr_app_serv_inst->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify App server instance
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_serv_inst->key
is_data = lr_app_serv_inst ).
ENDIF.
CLEAR: lv_inst_status,
lv_data_changed,
ls_server_inst_no,
ls_cluster_type,
ls_oper_sys,
ls_operating_sys,
lt_filter,
lt_filter_app_serv_inst,
lt_operating_sys.
UNASSIGN <fs_serv_inst_before>.
ENDLOOP.
"-----------------------------------
" Update Phasing
"-----------------------------------
IF lt_act_param_phasing IS NOT INITIAL.
me->mr_act_param_phasing = NEW /hec1/t_act_phase_inherit( lt_act_param_phasing ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = it_key
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-inherit_phase_assignment )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_phasing ).
ENDIF.
"-----------------------------------
" Set create App server node
" action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_node( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
" ***************************************************************************
" " Update mode after tier update
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_instance-update_after_tier.
LOOP AT lt_app_serv_inst REFERENCE INTO lr_app_serv_inst.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_tier[ key = lr_app_serv_inst->parent_key ] TO <fs_tier>.
IF <fs_tier> IS ASSIGNED.
IF <fs_tier>-hec_tier_descr IS NOT INITIAL AND
<fs_tier>-hec_tier_type_value IS NOT INITIAL AND
<fs_tier>-hec_tier_impl_type_value IS NOT INITIAL.
lv_release = abap_true.
ENDIF.
ENDIF.
IF lv_release <> lr_app_serv_inst->hec_row_selectable.
lr_app_serv_inst->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify App server instance
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_serv_inst->key
is_data = lr_app_serv_inst ).
ENDIF.
UNASSIGN <fs_tier>.
CLEAR: lv_release,
lv_data_changed.
ENDLOOP.
ENDCASE.
CATCH /bobf/cx_frw. " Exception class
ENDTRY.
ENDMETHOD.
METHOD determine_app_server_pc_cr.
DATA: lt_app_serv_perf_cat TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_serv_perf_cat_before TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_serv_perf_cat_pernode TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_node TYPE /hec1/t_data_app_node_ct,
lt_app_serv_inst TYPE /hec1/t_data_app_serv_inst_ct,
lt_app_server TYPE /hec1/t_data_app_serv_ct,
lt_app_storage_qty TYPE /hec1/t_data_app_storageqty_ct,
lt_act_param TYPE /hec1/t_act_create_app_qty,
lt_act_param_server_key TYPE /bobf/t_frw_key,
lt_act_param_server TYPE /hec1/t_act_update_app_server,
lt_act_param_node TYPE /hec1/t_act_update_app_node,
lt_act_param_succ TYPE /hec1/t_act_set_success_predec,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_act_param_phasing TYPE TABLE OF /hec1/s_act_phase_inherit,
lt_range TYPE RANGE OF string.
CLEAR: eo_message,
et_failed_key.
"-----------------------------------
" Get data
"-----------------------------------
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_serv_perf_cat ).
" Get App node (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-to_parent
IMPORTING et_data = lt_app_node ).
" Get landscape( APM GUID), delivery unit and data center
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING ev_root_key = DATA(lv_root_key)
er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
TRY.
CASE is_ctx-det_key.
" ***************************************************************************
" Create mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_perform_cat-create.
" Get for each App master node
" the App server performance category
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_node
it_key = VALUE #( FOR wa_node IN lt_app_node
( key = wa_node-key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_node-app_server_perform_cat
IMPORTING et_data = lt_app_serv_perf_cat_pernode ).
LOOP AT lt_app_serv_perf_cat
REFERENCE INTO DATA(lr_app_serv_perf_cat)
WHERE hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master.
"-----------------------------------
" Set Value List Quantity
"-----------------------------------
lr_app_serv_perf_cat->hec_srv_perf_cat_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_server_perf_cat(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_inf_provider_guid = lr_dlvy_unit->hec_inf_provider_guid
iv_sec_datacenter_guid = VALUE #( lt_datacenter[ hec_node_datacenter = lr_app_serv_perf_cat->hec_tier_datacenter_guid ]-hec_sec_datacenter_guid OPTIONAL )
iv_is_app_server = abap_true ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
lr_app_serv_perf_cat->hec_delete_visible = abap_true.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
DATA(lv_inst_status) = COND /hec1/config_instance_status( WHEN lr_app_serv_perf_cat->hec_srv_perf_cat_guid IS NOT INITIAL AND
lr_app_serv_perf_cat->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_serv_perf_cat->hec_instance_status.
lr_app_serv_perf_cat->hec_instance_status = lv_inst_status.
DATA(lv_data_changed) = abap_true.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_node[ key = lr_app_serv_perf_cat->parent_key ] TO FIELD-SYMBOL(<fs_app_node>).
IF <fs_app_node> IS ASSIGNED.
IF <fs_app_node>-hec_app_srv_perf_cat_qty IS NOT INITIAL AND
<fs_app_node>-hec_row_selectable = abap_true.
DATA(lv_release) = abap_true.
ENDIF.
ENDIF.
IF lv_release <> lr_app_serv_perf_cat->hec_row_selectable.
lr_app_serv_perf_cat->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"------------------------------------------
" Set CR related fields from the ROOT node
"------------------------------------------
DATA(lv_cr_data_changed) = /hec1/cl_config_helper=>SET_CR_RELATED_FIELDS(
EXPORTING
is_ctx = is_ctx
it_key = it_key
io_read = io_read
io_modify = io_modify
iv_mod_type = /hec1/if_config_constants=>gc_comp_mod_type-added
is_node_data = lr_app_serv_perf_cat
iv_set_apm = abap_true
iv_clear_phase = abap_true
).
IF lv_data_changed = abap_false.
lv_data_changed = lv_cr_data_changed.
ENDIF.
"-----------------------------------
" Fill action table for create
" App server storage amount
"-----------------------------------
IF NOT lr_app_serv_perf_cat->hec_server_required = abap_false.
INSERT VALUE #( key = lr_app_serv_perf_cat->key
parent_key = lr_app_serv_perf_cat->parent_key
hec_storage_amount_qty = lr_app_serv_perf_cat->hec_storage_qty ) INTO TABLE lt_act_param.
ENDIF.
"-----------------------------------
" Fill action table for setting
" App server performance category
" successor/predecessor
"-----------------------------------
DATA(lv_node_count) = REDUCE i( INIT x = 0
FOR <l> IN lt_app_serv_perf_cat_pernode WHERE ( parent_key = lr_app_serv_perf_cat->parent_key )
NEXT x = x + 1 ).
IF NOT line_exists( lt_act_param_succ[ key = lr_app_serv_perf_cat->parent_key ] ) AND lv_node_count > 1.
TRY.
INSERT VALUE #( key = lr_app_serv_perf_cat->parent_key
parent_key = lt_app_node[ key = lr_app_serv_perf_cat->parent_key ]-parent_key
hec_no_children_node = lv_node_count ) INTO TABLE lt_act_param_succ.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
"-----------------------------------
" Modify App server storage amount
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_serv_perf_cat->key
is_data = lr_app_serv_perf_cat ).
ENDIF.
UNASSIGN <fs_app_node>.
CLEAR: lv_inst_status,
lv_data_changed,
lv_release,
lv_node_count.
ENDLOOP. " LOOP AT lt_app_serv_perf_cat REFERENCE INTO lr_app_serv_perf_cat.
"-----------------------------------
" Set successor/predecessor action
" to GENERAL
"-----------------------------------
IF lt_act_param_succ IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_set_success_predec( lt_act_param_succ ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_node
assoc_key = /hec1/if_configuration_c=>sc_association-app_node-app_server_perform_cat )
it_key = VALUE #( FOR wa_act_succ IN lt_act_param_succ
( key = wa_act_succ-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-set_success_predec )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
"-----------------------------------
" Set create App server storage
" amount and create App server
" action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_qty( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_qty )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_server )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation ).
ENDIF.
" ***************************************************************************
" Update mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_perform_cat-update.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_before_image = abap_true
IMPORTING et_data = lt_app_serv_perf_cat_before ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( ( key = lv_root_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase ).
" Get App Node
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-to_parent
IMPORTING et_target_key = DATA(lt_app_node_key)
et_data = lt_app_node ).
" Get App server instance
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_node
it_key = lt_app_node_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_node-to_parent
IMPORTING et_data = lt_app_serv_inst ).
" Get App Server
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-app_server
IMPORTING et_data = lt_app_server
et_target_key = DATA(lt_app_server_key) ).
" Get App Storage Qty
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-app_storage_amount
IMPORTING et_data = lt_app_storage_qty ).
"-----------------------------------
" Get server performance category
"-----------------------------------
DATA(lt_range_table) = VALUE /hec1/t_selection_range( FOR wa_spc IN lt_app_serv_perf_cat
( option = /hec1/if_config_constants=>gc_range_option-eq
sign = /hec1/if_config_constants=>gc_range_sign-i
low = wa_spc-hec_srv_perf_cat_guid ) ).
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_appservperfcatbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_srv_perf_cat_guid IN @lt_range_table
INTO TABLE @DATA(lt_serv_perf_cat).
"-----------------------------------
" Get server
"-----------------------------------
CLEAR lt_range_table.
lt_range_table = VALUE /hec1/t_selection_range( FOR wa IN lt_app_serv_perf_cat
( option = /hec1/if_config_constants=>gc_range_option-eq
sign = /hec1/if_config_constants=>gc_range_sign-i
low = wa-hec_srv_perf_cat_guid ) ).
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_serverbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_srv_perf_cat_guid IN @lt_range_table
INTO TABLE @DATA(lt_server_data).
LOOP AT lt_app_serv_perf_cat REFERENCE INTO lr_app_serv_perf_cat.
ASSIGN lt_app_serv_perf_cat_before[ key = lr_app_serv_perf_cat->key ] TO FIELD-SYMBOL(<fs_app_serv_perf_cat_before>).
IF <fs_app_serv_perf_cat_before> IS ASSIGNED.
"-----------------------------------
" App server performance category
" has changed
"-----------------------------------
IF lr_app_serv_perf_cat->hec_srv_perf_cat_guid IS NOT INITIAL AND
lr_app_serv_perf_cat->hec_srv_perf_cat_guid <> <fs_app_serv_perf_cat_before>-hec_srv_perf_cat_guid.
" Set server RAM class and CPU
TRY.
DATA(ls_serv_perf_cat) = lt_serv_perf_cat[ hec_srv_perf_cat_guid = lr_app_serv_perf_cat->hec_srv_perf_cat_guid ].
lr_app_serv_perf_cat->hec_srv_perf_cat_descr = ls_serv_perf_cat-hec_srv_perf_cat_descr.
lr_app_serv_perf_cat->hec_srv_ram_class = ls_serv_perf_cat-hec_srv_ram_class.
lr_app_serv_perf_cat->hec_srv_cpu_class = ls_serv_perf_cat-hec_srv_cpu_class.
lr_app_serv_perf_cat->hec_tree_descr = ls_serv_perf_cat-hec_srv_perf_cat_descr. "#EC CI_FLDEXT_OK[2215424]
lv_data_changed = abap_true.
" Set Value List Quantity
lr_app_serv_perf_cat->hec_srv_perf_cat_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_server_perf_cat(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_inf_provider_guid = lr_dlvy_unit->hec_inf_provider_guid
iv_sec_datacenter_guid = VALUE #( lt_datacenter[ hec_node_datacenter = lr_app_serv_perf_cat->hec_tier_datacenter_guid ]-hec_sec_datacenter_guid OPTIONAL )
iv_is_app_server = abap_true ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
IF lr_app_serv_perf_cat->hec_effort_required = abap_true.
" Get effort time based legoblock GUID
SELECT hec_ram_condition_op,
hec_ram_condition,
hec_timebased_effort_bb_guid
FROM /hec1/i_appservnodetbbbbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_apst_clustty_clustnty_guid = @lr_app_serv_perf_cat->hec_apst_clustty_clustnty_guid AND
hec_tier_cat_value = @lr_app_serv_perf_cat->hec_tier_cat_value
INTO TABLE @DATA(lt_timebased_bb).
LOOP AT lt_timebased_bb ASSIGNING FIELD-SYMBOL(<fs_timebased_bb>).
DATA(lv_option) = SWITCH ddoption( <fs_timebased_bb>-hec_ram_condition_op
WHEN '<' THEN 'LT'
WHEN '>' THEN 'GT'
WHEN '=' THEN 'EQ'
WHEN '<=' THEN 'LE'
WHEN '>=' THEN 'GE' ).
INSERT VALUE #( sign = 'I'
option = lv_option
low = <fs_timebased_bb>-hec_ram_condition ) INTO TABLE lt_range.
IF lr_app_serv_perf_cat->hec_srv_ram_class IN lt_range.
DATA(lv_effort_bb_guid) = <fs_timebased_bb>-hec_timebased_effort_bb_guid.
EXIT. " >>>>>>>
ENDIF.
ENDLOOP.
IF lv_effort_bb_guid IS NOT INITIAL.
" Get the pricing
DATA(ls_price) = /hec1/cl_config_helper=>do_price_validation( iv_node_key = is_ctx-node_key
it_key = VALUE #( ( key = lr_app_serv_perf_cat->key ) )
io_read = io_read
iv_effort_bb_guid = lv_effort_bb_guid
iv_tier_is_dr_node = lr_app_serv_perf_cat->hec_tier_is_dr_node
iv_dr_operating_mode = lr_app_serv_perf_cat->hec_dr_oper_mode_value ).
lr_app_serv_perf_cat->price = CORRESPONDING #( ls_price ).
ENDIF.
ENDIF. " IF lr_app_serv_perf_cat->hec_effort_required = abap_true.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
TRY.
DATA(lv_datacenter_guid) = lt_datacenter[ hec_node_datacenter = lr_app_serv_perf_cat->hec_tier_datacenter_guid ]-hec_datacenter_guid.
DATA(lt_server) = /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_server( iv_apm_guid = lr_landscape->hec_apm_guid
iv_infra_provider_guid = lr_dlvy_unit->hec_inf_provider_guid
iv_sec_datacenter_guid = lv_datacenter_guid
iv_srv_perf_cat_guid = lr_app_serv_perf_cat->hec_srv_perf_cat_guid ).
"-----------------------------------
" Fill action table for Update
" App server
"-----------------------------------
IF lines( lt_server ) = 1.
INSERT VALUE #( key = lt_app_server[ parent_key = lr_app_serv_perf_cat->key ]-key
parent_key = lr_app_serv_perf_cat->key
hec_ip_server_guid = lt_server[ 1 ]-value
do_update_app_server = abap_true ) INTO TABLE lt_act_param_server.
ENDIF.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
CLEAR: lv_datacenter_guid,
lt_server.
ENDIF. " IF lr_app_serv_perf_cat->hec_srv_perf_cat_guid IS NOT INITIAL AND...
"-----------------------------------
" App server storage is added
"-----------------------------------
IF lr_app_serv_perf_cat->hec_storage_qty > <fs_app_serv_perf_cat_before>-hec_storage_qty.
"-----------------------------------
" Fill action table for create
" App server storage amount
"-----------------------------------
INSERT VALUE #( key = lr_app_serv_perf_cat->key
parent_key = lr_app_serv_perf_cat->parent_key
hec_storage_amount_qty = lr_app_serv_perf_cat->hec_storage_qty - <fs_app_serv_perf_cat_before>-hec_storage_qty ) INTO TABLE lt_act_param.
"-----------------------------------
" Fill action table for create
" App server storage
"-----------------------------------
TRY.
" App Storage is added without any parameters necessary
INSERT CORRESPONDING #( lt_app_server[ parent_key = lr_app_serv_perf_cat->key ] ) INTO TABLE lt_act_param_server_key.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
" Success message
/hec1/cl_config_helper=>set_message( EXPORTING iv_textid = /hec1/cx_bopf_config=>new_storage_added
iv_severity = /bobf/cm_frw=>co_severity_success
iv_attr1 = CONV #( lr_app_serv_perf_cat->hec_storage_qty -
<fs_app_serv_perf_cat_before>-hec_storage_qty )
CHANGING co_message = eo_message ).
" Set flag for deleting subnodes of standby node
IF lr_app_serv_perf_cat->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_serv_perf_cat->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_serv_perf_cat->hec_app_node_default = abap_true.
lv_data_changed = abap_true.
DATA(lv_delete_ha_subnode) = abap_true.
ENDIF.
ELSEIF lr_app_serv_perf_cat->hec_storage_qty < <fs_app_serv_perf_cat_before>-hec_storage_qty
AND lr_app_serv_perf_cat->hec_storage_qty < lines( VALUE /hec1/t_data_app_storageqty_ct( FOR app_storage_qty IN lt_app_storage_qty
WHERE ( parent_key = lr_app_serv_perf_cat->key )
( app_storage_qty ) ) ).
DATA(lv_attr_name) = /hec1/if_configuration_c=>sc_node_attribute-app_server_perform_cat-hec_storage_qty.
" Error message
/hec1/cl_config_helper=>set_message( EXPORTING iv_textid = /hec1/cx_bopf_config=>object_no_not_higher
is_origin_location = VALUE #( node_key = is_ctx-node_key
key = lr_app_serv_perf_cat->key
attributes = VALUE #( ( lv_attr_name ) ) )
CHANGING co_message = eo_message ).
" Set node number to value before update
lr_app_serv_perf_cat->hec_storage_qty = <fs_app_serv_perf_cat_before>-hec_storage_qty.
lv_data_changed = abap_true.
ENDIF. " IF ls_db_server_perf_cat-hec_dsp_storage_qty > ls_db_server_perf_cat_old-hec_dsp_storage_qty.
"-----------------------------------
" Phase has changed -
" update phase and inherit phase assignment
"-----------------------------------
IF lr_app_serv_perf_cat->hec_phase_guid NE <fs_app_serv_perf_cat_before>-hec_phase_guid.
" Only for default master node
IF lr_app_serv_perf_cat->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_serv_perf_cat->hec_app_node_default = abap_true.
APPEND VALUE #( hec_node_key = is_ctx-node_key
hec_bopf_key = lr_app_serv_perf_cat->key
hec_phase_guid_new = lr_app_serv_perf_cat->hec_phase_guid
hec_phase_guid_old = <fs_app_serv_perf_cat_before>-hec_phase_guid ) TO lt_act_param_phasing.
ENDIF.
lr_app_serv_perf_cat->hec_phase_changed = abap_true.
lv_data_changed = abap_true.
" Set flag for deleting subnodes of standby node
IF lr_app_serv_perf_cat->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_serv_perf_cat->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_serv_perf_cat->hec_app_node_default = abap_true.
lv_delete_ha_subnode = abap_true.
ENDIF.
ENDIF. "phasing changed
ENDIF. "if <fs_app_serv_perf_cat> is assigned.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_serv_perf_cat->hec_srv_perf_cat_guid IS NOT INITIAL AND
lr_app_serv_perf_cat->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_serv_perf_cat->hec_instance_status.
lr_app_serv_perf_cat->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Fill action table for delete
" App server standby node subnodes
" or relase standby node
"-----------------------------------
IF lr_app_serv_perf_cat->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_serv_perf_cat->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_serv_perf_cat->hec_app_node_default = abap_true AND
lv_data_changed = abap_true.
IF NOT line_exists( lt_act_param_node[ key = lr_app_serv_perf_cat->parent_key ] ).
TRY.
INSERT VALUE #( key = lr_app_serv_perf_cat->parent_key
parent_key = lt_app_node[ key = lr_app_serv_perf_cat->parent_key ]-parent_key
do_release_ha_node = COND #( WHEN lr_app_serv_perf_cat->hec_instance_status = /hec1/if_config_constants=>gc_instance_status-complete AND
<fs_app_serv_perf_cat_before>-hec_instance_status = /hec1/if_config_constants=>gc_instance_status-incomplete
THEN abap_true
ELSE abap_false )
do_delete_ha_subnode = COND #( WHEN lr_app_serv_perf_cat->hec_instance_status = /hec1/if_config_constants=>gc_instance_status-incomplete OR
lv_delete_ha_subnode = abap_true
THEN abap_true
ELSE abap_false ) ) INTO TABLE lt_act_param_node.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
ENDIF. " IF lr_app_serv_perf_cat->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha
"-----------------------------------
" Modify App server performance
" category
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_serv_perf_cat->key
is_data = lr_app_serv_perf_cat ).
ENDIF.
CLEAR: lv_inst_status,
lv_data_changed,
lv_delete_ha_subnode,
lv_attr_name,
lv_option,
lv_effort_bb_guid,
ls_serv_perf_cat,
ls_price,
lt_range,
lt_timebased_bb.
UNASSIGN <fs_app_serv_perf_cat_before>.
ENDLOOP.
"-----------------------------------
" Set Create App Server amount
" and Storage action to
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_qty( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_qty )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_server )
it_key = VALUE #( FOR wa_act_serv IN lt_act_param_server_key
( key = wa_act_serv-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_storage )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation ).
ENDIF. "lt_act_param is not initial
"-----------------------------------
" Set update App Server action to
" general
"-----------------------------------
IF lt_act_param_server IS NOT INITIAL.
CLEAR me->mr_act_param_server.
me->mr_act_param_server = NEW /hec1/t_act_update_app_server( lt_act_param_server ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act_server IN lt_act_param_server
( key = wa_act_server-parent_key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_server )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_server ).
ENDIF.
"-----------------------------------
" Update Phasing
"-----------------------------------
IF lt_act_param_phasing IS NOT INITIAL.
me->mr_act_param_phasing = NEW /hec1/t_act_phase_inherit( lt_act_param_phasing ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = it_key
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-inherit_phase_assignment )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_phasing ).
ENDIF.
"-----------------------------------
" Set update App node action to
" general
"-----------------------------------
IF lt_act_param_node IS NOT INITIAL.
CLEAR me->mr_act_param_app_node.
me->mr_act_param_app_node = NEW /hec1/t_act_update_app_node( lt_act_param_node ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_node )
it_key = VALUE #( FOR wa_act_node IN lt_act_param_node
( key = wa_act_node-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_app_node ).
ENDIF.
" ***************************************************************************
" Update mode after app node update
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_server_perform_cat-update_after_node.
LOOP AT lt_app_serv_perf_cat REFERENCE INTO lr_app_serv_perf_cat.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_node[ key = lr_app_serv_perf_cat->parent_key ] TO <fs_app_node>.
IF <fs_app_node> IS ASSIGNED.
IF <fs_app_node>-hec_app_srv_perf_cat_qty > 0 AND
<fs_app_node>-hec_row_selectable = abap_true.
lv_release = abap_true.
ENDIF.
ENDIF.
IF lv_release <> lr_app_serv_perf_cat->hec_row_selectable.
lr_app_serv_perf_cat->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Update App server cluster type
"-----------------------------------
IF lr_app_serv_perf_cat->hec_app_cluster_type_value <> <fs_app_node>-hec_app_cluster_type_value.
lr_app_serv_perf_cat->hec_app_cluster_type_value = <fs_app_node>-hec_app_cluster_type_value.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify App server performance
" category
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_serv_perf_cat->key
is_data = lr_app_serv_perf_cat ).
ENDIF.
UNASSIGN <fs_app_node>.
CLEAR: lv_release,
lv_data_changed.
ENDLOOP. " LOOP AT lt_app_serv_perf_cat
ENDCASE.
CATCH /bobf/cx_frw. " Exception class
ENDTRY.
ENDMETHOD.
METHOD determine_app_storage_amoun_cr.
DATA: lt_app_storage_qty TYPE /hec1/t_data_app_storageqty_ct,
lt_app_storage_qty_per_spc TYPE /hec1/t_data_app_storageqty_ct,
lt_app_serv_perf_cat TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_node TYPE /hec1/t_data_app_node_ct,
lt_app_storage_qty_before TYPE /hec1/t_data_app_storageqty_ct,
lt_app_server TYPE /hec1/t_data_app_serv_ct,
lt_app_storage TYPE /hec1/t_data_app_storage_ct,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_app_storage_qty_succ TYPE /hec1/t_data_app_storageqty_ct,
lt_act_param_node TYPE /hec1/t_act_update_app_node,
lt_act_param_storage TYPE /bobf/t_frw_key,
lt_act_param_succ TYPE /hec1/t_act_set_success_predec,
lt_act_param_phasing TYPE TABLE OF /hec1/s_act_phase_inherit.
CLEAR: eo_message,
et_failed_key.
"-----------------------------------
" Get data
"-----------------------------------
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_storage_qty ).
" Get App server performance category (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_storage_amount-to_parent
IMPORTING et_data = lt_app_serv_perf_cat ).
" Get landscape( APM GUID), delivery unit and data center
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING ev_root_key = DATA(lv_root_key)
er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
TRY.
CASE is_ctx-det_key.
" ***************************************************************************
" Create mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_amount-create.
" Get for each App server performance category
" the App storage amounts
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
it_key = VALUE #( FOR wa_spc IN lt_app_serv_perf_cat
( key = wa_spc-key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-app_storage_amount
IMPORTING et_data = lt_app_storage_qty_per_spc ).
LOOP AT lt_app_storage_qty
REFERENCE INTO DATA(lr_app_storage_qty)
WHERE hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master.
lr_app_storage_qty->hec_delete_visible = abap_true.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
DATA(lv_inst_status) = COND /hec1/config_instance_status( WHEN lr_app_storage_qty->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_storage_qty->hec_instance_status.
lr_app_storage_qty->hec_instance_status = lv_inst_status.
DATA(lv_data_changed) = abap_true.
" If standby node exist
IF lr_app_storage_qty->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_storage_qty->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_storage_qty->hec_app_node_default = abap_true AND
lr_app_storage_qty->hec_instance_status = /hec1/if_config_constants=>gc_instance_status-complete.
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = VALUE #( ( key = lr_app_storage_qty->key ) )
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-app_storage_amount-to_def_master_node
IMPORTING et_target_key = DATA(lt_key) ).
IF NOT line_exists( lt_act_param_node[ key = lt_key[ 1 ]-key ] ).
TRY.
INSERT VALUE #( key = lt_key[ 1 ]-key
do_release_ha_node = abap_true ) INTO TABLE lt_act_param_node.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
ENDIF.
ENDIF. " IF lv_inst_status <> lr_app_storage_qty->hec_instance_status.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_serv_perf_cat[ key = lr_app_storage_qty->parent_key ] TO FIELD-SYMBOL(<fs_app_serv_perf_cat>).
IF <fs_app_serv_perf_cat> IS ASSIGNED.
IF <fs_app_serv_perf_cat>-hec_srv_perf_cat_guid IS NOT INITIAL AND
<fs_app_serv_perf_cat>-hec_row_selectable = abap_true.
DATA(lv_release) = abap_true.
ENDIF.
ENDIF.
IF lv_release <> lr_app_storage_qty->hec_row_selectable.
lr_app_storage_qty->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"------------------------------------------
" Set CR related fields from the ROOT node
"------------------------------------------
DATA(lv_cr_data_changed) = /hec1/cl_config_helper=>SET_CR_RELATED_FIELDS(
EXPORTING
is_ctx = is_ctx
it_key = it_key
io_read = io_read
io_modify = io_modify
iv_mod_type = /hec1/if_config_constants=>gc_comp_mod_type-added
is_node_data = lr_app_storage_qty
iv_set_apm = abap_true
iv_clear_phase = abap_true
).
IF lv_data_changed = abap_false.
lv_data_changed = lv_cr_data_changed.
ENDIF.
"-----------------------------------
" Fill action table for setting
" App server storage amount
" successor/predecessor
"-----------------------------------
DATA(lv_node_count) = REDUCE i( INIT x = 0
FOR <l> IN lt_app_storage_qty_per_spc WHERE ( parent_key = lr_app_storage_qty->parent_key )
NEXT x = x + 1 ).
IF NOT line_exists( lt_act_param_succ[ key = lr_app_storage_qty->parent_key ] ) AND lv_node_count > 1.
TRY.
INSERT VALUE #( key = lr_app_storage_qty->parent_key
parent_key = lt_app_serv_perf_cat[ key = lr_app_storage_qty->parent_key ]-parent_key
hec_no_children_node = lv_node_count ) INTO TABLE lt_act_param_succ.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
"-----------------------------------
" Modify App storage amount
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_storage_qty->key
is_data = lr_app_storage_qty ).
ENDIF.
UNASSIGN <fs_app_serv_perf_cat>.
CLEAR: lv_inst_status,
lv_data_changed,
lv_release,
lv_node_count.
ENDLOOP.
"-----------------------------------
" Set update App node action to
" general
"-----------------------------------
IF lt_act_param_node IS NOT INITIAL.
CLEAR me->mr_act_param_app_node.
me->mr_act_param_app_node = NEW /hec1/t_act_update_app_node( lt_act_param_node ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_node )
it_key = VALUE #( FOR wa_act_node IN lt_act_param_node
( key = wa_act_node-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_app_node ).
ENDIF.
"-----------------------------------
" Set successor/predecessor action
" to GENERAL
"-----------------------------------
IF lt_act_param_succ IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_set_success_predec( lt_act_param_succ ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
assoc_key = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-app_storage_amount )
it_key = VALUE #( FOR wa_act_succ IN lt_act_param_succ
( key = wa_act_succ-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-set_success_predec )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
" ***************************************************************************
" Update mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_amount-update.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_before_image = abap_true
IMPORTING et_data = lt_app_storage_qty_before ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( ( key = lv_root_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase ).
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_association = /hec1/if_configuration_c=>sc_association-app_storage_amount-to_parent
IMPORTING et_target_key = DATA(lt_app_serv_pc_key) ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
it_key = lt_app_serv_pc_key
iv_association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-app_server
IMPORTING et_target_key = DATA(lt_app_serv_key)
et_key_link = DATA(lt_perf_cat_to_serv_link) ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server
it_key = lt_app_serv_key
iv_association = /hec1/if_configuration_c=>sc_association-app_server-app_storage
IMPORTING et_target_key = DATA(lt_app_storage_key)
et_key_link = DATA(lt_serv_to_storage_link)
et_data = lt_app_storage ).
LOOP AT lt_app_storage_qty REFERENCE INTO lr_app_storage_qty.
ASSIGN lt_app_storage_qty_before[ key = lr_app_storage_qty->key ] TO FIELD-SYMBOL(<fs_app_storage_qty_before>).
IF <fs_app_storage_qty_before> IS ASSIGNED.
"-----------------------------------
" Physical, virtual or additional storage
" has changed
"-----------------------------------
IF lr_app_storage_qty->hec_asq_main_stor_qty_virtual <> <fs_app_storage_qty_before>-hec_asq_main_stor_qty_virtual OR
lr_app_storage_qty->hec_asq_additional_stor_qty <> <fs_app_storage_qty_before>-hec_asq_additional_stor_qty OR
lr_app_storage_qty->hec_successor_guid <> <fs_app_storage_qty_before>-hec_successor_guid OR
lr_app_storage_qty->hec_predecessor_guid <> <fs_app_storage_qty_before>-hec_predecessor_guid.
lr_app_storage_qty->hec_tree_descr = |{ lr_app_storage_qty->hec_asq_main_stor_qty_virtual } + { lr_app_storage_qty->hec_asq_additional_stor_qty } [GiB] |.
lv_data_changed = abap_true.
" Storage needs to be adjusted
LOOP AT lt_serv_to_storage_link REFERENCE INTO DATA(lr_serv_to_storage_link)
WHERE source_key = lt_perf_cat_to_serv_link[ source_key = lr_app_storage_qty->parent_key ]-target_key.
INSERT VALUE #( key = lr_serv_to_storage_link->target_key ) INTO TABLE lt_act_param_storage.
ENDLOOP.
" Set flag for deleting subnodes of standby node
IF lr_app_storage_qty->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_storage_qty->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_storage_qty->hec_app_node_default = abap_true.
DATA(lv_delete_ha_subnode) = abap_true.
ENDIF.
ENDIF. "storage changed
"-----------------------------------
" Phasing has changed
"-----------------------------------
IF lr_app_storage_qty->hec_phase_guid NE <fs_app_storage_qty_before>-hec_phase_guid.
APPEND VALUE #( hec_node_key = is_ctx-node_key
hec_bopf_key = lr_app_storage_qty->key
hec_phase_guid_new = lr_app_storage_qty->hec_phase_guid
hec_phase_guid_old = <fs_app_storage_qty_before>-hec_phase_guid ) TO lt_act_param_phasing.
lr_app_storage_qty->hec_phase_changed = abap_true.
lv_data_changed = abap_true.
" Set flag for deleting subnodes of standby node
IF lr_app_storage_qty->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_storage_qty->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_storage_qty->hec_app_node_default = abap_true.
lv_delete_ha_subnode = abap_true.
ENDIF.
ENDIF. "phasing changed
ENDIF. " if <fs_app_storage_qty_before> is assigned
" end of before <-> after comparison
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_storage_qty->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_storage_qty->hec_instance_status.
lr_app_storage_qty->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Fill action table for delete
" App server standby node subnodes
" or relase standby node
"-----------------------------------
IF lr_app_storage_qty->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha AND
lr_app_storage_qty->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_storage_qty->hec_app_node_default = abap_true AND
lv_data_changed = abap_true.
" Only one master node per storage amount can exist
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = VALUE #( ( key = lr_app_storage_qty->key ) )
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-app_storage_amount-to_def_master_node
IMPORTING et_target_key = lt_key ).
IF NOT line_exists( lt_act_param_node[ key = lt_key[ 1 ]-key ] ).
TRY.
INSERT VALUE #( key = lt_key[ 1 ]-key
parent_key = space
do_release_ha_node = COND #( WHEN lr_app_storage_qty->hec_instance_status = /hec1/if_config_constants=>gc_instance_status-complete AND
<fs_app_storage_qty_before>-hec_instance_status = /hec1/if_config_constants=>gc_instance_status-incomplete
THEN abap_true
ELSE abap_false )
do_delete_ha_subnode = COND #( WHEN lr_app_storage_qty->hec_instance_status = /hec1/if_config_constants=>gc_instance_status-incomplete OR
lv_delete_ha_subnode = abap_true
THEN abap_true
ELSE abap_false ) ) INTO TABLE lt_act_param_node.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
ENDIF. " IF lr_app_serv_perf_cat->hec_app_cluster_type_value = /hec1/if_config_constants=>gc_app_clust_node-ha
"-----------------------------------
" Modify
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_storage_qty->key
is_data = lr_app_storage_qty ).
ENDIF.
UNASSIGN <fs_app_storage_qty_before>.
CLEAR: lv_inst_status,
lv_data_changed,
lv_delete_ha_subnode,
lt_key.
ENDLOOP. "LOOP AT lt_app_storage_qty REFERENCE INTO lr_app_storage_qty.
"-----------------------------------
" Set update App Storage action to
" general
"-----------------------------------
IF lt_act_param_storage IS NOT INITIAL.
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_storage )
it_key = lt_act_param_storage
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_storage )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation ). .
ENDIF.
"-----------------------------------
" Update Phasing
"-----------------------------------
IF lt_act_param_phasing IS NOT INITIAL.
me->mr_act_param_phasing = NEW /hec1/t_act_phase_inherit( lt_act_param_phasing ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = it_key
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-inherit_phase_assignment )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_phasing ).
ENDIF.
"-----------------------------------
" Set update App node action to
" general
"-----------------------------------
IF lt_act_param_node IS NOT INITIAL.
CLEAR me->mr_act_param_app_node.
me->mr_act_param_app_node = NEW /hec1/t_act_update_app_node( lt_act_param_node ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_node )
it_key = VALUE #( FOR wa_act_node IN lt_act_param_node
( key = wa_act_node-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_app_node ).
ENDIF.
" ***************************************************************************
" Update mode after app server
" performance category update
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_amount-update_after_serv_perf_cat.
LOOP AT lt_app_storage_qty REFERENCE INTO lr_app_storage_qty.
ASSIGN lt_app_serv_perf_cat[ key = lr_app_storage_qty->parent_key ] TO <fs_app_serv_perf_cat>.
IF <fs_app_serv_perf_cat> IS ASSIGNED.
IF <fs_app_serv_perf_cat>-hec_srv_perf_cat_guid IS NOT INITIAL AND
<fs_app_serv_perf_cat>-hec_row_selectable = abap_true.
lv_release = abap_true.
ENDIF.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
* IF lr_app_node->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
IF lr_app_storage_qty->hec_row_selectable <> lv_release.
lr_app_storage_qty->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
* " Release instance for selection( standby node)
* IF lr_app_storage_qty->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-standby AND
* me->check_standby_node_is_released( iv_is_app_server = abap_true
* iv_check_rule = /hec1/if_bopf_constants=>gc_check_rule-storage_amount
* is_ctx = is_ctx
* it_key = it_key
* io_read = io_read
* io_modify = io_modify ) = abap_true.
*
* IF lr_app_node->hec_row_selectable <> lv_release.
* lr_app_node->hec_row_selectable = lv_release.
* lv_data_changed = abap_true.
* ENDIF.
* ENDIF.
" Update App server cluster type
IF lr_app_storage_qty->hec_app_cluster_type_value <> <fs_app_serv_perf_cat>-hec_app_cluster_type_value.
lr_app_storage_qty->hec_app_cluster_type_value = <fs_app_serv_perf_cat>-hec_app_cluster_type_value.
lv_data_changed = abap_true.
ENDIF.
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_storage_qty->key
is_data = lr_app_storage_qty ).
ENDIF.
UNASSIGN <fs_app_serv_perf_cat>.
CLEAR: lv_release,
lv_data_changed.
ENDLOOP. " LOOP AT lt_app_storage_qty
ENDCASE.
CATCH /bobf/cx_frw. " Exception class
ENDTRY.
ENDMETHOD.
METHOD determine_app_storage_backu_cr.
DATA: lt_app_backup_before TYPE /hec1/t_data_app_backup_ct,
lt_app_backup TYPE /hec1/t_data_app_backup_ct,
lt_app_backup_perstorage TYPE /hec1/t_data_app_backup_ct,
lt_app_storage TYPE /hec1/t_data_app_storage_ct,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_act_param_succ TYPE /hec1/t_act_set_success_predec,
lt_act_param_phasing TYPE TABLE OF /hec1/s_act_phase_inherit.
CLEAR: eo_message,
et_failed_key.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_backup ).
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING ev_root_key = DATA(lv_root_key)
er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
TRY.
CASE is_ctx-det_key.
" ***************************************************************************
" Create mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_backup-create.
" Get App server storage (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_storage_backup-to_parent
IMPORTING et_data = lt_app_storage ).
" Get for each App storage the App backup
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_storage
it_key = VALUE #( FOR wa_node IN lt_app_storage
( key = wa_node-key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_storage-app_storage_backup
IMPORTING et_data = lt_app_backup_perstorage ).
LOOP AT lt_app_backup
REFERENCE INTO DATA(lr_app_backup)
WHERE hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master.
"-----------------------------------
" Set Value List Quantity
"-----------------------------------
lr_app_backup->hec_backup_class_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_backup(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_tier_category_value = lr_app_backup->hec_tier_cat_value
iv_is_app_backup = abap_true ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
lr_app_backup->hec_delete_visible = abap_true.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
DATA(lv_inst_status) = COND /hec1/config_instance_status( WHEN lr_app_backup->hec_backup_class_guid IS NOT INITIAL AND
lr_app_backup->hec_backup_size IS NOT INITIAL AND
lr_app_backup->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_backup->hec_instance_status.
lr_app_backup->hec_instance_status = lv_inst_status.
DATA(lv_data_changed) = abap_true.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_storage[ key = lr_app_backup->parent_key ] TO FIELD-SYMBOL(<fs_app_storage>).
IF <fs_app_storage> IS ASSIGNED.
IF <fs_app_storage>-hec_ip_storage_guid IS NOT INITIAL AND
<fs_app_storage>-hec_row_selectable = abap_true.
DATA(lv_release) = abap_true.
ENDIF.
UNASSIGN <fs_app_storage>.
ENDIF.
IF lv_release <> lr_app_backup->hec_row_selectable.
lr_app_backup->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"------------------------------------------
" Set CR related fields from the ROOT node
"------------------------------------------
DATA(lv_cr_data_changed) = /hec1/cl_config_helper=>SET_CR_RELATED_FIELDS(
EXPORTING
is_ctx = is_ctx
it_key = it_key
io_read = io_read
io_modify = io_modify
iv_mod_type = /hec1/if_config_constants=>gc_comp_mod_type-added
is_node_data = lr_app_backup
iv_set_apm = abap_true
iv_clear_phase = abap_true
).
IF lv_data_changed = abap_false.
lv_data_changed = lv_cr_data_changed.
ENDIF.
"-----------------------------------
" Fill action table for setting
" App server storage backup
" successor/predecessor
"-----------------------------------
DATA(lv_node_count) = REDUCE i( INIT x = 0
FOR <l> IN lt_app_backup_perstorage WHERE ( parent_key = lr_app_backup->parent_key )
NEXT x = x + 1 ).
IF NOT line_exists( lt_act_param_succ[ key = lr_app_backup->parent_key ] ) AND lv_node_count > 1.
TRY.
INSERT VALUE #( key = lr_app_backup->parent_key
parent_key = lt_app_storage[ key = lr_app_backup->parent_key ]-parent_key
hec_no_children_node = lv_node_count ) INTO TABLE lt_act_param_succ.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
"-----------------------------------
" Modify
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_backup->key
is_data = lr_app_backup ).
ENDIF.
CLEAR: lv_inst_status,
lv_data_changed,
lv_release,
lv_node_count.
ENDLOOP.
"-----------------------------------
" Set successor/predecessor action
" to GENERAL
"-----------------------------------
IF lt_act_param_succ IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_set_success_predec( lt_act_param_succ ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_storage
assoc_key = /hec1/if_configuration_c=>sc_association-app_storage-app_storage_backup )
it_key = VALUE #( FOR wa_act_succ IN lt_act_param_succ
( key = wa_act_succ-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-set_success_predec )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
" ***************************************************************************
" Update mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_backup-update.
" Data before update
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_before_image = abap_true
IMPORTING et_data = lt_app_backup_before ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( ( key = lv_root_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase ).
" Get App Storage
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-app_storage_backup-to_parent
IMPORTING et_target_key = DATA(lt_app_storage_key)
et_data = lt_app_storage ).
LOOP AT lt_app_backup REFERENCE INTO lr_app_backup.
ASSIGN lt_app_backup_before[ key = lr_app_backup->key ] TO FIELD-SYMBOL(<fs_app_backup_before>).
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_backup->hec_backup_class_guid IS NOT INITIAL AND
lr_app_backup->hec_backup_size IS NOT INITIAL AND
lr_app_backup->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_backup->hec_instance_status.
lr_app_backup->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
IF <fs_app_backup_before> IS ASSIGNED.
"-----------------------------------
" Backup GUID has changed
"-----------------------------------
IF lr_app_backup->hec_backup_class_guid IS NOT INITIAL AND
lr_app_backup->hec_backup_class_guid <> <fs_app_backup_before>-hec_backup_class_guid.
" Get backup class and backup class pricing
/hec1/cl_config_action_helper=>/hec1/if_bopf_action_helper~get_backup_class_and_price( EXPORTING is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( ( key = lr_app_backup->key ) )
iv_app_server = abap_true
iv_tier_category_value = lr_app_backup->hec_tier_cat_value
iv_tier_datacenter_guid = lr_app_backup->hec_tier_datacenter_guid
iv_backup_class_guid = lr_app_backup->hec_backup_class_guid
io_read = io_read
IMPORTING es_backup_class = DATA(ls_backup_class)
es_backup_pricing = DATA(ls_backup_pricing) ).
lr_app_backup->price = CORRESPONDING #( ls_backup_pricing ).
lr_app_backup->hec_backup_class_guid = ls_backup_class-hec_backup_class_guid.
lr_app_backup->hec_backup_class_descr = ls_backup_class-hec_backup_class_descr.
lr_app_backup->hec_tree_descr = ls_backup_class-hec_backup_class_descr. "#EC CI_FLDEXT_OK[2215424]
lr_app_backup->hec_backup_month_price_fee = lr_app_backup->hec_backup_size * lr_app_backup->hec_month_price_eur.
lv_data_changed = abap_true.
" Set Value List Quantity
lr_app_backup->hec_backup_class_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_backup(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_tier_category_value = lr_app_backup->hec_tier_cat_value
iv_is_app_backup = abap_true ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
ENDIF. " IF <fs_app_backup_before>-hec_backup_class_guid IS NOT INITIAL AND...
"-----------------------------------
" Backup size has changed
"-----------------------------------
IF lr_app_backup->hec_backup_size IS NOT INITIAL AND
lr_app_backup->hec_backup_size <> <fs_app_backup_before>-hec_backup_size.
lr_app_backup->hec_backup_month_price_fee = lr_app_backup->hec_backup_size * lr_app_backup->hec_month_price_eur.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Phase has changed
"-----------------------------------
IF lr_app_backup->hec_phase_guid NE <fs_app_backup_before>-hec_phase_guid.
" Only for default master node
IF lr_app_backup->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_backup->hec_app_node_default = abap_true.
APPEND VALUE #( hec_node_key = is_ctx-node_key
hec_bopf_key = lr_app_backup->key
hec_phase_guid_new = lr_app_backup->hec_phase_guid
hec_phase_guid_old = <fs_app_backup_before>-hec_phase_guid ) TO lt_act_param_phasing.
ENDIF.
lr_app_backup->hec_phase_changed = abap_true.
lv_data_changed = abap_true.
ENDIF. "phasing changed
ENDIF. "IF <fs_app_backup_before> IS ASSIGNED.
"-----------------------------------
" Modify App backup
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_backup->key
is_data = lr_app_backup ).
ENDIF.
UNASSIGN <fs_app_backup_before>.
CLEAR: lv_inst_status,
lv_data_changed,
ls_backup_class,
ls_backup_pricing.
ENDLOOP.
"-----------------------------------
" Update Phasing
"-----------------------------------
IF lt_act_param_phasing IS NOT INITIAL.
me->mr_act_param_phasing = NEW /hec1/t_act_phase_inherit( lt_act_param_phasing ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = it_key
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-inherit_phase_assignment )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_phasing ).
ENDIF.
" ***************************************************************************
" Update mode after storage update
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage_backup-update_after_storage.
" Get App server storage (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_storage_backup-to_parent
IMPORTING et_data = lt_app_storage ).
LOOP AT lt_app_backup REFERENCE INTO lr_app_backup.
ASSIGN lt_app_storage[ key = lr_app_backup->parent_key ] TO <fs_app_storage>.
IF <fs_app_storage> IS ASSIGNED.
"-----------------------------------
" Release instance for selection
"-----------------------------------
IF <fs_app_storage>-hec_ip_storage_guid IS NOT INITIAL AND
<fs_app_storage>-hec_row_selectable = abap_true.
lv_release = abap_true.
ENDIF.
IF lv_release <> lr_app_backup->hec_row_selectable.
lr_app_backup->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Update App server cluster type
"-----------------------------------
IF lr_app_backup->hec_app_cluster_type_value <> <fs_app_storage>-hec_app_cluster_type_value.
lr_app_backup->hec_app_cluster_type_value = <fs_app_storage>-hec_app_cluster_type_value.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify App storage backup
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_backup->key
is_data = lr_app_backup ).
ENDIF.
ENDIF. " IF <fs_app_storage> IS ASSIGNED.
UNASSIGN <fs_app_storage>.
CLEAR: lv_data_changed,
lv_release.
ENDLOOP.
ENDCASE.
CATCH /bobf/cx_frw. " Exception class
ENDTRY.
ENDMETHOD.
METHOD determine_app_storage_cr.
DATA: lt_app_server TYPE /hec1/t_data_app_serv_ct,
lt_app_storage TYPE /hec1/t_data_app_storage_ct,
lt_app_storage_perserver TYPE /hec1/t_data_app_storage_ct,
lt_app_storage_before TYPE /hec1/t_data_app_storage_ct,
lt_app_storage_succ TYPE /hec1/t_data_app_storage_ct,
lt_app_serv_perf_cat TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_storage_qty TYPE /hec1/t_data_app_storageqty_ct,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_app_backup TYPE /hec1/t_data_app_backup_ct,
lt_act_param TYPE /hec1/t_act_create_app_backup,
lt_act_param_storage TYPE /bobf/t_frw_key,
lt_act_param_phasing TYPE TABLE OF /hec1/s_act_phase_inherit.
CLEAR: eo_message,
et_failed_key.
"-----------------------------------
" Get data
"-----------------------------------
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_storage ).
" Get App server (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_storage-to_parent
IMPORTING et_data = lt_app_server ).
" Get landscape( APM GUID), delivery unit and data center
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING ev_root_key = DATA(lv_root_key)
er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
TRY.
CASE is_ctx-det_key.
" ***************************************************************************
" Create mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage-create.
" Get for each App server the App storage
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server
it_key = VALUE #( FOR wa_serv IN lt_app_server
( key = wa_serv-key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server-app_storage
IMPORTING et_data = lt_app_storage_perserver ).
LOOP AT lt_app_storage
REFERENCE INTO DATA(lr_app_storage)
WHERE hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master.
"-----------------------------------
" Set Value List Quantity
"-----------------------------------
lr_app_storage->hec_ip_storage_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_storage(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_infra_provider_guid = lr_dlvy_unit->hec_inf_provider_guid
iv_sec_datacenter_guid = VALUE #( lt_datacenter[ hec_node_datacenter = lr_app_storage->hec_tier_datacenter_guid ]-hec_sec_datacenter_guid OPTIONAL ) ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
lr_app_storage->hec_delete_visible = abap_false.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
DATA(lv_inst_status) = COND /hec1/config_instance_status( WHEN lr_app_storage->hec_ip_storage_guid IS NOT INITIAL AND
lr_app_storage->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_storage->hec_instance_status.
lr_app_storage->hec_instance_status = lv_inst_status.
DATA(lv_data_changed) = abap_true.
ENDIF.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_server[ key = lr_app_storage->parent_key ] TO FIELD-SYMBOL(<fs_app_server>).
IF <fs_app_server> IS ASSIGNED.
IF <fs_app_server>-hec_ip_server_guid IS NOT INITIAL AND
<fs_app_server>-hec_row_selectable = abap_true.
DATA(lv_release) = abap_true.
ENDIF.
ENDIF.
IF lv_release <> lr_app_storage->hec_row_selectable.
lr_app_storage->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"------------------------------------------
" Set CR related fields from the ROOT node
"------------------------------------------
DATA(lv_cr_data_changed) = /hec1/cl_config_helper=>SET_CR_RELATED_FIELDS(
EXPORTING
is_ctx = is_ctx
it_key = it_key
io_read = io_read
io_modify = io_modify
iv_mod_type = /hec1/if_config_constants=>gc_comp_mod_type-added
is_node_data = lr_app_storage
iv_set_apm = abap_true
iv_clear_phase = abap_true
).
IF lv_data_changed = abap_false.
lv_data_changed = lv_cr_data_changed.
ENDIF.
"-----------------------------------
" Fill action table for create
" App server storage backup
"-----------------------------------
IF lr_app_storage->hec_backup_relev_value = '01'. " mandantory
INSERT VALUE #( key = lr_app_storage->key
parent_key = lr_app_storage->parent_key
hec_backup_qty = lr_app_storage->hec_backup_qty ) INTO TABLE lt_act_param.
ENDIF.
"-----------------------------------
" Fill action table for setting
" App server storage
" successor/predecessor
"-----------------------------------
DATA(lv_node_count) = REDUCE i( INIT x = 0
FOR <l> IN lt_app_storage_perserver WHERE ( parent_key = lr_app_storage->parent_key )
NEXT x = x + 1 ).
IF NOT line_exists( lt_act_param_storage[ key = lr_app_storage->key ] ) AND lv_node_count > 1.
TRY.
INSERT VALUE #( key = lr_app_storage->key ) INTO TABLE lt_act_param_storage.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
"-----------------------------------
" Modify App server storage
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_storage->key
is_data = lr_app_storage ).
ENDIF.
UNASSIGN <fs_app_server>.
CLEAR: lv_inst_status,
lv_data_changed,
lv_release,
lv_node_count.
ENDLOOP.
"-----------------------------------
" Set create App server storage
" backup action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_backup( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_backup )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
"-----------------------------------
" Set update App storage action
" to GENERAL
"-----------------------------------
IF lt_act_param_storage IS NOT INITIAL.
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = VALUE #( BASE CORRESPONDING #( is_ctx )
node_key = /hec1/if_configuration_c=>sc_node-app_storage )
it_key = lt_act_param_storage
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-update_app_storage )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation ).
ENDIF.
" ***************************************************************************
" Update mode
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage-update.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_before_image = abap_true
IMPORTING et_data = lt_app_storage_before ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( ( key = lv_root_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase ).
" Get App server (parent)
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_storage-to_parent
IMPORTING et_data = lt_app_server ).
" Get Backup
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_storage-app_storage_backup
IMPORTING et_data = lt_app_backup ).
LOOP AT lt_app_storage REFERENCE INTO lr_app_storage.
ASSIGN lt_app_storage_before[ key = lr_app_storage->key ] TO FIELD-SYMBOL(<fs_app_storage_before>).
IF <fs_app_storage_before> IS ASSIGNED.
"-----------------------------------
" App storage IP GUID has changed
"-----------------------------------
IF lr_app_storage->hec_ip_storage_guid IS NOT INITIAL AND
lr_app_storage->hec_ip_storage_guid <> <fs_app_storage_before>-hec_ip_storage_guid.
" since this is the parent there can only be one entry
TRY.
DATA(ls_app_server) = lt_app_server[ key = lr_app_storage->parent_key ].
CATCH cx_sy_itab_line_not_found.
ENDTRY.
SELECT SINGLE *
FROM /hec1/i_storagelbbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_sec_datacenter_guid = @ls_app_server-hec_sec_datacenter_guid AND
hec_infra_provider_guid = @lr_dlvy_unit->hec_inf_provider_guid AND
hec_ip_storage_guid = @lr_app_storage->hec_ip_storage_guid
INTO @DATA(ls_storage).
SELECT SINGLE * FROM /hec1/c_cbp_lb "#EC CI_ALL_FIELDS_NEEDED
INTO @DATA(ls_pricing)
WHERE hec_price_lb = @ls_storage-hec_cb_pricing_lb_guid.
lr_app_storage->* = CORRESPONDING #( BASE ( lr_app_storage->* ) ls_pricing ).
lr_app_storage->hec_ip_storage_guid = ls_storage-hec_ip_storage_guid.
lr_app_storage->hec_storage_descr = ls_storage-hec_storage_descr.
lr_app_storage->hec_month_price_fee = lr_app_storage->hec_storage_quantity * lr_app_storage->hec_month_price_eur.
lr_app_storage->hec_tree_descr = ls_storage-hec_storage_descr. "#EC CI_FLDEXT_OK[2215424]
lv_data_changed = abap_true.
" Set Value List Quantity
lr_app_storage->hec_ip_storage_vlqt = COND #( WHEN 1 < lines( /hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_storage(
iv_apm_guid = lr_landscape->hec_apm_guid
iv_infra_provider_guid = lr_dlvy_unit->hec_inf_provider_guid
iv_sec_datacenter_guid = VALUE #( lt_datacenter[ hec_node_datacenter = lr_app_storage->hec_tier_datacenter_guid ]-hec_sec_datacenter_guid OPTIONAL ) ) )
THEN /hec1/if_config_constants=>gc_value_list_quantity-multi
ELSE /hec1/if_config_constants=>gc_value_list_quantity-single ).
ENDIF. "ip storage has changed
"-----------------------------------
" App storage amount has changed
"-----------------------------------
IF lr_app_storage->hec_storage_quantity IS NOT INITIAL AND
lr_app_storage->hec_storage_quantity <> <fs_app_storage_before>-hec_storage_quantity.
lr_app_storage->hec_month_price_fee = lr_app_storage->hec_storage_quantity * lr_app_storage->hec_month_price_eur.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" App storage backup quantity is added
"-----------------------------------
IF lr_app_storage->hec_backup_qty > <fs_app_storage_before>-hec_backup_qty.
INSERT VALUE #( key = lr_app_storage->key
parent_key = lr_app_storage->parent_key
hec_backup_qty = lr_app_storage->hec_backup_qty - <fs_app_storage_before>-hec_backup_qty ) INTO TABLE lt_act_param.
" Success message
/hec1/cl_config_helper=>set_message( EXPORTING iv_textid = /hec1/cx_bopf_config=>new_backup_added
iv_severity = /bobf/cm_frw=>co_severity_success
iv_attr1 = CONV #( lr_app_storage->hec_backup_qty -
<fs_app_storage_before>-hec_backup_qty )
CHANGING co_message = eo_message ).
ELSEIF lr_app_storage->hec_backup_qty < <fs_app_storage_before>-hec_backup_qty
AND lr_app_storage->hec_backup_qty < lines( VALUE /hec1/t_data_app_backup_ct( FOR app_backup IN lt_app_backup
WHERE ( parent_key = lr_app_storage->key )
( app_backup ) ) ).
DATA(lv_attr_name) = /hec1/if_configuration_c=>sc_node_attribute-solution-hec_tier_qty_nprod_level.
" Error message
/hec1/cl_config_helper=>set_message( EXPORTING iv_textid = /hec1/cx_bopf_config=>object_no_not_higher
is_origin_location = VALUE #( node_key = is_ctx-node_key
key = lr_app_storage->key
attributes = VALUE #( ( lv_attr_name ) ) )
CHANGING co_message = eo_message ).
" Set node number to value before update
lr_app_storage->hec_backup_qty = <fs_app_storage_before>-hec_backup_qty.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Phase has changed - update phase and inherit phase assignment
"-----------------------------------
IF lr_app_storage->hec_phase_guid NE <fs_app_storage_before>-hec_phase_guid.
" Only for default master node
IF lr_app_storage->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master AND
lr_app_storage->hec_app_node_default = abap_true.
APPEND VALUE #( hec_node_key = is_ctx-node_key
hec_bopf_key = lr_app_storage->key
hec_phase_guid_new = lr_app_storage->hec_phase_guid
hec_phase_guid_old = <fs_app_storage_before>-hec_phase_guid ) TO lt_act_param_phasing.
ENDIF.
lr_app_storage->hec_phase_changed = abap_true.
lv_data_changed = abap_true.
ENDIF. "phasing changed
ENDIF. "if <fs_app_storage_before> is assigned.
"-----------------------------------
" Check instance status and switch
"-----------------------------------
lv_inst_status = COND /hec1/config_instance_status( WHEN lr_app_storage->hec_ip_storage_guid IS NOT INITIAL AND
lr_app_storage->hec_phase_guid IS NOT INITIAL
THEN /hec1/if_config_constants=>gc_instance_status-complete
ELSE /hec1/if_config_constants=>gc_instance_status-incomplete ).
IF lv_inst_status <> lr_app_storage->hec_instance_status.
lr_app_storage->hec_instance_status = lv_inst_status.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Modify
"-----------------------------------
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_storage->key
is_data = lr_app_storage ).
ENDIF.
CLEAR: lv_inst_status,
lv_data_changed,
ls_app_server,
ls_pricing,
ls_storage.
UNASSIGN <fs_app_storage_before>.
ENDLOOP.
"-----------------------------------
" Set create App server storage
" backup action to general
"-----------------------------------
IF lt_act_param IS NOT INITIAL.
CLEAR me->mr_act_param.
me->mr_act_param = NEW /hec1/t_act_create_app_backup( lt_act_param ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_act IN lt_act_param
( key = wa_act-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-create_app_backup )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param ).
ENDIF.
"-----------------------------------
" Update Phasing
"-----------------------------------
IF lt_act_param_phasing IS NOT INITIAL.
me->mr_act_param_phasing = NEW /hec1/t_act_phase_inherit( lt_act_param_phasing ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = it_key
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-inherit_phase_assignment )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_phasing ).
ENDIF.
" ***************************************************************************
" Update mode after server update
" ***************************************************************************
WHEN /hec1/if_configuration_c=>sc_determination-app_storage-update_after_server.
LOOP AT lt_app_storage REFERENCE INTO lr_app_storage.
"-----------------------------------
" Release instance for selection
"-----------------------------------
ASSIGN lt_app_server[ key = lr_app_storage->parent_key ] TO <fs_app_server>.
IF <fs_app_server> IS ASSIGNED.
IF <fs_app_server>-hec_ip_server_guid IS NOT INITIAL AND
<fs_app_server>-hec_row_selectable = abap_true.
lv_release = abap_true.
ENDIF.
ENDIF.
IF lr_app_storage->hec_row_selectable <> lv_release.
lr_app_storage->hec_row_selectable = lv_release.
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Update App server cluster type
"-----------------------------------
IF lr_app_storage->hec_app_cluster_type_value <> <fs_app_server>-hec_app_cluster_type_value.
lr_app_storage->hec_app_cluster_type_value = <fs_app_server>-hec_app_cluster_type_value.
lv_data_changed = abap_true.
ENDIF.
IF lv_data_changed = abap_true.
io_modify->update( iv_node = is_ctx-node_key
iv_key = lr_app_storage->key
is_data = lr_app_storage ).
ENDIF.
UNASSIGN <fs_app_server>.
CLEAR: lv_release,
lv_data_changed.
ENDLOOP. " LOOP AT lt_app_storage
ENDCASE.
CATCH /bobf/cx_frw. " Exception class
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
31631,
1220,
258,
66,
16,
14,
565,
62,
11250,
62,
15255,
62,
1324,
62,
15388,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1220,
258,
66,
16,
14,
565,
62,
8019,
62,
67,
62,
16668,
4871,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
12260,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
12260,
62,
21048,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42865,
285,
81,
62,
529,
62,
17143,
41876,
4526,
37,
5390,
1366,
764,
198,
220,
220,
220,
42865,
285,
81,
62,
529,
62,
17143,
16,
41876,
4526,
37,
5390,
1366,
764,
198,
220,
220,
220,
42865,
285,
81,
62,
529,
62,
17143,
62,
1324,
62,
17440,
41876,
4526,
37,
5390,
1366,
764,
198,
220,
220,
220,
42865,
285,
81,
62,
529,
62,
17143,
62,
19608,
330,
41876,
4526,
37,
5390,
1366,
764,
198,
220,
220,
220,
42865,
285,
81,
62,
529,
62,
17143,
62,
67,
6780,
88,
41876,
4526,
37,
5390,
1366,
764,
198,
220,
220,
220,
42865,
285,
81,
62,
529,
62,
17143,
62,
746,
2313,
41876,
4526,
37,
5390,
1366,
764,
198,
220,
220,
220,
42865,
285,
81,
62,
529,
62,
17143,
62,
15388,
41876,
4526,
37,
5390,
1366,
764,
198,
220,
220,
220,
42865,
285,
81,
62,
529,
62,
17143,
62,
15388,
62,
14751,
41876,
4526,
37,
5390,
1366,
764,
198,
220,
220,
220,
42865,
285,
81,
62,
529,
62,
17143,
62,
1324,
62,
1891,
929,
41876,
4526,
37,
5390,
1366,
764,
628,
220,
220,
220,
337,
36252,
50,
5004,
62,
1324,
62,
17440,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
49464,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
82,
62,
8310,
86,
62,
49464,
62,
15255,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
83,
62,
8310,
86,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
961,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1220,
65,
672,
69,
14,
361,
62,
8310,
86,
62,
961,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
4666,
1958,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1220,
65,
672,
69,
14,
361,
62,
8310,
86,
62,
4666,
1958,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
68,
78,
62,
20500,
220,
220,
220,
41876,
4526,
37,
5390,
1220,
65,
672,
69,
14,
361,
62,
8310,
86,
62,
20500,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
316,
62,
47904,
62,
2539,
41876,
1220,
65,
672,
69,
14,
83,
62,
8310,
86,
62,
2539,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1220,
65,
672,
69,
14,
66,
87,
62,
8310,
86,
764,
198,
220,
220,
220,
337,
36252,
50,
5004,
62,
1324,
62,
17440,
62,
6098,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
49464,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
82,
62,
8310,
86,
62,
49464,
62,
15255,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
83,
62,
8310,
86,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
961,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1220,
65,
672,
69,
14,
361,
62,
8310,
86,
62,
961,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
4666,
1958,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1220,
65,
672,
69,
14,
361,
62,
8310,
86,
62,
4666,
1958,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
68,
78,
62,
20500,
220,
220,
220,
41876,
4526,
37,
5390,
1220,
65,
672,
69,
14,
361,
62,
8310,
86,
62,
20500,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
316,
62,
47904,
62,
2539,
41876,
1220,
65,
672,
69,
14,
83,
62,
8310,
86,
62,
2539,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1220,
65,
672,
69,
14,
66,
87,
62,
8310,
86,
764,
198,
220,
220,
220,
337,
36252,
50,
5004,
62,
1324,
62,
15388,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
49464,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
82,
62,
8310,
86,
62,
49464,
62,
15255,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
83,
62,
8310,
86,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
961,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1220,
65,
672,
69,
14,
361,
62,
8310,
86,
62,
961,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
4666,
1958,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1220,
65,
672,
69,
14,
361,
62,
8310,
86,
62,
4666,
1958,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
68,
78,
62,
20500,
220,
220,
220,
41876,
4526,
37,
5390,
1220,
65,
672,
69,
14,
361,
62,
8310,
86,
62,
20500,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
316,
62,
47904,
62,
2539,
41876,
1220,
65,
672,
69,
14,
83,
62,
8310,
86,
62,
2539,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1220,
65,
672,
69,
14,
66
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_gui_html_processor DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
CONSTANTS c_css_build_name TYPE string VALUE 'css/bundle.css'.
CONSTANTS c_comment_start TYPE string VALUE `<!-- by AG HTML preprocessor `.
CONSTANTS c_comment_end TYPE string VALUE `-->`.
INTERFACES zif_abapgit_gui_html_processor .
METHODS constructor
IMPORTING
ii_asset_man TYPE REF TO zif_abapgit_gui_asset_manager.
METHODS preserve_css
IMPORTING
!iv_css_url TYPE string .
PROTECTED SECTION.
PRIVATE SECTION.
DATA mt_preserve_css TYPE string_table.
DATA mi_asset_man TYPE REF TO zif_abapgit_gui_asset_manager.
METHODS patch_html
IMPORTING
iv_html TYPE string
EXPORTING
ev_html TYPE string
et_css_urls TYPE string_table
RAISING
zcx_abapgit_exception.
METHODS is_preserved
IMPORTING
!iv_css_url TYPE string
RETURNING
VALUE(rv_yes) TYPE abap_bool.
ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_HTML_PROCESSOR IMPLEMENTATION.
METHOD constructor.
mi_asset_man = ii_asset_man.
ENDMETHOD.
METHOD is_preserved.
READ TABLE mt_preserve_css TRANSPORTING NO FIELDS WITH KEY table_line = iv_css_url.
rv_yes = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD patch_html.
CONSTANTS lc_css_re TYPE string VALUE `<link\s+rel="stylesheet"\s+type="text/css"\s+href="(\S+)">`.
DATA lv_head_end TYPE i.
DATA lo_css_re TYPE REF TO cl_abap_regex.
DATA lo_matcher TYPE REF TO cl_abap_matcher.
DATA lv_css_path TYPE string.
DATA lv_off TYPE i.
DATA lv_len TYPE i.
DATA lv_cur TYPE i.
DATA lc_css_build TYPE string VALUE '<link rel="stylesheet" type="text/css" href="$BUILD_NAME">'.
REPLACE FIRST OCCURRENCE OF '$BUILD_NAME' IN lc_css_build WITH c_css_build_name. " Mmmm
CLEAR: ev_html, et_css_urls.
lv_head_end = find( val = iv_html regex = |{ cl_abap_char_utilities=>newline }?\\s*</head>| case = abap_false ).
IF lv_head_end <= 0.
zcx_abapgit_exception=>raise( 'HTML preprocessor: </head> not found' ).
ENDIF.
CREATE OBJECT lo_css_re
EXPORTING
ignore_case = abap_true
pattern = lc_css_re.
lo_matcher = lo_css_re->create_matcher( text = substring( val = iv_html len = lv_head_end ) ).
WHILE lo_matcher->find_next( ) = abap_true.
lv_css_path = lo_matcher->get_submatch( 1 ).
IF abap_false = is_preserved( lv_css_path ).
lv_off = lo_matcher->get_offset( ).
lv_len = lo_matcher->get_length( ).
ev_html = ev_html && substring( val = iv_html off = lv_cur len = lv_off - lv_cur ).
ev_html = ev_html && c_comment_start && substring( val = iv_html off = lv_off len = lv_len ) && c_comment_end.
lv_cur = lv_off + lv_len.
APPEND lv_css_path TO et_css_urls.
ENDIF.
ENDWHILE.
ev_html = ev_html && substring( val = iv_html off = lv_cur len = lv_head_end - lv_cur ).
IF lines( et_css_urls ) > 0.
ev_html = ev_html
&& cl_abap_char_utilities=>newline && ` ` " Assume 4 space indent, maybe improve and detect ?
&& c_comment_start && c_comment_end
&& lc_css_build.
ENDIF.
ev_html = ev_html && substring( val = iv_html off = lv_head_end ).
ENDMETHOD.
METHOD preserve_css.
APPEND iv_css_url TO mt_preserve_css.
ENDMETHOD.
METHOD zif_abapgit_gui_html_processor~process.
DATA lo_css_processor TYPE REF TO zcl_abapgit_gui_css_processor.
DATA lt_css_urls TYPE string_table.
DATA lv_css_build TYPE string.
FIELD-SYMBOLS <lv_url> LIKE LINE OF lt_css_urls.
patch_html(
EXPORTING
iv_html = iv_html
IMPORTING
ev_html = rv_html
et_css_urls = lt_css_urls ).
IF lines( lt_css_urls ) > 0.
CREATE OBJECT lo_css_processor
EXPORTING
ii_asset_manager = mi_asset_man.
LOOP AT lt_css_urls ASSIGNING <lv_url>.
lo_css_processor->add_file( <lv_url> ).
ENDLOOP.
lv_css_build = lo_css_processor->process( ).
ii_gui_services->cache_asset(
iv_url = |{ c_css_build_name }|
iv_type = 'text'
iv_subtype = 'css'
iv_text = lv_css_build ).
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
6494,
62,
41341,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
25471,
62,
11249,
62,
3672,
41876,
4731,
26173,
8924,
705,
25471,
14,
65,
31249,
13,
25471,
4458,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
23893,
62,
9688,
41876,
4731,
26173,
8924,
4600,
27,
28112,
416,
13077,
11532,
662,
41341,
4600,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
23893,
62,
437,
41876,
4731,
26173,
8924,
4600,
46904,
44646,
628,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
6494,
62,
41341,
764,
628,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21065,
62,
562,
316,
62,
805,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
562,
316,
62,
37153,
13,
628,
220,
220,
220,
337,
36252,
50,
12201,
62,
25471,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
25471,
62,
6371,
41876,
4731,
764,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
45079,
62,
18302,
3760,
62,
25471,
41876,
4731,
62,
11487,
13,
198,
220,
220,
220,
42865,
21504,
62,
562,
316,
62,
805,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
562,
316,
62,
37153,
13,
628,
220,
220,
220,
337,
36252,
50,
8529,
62,
6494,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
6494,
41876,
4731,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
819,
62,
6494,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
2123,
62,
25471,
62,
6371,
82,
41876,
4731,
62,
11487,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
337,
36252,
50,
318,
62,
18302,
8520,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
25471,
62,
6371,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8505,
8,
41876,
450,
499,
62,
30388,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
40156,
62,
28656,
62,
4805,
4503,
7597,
1581,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
21504,
62,
562,
316,
62,
805,
796,
21065,
62,
562,
316,
62,
805,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
318,
62,
18302,
8520,
13,
198,
220,
220,
220,
20832,
43679,
45079,
62,
18302,
3760,
62,
25471,
48213,
4303,
9863,
2751,
8005,
18930,
3698,
5258,
13315,
35374,
3084,
62,
1370,
796,
21628,
62,
25471,
62,
6371,
13,
198,
220,
220,
220,
374,
85,
62,
8505,
796,
20512,
66,
7,
827,
12,
7266,
6015,
796,
657,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
8529,
62,
6494,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
300,
66,
62,
25471,
62,
260,
41876,
4731,
26173,
8924,
4600,
27,
8726,
59,
82,
10,
2411,
2625,
47720,
25473,
1,
59,
82,
10,
4906,
2625,
5239,
14,
25471,
1,
59,
82,
10,
33257,
2625,
38016,
50,
28988,
5320,
44646,
628,
220,
220,
220,
42865,
300,
85,
62,
2256,
62,
437,
41876,
1312,
13,
198,
220,
220,
220,
42865,
2376,
62,
25471,
62,
260,
220,
220,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
260,
25636,
13,
198,
220,
220,
220,
42865,
2376,
62,
6759,
2044,
220,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
6759,
2044,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
25471,
62,
6978,
41876,
4731,
13,
628,
220,
220,
220,
42865,
300,
85,
62,
2364,
41876,
1312,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
11925,
41876,
1312,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
22019,
41876,
1312,
13,
628,
220,
220,
220,
42865,
300,
66,
62,
25471,
62,
11249,
41876,
4731,
26173,
8924,
705,
27,
8726,
823,
2625,
47720,
25473,
1,
2099,
2625,
5239,
14,
25471,
1,
13291,
2625,
3,
19499,
26761,
62,
20608,
5320,
4458,
198,
220,
220,
220,
45285,
11598,
31328,
440,
4093,
31302,
18310,
3963,
705,
3,
19499,
26761,
62,
20608,
6,
3268,
300,
66,
62,
25471,
62,
11249,
13315,
269,
62,
25471,
62,
11249,
62,
3672,
13,
366,
337,
27532,
628,
220,
220,
220,
30301,
1503,
25,
819,
62,
6494,
11,
2123,
62,
25471,
62,
6371,
82,
13,
628,
220,
220,
220,
300,
85,
62,
2256,
62,
437,
796,
1064,
7,
1188,
796,
21628,
62,
6494,
40364,
796,
930,
90,
537,
62,
397,
499,
62,
10641,
62,
315,
2410,
14804,
3605,
1370,
1782,
30,
6852,
82,
9,
3556,
2256,
29,
91,
1339,
796,
450,
499,
62,
9562,
6739,
198,
220,
220,
220,
16876,
300,
85,
62,
2256,
62,
437,
19841,
657,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
28656,
662,
41341,
25,
7359,
2256,
29,
407,
1043,
6,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
2376,
62,
25471,
62,
260,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
8856,
62,
7442,
796,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
220,
220,
3912,
220,
220,
220,
220,
796,
300,
66,
62,
25471,
62,
260,
13,
628,
220,
220,
220,
2376,
62,
6759,
2044,
796,
2376,
62,
25471,
62,
260,
3784,
17953,
62,
6759,
2044,
7,
2420,
796,
3293,
1806,
7,
1188,
796,
21628,
62,
6494,
18896,
796,
300,
85,
62,
2256,
62
] | [
1,
1,
1,
1,
1,
1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( val = `ha` occ = 5 ).
| [
13116,
1976,
62,
44754,
62,
8841,
13,
198,
198,
13564,
9585,
7,
1188,
796,
4600,
3099,
63,
220,
1609,
796,
642,
6739,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*----------------------------------------------------------------------*
***INCLUDE LZBT_DYNPROO01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module STATUS_0001 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0001 OUTPUT.
PERFORM status_0001.
ENDMODULE. " STATUS_0001 OUTPUT
*&---------------------------------------------------------------------*
*& Module SET_SUBSCREENS_0001 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE set_subscreens_0001 OUTPUT.
PERFORM set_subscreens_0001.
ENDMODULE. " SET_SUBSCREENS_0001 OUTPUT
*&---------------------------------------------------------------------*
*& Module PBO_0300 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE pbo_0300 OUTPUT.
PERFORM pbo_0300.
ENDMODULE. " PBO_0300 OUTPUT
*&---------------------------------------------------------------------*
*& Module SET_DISPLAY_MODE OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE set_display_mode OUTPUT.
PERFORM set_dynpro_display_mode USING g_display_mode.
ENDMODULE. " SET_DISPLAY_MODE OUTPUT
*&---------------------------------------------------------------------*
*& Module PBO_0500 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE pbo_0500 OUTPUT.
PERFORM pbo_0500.
ENDMODULE. " PBO_0500 OUTPUT
*&---------------------------------------------------------------------*
*& Module PBO_0101 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE pbo_0101 OUTPUT.
PERFORM pbo_0101.
ENDMODULE. " PBO_0101 OUTPUT
*&---------------------------------------------------------------------*
*& Module STATUS_0700 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0700 OUTPUT.
PERFORM pbo_0700.
ENDMODULE. " STATUS_0700 OUTPUT
| [
9,
10097,
23031,
9,
198,
8162,
1268,
5097,
52,
7206,
406,
57,
19313,
62,
35,
56,
38588,
6684,
486,
764,
198,
9,
10097,
23031,
9,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
220,
220,
220,
220,
19937,
220,
15486,
2937,
62,
39103,
220,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
220,
220,
220,
220,
220,
220,
2420,
198,
9,
10097,
23031,
9,
198,
33365,
24212,
3722,
62,
39103,
16289,
30076,
13,
198,
9,
220,
25823,
28223,
12,
35744,
2937,
705,
24223,
4458,
198,
9,
220,
25823,
37977,
2538,
33,
1503,
705,
31811,
4458,
198,
198,
10619,
33365,
24212,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
15486,
2937,
62,
39103,
220,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
220,
220,
220,
220,
19937,
220,
15486,
2937,
62,
18005,
220,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
220,
220,
220,
220,
220,
220,
2420,
198,
9,
10097,
23031,
9,
198,
33365,
24212,
3722,
62,
18005,
16289,
30076,
13,
198,
220,
19878,
21389,
3722,
62,
18005,
13,
198,
10619,
33365,
24212,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
15486,
2937,
62,
18005,
220,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
220,
220,
220,
220,
19937,
220,
25823,
62,
12564,
4462,
43387,
16938,
62,
18005,
220,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
220,
220,
220,
220,
220,
220,
2420,
198,
9,
10097,
23031,
9,
198,
33365,
24212,
900,
62,
7266,
1416,
5681,
62,
18005,
16289,
30076,
13,
198,
220,
19878,
21389,
900,
62,
7266,
1416,
5681,
62,
18005,
13,
198,
10619,
33365,
24212,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
25823,
62,
12564,
4462,
43387,
16938,
62,
18005,
220,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
220,
220,
220,
220,
19937,
220,
350,
8202,
62,
3070,
405,
220,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
220,
220,
220,
220,
220,
220,
2420,
198,
9,
10097,
23031,
9,
198,
33365,
24212,
279,
2127,
62,
3070,
405,
16289,
30076,
13,
198,
220,
19878,
21389,
279,
2127,
62,
3070,
405,
13,
198,
10619,
33365,
24212,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
350,
8202,
62,
3070,
405,
220,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
220,
220,
220,
220,
19937,
220,
25823,
62,
26288,
31519,
62,
49058,
220,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
220,
220,
220,
220,
220,
220,
2420,
198,
9,
10097,
23031,
9,
198,
33365,
24212,
900,
62,
13812,
62,
14171,
16289,
30076,
13,
198,
220,
19878,
21389,
900,
62,
67,
2047,
1676,
62,
13812,
62,
14171,
1294,
2751,
308,
62,
13812,
62,
14171,
13,
198,
10619,
33365,
24212,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
25823,
62,
26288,
31519,
62,
49058,
220,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
220,
220,
220,
220,
19937,
220,
350,
8202,
62,
2713,
405,
220,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
220,
220,
220,
220,
220,
220,
2420,
198,
9,
10097,
23031,
9,
198,
33365,
24212,
279,
2127,
62,
2713,
405,
16289,
30076,
13,
198,
220,
19878,
21389,
279,
2127,
62,
2713,
405,
13,
198,
10619,
33365,
24212,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
350,
8202,
62,
2713,
405,
220,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
220,
220,
220,
220,
19937,
220,
350,
8202,
62,
486,
486,
220,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
220,
220,
220,
220,
220,
220,
2420,
198,
9,
10097,
23031,
9,
198,
33365,
24212,
279,
2127,
62,
486,
486,
16289,
30076,
13,
198,
220,
19878,
21389,
279,
2127,
62,
486,
486,
13,
198,
10619,
33365,
24212,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
350,
8202,
62,
486,
486,
220,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
220,
220,
220,
220,
19937,
220,
15486,
2937,
62,
2998,
405,
220,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
220,
220,
220,
220,
220,
220,
2420,
198,
9,
10097,
23031,
9,
198,
33365,
24212,
3722,
62,
2998,
405,
16289,
30076,
13,
198,
220,
19878,
21389,
279,
2127,
62,
2998,
405,
13,
198,
198,
10619,
33365,
24212,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
15486,
2937,
62,
2998,
405,
220,
16289,
30076,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ZCL_GTT_STS_TOOLS definition
public
create public .
public section.
constants:
BEGIN OF cs_condition,
true TYPE sy-binpt VALUE 'T',
false TYPE sy-binpt VALUE 'F',
END OF cs_condition .
class-methods ARE_STRUCTURES_DIFFERENT
importing
!IR_DATA1 type ref to DATA
!IR_DATA2 type ref to DATA
returning
value(RV_RESULT) type SY-BINPT
raising
CX_UDM_MESSAGE .
class-methods GET_POSTAL_ADDRESS
importing
!IV_NODE_ID type /SCMTMS/BO_NODE_ID
exporting
!ET_POSTAL_ADDRESS type /BOFU/T_ADDR_POSTAL_ADDRESSK
raising
CX_UDM_MESSAGE .
class-methods CONVERT_UTC_TIMESTAMP
importing
!IV_TIMEZONE type TTZZ-TZONE
changing
!CV_TIMESTAMP type /SCMTMS/TIMESTAMP
raising
CX_UDM_MESSAGE .
class-methods GET_FIELD_OF_STRUCTURE
importing
!IR_STRUCT_DATA type ref to DATA
!IV_FIELD_NAME type CLIKE
returning
value(RV_VALUE) type CHAR50
raising
CX_UDM_MESSAGE .
class-methods GET_ERRORS_LOG
importing
!IO_UMD_MESSAGE type ref to CX_UDM_MESSAGE
!IV_APPSYS type C
exporting
!ES_BAPIRET type BAPIRET2 .
class-methods GET_LOCAL_TIMESTAMP
importing
!IV_DATE type ANY default SY-DATUM
!IV_TIME type ANY default SY-UZEIT
returning
value(RV_TIMESTAMP) type /SAPTRX/EVENT_EXP_DATETIME .
class-methods GET_PRETTY_VALUE
importing
!IV_VALUE type ANY
returning
value(RV_PRETTY) type /SAPTRX/PARAMVAL200 .
class-methods GET_SYSTEM_TIME_ZONE
returning
value(RV_TZONE) type TIMEZONE
raising
CX_UDM_MESSAGE .
class-methods GET_SYSTEM_DATE_TIME
returning
value(RV_DATETIME) type STRING
raising
CX_UDM_MESSAGE .
class-methods IS_NUMBER
importing
!IV_VALUE type ANY
returning
value(RV_RESULT) type ABAP_BOOL .
class-methods IS_TABLE
importing
!IV_VALUE type ANY
returning
value(RV_RESULT) type ABAP_BOOL .
class-methods THROW_EXCEPTION
importing
!IV_TEXTID type SOTR_CONC default ''
raising
CX_UDM_MESSAGE .
class-methods GET_STOP_POINTS
importing
!IV_ROOT_ID type /SCMTMS/TOR_ID
!IT_STOP type /SCMTMS/T_EM_BO_TOR_STOP
exporting
!ET_STOP_POINTS type ZIF_GTT_STS_EF_TYPES=>TT_STOP_POINTS .
class-methods IS_ODD
importing
!IV_VALUE type N
returning
value(RV_IS_ODD) type ABAP_BOOL .
class-methods GET_CAPA_MATCH_KEY
importing
!IV_ASSGN_STOP_KEY type /SCMTMS/TOR_STOP_KEY
!IT_CAPA_STOP type /SCMTMS/T_EM_BO_TOR_STOP
!IT_CAPA_ROOT type /SCMTMS/T_EM_BO_TOR_ROOT
!IV_BEFORE_IMAGE type ABAP_BOOL optional
returning
value(RV_CAPA_MATCHKEY) type /SAPTRX/LOC_ID_2 .
class-methods CHECK_IS_FO_DELETED
importing
!IS_ROOT_NEW type /SCMTMS/S_EM_BO_TOR_ROOT
!IS_ROOT_OLD type /SCMTMS/S_EM_BO_TOR_ROOT
returning
value(RV_RESULT) type ZIF_GTT_STS_EF_TYPES=>TV_CONDITION
raising
CX_UDM_MESSAGE .
class-methods GET_FO_TRACKED_ITEM_OBJ
importing
!IS_APP_OBJECT type TRXAS_APPOBJ_CTAB_WA
!IS_ROOT type /SCMTMS/S_EM_BO_TOR_ROOT
!IT_ITEM type /SCMTMS/T_EM_BO_TOR_ITEM
!IV_APPSYS type /SAPTRX/APPLSYSTEM
!IV_OLD_DATA type ABAP_BOOL default ABAP_FALSE
changing
!CT_TRACK_ID_DATA type ZIF_GTT_STS_EF_TYPES=>TT_ENH_TRACK_ID_DATA
raising
CX_UDM_MESSAGE .
class-methods GET_TRACK_OBJ_CHANGES
importing
!IS_APP_OBJECT type TRXAS_APPOBJ_CTAB_WA
!IV_APPSYS type /SAPTRX/APPLSYSTEM
!IT_TRACK_ID_DATA_NEW type ZIF_GTT_STS_EF_TYPES=>TT_ENH_TRACK_ID_DATA
!IT_TRACK_ID_DATA_OLD type ZIF_GTT_STS_EF_TYPES=>TT_ENH_TRACK_ID_DATA
changing
!CT_TRACK_ID_DATA type ZIF_GTT_STS_EF_TYPES=>TT_TRACK_ID_DATA
raising
CX_UDM_MESSAGE .
class-methods GET_TRMODCOD
importing
!IV_TRMODCOD type /SCMTMS/TRMODCODE
returning
value(RV_TRMODCOD) type /SCMTMS/TRMODCODE .
class-methods GET_LOCATION_TYPE
importing
!IV_LOCNO type /SAPAPO/LOCNO
returning
value(RV_LOCTYPE) type /SAPTRX/LOC_ID_TYPE .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_GTT_STS_TOOLS IMPLEMENTATION.
METHOD are_structures_different.
DATA: lt_fields TYPE cl_abap_structdescr=>component_table,
lv_dummy TYPE char100 ##needed.
FIELD-SYMBOLS: <ls_data1> TYPE any,
<ls_data2> TYPE any,
<lv_value1> TYPE any,
<lv_value2> TYPE any.
ASSIGN ir_data1->* TO <ls_data1>.
ASSIGN ir_data2->* TO <ls_data2>.
IF <ls_data1> IS ASSIGNED AND <ls_data2> IS ASSIGNED.
lt_fields = CAST cl_abap_structdescr(
cl_abap_typedescr=>describe_by_data(
p_data = <ls_data1> )
)->get_components( ).
rv_result = cs_condition-false.
LOOP AT lt_fields ASSIGNING FIELD-SYMBOL(<ls_fields>).
ASSIGN COMPONENT <ls_fields>-name OF STRUCTURE <ls_data1> TO <lv_value1>.
ASSIGN COMPONENT <ls_fields>-name OF STRUCTURE <ls_data2> TO <lv_value2>.
IF <lv_value1> IS ASSIGNED AND
<lv_value2> IS ASSIGNED.
IF <lv_value1> <> <lv_value2>.
rv_result = cs_condition-true.
EXIT.
ENDIF.
ELSE.
MESSAGE e001(zgtt_sts) WITH <ls_fields>-name INTO lv_dummy.
zcl_gtt_sts_tools=>throw_exception( ).
ENDIF.
ENDLOOP.
ELSE.
MESSAGE e002(zgtt_sts) INTO lv_dummy.
zcl_gtt_sts_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD check_is_fo_deleted.
rv_result = zif_gtt_sts_ef_constants=>cs_condition-false.
DATA(lv_carrier_removed) = xsdbool(
is_root_old-tsp IS INITIAL AND is_root_new-tsp IS NOT INITIAL ).
DATA(lv_execution_status_changed) = xsdbool(
( is_root_old-execution <> /scmtms/if_tor_status_c=>sc_root-execution-v_in_execution AND
is_root_old-execution <> /scmtms/if_tor_status_c=>sc_root-execution-v_ready_for_execution AND
is_root_old-execution <> /scmtms/if_tor_status_c=>sc_root-execution-v_executed ) AND
( is_root_new-execution = /scmtms/if_tor_status_c=>sc_root-execution-v_in_execution OR
is_root_new-execution = /scmtms/if_tor_status_c=>sc_root-execution-v_ready_for_execution OR
is_root_new-execution = /scmtms/if_tor_status_c=>sc_root-execution-v_executed ) ).
DATA(lv_lifecycle_status_changed) = xsdbool(
( is_root_old-lifecycle <> /scmtms/if_tor_status_c=>sc_root-lifecycle-v_in_process AND
is_root_old-lifecycle <> /scmtms/if_tor_status_c=>sc_root-lifecycle-v_completed ) AND
( is_root_new-lifecycle = /scmtms/if_tor_status_c=>sc_root-lifecycle-v_in_process OR
is_root_new-lifecycle = /scmtms/if_tor_status_c=>sc_root-lifecycle-v_completed ) ).
IF lv_carrier_removed = abap_true OR lv_execution_status_changed = abap_true OR
lv_lifecycle_status_changed = abap_true .
rv_result = zif_gtt_sts_ef_constants=>cs_condition-true.
ENDIF.
ENDMETHOD.
METHOD convert_utc_timestamp.
DATA:
lv_timestamp TYPE timestamp,
lv_date TYPE d,
lv_time TYPE t,
lv_tz_utc TYPE ttzz-tzone VALUE 'UTC',
lv_dst TYPE c LENGTH 1.
lv_timestamp = cv_timestamp.
CONVERT TIME STAMP lv_timestamp TIME ZONE iv_timezone
INTO DATE lv_date TIME lv_time DAYLIGHT SAVING TIME lv_dst.
CONVERT DATE lv_date TIME lv_time DAYLIGHT SAVING TIME lv_dst
INTO TIME STAMP lv_timestamp TIME ZONE lv_tz_utc.
cv_timestamp = lv_timestamp.
ENDMETHOD.
METHOD get_capa_match_key.
DATA lt_stop TYPE /scmtms/t_em_bo_tor_stop.
ASSIGN it_capa_stop[ node_id = iv_assgn_stop_key ] TO FIELD-SYMBOL(<ls_capa_stop>).
IF sy-subrc <> 0.
RETURN.
ENDIF.
ASSIGN it_capa_root[ node_id = <ls_capa_stop>-parent_node_id ]-tor_id TO FIELD-SYMBOL(<lv_tor_id>).
IF sy-subrc <> 0.
RETURN.
ENDIF.
/scmtms/cl_tor_helper_stop=>get_stop_sequence(
EXPORTING
it_root_key = VALUE #( ( key = <ls_capa_stop>-parent_node_id ) )
iv_before_image = iv_before_image
IMPORTING
et_stop_seq_d = DATA(lt_stop_seq) ).
ASSIGN lt_stop_seq[ root_key = <ls_capa_stop>-parent_node_id ] TO FIELD-SYMBOL(<ls_stop_seq>) ##WARN_OK.
IF sy-subrc <> 0.
RETURN.
ENDIF.
lt_stop = CORRESPONDING /scmtms/t_em_bo_tor_stop( <ls_stop_seq>-stop_seq ).
ASSIGN <ls_stop_seq>-stop_map[ stop_key = <ls_capa_stop>-node_id ]-tabix TO FIELD-SYMBOL(<lv_seq_num>) ##WARN_OK.
IF sy-subrc <> 0.
RETURN.
ENDIF.
zcl_gtt_sts_tools=>get_stop_points(
EXPORTING
iv_root_id = <lv_tor_id>
it_stop = lt_stop
IMPORTING
et_stop_points = DATA(lt_stop_points) ).
ASSIGN lt_stop_points[ seq_num = <lv_seq_num>
log_locid = <ls_capa_stop>-log_locid ] TO FIELD-SYMBOL(<ls_stop_point>) ##WARN_OK.
IF sy-subrc = 0.
rv_capa_matchkey = <ls_stop_point>-stop_id.
SHIFT rv_capa_matchkey LEFT DELETING LEADING '0'.
ENDIF.
ENDMETHOD.
METHOD get_errors_log.
es_bapiret-id = io_umd_message->m_msgid.
es_bapiret-number = io_umd_message->m_msgno.
es_bapiret-type = io_umd_message->m_msgty.
es_bapiret-message_v1 = io_umd_message->m_msgv1.
es_bapiret-message_v2 = io_umd_message->m_msgv2.
es_bapiret-message_v3 = io_umd_message->m_msgv3.
es_bapiret-message_v4 = io_umd_message->m_msgv4.
es_bapiret-system = iv_appsys.
ENDMETHOD.
METHOD get_field_of_structure.
FIELD-SYMBOLS: <ls_struct> TYPE any,
<lv_value> TYPE any.
ASSIGN ir_struct_data->* TO <ls_struct>.
IF <ls_struct> IS ASSIGNED.
ASSIGN COMPONENT iv_field_name OF STRUCTURE <ls_struct> TO <lv_value>.
IF <lv_value> IS ASSIGNED.
rv_value = <lv_value>.
ELSE.
zcl_gtt_sts_tools=>throw_exception( ).
ENDIF.
ELSE.
zcl_gtt_sts_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD get_fo_tracked_item_obj.
CONSTANTS: cs_mtr_truck TYPE string VALUE '31'.
DATA:
lv_tmp_restrxcod TYPE /saptrx/trxcod,
lv_restrxcod TYPE /saptrx/trxcod.
lv_restrxcod = zif_gtt_sts_constants=>cs_trxcod-fo_resource.
TRY.
CALL FUNCTION 'ZGTT_SOF_GET_TRACKID'
EXPORTING
iv_type = is_app_object-appobjtype
iv_app = 'STS'
IMPORTING
ev_restrxcod = lv_tmp_restrxcod.
IF lv_tmp_restrxcod IS NOT INITIAL.
lv_restrxcod = lv_tmp_restrxcod.
ENDIF.
CATCH cx_sy_dyn_call_illegal_func.
ENDTRY.
LOOP AT it_item ASSIGNING FIELD-SYMBOL(<ls_item>).
IF <ls_item>-platenumber IS ASSIGNED AND <ls_item>-res_id IS ASSIGNED AND <ls_item>-node_id IS ASSIGNED AND
<ls_item>-item_cat IS ASSIGNED AND <ls_item>-item_cat = /scmtms/if_tor_const=>sc_tor_item_category-av_item.
DATA(lv_tor_id) = |{ is_root-tor_id ALPHA = OUT }|.
CONDENSE lv_tor_id.
IF is_root-tor_id IS NOT INITIAL AND <ls_item>-res_id IS NOT INITIAL.
APPEND VALUE #( key = <ls_item>-node_id
appsys = iv_appsys
appobjtype = is_app_object-appobjtype
appobjid = is_app_object-appobjid
trxcod = lv_restrxcod
trxid = |{ lv_tor_id }{ <ls_item>-res_id }| ) TO ct_track_id_data.
ENDIF.
DATA(lv_mtr) = is_root-mtr.
SELECT SINGLE motscode FROM /sapapo/trtype INTO lv_mtr WHERE ttype = lv_mtr.
SHIFT lv_mtr LEFT DELETING LEADING '0'.
IF is_root-tor_id IS NOT INITIAL AND <ls_item>-platenumber IS NOT INITIAL AND lv_mtr = cs_mtr_truck.
lv_tor_id = |{ is_root-tor_id ALPHA = OUT }|.
CONDENSE lv_tor_id.
APPEND VALUE #( key = |{ <ls_item>-node_id }P|
appsys = iv_appsys
appobjtype = is_app_object-appobjtype
appobjid = is_app_object-appobjid
trxcod = lv_restrxcod
trxid = |{ lv_tor_id }{ <ls_item>-platenumber }| ) TO ct_track_id_data.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD get_local_timestamp.
rv_timestamp = COND #( WHEN iv_date IS NOT INITIAL
THEN |0{ iv_date }{ iv_time }| ).
ENDMETHOD.
METHOD get_postal_address.
DATA(lo_tor_srv_mgr) = /bobf/cl_tra_serv_mgr_factory=>get_service_manager( iv_bo_key = /scmtms/if_tor_c=>sc_bo_key ).
DATA(lo_loc_srv_mgr) = /bobf/cl_tra_serv_mgr_factory=>get_service_manager( iv_bo_key = /scmtms/if_location_c=>sc_bo_key ).
lo_tor_srv_mgr->retrieve_by_association(
EXPORTING
iv_node_key = /scmtms/if_tor_c=>sc_node-root
it_key = VALUE #( ( key = iv_node_id ) )
iv_association = /scmtms/if_tor_c=>sc_association-root-stop
IMPORTING
et_target_key = DATA(lt_stop_target_key) ).
IF lt_stop_target_key IS NOT INITIAL.
lo_tor_srv_mgr->retrieve_by_association(
EXPORTING
iv_node_key = /scmtms/if_tor_c=>sc_node-stop
it_key = CORRESPONDING #( lt_stop_target_key )
iv_association = /scmtms/if_tor_c=>sc_association-stop-bo_loc_log
IMPORTING
et_key_link = DATA(lt_loc_log_key_link) ).
IF lt_loc_log_key_link IS NOT INITIAL.
lo_loc_srv_mgr->retrieve_by_association(
EXPORTING
iv_node_key = /scmtms/if_location_c=>sc_node-root
it_key = CORRESPONDING #( lt_loc_log_key_link MAPPING key = target_key )
iv_association = /scmtms/if_location_c=>sc_association-root-address
IMPORTING
et_key_link = DATA(lt_address_key_link) ).
IF lt_address_key_link IS NOT INITIAL.
TRY.
DATA(lr_bo_conf) = /bobf/cl_frw_factory=>get_configuration( iv_bo_key = /scmtms/if_location_c=>sc_bo_key ).
CATCH /bobf/cx_frw.
MESSAGE e011(zgtt_sts) INTO DATA(lv_dummy) ##needed.
zcl_gtt_sts_tools=>throw_exception( ).
ENDTRY.
DATA(lv_postal_ass_key) = lr_bo_conf->get_content_key_mapping(
iv_content_cat = /bobf/if_conf_c=>sc_content_ass
iv_do_content_key = /bofu/if_addr_constants=>sc_association-root-postal_address
iv_do_root_node_key = /scmtms/if_location_c=>sc_node-/bofu/address ).
lo_loc_srv_mgr->retrieve_by_association(
EXPORTING
iv_node_key = /scmtms/if_location_c=>sc_node-/bofu/address
it_key = CORRESPONDING #( lt_address_key_link MAPPING key = target_key )
iv_association = lv_postal_ass_key
iv_fill_data = abap_true
IMPORTING
et_data = et_postal_address ).
ENDIF.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD get_pretty_value.
rv_pretty = COND #( WHEN zcl_gtt_sts_tools=>is_number( iv_value = iv_value ) = abap_true
THEN |{ iv_value }|
ELSE iv_value ).
ENDMETHOD.
METHOD get_stop_points.
DATA lv_order(4) TYPE n VALUE '0001'.
LOOP AT it_stop USING KEY parent_seqnum ASSIGNING FIELD-SYMBOL(<ls_stop>).
IF NOT zcl_gtt_sts_tools=>is_odd( <ls_stop>-seq_num ).
lv_order += 1.
ENDIF.
APPEND VALUE #( stop_id = |{ iv_root_id }{ lv_order }|
log_locid = <ls_stop>-log_locid
seq_num = <ls_stop>-seq_num ) TO et_stop_points.
ENDLOOP.
ENDMETHOD.
METHOD get_system_date_time.
rv_datetime = |0{ sy-datum }{ sy-uzeit }|.
ENDMETHOD.
METHOD get_system_time_zone.
CALL FUNCTION 'GET_SYSTEM_TIMEZONE'
IMPORTING
timezone = rv_tzone
EXCEPTIONS
customizing_missing = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e003(ZGTT_STS) INTO DATA(lv_dummy) ##needed.
zcl_gtt_sts_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD get_track_obj_changes.
DATA(lt_track_id_data_new) = it_track_id_data_new.
DATA(lt_track_id_data_old) = it_track_id_data_old.
LOOP AT lt_track_id_data_new ASSIGNING FIELD-SYMBOL(<ls_track_id_data>).
READ TABLE lt_track_id_data_old WITH KEY key = <ls_track_id_data>-key ASSIGNING FIELD-SYMBOL(<ls_track_id_data_old>).
IF sy-subrc = 0.
DATA(lt_fields) = CAST cl_abap_structdescr( cl_abap_typedescr=>describe_by_data(
p_data = <ls_track_id_data> ) )->get_included_view( ).
DATA(lv_result) = abap_false.
LOOP AT lt_fields ASSIGNING FIELD-SYMBOL(<ls_fields>).
ASSIGN COMPONENT <ls_fields>-name OF STRUCTURE <ls_track_id_data> TO FIELD-SYMBOL(<lv_value1>).
ASSIGN COMPONENT <ls_fields>-name OF STRUCTURE <ls_track_id_data_old> TO FIELD-SYMBOL(<lv_value2>).
IF <lv_value1> IS ASSIGNED AND
<lv_value2> IS ASSIGNED.
IF <lv_value1> <> <lv_value2>.
lv_result = abap_true.
EXIT.
ENDIF.
ENDIF.
ENDLOOP.
IF lv_result = abap_true.
APPEND VALUE #( appsys = iv_appsys
appobjtype = is_app_object-appobjtype
appobjid = is_app_object-appobjid
trxcod = <ls_track_id_data>-trxcod
trxid = <ls_track_id_data>-trxid ) TO ct_track_id_data.
APPEND VALUE #( appsys = iv_appsys
appobjtype = is_app_object-appobjtype
appobjid = is_app_object-appobjid
trxcod = <ls_track_id_data_old>-trxcod
trxid = <ls_track_id_data_old>-trxid
action = /scmtms/cl_scem_int_c=>sc_param_action-delete ) TO ct_track_id_data.
ENDIF.
DELETE lt_track_id_data_old WHERE key = <ls_track_id_data>-key.
ELSE.
APPEND VALUE #( appsys = iv_appsys
appobjtype = is_app_object-appobjtype
appobjid = is_app_object-appobjid
trxcod = <ls_track_id_data>-trxcod
trxid = <ls_track_id_data>-trxid ) TO ct_track_id_data.
ENDIF.
ENDLOOP.
" Deleted resources
LOOP AT lt_track_id_data_old ASSIGNING FIELD-SYMBOL(<ls_track_id_data_del>).
APPEND VALUE #( appsys = iv_appsys
appobjtype = is_app_object-appobjtype
appobjid = is_app_object-appobjid
trxcod = <ls_track_id_data_del>-trxcod
trxid = <ls_track_id_data_del>-trxid
action = /scmtms/cl_scem_int_c=>sc_param_action-delete ) TO ct_track_id_data.
ENDLOOP.
ENDMETHOD.
METHOD get_trmodcod.
CASE iv_trmodcod.
WHEN '01'.
rv_trmodcod = '03'.
WHEN '02'.
rv_trmodcod = '02'.
WHEN '03'.
rv_trmodcod = '01'.
WHEN '05'.
rv_trmodcod = '04'.
WHEN '06'.
rv_trmodcod = '05'.
WHEN OTHERS.
rv_trmodcod = ''.
ENDCASE.
ENDMETHOD.
METHOD is_number.
DATA(lo_type) = cl_abap_typedescr=>describe_by_data( p_data = iv_value ).
rv_result = SWITCH #( lo_type->type_kind
WHEN cl_abap_typedescr=>typekind_decfloat OR
cl_abap_typedescr=>typekind_decfloat16 OR
cl_abap_typedescr=>typekind_decfloat34 OR
cl_abap_typedescr=>typekind_float OR
cl_abap_typedescr=>typekind_int OR
cl_abap_typedescr=>typekind_int1 OR
cl_abap_typedescr=>typekind_int2 OR
cl_abap_typedescr=>typekind_int8 OR
cl_abap_typedescr=>typekind_num OR
cl_abap_typedescr=>typekind_numeric OR
cl_abap_typedescr=>typekind_packed
THEN abap_true
ELSE abap_false ).
ENDMETHOD.
METHOD is_odd.
DATA lv_reminder TYPE n.
lv_reminder = iv_value MOD 2.
IF lv_reminder <> 0.
rv_is_odd = abap_true.
ELSE.
rv_is_odd = abap_false.
ENDIF.
ENDMETHOD.
METHOD is_table.
DATA(lo_type) = cl_abap_typedescr=>describe_by_data( p_data = iv_value ).
rv_result = boolc( lo_type->type_kind = cl_abap_typedescr=>typekind_table ).
ENDMETHOD.
METHOD throw_exception.
RAISE EXCEPTION TYPE cx_udm_message
EXPORTING
textid = iv_textid
m_msgid = sy-msgid
m_msgty = sy-msgty
m_msgno = sy-msgno
m_msgv1 = sy-msgv1
m_msgv2 = sy-msgv2
m_msgv3 = sy-msgv3
m_msgv4 = sy-msgv4.
ENDMETHOD.
METHOD get_location_type.
DATA:
lv_loctype TYPE /sapapo/c_loctype.
CLEAR:rv_loctype.
CALL FUNCTION '/SAPAPO/LOC_LOCID_GET_LOCATION'
EXPORTING
iv_locno = iv_locno
IMPORTING
ev_loctype = lv_loctype
EXCEPTIONS
location_not_found = 1
not_qualified = 2
OTHERS = 3.
IF sy-subrc = 0.
CASE lv_loctype.
WHEN '1001'."Plant
rv_loctype = zif_gtt_sts_constants=>cs_location_type-plant.
WHEN '1003'."Shipping Point
rv_loctype = zif_gtt_sts_constants=>cs_location_type-shippingpoint.
WHEN '1010'."Customer
rv_loctype = zif_gtt_sts_constants=>cs_location_type-customer.
WHEN '1011'."Supplier
rv_loctype = zif_gtt_sts_constants=>cs_location_type-supplier.
WHEN '1021'."Business Partner
rv_loctype = zif_gtt_sts_constants=>cs_location_type-bp.
WHEN OTHERS."Logistic Location
rv_loctype = zif_gtt_sts_constants=>cs_location_type-logistic.
ENDCASE.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
5097,
62,
38,
15751,
62,
2257,
50,
62,
10468,
3535,
50,
6770,
198,
220,
1171,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
38491,
25,
198,
220,
220,
220,
347,
43312,
3963,
50115,
62,
31448,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2081,
220,
41876,
827,
12,
8800,
457,
26173,
8924,
705,
51,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
3991,
41876,
827,
12,
8800,
457,
26173,
8924,
705,
37,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
50115,
62,
31448,
764,
628,
220,
1398,
12,
24396,
82,
15986,
62,
46126,
29514,
62,
35,
5064,
24302,
3525,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
4663,
62,
26947,
16,
2099,
1006,
284,
42865,
198,
220,
220,
220,
220,
220,
5145,
4663,
62,
26947,
17,
2099,
1006,
284,
42865,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
19535,
16724,
8,
2099,
19704,
12,
33,
1268,
11571,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
327,
55,
62,
8322,
44,
62,
44,
1546,
4090,
8264,
764,
198,
220,
1398,
12,
24396,
82,
17151,
62,
32782,
1847,
62,
2885,
7707,
7597,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
45,
16820,
62,
2389,
2099,
1220,
6173,
13752,
5653,
14,
8202,
62,
45,
16820,
62,
2389,
198,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
5145,
2767,
62,
32782,
1847,
62,
2885,
7707,
7597,
2099,
1220,
8202,
38989,
14,
51,
62,
2885,
7707,
62,
32782,
1847,
62,
2885,
7707,
7597,
42,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
327,
55,
62,
8322,
44,
62,
44,
1546,
4090,
8264,
764,
198,
220,
1398,
12,
24396,
82,
7102,
15858,
62,
17429,
62,
51,
3955,
6465,
23518,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
34694,
57,
11651,
2099,
26653,
30148,
12,
51,
57,
11651,
198,
220,
220,
220,
5609,
198,
220,
220,
220,
220,
220,
5145,
33538,
62,
51,
3955,
6465,
23518,
2099,
1220,
6173,
13752,
5653,
14,
51,
3955,
6465,
23518,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
327,
55,
62,
8322,
44,
62,
44,
1546,
4090,
8264,
764,
198,
220,
1398,
12,
24396,
82,
17151,
62,
44603,
62,
19238,
62,
46126,
11335,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
4663,
62,
46126,
62,
26947,
2099,
1006,
284,
42865,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
44603,
62,
20608,
2099,
43749,
7336,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
39488,
8,
2099,
28521,
1120,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
327,
55,
62,
8322,
44,
62,
44,
1546,
4090,
8264,
764,
198,
220,
1398,
12,
24396,
82,
17151,
62,
24908,
50,
62,
25294,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
9399,
62,
5883,
35,
62,
44,
1546,
4090,
8264,
2099,
1006,
284,
327,
55,
62,
8322,
44,
62,
44,
1546,
4090,
8264,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
2969,
3705,
16309,
2099,
327,
198,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
5145,
1546,
62,
33,
17614,
26087,
2099,
347,
17614,
26087,
17,
764,
198,
220,
1398,
12,
24396,
82,
17151,
62,
29701,
1847,
62,
51,
3955,
6465,
23518,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
35,
6158,
2099,
15529,
4277,
19704,
12,
35,
1404,
5883,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
34694,
2099,
15529,
4277,
19704,
12,
52,
21211,
2043,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
51,
3955,
6465,
23518,
8,
2099,
1220,
50,
2969,
5446,
55,
14,
20114,
3525,
62,
49864,
62,
35,
1404,
2767,
12789,
764,
198,
220,
1398,
12,
24396,
82,
17151,
62,
47,
26087,
9936,
62,
39488,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
39488,
2099,
15529,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
47,
26087,
9936,
8,
2099,
1220,
50,
2969,
5446,
55,
14,
27082,
2390,
23428,
2167,
764,
198,
220,
1398,
12,
24396,
82,
17151,
62,
23060,
25361,
62,
34694,
62,
57,
11651,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
51,
57,
11651,
8,
2099,
20460,
57,
11651,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
327,
55,
62,
8322,
44,
62,
44,
1546,
4090,
8264,
764,
198,
220,
1398,
12,
24396,
82,
17151,
62,
23060,
25361,
62,
35,
6158,
62,
34694,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
35,
1404,
2767,
12789,
8,
2099,
19269,
2751,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
327,
55,
62,
8322,
44,
62,
44,
1546,
4090,
8264,
764,
198,
220,
1398,
12,
24396,
82,
3180,
62,
41359,
13246,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
39488,
2099,
15529,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
19535,
16724,
8,
2099,
9564,
2969,
62,
8202,
3535,
764,
198,
220,
1398,
12,
24396,
82,
3180,
62,
38148,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
39488,
2099,
15529,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
19535,
16724,
8,
2099,
9564,
2969,
62,
8202,
3535,
764,
198,
220,
1398,
12,
24396,
82,
35383,
3913,
62,
6369,
42006,
2849,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
32541,
2389,
2099,
311,
2394,
49,
62,
10943,
34,
4277,
10148,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
327,
55,
62,
8322,
44,
62,
44,
1546,
4090,
8264,
764,
198,
220,
1398,
12,
24396,
82,
17151,
62,
2257,
3185,
62,
16402,
1268,
4694,
198,
220,
220,
220,
33332,
198,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
"! <h1>API for Getting a Travel</h1>
"!
"! <p>
"! Function module to get a single Travel instance with all related Bookings and
"! Booking Supplements related to the importing Travel ID.
"! </p>
"!
"!
"! @parameter iv_travel_id | Travel ID
"! @parameter iv_include_buffer | Include any changes that have not yet been committed
"! @parameter es_travel | Travel Data like /DMO/TRAVEL11 related to the importing Travel ID
"! @parameter et_booking | Table of Bookings like /DMO/BOOKING11 related to the importing Travel ID
"! @parameter et_booking_supplement | Table of Booking Supplements like /DMO/BOOK_SUP_11 related to the importing Travel ID
"! @parameter et_messages | Table of occurred messages
"!
FUNCTION /DMO/FLIGHT_TRAVEL_READ11.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IV_TRAVEL_ID) TYPE /DMO/TRAVEL_ID11
*" REFERENCE(IV_INCLUDE_BUFFER) TYPE ABAP_BOOLEAN DEFAULT
*" ABAP_TRUE
*" EXPORTING
*" REFERENCE(ES_TRAVEL) TYPE /DMO/TRAVEL11
*" REFERENCE(ET_BOOKING) TYPE /DMO/IF_FLIGHT_LEGACY11=>TT_BOOKING
*" REFERENCE(ET_BOOKING_SUPPLEMENT) TYPE
*" /DMO/IF_FLIGHT_LEGACY11=>TT_BOOKING_SUPPLEMENT
*" REFERENCE(ET_MESSAGES) TYPE /DMO/IF_FLIGHT_LEGACY11=>TT_MESSAGE
*"----------------------------------------------------------------------
CLEAR es_travel.
CLEAR et_booking.
CLEAR et_booking_supplement.
CLEAR et_messages.
/dmo/cl_flight_legacy11=>get_instance( )->get_travel( EXPORTING iv_travel_id = iv_travel_id
iv_include_buffer = iv_include_buffer
IMPORTING es_travel = es_travel
et_booking = et_booking
et_booking_supplement = et_booking_supplement
et_messages = DATA(lt_messages) ).
/dmo/cl_flight_legacy11=>get_instance( )->convert_messages( EXPORTING it_messages = lt_messages
IMPORTING et_messages = et_messages ).
ENDFUNCTION.
| [
40484,
1279,
71,
16,
29,
17614,
329,
18067,
257,
13524,
3556,
71,
16,
29,
198,
40484,
198,
40484,
1279,
79,
29,
198,
40484,
15553,
8265,
284,
651,
257,
2060,
13524,
4554,
351,
477,
3519,
4897,
654,
290,
198,
40484,
4897,
278,
8105,
3639,
3519,
284,
262,
33332,
13524,
4522,
13,
198,
40484,
7359,
79,
29,
198,
40484,
198,
40484,
198,
40484,
2488,
17143,
2357,
21628,
62,
35927,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
13524,
4522,
198,
40484,
2488,
17143,
2357,
21628,
62,
17256,
62,
22252,
220,
220,
220,
220,
930,
40348,
597,
2458,
326,
423,
407,
1865,
587,
5364,
198,
40484,
2488,
17143,
2357,
1658,
62,
35927,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
13524,
6060,
588,
1220,
35,
11770,
14,
51,
3861,
18697,
1157,
3519,
284,
262,
33332,
13524,
4522,
198,
40484,
2488,
17143,
2357,
2123,
62,
2070,
278,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
8655,
286,
4897,
654,
588,
1220,
35,
11770,
14,
39453,
2751,
1157,
3519,
284,
262,
33332,
13524,
4522,
198,
40484,
2488,
17143,
2357,
2123,
62,
2070,
278,
62,
18608,
1732,
930,
8655,
286,
4897,
278,
8105,
3639,
588,
1220,
35,
11770,
14,
39453,
62,
40331,
62,
1157,
3519,
284,
262,
33332,
13524,
4522,
198,
40484,
2488,
17143,
2357,
2123,
62,
37348,
1095,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
8655,
286,
5091,
6218,
198,
40484,
198,
42296,
4177,
2849,
1220,
35,
11770,
14,
3697,
9947,
62,
51,
3861,
18697,
62,
15675,
1157,
13,
198,
9,
1,
10097,
23031,
198,
9,
1,
9,
1,
14565,
26491,
25,
198,
9,
1,
220,
30023,
9863,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
3824,
62,
51,
3861,
18697,
62,
2389,
8,
41876,
220,
1220,
35,
11770,
14,
51,
3861,
18697,
62,
2389,
1157,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
3824,
62,
1268,
5097,
52,
7206,
62,
19499,
45746,
8,
41876,
220,
9564,
2969,
62,
33,
6684,
2538,
1565,
5550,
38865,
198,
9,
1,
220,
220,
220,
220,
220,
220,
9564,
2969,
62,
5446,
8924,
198,
9,
1,
220,
7788,
15490,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
1546,
62,
51,
3861,
18697,
8,
41876,
220,
1220,
35,
11770,
14,
51,
3861,
18697,
1157,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
2767,
62,
39453,
2751,
8,
41876,
220,
1220,
35,
11770,
14,
5064,
62,
3697,
9947,
62,
2538,
38,
43300,
1157,
14804,
15751,
62,
39453,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
2767,
62,
39453,
2751,
62,
40331,
16437,
10979,
8,
41876,
198,
9,
1,
220,
220,
220,
220,
220,
220,
220,
1220,
35,
11770,
14,
5064,
62,
3697,
9947,
62,
2538,
38,
43300,
1157,
14804,
15751,
62,
39453,
2751,
62,
40331,
16437,
10979,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
2767,
62,
44,
1546,
4090,
48075,
8,
41876,
220,
1220,
35,
11770,
14,
5064,
62,
3697,
9947,
62,
2538,
38,
43300,
1157,
14804,
15751,
62,
44,
1546,
4090,
8264,
198,
9,
1,
10097,
23031,
198,
220,
30301,
1503,
1658,
62,
35927,
13,
198,
220,
30301,
1503,
2123,
62,
2070,
278,
13,
198,
220,
30301,
1503,
2123,
62,
2070,
278,
62,
18608,
1732,
13,
198,
220,
30301,
1503,
2123,
62,
37348,
1095,
13,
628,
220,
1220,
67,
5908,
14,
565,
62,
22560,
62,
1455,
1590,
1157,
14804,
1136,
62,
39098,
7,
1267,
3784,
1136,
62,
35927,
7,
7788,
15490,
2751,
21628,
62,
35927,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
35927,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
17256,
62,
22252,
220,
220,
220,
220,
796,
21628,
62,
17256,
62,
22252,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
1658,
62,
35927,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
1658,
62,
35927,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2123,
62,
2070,
278,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
2123,
62,
2070,
278,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2123,
62,
2070,
278,
62,
18608,
1732,
796,
2123,
62,
2070,
278,
62,
18608,
1732,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2123,
62,
37348,
1095,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
42865,
7,
2528,
62,
37348,
1095,
8,
6739,
628,
220,
1220,
67,
5908,
14,
565,
62
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_object_cus2 DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
METHODS constructor
IMPORTING
is_item TYPE zif_abapgit_definitions=>ty_item
iv_language TYPE spras.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES: ty_attribute_titles TYPE STANDARD TABLE OF cus_atrt
WITH NON-UNIQUE DEFAULT KEY,
ty_attribute_countries TYPE STANDARD TABLE OF cus_atrcou
WITH NON-UNIQUE DEFAULT KEY,
ty_attribute_components TYPE STANDARD TABLE OF tfm18
WITH NON-UNIQUE DEFAULT KEY,
ty_attribute_comp_variants TYPE STANDARD TABLE OF cus_atrvco
WITH NON-UNIQUE DEFAULT KEY.
TYPES: BEGIN OF ty_customizing_attribute,
header TYPE cus_atrh,
titles TYPE ty_attribute_titles,
countries TYPE ty_attribute_countries,
components TYPE ty_attribute_components,
components_variants TYPE ty_attribute_comp_variants,
END OF ty_customizing_attribute.
DATA: mv_img_attribute TYPE cus_atr.
ENDCLASS.
CLASS zcl_abapgit_object_cus2 IMPLEMENTATION.
METHOD constructor.
super->constructor( is_item = is_item
iv_language = iv_language ).
mv_img_attribute = ms_item-obj_name.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: ls_message TYPE hier_mess.
CALL FUNCTION 'S_CUS_ATTRIBUTES_DELETE'
EXPORTING
img_attribute = mv_img_attribute
IMPORTING
message = ls_message.
IF ls_message-msgty <> 'S'.
zcx_abapgit_exception=>raise( |error from delete CUS2 { mv_img_attribute } S_CUS_ATTRIBUTES_DELETE| ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_customizing_attribute TYPE ty_customizing_attribute,
ls_message TYPE hier_mess.
io_xml->read(
EXPORTING
iv_name = 'CUS2'
CHANGING
cg_data = ls_customizing_attribute ).
CALL FUNCTION 'S_CUS_ATTRIBUTES_SAVE'
EXPORTING
img_attribute = ls_customizing_attribute-header
IMPORTING
message = ls_message
TABLES
attributes_title = ls_customizing_attribute-titles
attributes_countries = ls_customizing_attribute-countries
attributes_components = ls_customizing_attribute-components.
IF ls_message-msgty <> 'S'.
zcx_abapgit_exception=>raise( |error from deserialize CUS2 { mv_img_attribute } S_CUS_ATTRIBUTES_SAVE| ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
CALL FUNCTION 'S_CUS_ATTRIBUTES_EXIST'
EXPORTING
img_attribute = mv_img_attribute
EXCEPTIONS
attributes_exists_not = 1
OTHERS = 2.
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
zcx_abapgit_exception=>raise( |TODO: Jump| ).
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_customizing_attribute TYPE ty_customizing_attribute.
CALL FUNCTION 'S_CUS_ATTRIBUTES_READ'
EXPORTING
img_attribute = mv_img_attribute
IMPORTING
attribute_header = ls_customizing_attribute-header
TABLES
attribute_title = ls_customizing_attribute-titles
attribute_countries = ls_customizing_attribute-countries
attribute_components = ls_customizing_attribute-components
attribute_components_variants = ls_customizing_attribute-components_variants.
CLEAR: ls_customizing_attribute-header-fdatetime,
ls_customizing_attribute-header-fuser,
ls_customizing_attribute-header-ldatetime,
ls_customizing_attribute-header-luser.
IF io_xml->i18n_params( )-main_language_only = abap_true.
DELETE ls_customizing_attribute-titles WHERE spras <> mv_language.
ENDIF.
io_xml->add( iv_name = 'CUS2'
ig_data = ls_customizing_attribute ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
9042,
17,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
628,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
9186,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16129,
41876,
7500,
292,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
1259,
62,
42348,
62,
83,
30540,
220,
220,
220,
220,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
269,
385,
62,
265,
17034,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1259,
62,
42348,
62,
9127,
1678,
220,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
269,
385,
62,
265,
6015,
280,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1259,
62,
42348,
62,
5589,
3906,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
256,
38353,
1507,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1259,
62,
42348,
62,
5589,
62,
25641,
1187,
41876,
49053,
9795,
43679,
3963,
269,
385,
62,
265,
81,
85,
1073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
23144,
2890,
62,
42348,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13639,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
385,
62,
265,
17179,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8714,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
42348,
62,
83,
30540,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2678,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
42348,
62,
9127,
1678,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6805,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
42348,
62,
5589,
3906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6805,
62,
25641,
1187,
41876,
1259,
62,
42348,
62,
5589,
62,
25641,
1187,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
23144,
2890,
62,
42348,
13,
628,
220,
220,
220,
42865,
25,
285,
85,
62,
9600,
62,
42348,
41876,
269,
385,
62,
265,
81,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
9042,
17,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
2208,
3784,
41571,
273,
7,
318,
62,
9186,
796,
318,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16129,
796,
21628,
62,
16129,
6739,
628,
220,
220,
220,
285,
85,
62,
9600,
62,
42348,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
40985,
62,
1525,
13,
198,
220,
220,
220,
374,
85,
62,
7220,
796,
269,
62,
7220,
62,
34680,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
33678,
13,
628,
220,
220,
220,
42865,
25,
43979,
62,
20500,
41876,
13550,
62,
37348,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
50,
62,
34,
2937,
62,
1404,
5446,
9865,
3843,
1546,
62,
7206,
2538,
9328,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
33705,
62,
42348,
796,
285,
85,
62,
9600,
62,
42348,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
3275,
220,
220,
220,
220,
220,
220,
796,
43979,
62,
20500,
13,
628,
220,
220,
220,
16876,
43979,
62,
20500,
12,
19662,
774,
1279,
29,
705,
50,
4458,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
930,
18224,
422,
12233,
327,
2937,
17,
1391,
285,
85,
62,
9600,
62,
42348,
1782,
311,
62,
34,
2937,
62,
1404,
5446,
9865,
3843,
1546,
62,
7206,
2538,
9328
] | [
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|
CLASS ycl_abapgit_object_enho_fugr DEFINITION PUBLIC.
PUBLIC SECTION.
METHODS: constructor
IMPORTING
is_item TYPE yif_abapgit_definitions=>ty_item
io_files TYPE REF TO ycl_abapgit_objects_files.
INTERFACES: yif_abapgit_object_enho.
PRIVATE SECTION.
DATA: ms_item TYPE yif_abapgit_definitions=>ty_item,
mo_files TYPE REF TO ycl_abapgit_objects_files.
ENDCLASS.
CLASS YCL_ABAPGIT_OBJECT_ENHO_FUGR IMPLEMENTATION.
METHOD constructor.
ms_item = is_item.
mo_files = io_files.
ENDMETHOD.
METHOD yif_abapgit_object_enho~deserialize.
DATA: lo_fugrdata TYPE REF TO cl_enh_tool_fugr,
ls_enha_data TYPE enhfugrdata,
li_tool TYPE REF TO if_enh_tool,
lv_tool TYPE enhtooltype,
lv_package TYPE devclass.
FIELD-SYMBOLS: <ls_fuba> TYPE enhfugrfuncdata.
io_xml->read(
EXPORTING
iv_name = 'TOOL'
CHANGING
cg_data = lv_tool ).
io_xml->read(
EXPORTING
iv_name = 'FUGRDATA'
CHANGING
cg_data = ls_enha_data ).
lv_package = iv_package.
TRY.
cl_enh_factory=>create_enhancement(
EXPORTING
enhname = |{ ms_item-obj_name }|
enhtype = ''
enhtooltype = lv_tool
IMPORTING
enhancement = li_tool
CHANGING
devclass = lv_package ).
lo_fugrdata ?= li_tool.
lo_fugrdata->set_fugr( ls_enha_data-fugr ).
LOOP AT ls_enha_data-enh_fubas ASSIGNING <ls_fuba>.
lo_fugrdata->set_func_data( func_name = <ls_fuba>-fuba
func_enhadata = <ls_fuba> ).
ENDLOOP.
lo_fugrdata->if_enh_object~save( ).
lo_fugrdata->if_enh_object~unlock( ).
CATCH cx_enh_root.
ycx_abapgit_exception=>raise( |error deserializing ENHO fugrdata { ms_item-obj_name }| ).
ENDTRY.
ENDMETHOD.
METHOD yif_abapgit_object_enho~serialize.
DATA: lo_fugrdata TYPE REF TO cl_enh_tool_fugr,
lv_fugr_name TYPE rs38l-area,
ls_enha_data TYPE enhfugrdata.
FIELD-SYMBOLS: <ls_docuobj> TYPE enhfugrparamdocu.
lo_fugrdata ?= ii_enh_tool.
lo_fugrdata->get_fugr(
IMPORTING
fugr_name = lv_fugr_name ).
TRY.
lo_fugrdata->get_all_data_for_fugr(
EXPORTING
fugr_name = lv_fugr_name
IMPORTING
enha_data = ls_enha_data ).
LOOP AT ls_enha_data-docuobjs ASSIGNING <ls_docuobj>.
CLEAR: <ls_docuobj>-shorttext,
<ls_docuobj>-longtext.
ENDLOOP.
CATCH cx_enh_not_found.
ycx_abapgit_exception=>raise( |error deserializing ENHO fugrdata { ms_item-obj_name }| ).
ENDTRY.
io_xml->add( iv_name = 'TOOL'
ig_data = lo_fugrdata->if_enh_tool~get_tool( ) ).
io_xml->add( iv_name = 'FUGRDATA'
ig_data = ls_enha_data ).
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
565,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
62,
69,
1018,
81,
5550,
20032,
17941,
44731,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
9186,
220,
41876,
331,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
16624,
41876,
4526,
37,
5390,
331,
565,
62,
397,
499,
18300,
62,
48205,
62,
16624,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
331,
361,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
13845,
62,
9186,
220,
41876,
331,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6941,
62,
16624,
41876,
4526,
37,
5390,
331,
565,
62,
397,
499,
18300,
62,
48205,
62,
16624,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
575,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
1677,
32298,
62,
37,
7340,
49,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
13845,
62,
9186,
796,
318,
62,
9186,
13,
198,
220,
220,
220,
6941,
62,
16624,
796,
33245,
62,
16624,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
331,
361,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
93,
8906,
48499,
1096,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
69,
1018,
4372,
1045,
220,
41876,
4526,
37,
5390,
537,
62,
16550,
62,
25981,
62,
69,
1018,
81,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
268,
3099,
62,
7890,
41876,
5881,
69,
1018,
4372,
1045,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7649,
62,
25981,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
611,
62,
16550,
62,
25981,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
25981,
220,
220,
220,
220,
220,
41876,
551,
4352,
970,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
26495,
220,
220,
41876,
1614,
4871,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
69,
22013,
29,
41876,
5881,
69,
1018,
81,
20786,
7890,
13,
628,
220,
220,
220,
33245,
62,
19875,
3784,
961,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3672,
796,
705,
10468,
3535,
6,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
269,
70,
62,
7890,
796,
300,
85,
62,
25981,
6739,
628,
220,
220,
220,
33245,
62,
19875,
3784,
961,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3672,
796,
705,
37,
7340,
49,
26947,
6,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
269,
70,
62,
7890,
796,
43979,
62,
268,
3099,
62,
7890,
6739,
628,
220,
220,
220,
300,
85,
62,
26495,
796,
21628,
62,
26495,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
16550,
62,
69,
9548,
14804,
17953,
62,
16550,
590,
434,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5881,
3672,
220,
220,
220,
220,
796,
930,
90,
13845,
62,
9186,
12,
26801,
62,
3672,
1782,
91,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5881,
4906,
220,
220,
220,
220,
796,
10148,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
551,
4352,
970,
4906,
796,
300,
85,
62,
25981,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28554,
796,
7649,
62,
25981,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1614,
4871,
220,
220,
220,
796,
300,
85,
62,
26495,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
69,
1018,
4372,
1045,
5633,
28,
7649,
62,
25981,
13,
628,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
69,
1018,
4372,
1045,
3784,
2617,
62,
69,
1018,
81,
7,
43979,
62,
268,
3099,
62,
7890,
12,
69,
1018,
81,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
17579,
3185,
5161,
43979,
62,
268,
3099,
62,
7890,
12,
16550,
62,
69,
549,
292,
24994,
3528,
15871,
1279,
7278,
62,
69,
22013,
28401,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
69,
1018,
4372,
1045,
3784,
2617,
62,
20786,
62,
7890,
7,
25439,
62,
3672,
220,
220,
220,
220,
796,
1279,
7278,
62,
69,
22013,
29,
12,
69,
22013,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25439,
62,
16550,
14706,
796,
1279,
7278,
62,
69,
22013,
29,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
69,
1018,
4372,
1045,
3784,
361,
62,
16550,
62,
15252,
93,
21928,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
69,
1018,
4372,
1045,
3784,
361,
62,
16550,
62,
15252,
93,
403,
5354,
7,
6739,
628,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
16550,
62,
15763,
13,
198,
220,
220,
220,
220,
220,
220,
220,
331,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
930,
18224,
748,
48499,
2890,
12964,
32298,
31497,
4372,
1045,
1391,
13845,
62,
9186,
12,
26801,
62,
3672,
1782,
91,
6739
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ZCL_EXCEL_READER_2007 definition
public
create public .
public section.
*"* public components of class ZCL_EXCEL_READER_2007
*"* do not include other source files here!!!
type-pools IXML .
interfaces ZIF_EXCEL_READER .
class-methods FILL_STRUCT_FROM_ATTRIBUTES
importing
!IP_ELEMENT type ref to IF_IXML_ELEMENT
changing
!CP_STRUCTURE type ANY .
protected section.
types:
*"* protected components of class ZCL_EXCEL_READER_2007
*"* do not include other source files here!!!
BEGIN OF t_relationship,
id TYPE string,
type TYPE string,
target TYPE string,
targetmode TYPE string,
worksheet TYPE REF TO zcl_excel_worksheet,
sheetid TYPE string, "ins #235 - repeat rows/cols - needed to identify correct sheet
END OF t_relationship .
types:
BEGIN OF t_fileversion,
appname TYPE string,
lastedited TYPE string,
lowestedited TYPE string,
rupbuild TYPE string,
codename TYPE string,
END OF t_fileversion .
types:
BEGIN OF t_sheet,
name TYPE string,
sheetid TYPE string,
id TYPE string,
state TYPE string,
END OF t_sheet .
types:
BEGIN OF t_workbookpr,
codename TYPE string,
defaultthemeversion TYPE string,
END OF t_workbookpr .
types:
BEGIN OF t_sheetpr,
codename TYPE string,
END OF t_sheetpr .
types:
BEGIN OF t_range,
name TYPE string,
hidden TYPE string, "inserted with issue #235 because Autofilters didn't passthrough
localsheetid TYPE string, " issue #163
END OF t_range .
types:
t_fills TYPE STANDARD TABLE OF REF TO zcl_excel_style_fill WITH NON-UNIQUE DEFAULT KEY .
types:
t_borders TYPE STANDARD TABLE OF REF TO zcl_excel_style_borders WITH NON-UNIQUE DEFAULT KEY .
types:
t_fonts TYPE STANDARD TABLE OF REF TO zcl_excel_style_font WITH NON-UNIQUE DEFAULT KEY .
types:
t_style_refs TYPE STANDARD TABLE OF REF TO zcl_excel_style WITH NON-UNIQUE DEFAULT KEY .
types:
BEGIN OF t_color,
indexed TYPE string,
rgb TYPE string,
theme TYPE string,
tint TYPE string,
END OF t_color .
types:
BEGIN OF t_rel_drawing,
id TYPE string,
content TYPE xstring,
file_ext TYPE string,
content_xml TYPE REF TO if_ixml_document,
END OF t_rel_drawing .
types:
t_rel_drawings TYPE STANDARD TABLE OF t_rel_drawing WITH NON-UNIQUE DEFAULT KEY .
types:
BEGIN OF gts_external_hyperlink,
id TYPE string,
target TYPE string,
END OF gts_external_hyperlink .
types:
gtt_external_hyperlinks TYPE HASHED TABLE OF gts_external_hyperlink WITH UNIQUE KEY id .
types:
BEGIN OF ty_ref_formulae,
sheet TYPE REF TO zcl_excel_worksheet,
row TYPE i,
column TYPE i,
si TYPE i,
ref TYPE string,
formula TYPE string,
END OF ty_ref_formulae .
types:
tyt_ref_formulae TYPE HASHED TABLE OF ty_ref_formulae WITH UNIQUE KEY sheet row column .
data SHARED_STRINGS type STRINGTAB .
data STYLES type T_STYLE_REFS .
data MT_REF_FORMULAE type TYT_REF_FORMULAE .
data MT_DXF_STYLES type ZEXCEL_T_STYLES_COND_MAPPING .
methods FILL_ROW_OUTLINES
importing
!IO_WORKSHEET type ref to ZCL_EXCEL_WORKSHEET
raising
ZCX_EXCEL .
methods GET_FROM_ZIP_ARCHIVE
importing
!I_FILENAME type STRING
returning
value(R_CONTENT) type XSTRING
raising
ZCX_EXCEL .
methods GET_IXML_FROM_ZIP_ARCHIVE
importing
!I_FILENAME type STRING
!IS_NORMALIZING type BOOLEAN default 'X'
returning
value(R_IXML) type ref to IF_IXML_DOCUMENT
raising
ZCX_EXCEL .
methods LOAD_DRAWING_ANCHOR
importing
!IO_ANCHOR_ELEMENT type ref to IF_IXML_ELEMENT
!IO_WORKSHEET type ref to ZCL_EXCEL_WORKSHEET
!IT_RELATED_DRAWINGS type T_REL_DRAWINGS .
methods LOAD_SHARED_STRINGS
importing
!IP_PATH type STRING
raising
ZCX_EXCEL .
methods LOAD_STYLES
importing
!IP_PATH type STRING
!IP_EXCEL type ref to ZCL_EXCEL
raising
ZCX_EXCEL .
methods LOAD_DXF_STYLES
importing
!IV_PATH type STRING
!IO_EXCEL type ref to ZCL_EXCEL
raising
ZCX_EXCEL .
methods LOAD_STYLE_BORDERS
importing
!IP_XML type ref to IF_IXML_DOCUMENT
returning
value(EP_BORDERS) type T_BORDERS .
methods LOAD_STYLE_FILLS
importing
!IP_XML type ref to IF_IXML_DOCUMENT
returning
value(EP_FILLS) type T_FILLS .
methods LOAD_STYLE_FONTS
importing
!IP_XML type ref to IF_IXML_DOCUMENT
returning
value(EP_FONTS) type T_FONTS .
methods LOAD_STYLE_NUM_FORMATS
importing
!IP_XML type ref to IF_IXML_DOCUMENT
returning
value(EP_NUM_FORMATS) type ZCL_EXCEL_STYLE_NUMBER_FORMAT=>T_NUM_FORMATS .
methods LOAD_WORKBOOK
importing
!IV_WORKBOOK_FULL_FILENAME type STRING
!IO_EXCEL type ref to ZCL_EXCEL
raising
ZCX_EXCEL .
methods LOAD_WORKSHEET
importing
!IP_PATH type STRING
!IO_WORKSHEET type ref to ZCL_EXCEL_WORKSHEET
raising
ZCX_EXCEL .
methods LOAD_WORKSHEET_COND_FORMAT
importing
!IO_IXML_WORKSHEET type ref to IF_IXML_DOCUMENT
!IO_WORKSHEET type ref to ZCL_EXCEL_WORKSHEET
raising
ZCX_EXCEL .
methods LOAD_WORKSHEET_COND_FORMAT_AA
importing
!IO_IXML_RULE type ref to IF_IXML_ELEMENT
!IO_STYLE_COND type ref to ZCL_EXCEL_STYLE_COND.
methods LOAD_WORKSHEET_COND_FORMAT_CI
importing
!IO_IXML_RULE type ref to IF_IXML_ELEMENT
!IO_STYLE_COND type ref to ZCL_EXCEL_STYLE_COND .
methods LOAD_WORKSHEET_COND_FORMAT_CS
importing
!IO_IXML_RULE type ref to IF_IXML_ELEMENT
!IO_STYLE_COND type ref to ZCL_EXCEL_STYLE_COND .
methods LOAD_WORKSHEET_COND_FORMAT_EX
importing
!IO_IXML_RULE type ref to IF_IXML_ELEMENT
!IO_STYLE_COND type ref to ZCL_EXCEL_STYLE_COND .
methods LOAD_WORKSHEET_COND_FORMAT_IS
importing
!IO_IXML_RULE type ref to IF_IXML_ELEMENT
!IO_STYLE_COND type ref to ZCL_EXCEL_STYLE_COND .
methods LOAD_WORKSHEET_COND_FORMAT_DB
importing
!IO_IXML_RULE type ref to IF_IXML_ELEMENT
!IO_STYLE_COND type ref to ZCL_EXCEL_STYLE_COND .
methods LOAD_WORKSHEET_COND_FORMAT_T10
importing
!IO_IXML_RULE type ref to IF_IXML_ELEMENT
!IO_STYLE_COND type ref to ZCL_EXCEL_STYLE_COND .
methods LOAD_WORKSHEET_DRAWING
importing
!IP_PATH type STRING
!IO_WORKSHEET type ref to ZCL_EXCEL_WORKSHEET
raising
ZCX_EXCEL .
methods LOAD_WORKSHEET_HYPERLINKS
importing
!IO_IXML_WORKSHEET type ref to IF_IXML_DOCUMENT
!IO_WORKSHEET type ref to ZCL_EXCEL_WORKSHEET
!IT_EXTERNAL_HYPERLINKS type GTT_EXTERNAL_HYPERLINKS
raising
ZCX_EXCEL .
methods LOAD_WORKSHEET_PAGEBREAKS
importing
!IO_IXML_WORKSHEET type ref to IF_IXML_DOCUMENT
!IO_WORKSHEET type ref to ZCL_EXCEL_WORKSHEET
raising
ZCX_EXCEL .
methods LOAD_WORKSHEET_PAGEMARGINS
importing
!IO_IXML_WORKSHEET type ref to IF_IXML_DOCUMENT
!IO_WORKSHEET type ref to ZCL_EXCEL_WORKSHEET
raising
ZCX_EXCEL .
class-methods RESOLVE_PATH
importing
!IP_PATH type STRING
returning
value(RP_RESULT) type STRING .
methods RESOLVE_REFERENCED_FORMULAE .
methods GET_DXF_STYLE_GUID
importing
!IO_IXML_DXF type ref to IF_IXML_ELEMENT
!IO_EXCEL type ref to ZCL_EXCEL
returning
value(RV_STYLE_GUID) type ZEXCEL_CELL_STYLE .
methods LOAD_THEME
importing
value(IV_PATH) type STRING
!IP_EXCEL type ref to ZCL_EXCEL .
private section.
data ZIP type ref to LCL_ZIP_ARCHIVE .
methods CREATE_ZIP_ARCHIVE
importing
!I_XLSX_BINARY type XSTRING
!I_USE_ALTERNATE_ZIP type SEOCLSNAME optional
returning
value(E_ZIP) type ref to LCL_ZIP_ARCHIVE
raising
ZCX_EXCEL .
methods READ_FROM_APPLSERVER
importing
!I_FILENAME type CSEQUENCE
returning
value(R_EXCEL_DATA) type XSTRING .
methods READ_FROM_LOCAL_FILE
importing
!I_FILENAME type CSEQUENCE
returning
value(R_EXCEL_DATA) type XSTRING
raising
ZCX_EXCEL .
ENDCLASS.
CLASS ZCL_EXCEL_READER_2007 IMPLEMENTATION.
METHOD create_zip_archive.
CASE i_use_alternate_zip.
WHEN space.
e_zip = lcl_abap_zip_archive=>create( i_xlsx_binary ).
WHEN OTHERS.
e_zip = lcl_alternate_zip_archive=>create( i_data = i_xlsx_binary
i_alternate_zip_class = i_use_alternate_zip ).
ENDCASE.
ENDMETHOD.
METHOD fill_row_outlines.
TYPES: BEGIN OF lts_row_data,
row TYPE i,
outline_level TYPE i,
END OF lts_row_data,
ltt_row_data TYPE SORTED TABLE OF lts_row_data WITH UNIQUE KEY row.
DATA: lt_row_data TYPE ltt_row_data,
ls_row_data LIKE LINE OF lt_row_data,
lt_collapse_rows TYPE HASHED TABLE OF i WITH UNIQUE KEY table_line,
lv_collapsed TYPE abap_bool,
lv_outline_level TYPE i,
lv_next_consecutive_row TYPE i,
lt_outline_rows TYPE zcl_excel_worksheet=>mty_ts_outlines_row,
ls_outline_row LIKE LINE OF lt_outline_rows,
lo_row TYPE REF TO zcl_excel_row,
lo_row_iterator TYPE REF TO cl_object_collection_iterator,
lv_row_offset TYPE i,
lv_row_collapse_flag TYPE i.
FIELD-SYMBOLS: <ls_row_data> LIKE LINE OF lt_row_data.
* First collect information about outlines ( outline leven and collapsed state )
lo_row_iterator = io_worksheet->get_rows_iterator( ).
WHILE lo_row_iterator->has_next( ) = abap_true.
lo_row ?= lo_row_iterator->get_next( ).
ls_row_data-row = lo_row->get_row_index( ).
ls_row_data-outline_level = lo_row->get_outline_level( ).
IF ls_row_data-outline_level IS NOT INITIAL.
INSERT ls_row_data INTO TABLE lt_row_data.
ENDIF.
lv_collapsed = lo_row->get_collapsed( ).
IF lv_collapsed = abap_true.
INSERT lo_row->get_row_index( ) INTO TABLE lt_collapse_rows.
ENDIF.
ENDWHILE.
* Now parse this information - we need consecutive rows - any gap will create a new outline
DO 7 TIMES. " max number of outlines allowed
lv_outline_level = sy-index.
CLEAR lv_next_consecutive_row.
CLEAR ls_outline_row.
LOOP AT lt_row_data ASSIGNING <ls_row_data> WHERE outline_level >= lv_outline_level.
IF lv_next_consecutive_row <> <ls_row_data>-row " A gap --> close all open outlines
AND lv_next_consecutive_row IS NOT INITIAL. " First time in loop.
INSERT ls_outline_row INTO TABLE lt_outline_rows.
CLEAR: ls_outline_row.
ENDIF.
IF ls_outline_row-row_from IS INITIAL.
ls_outline_row-row_from = <ls_row_data>-row.
ENDIF.
ls_outline_row-row_to = <ls_row_data>-row.
lv_next_consecutive_row = <ls_row_data>-row + 1.
ENDLOOP.
IF ls_outline_row-row_from IS NOT INITIAL.
INSERT ls_outline_row INTO TABLE lt_outline_rows.
ENDIF.
ENDDO.
* lt_outline_rows holds all outline information
* we now need to determine whether the outline is collapsed or not
LOOP AT lt_outline_rows INTO ls_outline_row.
IF io_worksheet->zif_excel_sheet_properties~summarybelow = zif_excel_sheet_properties=>c_below_off.
lv_row_collapse_flag = ls_outline_row-row_from - 1.
ELSE.
lv_row_collapse_flag = ls_outline_row-row_to + 1.
ENDIF.
READ TABLE lt_collapse_rows TRANSPORTING NO FIELDS WITH TABLE KEY table_line = lv_row_collapse_flag.
IF sy-subrc = 0.
ls_outline_row-collapsed = abap_true.
ENDIF.
io_worksheet->set_row_outline( iv_row_from = ls_outline_row-row_from
iv_row_to = ls_outline_row-row_to
iv_collapsed = ls_outline_row-collapsed ).
ENDLOOP.
* Finally purge outline information ( collapsed state, outline leve) from row_dimensions, since we want to keep these in the outline-table
lo_row_iterator = io_worksheet->get_rows_iterator( ).
WHILE lo_row_iterator->has_next( ) = abap_true.
lo_row ?= lo_row_iterator->get_next( ).
lo_row->set_outline_level( 0 ).
lo_row->set_collapsed( abap_false ).
ENDWHILE.
ENDMETHOD.
method fill_struct_from_attributes.
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-07
* - ...
* changes: renaming variables to naming conventions
* aligning code
* adding comments to explain what we are trying to achieve
*--------------------------------------------------------------------*
data: lv_name type string,
lo_attributes type ref to if_ixml_named_node_map,
lo_attribute type ref to if_ixml_attribute,
lo_iterator type ref to if_ixml_node_iterator.
field-symbols: <component> type any.
*--------------------------------------------------------------------*
* The values of named attributes of a tag are being read and moved into corresponding
* fields of given structure
* Behaves like move-corresonding tag to structure
* Example:
* <Relationship Target="docProps/app.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Id="rId3"/>
* Here the attributes are Target, Type and Id. Thus if the passed
* structure has fieldnames Id and Target these would be filled with
* "rId3" and "docProps/app.xml" respectively
*--------------------------------------------------------------------*
clear cp_structure.
lo_attributes = ip_element->get_attributes( ).
lo_iterator = lo_attributes->create_iterator( ).
lo_attribute ?= lo_iterator->get_next( ).
while lo_attribute is bound.
lv_name = lo_attribute->get_name( ).
translate lv_name to upper case.
assign component lv_name of structure cp_structure to <component>.
if sy-subrc = 0.
<component> = lo_attribute->get_value( ).
endif.
lo_attribute ?= lo_iterator->get_next( ).
endwhile.
endmethod.
METHOD get_dxf_style_guid.
DATA: lo_ixml_dxf_children TYPE REF TO if_ixml_node_list,
lo_ixml_iterator_dxf_children TYPE REF TO if_ixml_node_iterator,
lo_ixml_dxf_child TYPE REF TO if_ixml_element,
lv_dxf_child_type TYPE string,
lo_ixml_element TYPE REF TO if_ixml_element,
lo_ixml_element2 TYPE REF TO if_ixml_element,
lv_val TYPE string.
DATA: ls_cstyle TYPE zexcel_s_cstyle_complete,
ls_cstylex TYPE zexcel_s_cstylex_complete.
lo_ixml_dxf_children = io_ixml_dxf->get_children( ).
lo_ixml_iterator_dxf_children = lo_ixml_dxf_children->create_iterator( ).
lo_ixml_dxf_child ?= lo_ixml_iterator_dxf_children->get_next( ).
WHILE lo_ixml_dxf_child IS BOUND.
lv_dxf_child_type = lo_ixml_dxf_child->get_name( ).
CASE lv_dxf_child_type.
WHEN 'font'.
*--------------------------------------------------------------------*
* italic
*--------------------------------------------------------------------*
lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'i' ).
IF lo_ixml_element IS BOUND.
CLEAR lv_val.
lv_val = lo_ixml_element->get_attribute_ns( 'val' ).
IF lv_val <> '0'.
ls_cstyle-font-italic = 'X'.
ls_cstylex-font-italic = 'X'.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* bold
*--------------------------------------------------------------------*
lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'b' ).
IF lo_ixml_element IS BOUND.
CLEAR lv_val.
lv_val = lo_ixml_element->get_attribute_ns( 'val' ).
IF lv_val <> '0'.
ls_cstyle-font-bold = 'X'.
ls_cstylex-font-bold = 'X'.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* strikethrough
*--------------------------------------------------------------------*
lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'strike' ).
IF lo_ixml_element IS BOUND.
CLEAR lv_val.
lv_val = lo_ixml_element->get_attribute_ns( 'val' ).
IF lv_val <> '0'.
ls_cstyle-font-strikethrough = 'X'.
ls_cstylex-font-strikethrough = 'X'.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* color
*--------------------------------------------------------------------*
lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'color' ).
IF lo_ixml_element IS BOUND.
CLEAR lv_val.
lv_val = lo_ixml_element->get_attribute_ns( 'rgb' ).
ls_cstyle-font-color-rgb = lv_val.
ls_cstylex-font-color-rgb = 'X'.
ENDIF.
WHEN 'fill'.
lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'patternFill' ).
IF lo_ixml_element IS BOUND.
lo_ixml_element2 = lo_ixml_element->find_from_name( 'bgColor' ).
IF lo_ixml_element2 IS BOUND.
CLEAR lv_val.
lv_val = lo_ixml_element2->get_attribute_ns( 'rgb' ).
IF lv_val IS NOT INITIAL.
ls_cstyle-fill-filltype = zcl_excel_style_fill=>c_fill_solid.
ls_cstyle-fill-bgcolor-rgb = lv_val.
ls_cstylex-fill-filltype = 'X'.
ls_cstylex-fill-bgcolor-rgb = 'X'.
ENDIF.
ENDIF.
CLEAR lv_val.
lv_val = lo_ixml_element2->get_attribute_ns( 'theme' ).
IF lv_val IS NOT INITIAL.
ls_cstyle-fill-filltype = zcl_excel_style_fill=>c_fill_solid.
ls_cstyle-fill-bgcolor-theme = lv_val.
ls_cstylex-fill-filltype = 'X'.
ls_cstylex-fill-bgcolor-theme = 'X'.
ENDIF.
ENDIF.
* 2do - borders into dxf-styles. Here and in writerclass
* WHEN 'border'.
* lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'left' ).
* IF lo_ixml_element IS BOUND.
* CLEAR lv_val.
* lv_val = lo_ixml_element2->get_attribute_ns( 'style' ).
* IF lv_val IS NOT INITIAL.
* ls_cstyle-borders-left-border_style = lv_val.
* ls_cstylex-borders-left-border_style = 'X'.
* ENDIF.
* ENDIF.
ENDCASE.
lo_ixml_dxf_child ?= lo_ixml_iterator_dxf_children->get_next( ).
ENDWHILE.
rv_style_guid = io_excel->get_static_cellstyle_guid( ip_cstyle_complete = ls_cstyle
ip_cstylex_complete = ls_cstylex ).
ENDMETHOD.
METHOD get_from_zip_archive.
ASSERT zip IS BOUND. " zip object has to exist at this point
r_content = zip->read( i_filename ).
ENDMETHOD.
METHOD get_ixml_from_zip_archive.
DATA: lv_content TYPE xstring,
lo_ixml TYPE REF TO if_ixml,
lo_streamfactory TYPE REF TO if_ixml_stream_factory,
lo_istream TYPE REF TO if_ixml_istream,
lo_parser TYPE REF TO if_ixml_parser.
*--------------------------------------------------------------------*
* Load XML file from archive into an input stream,
* and parse that stream into an ixml object
*--------------------------------------------------------------------*
lv_content = me->get_from_zip_archive( i_filename ).
lo_ixml = cl_ixml=>create( ).
lo_streamfactory = lo_ixml->create_stream_factory( ).
lo_istream = lo_streamfactory->create_istream_xstring( lv_content ).
r_ixml = lo_ixml->create_document( ).
lo_parser = lo_ixml->create_parser( stream_factory = lo_streamfactory
istream = lo_istream
document = r_ixml ).
lo_parser->set_normalizing( is_normalizing ).
lo_parser->set_validating( mode = if_ixml_parser=>co_no_validation ).
lo_parser->parse( ).
ENDMETHOD.
METHOD load_drawing_anchor.
TYPES: BEGIN OF t_c_nv_pr,
name TYPE string,
id TYPE string,
END OF t_c_nv_pr.
TYPES: BEGIN OF t_blip,
cstate TYPE string,
embed TYPE string,
END OF t_blip.
TYPES: BEGIN OF t_chart,
id TYPE string,
END OF t_chart.
TYPES: BEGIN OF t_ext,
cx TYPE string,
cy TYPE string,
END OF t_ext.
CONSTANTS: lc_xml_attr_true TYPE string VALUE 'true',
lc_xml_attr_true_int TYPE string VALUE '1'.
CONSTANTS: lc_rel_chart TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart',
lc_rel_image TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image'.
DATA: lo_drawing TYPE REF TO zcl_excel_drawing,
node TYPE REF TO if_ixml_element,
node2 TYPE REF TO if_ixml_element,
node3 TYPE REF TO if_ixml_element,
node4 TYPE REF TO if_ixml_element,
ls_upper TYPE zexcel_drawing_location,
ls_lower TYPE zexcel_drawing_location,
ls_size TYPE zexcel_drawing_size,
ext TYPE t_ext,
lv_content TYPE xstring,
lv_relation_id TYPE string,
lv_title TYPE string,
cnvpr TYPE t_c_nv_pr,
blip TYPE t_blip,
chart TYPE t_chart,
drawing_type TYPE zexcel_drawing_type,
rel_drawing TYPE t_rel_drawing.
node ?= io_anchor_element->find_from_name( name = 'from' namespace = 'xdr' ).
CHECK node IS NOT INITIAL.
node2 ?= node->find_from_name( name = 'col' namespace = 'xdr' ).
ls_upper-col = node2->get_value( ).
node2 ?= node->find_from_name( name = 'row' namespace = 'xdr' ).
ls_upper-row = node2->get_value( ).
node2 ?= node->find_from_name( name = 'colOff' namespace = 'xdr' ).
ls_upper-col_offset = node2->get_value( ).
node2 ?= node->find_from_name( name = 'rowOff' namespace = 'xdr' ).
ls_upper-row_offset = node2->get_value( ).
node ?= io_anchor_element->find_from_name( name = 'ext' namespace = 'xdr' ).
IF node IS INITIAL.
CLEAR ls_size.
ELSE.
me->fill_struct_from_attributes( EXPORTING ip_element = node CHANGING cp_structure = ext ).
ls_size-width = ext-cx.
ls_size-height = ext-cy.
TRY.
ls_size-width = zcl_excel_drawing=>emu2pixel( ls_size-width ).
CATCH cx_root.
ENDTRY.
TRY.
ls_size-height = zcl_excel_drawing=>emu2pixel( ls_size-height ).
CATCH cx_root.
ENDTRY.
ENDIF.
node ?= io_anchor_element->find_from_name( name = 'to' namespace = 'xdr' ).
IF node IS INITIAL.
CLEAR ls_lower.
ELSE.
node2 ?= node->find_from_name( name = 'col' namespace = 'xdr' ).
ls_lower-col = node2->get_value( ).
node2 ?= node->find_from_name( name = 'row' namespace = 'xdr' ).
ls_lower-row = node2->get_value( ).
node2 ?= node->find_from_name( name = 'colOff' namespace = 'xdr' ).
ls_lower-col_offset = node2->get_value( ).
node2 ?= node->find_from_name( name = 'rowOff' namespace = 'xdr' ).
ls_lower-row_offset = node2->get_value( ).
ENDIF.
node ?= io_anchor_element->find_from_name( name = 'pic' namespace = 'xdr' ).
IF node IS NOT INITIAL.
node2 ?= node->find_from_name( name = 'nvPicPr' namespace = 'xdr' ).
CHECK node2 IS NOT INITIAL.
node3 ?= node2->find_from_name( name = 'cNvPr' namespace = 'xdr' ).
CHECK node3 IS NOT INITIAL.
me->fill_struct_from_attributes( EXPORTING ip_element = node3 CHANGING cp_structure = cnvpr ).
lv_title = cnvpr-name.
node2 ?= node->find_from_name( name = 'blipFill' namespace = 'xdr' ).
CHECK node2 IS NOT INITIAL.
node3 ?= node2->find_from_name( name = 'blip' namespace = 'a' ).
CHECK node3 IS NOT INITIAL.
me->fill_struct_from_attributes( EXPORTING ip_element = node3 CHANGING cp_structure = blip ).
lv_relation_id = blip-embed.
drawing_type = zcl_excel_drawing=>type_image.
ENDIF.
node ?= io_anchor_element->find_from_name( name = 'graphicFrame' namespace = 'xdr' ).
IF node IS NOT INITIAL.
node2 ?= node->find_from_name( name = 'nvGraphicFramePr' namespace = 'xdr' ).
CHECK node2 IS NOT INITIAL.
node3 ?= node2->find_from_name( name = 'cNvPr' namespace = 'xdr' ).
CHECK node3 IS NOT INITIAL.
me->fill_struct_from_attributes( EXPORTING ip_element = node3 CHANGING cp_structure = cnvpr ).
lv_title = cnvpr-name.
node2 ?= node->find_from_name( name = 'graphic' namespace = 'a' ).
CHECK node2 IS NOT INITIAL.
node3 ?= node2->find_from_name( name = 'graphicData' namespace = 'a' ).
CHECK node3 IS NOT INITIAL.
node4 ?= node2->find_from_name( name = 'chart' namespace = 'c' ).
CHECK node4 IS NOT INITIAL.
me->fill_struct_from_attributes( EXPORTING ip_element = node4 CHANGING cp_structure = chart ).
lv_relation_id = chart-id.
drawing_type = zcl_excel_drawing=>type_chart.
ENDIF.
lo_drawing = io_worksheet->excel->add_new_drawing(
ip_type = drawing_type
ip_title = lv_title ).
io_worksheet->add_drawing( lo_drawing ).
lo_drawing->set_position2(
EXPORTING
ip_from = ls_upper
ip_to = ls_lower ).
READ TABLE it_related_drawings INTO rel_drawing
WITH KEY id = lv_relation_id.
lo_drawing->set_media(
EXPORTING
ip_media = rel_drawing-content
ip_media_type = rel_drawing-file_ext
ip_width = ls_size-width
ip_height = ls_size-height ).
IF drawing_type = zcl_excel_drawing=>type_chart.
"-------------Added by Alessandro Iannacci - Should load chart attributes
lo_drawing->load_chart_attributes( rel_drawing-content_xml ).
ENDIF.
ENDMETHOD.
METHOD load_dxf_styles.
DATA: lo_styles_xml TYPE REF TO if_ixml_document,
lo_node_dxfs TYPE REF TO if_ixml_element,
lo_nodes_dxf TYPE REF TO if_ixml_node_collection,
lo_iterator_dxf TYPE REF TO if_ixml_node_iterator,
lo_node_dxf TYPE REF TO if_ixml_element,
lv_dxf_count TYPE i.
FIELD-SYMBOLS: <ls_dxf_style> LIKE LINE OF mt_dxf_styles.
*--------------------------------------------------------------------*
* Look for dxfs-node
*--------------------------------------------------------------------*
lo_styles_xml = me->get_ixml_from_zip_archive( iv_path ).
lo_node_dxfs = lo_styles_xml->find_from_name( 'dxfs' ).
CHECK lo_node_dxfs IS BOUND.
*--------------------------------------------------------------------*
* loop through all dxf-nodes and create style for each
*--------------------------------------------------------------------*
lo_nodes_dxf ?= lo_node_dxfs->get_elements_by_tag_name( 'dxf' ).
lo_iterator_dxf = lo_nodes_dxf->create_iterator( ).
lo_node_dxf ?= lo_iterator_dxf->get_next( ).
WHILE lo_node_dxf IS BOUND.
APPEND INITIAL LINE TO mt_dxf_styles ASSIGNING <ls_dxf_style>.
<ls_dxf_style>-dxf = lv_dxf_count. " We start counting at 0
ADD 1 TO lv_dxf_count. " prepare next entry
<ls_dxf_style>-guid = get_dxf_style_guid( io_ixml_dxf = lo_node_dxf
io_excel = io_excel ).
lo_node_dxf ?= lo_iterator_dxf->get_next( ).
ENDWHILE.
ENDMETHOD.
method LOAD_SHARED_STRINGS.
*--------------------------------------------------------------------*
* ToDos:
* 2do§1 Support partial formatting of strings in cells
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-11
* - ...
* changes: renaming variables to naming conventions
* renaming variables to indicate what they are used for
* aligning code
* adding comments to explain what we are trying to achieve
* rewriting code for better readibility
*--------------------------------------------------------------------*
DATA:
lo_shared_strings_xml TYPE REF TO if_ixml_document,
lo_node_si TYPE REF TO if_ixml_element,
lo_node_si_child TYPE REF TO if_ixml_element,
lo_node_r_child_t TYPE REF TO if_ixml_element,
lv_tag_name TYPE string,
lv_node_value TYPE string.
FIELD-SYMBOLS: <lv_shared_string> LIKE LINE OF me->shared_strings.
*--------------------------------------------------------------------*
* §1 Parse shared strings file and get into internal table
* So far I have encountered 2 ways how a string can be represented in the shared strings file
* §1.1 - "simple" strings
* §1.2 - rich text formatted strings
* Following is an example how this file could be set up; 2 strings in simple formatting, 3rd string rich textformatted
* <?xml version="1.0" encoding="UTF-8" standalone="true"?>
* <sst uniqueCount="6" count="6" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
* <si>
* <t>This is a teststring 1</t>
* </si>
* <si>
* <t>This is a teststring 2</t>
* </si>
* <si>
* <r>
* <t>T</t>
* </r>
* <r>
* <rPr>
* <sz val="11"/>
* <color rgb="FFFF0000"/>
* <rFont val="Calibri"/>
* <family val="2"/>
* <scheme val="minor"/>
* </rPr>
* <t xml:space="preserve">his is a </t>
* </r>
* <r>
* <rPr>
* <sz val="11"/>
* <color theme="1"/>
* <rFont val="Calibri"/>
* <family val="2"/>
* <scheme val="minor"/>
* </rPr>
* <t>teststring 3</t>
* </r>
* </si>
* </sst>
*--------------------------------------------------------------------*
lo_shared_strings_xml = me->get_ixml_from_zip_archive( i_filename = ip_path
is_normalizing = space ). " NO!!! normalizing - otherwise leading blanks will be omitted and that is not really desired for the stringtable
lo_node_si ?= lo_shared_strings_xml->find_from_name( 'si' ).
WHILE lo_node_si IS BOUND.
APPEND INITIAL LINE TO me->shared_strings ASSIGNING <lv_shared_string>. " Each <si>-entry in the xml-file must lead to an entry in our stringtable
lo_node_si_child ?= lo_node_si->get_first_child( ).
IF lo_node_si_child IS BOUND.
lv_tag_name = lo_node_si_child->get_name( ).
IF lv_tag_name = 't'.
*--------------------------------------------------------------------*
* §1.1 - "simple" strings
* Example: see above
*--------------------------------------------------------------------*
<lv_shared_string> = lo_node_si_child->get_value( ).
ELSE.
*--------------------------------------------------------------------*
* §1.2 - rich text formatted strings
* it is sufficient to strip the <t>...</t> tag from each <r>-tag and concatenate these
* as long as rich text formatting is not supported (2do§1) ignore all info about formatting
* Example: see above
*--------------------------------------------------------------------*
WHILE lo_node_si_child IS BOUND. " actually these children of <si> are <r>-tags
lo_node_r_child_t ?= lo_node_si_child->find_from_name( 't' ). " extract the <t>...</t> part of each <r>-tag
IF lo_node_r_child_t IS BOUND.
lv_node_value = lo_node_r_child_t->get_value( ).
CONCATENATE <lv_shared_string> lv_node_value INTO <lv_shared_string> RESPECTING BLANKS.
ENDIF.
lo_node_si_child ?= lo_node_si_child->get_next( ).
ENDWHILE.
ENDIF.
ENDIF.
lo_node_si ?= lo_node_si->get_next( ).
ENDWHILE.
endmethod.
METHOD load_styles.
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (wip ) 2012-11-25
* - ...
* changes: renaming variables and types to naming conventions
* aligning code
* adding comments to explain what we are trying to achieve
*--------------------------------------------------------------------*
TYPES: BEGIN OF lty_xf,
applyalignment TYPE string,
applyborder TYPE string,
applyfill TYPE string,
applyfont TYPE string,
applynumberformat TYPE string,
applyprotection TYPE string,
borderid TYPE string,
fillid TYPE string,
fontid TYPE string,
numfmtid TYPE string,
pivotbutton TYPE string,
quoteprefix TYPE string,
xfid TYPE string,
END OF lty_xf.
TYPES: BEGIN OF lty_alignment,
horizontal TYPE string,
indent TYPE string,
justifylastline TYPE string,
readingorder TYPE string,
relativeindent TYPE string,
shrinktofit TYPE string,
textrotation TYPE string,
vertical TYPE string,
wraptext TYPE string,
END OF lty_alignment.
TYPES: BEGIN OF lty_protection,
hidden TYPE string,
locked TYPE string,
END OF lty_protection.
DATA: lo_styles_xml TYPE REF TO if_ixml_document,
lo_style TYPE REF TO zcl_excel_style,
lt_num_formats TYPE zcl_excel_style_number_format=>t_num_formats,
lt_fills TYPE t_fills,
lt_borders TYPE t_borders,
lt_fonts TYPE t_fonts,
ls_num_format TYPE zcl_excel_style_number_format=>t_num_format ,
ls_fill TYPE REF TO zcl_excel_style_fill,
ls_cell_border TYPE REF TO zcl_excel_style_borders,
ls_font TYPE REF TO zcl_excel_style_font,
lo_node_cellxfs TYPE REF TO if_ixml_element,
lo_node_cellxfs_xf TYPE REF TO if_ixml_element,
lo_node_cellxfs_xf_alignment TYPE REF TO if_ixml_element,
lo_node_cellxfs_xf_protection TYPE REF TO if_ixml_element,
lo_nodes_xf TYPE REF TO if_ixml_node_collection,
lo_iterator_cellxfs TYPE REF TO if_ixml_node_iterator,
ls_xf TYPE lty_xf,
ls_alignment TYPE lty_alignment,
ls_protection TYPE lty_protection,
lv_index TYPE i.
*--------------------------------------------------------------------*
* To build a complete style that fully describes how a cell looks like
* we need the various parts
* §1 - Numberformat
* §2 - Fillstyle
* §3 - Borders
* §4 - Font
* §5 - Alignment
* §6 - Protection
* Following is an example how this part of a file could be set up
* ...
* parts with various formatinformation - see §1,§2,§3,§4
* ...
* <cellXfs count="26">
* <xf numFmtId="0" borderId="0" fillId="0" fontId="0" xfId="0"/>
* <xf numFmtId="0" borderId="0" fillId="2" fontId="0" xfId="0" applyFill="1"/>
* <xf numFmtId="0" borderId="1" fillId="3" fontId="0" xfId="0" applyFill="1" applyBorder="1"/>
* <xf numFmtId="0" borderId="2" fillId="3" fontId="0" xfId="0" applyFill="1" applyBorder="1"/>
* <xf numFmtId="0" borderId="3" fillId="3" fontId="0" xfId="0" applyFill="1" applyBorder="1"/>
* <xf numFmtId="0" borderId="4" fillId="3" fontId="0" xfId="0" applyFill="1" applyBorder="1"/>
* <xf numFmtId="0" borderId="0" fillId="3" fontId="0" xfId="0" applyFill="1" applyBorder="1"/>
* ...
* </cellXfs>
*--------------------------------------------------------------------*
lo_styles_xml = me->get_ixml_from_zip_archive( ip_path ).
*--------------------------------------------------------------------*
* The styles are build up from
* §1 number formats
* §2 fill styles
* §3 border styles
* §4 fonts
* These need to be read before we can try to build up a complete
* style that describes the look of a cell
*--------------------------------------------------------------------*
lt_num_formats = load_style_num_formats( lo_styles_xml ). " §1
lt_fills = load_style_fills( lo_styles_xml ). " §2
lt_borders = load_style_borders( lo_styles_xml ). " §3
lt_fonts = load_style_fonts( lo_styles_xml ). " §4
*--------------------------------------------------------------------*
* Now everything is prepared to build a "full" style
*--------------------------------------------------------------------*
lo_node_cellxfs = lo_styles_xml->find_from_name( name = 'cellXfs' ).
IF lo_node_cellxfs IS BOUND.
lo_nodes_xf = lo_node_cellxfs->get_elements_by_tag_name( name = 'xf' ).
lo_iterator_cellxfs = lo_nodes_xf->create_iterator( ).
lo_node_cellxfs_xf ?= lo_iterator_cellxfs->get_next( ).
WHILE lo_node_cellxfs_xf IS BOUND.
lo_style = ip_excel->add_new_style( ).
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_cellxfs_xf
CHANGING
cp_structure = ls_xf ).
*--------------------------------------------------------------------*
* §2 fill style
*--------------------------------------------------------------------*
IF ls_xf-applyfill = '1' AND ls_xf-fillid IS NOT INITIAL.
lv_index = ls_xf-fillid + 1.
READ TABLE lt_fills INTO ls_fill INDEX lv_index.
IF sy-subrc = 0.
lo_style->fill = ls_fill.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* §1 number format
*--------------------------------------------------------------------*
IF ls_xf-numfmtid IS NOT INITIAL.
READ TABLE lt_num_formats INTO ls_num_format WITH TABLE KEY id = ls_xf-numfmtid.
IF sy-subrc = 0.
lo_style->number_format = ls_num_format-format.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* §3 border style
*--------------------------------------------------------------------*
IF ls_xf-applyborder = '1' AND ls_xf-borderid IS NOT INITIAL.
lv_index = ls_xf-borderid + 1.
READ TABLE lt_borders INTO ls_cell_border INDEX lv_index.
IF sy-subrc = 0.
lo_style->borders = ls_cell_border.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* §4 font
*--------------------------------------------------------------------*
IF ls_xf-applyfont = '1' AND ls_xf-fontid IS NOT INITIAL.
lv_index = ls_xf-fontid + 1.
READ TABLE lt_fonts INTO ls_font INDEX lv_index.
IF sy-subrc = 0.
lo_style->font = ls_font.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* §5 - Alignment
*--------------------------------------------------------------------*
lo_node_cellxfs_xf_alignment ?= lo_node_cellxfs_xf->find_from_name( 'alignment' ).
IF lo_node_cellxfs_xf_alignment IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_cellxfs_xf_alignment
CHANGING
cp_structure = ls_alignment ).
IF ls_alignment-horizontal IS NOT INITIAL.
lo_style->alignment->horizontal = ls_alignment-horizontal.
ENDIF.
IF ls_alignment-vertical IS NOT INITIAL.
lo_style->alignment->vertical = ls_alignment-vertical.
ENDIF.
IF ls_alignment-textrotation IS NOT INITIAL.
lo_style->alignment->textrotation = ls_alignment-textrotation.
ENDIF.
IF ls_alignment-wraptext = '1' OR ls_alignment-wraptext = 'true'.
lo_style->alignment->wraptext = abap_true.
ENDIF.
IF ls_alignment-shrinktofit = '1' OR ls_alignment-shrinktofit = 'true'.
lo_style->alignment->shrinktofit = abap_true.
ENDIF.
IF ls_alignment-indent IS NOT INITIAL.
lo_style->alignment->indent = ls_alignment-indent.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* §6 - Protection
*--------------------------------------------------------------------*
lo_node_cellxfs_xf_protection ?= lo_node_cellxfs_xf->find_from_name( 'protection' ).
IF lo_node_cellxfs_xf_protection IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_cellxfs_xf_protection
CHANGING
cp_structure = ls_protection ).
IF ls_protection-locked = '1' OR ls_protection-locked = 'true'.
lo_style->protection->locked = zcl_excel_style_protection=>c_protection_locked.
ELSE.
lo_style->protection->locked = zcl_excel_style_protection=>c_protection_unlocked.
ENDIF.
IF ls_protection-hidden = '1' OR ls_protection-hidden = 'true'.
lo_style->protection->hidden = zcl_excel_style_protection=>c_protection_hidden.
ELSE.
lo_style->protection->hidden = zcl_excel_style_protection=>c_protection_unhidden.
ENDIF.
ENDIF.
INSERT lo_style INTO TABLE me->styles.
lo_node_cellxfs_xf ?= lo_iterator_cellxfs->get_next( ).
ENDWHILE.
ENDIF.
ENDMETHOD.
method LOAD_STYLE_BORDERS.
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-25
* - ...
* changes: renaming variables and types to naming conventions
* aligning code
* renaming variables to indicate what they are used for
* adding comments to explain what we are trying to achieve
*--------------------------------------------------------------------*
DATA: lo_node_border TYPE REF TO if_ixml_element,
lo_node_bordertype TYPE REF TO if_ixml_element,
lo_node_bordercolor TYPE REF TO if_ixml_element,
lo_cell_border TYPE REF TO zcl_excel_style_borders,
lo_border TYPE REF TO zcl_excel_style_border,
ls_color TYPE t_color.
*--------------------------------------------------------------------*
* We need a table of used borderformats to build up our styles
* §1 A cell has 4 outer borders and 2 diagonal "borders"
* These borders can be formatted separately but the diagonal borders
* are always being formatted the same
* We'll parse through the <border>-tag for each of the bordertypes
* §2 and read the corresponding formatting information
* Following is an example how this part of a file could be set up
* <border diagonalDown="1">
* <left style="mediumDashDotDot">
* <color rgb="FFFF0000"/>
* </left>
* <right/>
* <top style="thick">
* <color rgb="FFFF0000"/>
* </top>
* <bottom style="thick">
* <color rgb="FFFF0000"/>
* </bottom>
* <diagonal style="thick">
* <color rgb="FFFF0000"/>
* </diagonal>
* </border>
*--------------------------------------------------------------------*
lo_node_border ?= ip_xml->find_from_name( 'border' ).
WHILE lo_node_border IS BOUND.
CREATE OBJECT lo_cell_border.
*--------------------------------------------------------------------*
* Diagonal borderlines are formatted the equally. Determine what kind of diagonal borders are present if any
*--------------------------------------------------------------------*
* DiagonalNone = 0
* DiagonalUp = 1
* DiagonalDown = 2
* DiagonalBoth = 3
*--------------------------------------------------------------------*
IF lo_node_border->get_attribute( 'diagonalDown' ) IS NOT INITIAL.
add zcl_excel_style_borders=>c_diagonal_down to lo_cell_border->diagonal_mode.
ENDIF.
IF lo_node_border->get_attribute( 'diagonalUp' ) IS NOT INITIAL.
add zcl_excel_style_borders=>c_diagonal_up to lo_cell_border->diagonal_mode.
ENDIF.
lo_node_bordertype ?= lo_node_border->get_first_child( ).
WHILE lo_node_bordertype IS BOUND.
*--------------------------------------------------------------------*
* §1 Determine what kind of border we are talking about
*--------------------------------------------------------------------*
* Up, down, left, right, diagonal
*--------------------------------------------------------------------*
CREATE OBJECT lo_border.
CASE lo_node_bordertype->get_name( ).
WHEN 'left'.
lo_cell_border->left = lo_border.
WHEN 'right'.
lo_cell_border->right = lo_border.
WHEN 'top'.
lo_cell_border->top = lo_border.
WHEN 'bottom'.
lo_cell_border->down = lo_border.
WHEN 'diagonal'.
lo_cell_border->diagonal = lo_border.
ENDCASE.
*--------------------------------------------------------------------*
* §2 Read the border-formatting
*--------------------------------------------------------------------*
lo_border->border_style = lo_node_bordertype->get_attribute( 'style' ).
lo_node_bordercolor ?= lo_node_bordertype->find_from_name( 'color' ).
IF lo_node_bordercolor IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_bordercolor
CHANGING
cp_structure = ls_color ).
lo_border->border_color-rgb = ls_color-rgb.
IF ls_color-indexed IS NOT INITIAL.
lo_border->border_color-indexed = ls_color-indexed.
ENDIF.
IF ls_color-theme IS NOT INITIAL.
lo_border->border_color-theme = ls_color-theme.
ENDIF.
lo_border->border_color-tint = ls_color-tint.
ENDIF.
lo_node_bordertype ?= lo_node_bordertype->get_next( ).
ENDWHILE.
INSERT lo_cell_border INTO TABLE ep_borders.
lo_node_border ?= lo_node_border->get_next( ).
ENDWHILE.
endmethod.
method LOAD_STYLE_FILLS.
*--------------------------------------------------------------------*
* ToDos:
* 2do§1 Support gradientFill
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-25
* - ...
* changes: renaming variables and types to naming conventions
* aligning code
* commenting on problems/future enhancements/todos we already know of or should decide upon
* adding comments to explain what we are trying to achieve
* renaming variables to indicate what they are used for
*--------------------------------------------------------------------*
DATA: lv_value TYPE string,
lo_node_fill TYPE REF TO if_ixml_element,
lo_node_fill_child TYPE REF TO if_ixml_element,
lo_node_bgcolor TYPE REF TO if_ixml_element,
lo_node_fgcolor TYPE REF TO if_ixml_element,
lo_node_stop TYPE REF TO if_ixml_element,
lo_fill TYPE REF TO zcl_excel_style_fill,
ls_color TYPE t_color.
*--------------------------------------------------------------------*
* We need a table of used fillformats to build up our styles
* Following is an example how this part of a file could be set up
* <fill>
* <patternFill patternType="gray125"/>
* </fill>
* <fill>
* <patternFill patternType="solid">
* <fgColor rgb="FFFFFF00"/>
* <bgColor indexed="64"/>
* </patternFill>
* </fill>
*--------------------------------------------------------------------*
lo_node_fill ?= ip_xml->find_from_name( 'fill' ).
WHILE lo_node_fill IS BOUND.
CREATE OBJECT lo_fill.
lo_node_fill_child ?= lo_node_fill->get_first_child( ).
lv_value = lo_node_fill_child->get_name( ).
CASE lv_value.
*--------------------------------------------------------------------*
* Patternfill
*--------------------------------------------------------------------*
WHEN 'patternFill'.
lo_fill->filltype = lo_node_fill_child->get_attribute( 'patternType' ).
*--------------------------------------------------------------------*
* Patternfill - background color
*--------------------------------------------------------------------*
lo_node_bgcolor = lo_node_fill_child->find_from_name( 'bgColor' ).
IF lo_node_bgcolor IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_bgcolor
CHANGING
cp_structure = ls_color ).
lo_fill->bgcolor-rgb = ls_color-rgb.
IF ls_color-indexed IS NOT INITIAL.
lo_fill->bgcolor-indexed = ls_color-indexed.
ENDIF.
IF ls_color-theme IS NOT INITIAL.
lo_fill->bgcolor-theme = ls_color-theme.
ENDIF.
lo_fill->bgcolor-tint = ls_color-tint.
ENDIF.
*--------------------------------------------------------------------*
* Patternfill - foreground color
*--------------------------------------------------------------------*
lo_node_fgcolor = lo_node_fill->find_from_name( 'fgColor' ).
IF lo_node_fgcolor IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_fgcolor
CHANGING
cp_structure = ls_color ).
lo_fill->fgcolor-rgb = ls_color-rgb.
IF ls_color-indexed IS NOT INITIAL.
lo_fill->fgcolor-indexed = ls_color-indexed.
ENDIF.
IF ls_color-theme IS NOT INITIAL.
lo_fill->fgcolor-theme = ls_color-theme.
ENDIF.
lo_fill->fgcolor-tint = ls_color-tint.
ENDIF.
*--------------------------------------------------------------------*
* gradientFill
*--------------------------------------------------------------------*
WHEN 'gradientFill'.
lo_fill->gradtype-type = lo_node_fill_child->get_attribute( 'type' ).
lo_fill->gradtype-top = lo_node_fill_child->get_attribute( 'top' ).
lo_fill->gradtype-left = lo_node_fill_child->get_attribute( 'left' ).
lo_fill->gradtype-right = lo_node_fill_child->get_attribute( 'right' ).
lo_fill->gradtype-bottom = lo_node_fill_child->get_attribute( 'bottom' ).
lo_fill->gradtype-degree = lo_node_fill_child->get_attribute( 'degree' ).
free lo_node_stop.
lo_node_stop ?= lo_node_fill_child->find_from_name( 'stop' ).
while lo_node_stop is bound.
if lo_fill->gradtype-position1 is initial.
lo_fill->gradtype-position1 = lo_node_stop->get_attribute( 'position' ).
lo_node_bgcolor = lo_node_stop->find_from_name( 'color' ).
IF lo_node_bgcolor IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_bgcolor
CHANGING
cp_structure = ls_color ).
lo_fill->bgcolor-rgb = ls_color-rgb.
IF ls_color-indexed IS NOT INITIAL.
lo_fill->bgcolor-indexed = ls_color-indexed.
ENDIF.
IF ls_color-theme IS NOT INITIAL.
lo_fill->bgcolor-theme = ls_color-theme.
ENDIF.
lo_fill->bgcolor-tint = ls_color-tint.
ENDIF.
elseif lo_fill->gradtype-position2 is initial.
lo_fill->gradtype-position2 = lo_node_stop->get_attribute( 'position' ).
lo_node_fgcolor = lo_node_stop->find_from_name( 'color' ).
IF lo_node_fgcolor IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_fgcolor
CHANGING
cp_structure = ls_color ).
lo_fill->fgcolor-rgb = ls_color-rgb.
IF ls_color-indexed IS NOT INITIAL.
lo_fill->fgcolor-indexed = ls_color-indexed.
ENDIF.
IF ls_color-theme IS NOT INITIAL.
lo_fill->fgcolor-theme = ls_color-theme.
ENDIF.
lo_fill->fgcolor-tint = ls_color-tint.
ENDIF.
elseif lo_fill->gradtype-position3 is initial.
lo_fill->gradtype-position3 = lo_node_stop->get_attribute( 'position' ).
"BGColor is filled already with position 1 no need to check again
endif.
lo_node_stop ?= lo_node_stop->get_next( ).
ENDWHILE.
WHEN OTHERS.
ENDCASE.
INSERT lo_fill INTO TABLE ep_fills.
lo_node_fill ?= lo_node_fill->get_next( ).
ENDWHILE.
endmethod.
METHOD load_style_fonts.
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-25
* - ...
* changes: renaming variables and types to naming conventions
* aligning code
* removing unused variables
* adding comments to explain what we are trying to achieve
*--------------------------------------------------------------------*
DATA: lo_node_font TYPE REF TO if_ixml_element,
lo_node2 TYPE REF TO if_ixml_element,
lo_font TYPE REF TO zcl_excel_style_font,
ls_color TYPE t_color.
*--------------------------------------------------------------------*
* We need a table of used fonts to build up our styles
* Following is an example how this part of a file could be set up
* <font>
* <sz val="11"/>
* <color theme="1"/>
* <name val="Calibri"/>
* <family val="2"/>
* <scheme val="minor"/>
* </font>
*--------------------------------------------------------------------*
lo_node_font ?= ip_xml->find_from_name( 'font' ).
WHILE lo_node_font IS BOUND.
CREATE OBJECT lo_font.
*--------------------------------------------------------------------*
* Bold
*--------------------------------------------------------------------*
IF lo_node_font->find_from_name( 'b' ) IS BOUND.
lo_font->bold = abap_true.
ENDIF.
*--------------------------------------------------------------------*
* Italic
*--------------------------------------------------------------------*
IF lo_node_font->find_from_name( 'i' ) IS BOUND.
lo_font->italic = abap_true.
ENDIF.
*--------------------------------------------------------------------*
* Underline
*--------------------------------------------------------------------*
lo_node2 = lo_node_font->find_from_name( 'u' ).
IF lo_node2 IS BOUND.
lo_font->underline = abap_true.
lo_font->underline_mode = lo_node2->get_attribute( 'val' ).
ENDIF.
*--------------------------------------------------------------------*
* StrikeThrough
*--------------------------------------------------------------------*
IF lo_node_font->find_from_name( 'strike' ) IS BOUND.
lo_font->strikethrough = abap_true.
ENDIF.
*--------------------------------------------------------------------*
* Fontsize
*--------------------------------------------------------------------*
lo_node2 = lo_node_font->find_from_name( 'sz' ).
IF lo_node2 IS BOUND.
lo_font->size = lo_node2->get_attribute( 'val' ).
ENDIF.
*--------------------------------------------------------------------*
* Fontname
*--------------------------------------------------------------------*
lo_node2 = lo_node_font->find_from_name( 'name' ).
IF lo_node2 IS BOUND.
lo_font->name = lo_node2->get_attribute( 'val' ).
ENDIF.
*--------------------------------------------------------------------*
* Fontfamily
*--------------------------------------------------------------------*
lo_node2 = lo_node_font->find_from_name( 'family' ).
IF lo_node2 IS BOUND.
lo_font->family = lo_node2->get_attribute( 'val' ).
ENDIF.
*--------------------------------------------------------------------*
* Fontscheme
*--------------------------------------------------------------------*
lo_node2 = lo_node_font->find_from_name( 'scheme' ).
IF lo_node2 IS BOUND.
lo_font->scheme = lo_node2->get_attribute( 'val' ).
ELSE.
CLEAR lo_font->scheme.
ENDIF.
*--------------------------------------------------------------------*
* Fontcolor
*--------------------------------------------------------------------*
lo_node2 = lo_node_font->find_from_name( 'color' ).
IF lo_node2 IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node2
CHANGING
cp_structure = ls_color ).
lo_font->color-rgb = ls_color-rgb.
IF ls_color-indexed IS NOT INITIAL.
lo_font->color-indexed = ls_color-indexed.
ENDIF.
IF ls_color-theme IS NOT INITIAL.
lo_font->color-theme = ls_color-theme.
ENDIF.
lo_font->color-tint = ls_color-tint.
ENDIF.
INSERT lo_font INTO TABLE ep_fonts.
lo_node_font ?= lo_node_font->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_style_num_formats.
*--------------------------------------------------------------------*
* ToDos:
* 2do§1 Explain gaps in predefined formats
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-25
* - ...
* changes: renaming variables and types to naming conventions
* adding comments to explain what we are trying to achieve
* aligning code
*--------------------------------------------------------------------*
DATA: lo_node_numfmt TYPE REF TO if_ixml_element,
ls_num_format TYPE ZCL_EXCEL_STYLE_NUMBER_FORMAT=>T_NUM_FORMAT .
*--------------------------------------------------------------------*
* We need a table of used numberformats to build up our styles
* there are two kinds of numberformats
* §1 built-in numberformats
* §2 and those that have been explicitly added by the createor of the excel-file
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* §1 built-in numberformats
*--------------------------------------------------------------------*
ep_num_formats = ZCL_EXCEL_STYLE_NUMBER_FORMAT=>mt_built_in_num_formats.
*--------------------------------------------------------------------*
* §2 Get non-internal numberformats that are found in the file explicitly
* Following is an example how this part of a file could be set up
* <numFmts count="1">
* <numFmt formatCode="#,###,###,###,##0.00" numFmtId="164"/>
* </numFmts>
*--------------------------------------------------------------------*
lo_node_numfmt ?= ip_xml->find_from_name( 'numFmt' ).
WHILE lo_node_numfmt IS BOUND.
CLEAR ls_num_format.
CREATE OBJECT ls_num_format-format.
ls_num_format-format->format_code = lo_node_numfmt->get_attribute( 'formatCode' ).
ls_num_format-id = lo_node_numfmt->get_attribute( 'numFmtId' ).
INSERT ls_num_format INTO TABLE ep_num_formats.
lo_node_numfmt ?= lo_node_numfmt->get_next( ).
ENDWHILE.
ENDMETHOD.
method load_theme.
data theme type ref to zcl_excel_theme.
data: lo_theme_xml type ref to if_ixml_document.
create object theme.
lo_theme_xml = me->get_ixml_from_zip_archive( iv_path ).
theme->read_theme( io_theme_xml = lo_theme_xml ).
ip_excel->set_theme( io_theme = theme ).
endmethod.
method LOAD_WORKBOOK.
*--------------------------------------------------------------------*
* ToDos:
* 2do§1 Move macro-reading from zcl_excel_reader_xlsm to this class
* autodetect existance of macro/vba content
* Allow inputparameter to explicitly tell reader to ignore vba-content
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-10
* - ...
* changes: renaming variables to naming conventions
* aligning code
* removing unused variables
* adding me-> where possible
* renaming variables to indicate what they are used for
* adding comments to explain what we are trying to achieve
* renaming i/o parameters: previous input-parameter ip_path holds a (full) filename and not a path --> rename to iv_workbook_full_filename
* ip_excel renamed while being at it --> rename to io_excel
*--------------------------------------------------------------------*
* issue #232 - Read worksheetstate hidden/veryHidden
* - Stefan Schmoecker, 2012-11-11
*--------------------------------------------------------------------*
* issue#235 - repeat rows/columns
* - Stefan Schmoecker, 2012-12-02
* changes: correction in named ranges to correctly attach
* sheetlocal names/ranges to the correct sheet
*--------------------------------------------------------------------*
* issue#284 - Copied formulae ignored when reading excelfile
* - Stefan Schmoecker, 2013-08-02
* changes: initialize area to hold referenced formulaedata
* after all worksheets have been read resolve formuae
*--------------------------------------------------------------------*
CONSTANTS: lcv_shared_strings TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',
lcv_worksheet TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',
lcv_styles TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',
lcv_vba_project TYPE string VALUE 'http://schemas.microsoft.com/office/2006/relationships/vbaProject', "#EC NEEDED for future incorporation of XLSM-reader
lcv_theme TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',
*--------------------------------------------------------------------*
* #232: Read worksheetstate hidden/veryHidden - begin data declarations
*--------------------------------------------------------------------*
lcv_worksheet_state_hidden TYPE string VALUE 'hidden',
lcv_worksheet_state_veryhidden TYPE string VALUE 'veryHidden'.
*--------------------------------------------------------------------*
* #232: Read worksheetstate hidden/veryHidden - end data declarations
*--------------------------------------------------------------------*
DATA:
lv_path TYPE string,
lv_filename TYPE chkfile,
lv_full_filename TYPE string,
lo_rels_workbook TYPE REF TO if_ixml_document,
lt_worksheets TYPE STANDARD TABLE OF t_relationship WITH NON-UNIQUE DEFAULT KEY,
lo_workbook TYPE REF TO if_ixml_document,
lv_workbook_index TYPE i,
lv_worksheet_path TYPE string,
ls_sheet TYPE t_sheet,
lo_node TYPE REF TO if_ixml_element,
ls_relationship TYPE t_relationship,
lo_worksheet TYPE REF TO zcl_excel_worksheet,
lo_range TYPE REF TO zcl_excel_range,
lv_worksheet_title TYPE zexcel_sheet_title,
lv_tabix TYPE sytabix, " #235 - repeat rows/cols. Needed to link defined name to correct worksheet
ls_range TYPE t_range,
lv_range_value TYPE zexcel_range_value,
*--------------------------------------------------------------------*
* #229: Set active worksheet - begin data declarations
*--------------------------------------------------------------------*
lv_active_sheet_string TYPE string,
lv_zexcel_active_worksheet TYPE zexcel_active_worksheet,
*--------------------------------------------------------------------*
* issue#235 - repeat rows/columns - added autofilter support while changing this section
lo_autofilter TYPE REF TO zcl_excel_autofilter,
ls_area TYPE zexcel_s_autofilter_area,
lv_col_start_alpha TYPE zexcel_cell_column_alpha,
lv_col_end_alpha TYPE zexcel_cell_column_alpha,
lv_row_start TYPE zexcel_cell_row,
lv_row_end TYPE zexcel_cell_row ,
lv_regex TYPE string,
lv_range_value_1 TYPE zexcel_range_value,
lv_range_value_2 TYPE zexcel_range_value.
*--------------------------------------------------------------------*
* #229: Set active worksheet - end data declarations
*--------------------------------------------------------------------*
FIELD-SYMBOLS: <worksheet> TYPE t_relationship.
*--------------------------------------------------------------------*
* §1 Get the position of files related to this workbook
* Usually this will be <root>/xl/workbook.xml
* Thus the workbookroot will be <root>/xl/
* The position of all related files will be given in file
* <workbookroot>/_rels/<workbookfilename>.rels and their positions
* be be given relative to the workbookroot
* Following is an example how this file could be set up
* <?xml version="1.0" encoding="UTF-8" standalone="true"?>
* <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
* <Relationship Target="styles.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Id="rId6"/>
* <Relationship Target="theme/theme1.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Id="rId5"/>
* <Relationship Target="worksheets/sheet1.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Id="rId1"/>
* <Relationship Target="worksheets/sheet2.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Id="rId2"/>
* <Relationship Target="worksheets/sheet3.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Id="rId3"/>
* <Relationship Target="worksheets/sheet4.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Id="rId4"/>
* <Relationship Target="sharedStrings.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Id="rId7"/>
* </Relationships>
*
* §2 Load data that is relevant to the complete workbook
* Currently supported is:
* §2.1 Shared strings - This holds all strings that are used in all worksheets
* §2.2 Styles - This holds all styles that are used in all worksheets
* §2.3 Worksheets - For each worksheet in the workbook one entry appears here to point to the file that holds the content of this worksheet
* §2.4 [Themes] - not supported
* §2.5 [VBA (Macro)] - supported in class zcl_excel_reader_xlsm but should be moved here and autodetect
* ...
*
* §3 Some information is held in the workbookfile as well
* §3.1 Names and order of of worksheets
* §3.2 Active worksheet
* §3.3 Defined names
* ...
* Following is an example how this file could be set up
* <?xml version="1.0" encoding="UTF-8" standalone="true"?>
* <workbook xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
* <fileVersion rupBuild="4506" lowestEdited="4" lastEdited="4" appName="xl"/>
* <workbookPr defaultThemeVersion="124226"/>
* <bookViews>
* <workbookView activeTab="1" windowHeight="8445" windowWidth="19035" yWindow="120" xWindow="120"/>
* </bookViews>
* <sheets>
* <sheet r:id="rId1" sheetId="1" name="Sheet1"/>
* <sheet r:id="rId2" sheetId="2" name="Sheet2"/>
* <sheet r:id="rId3" sheetId="3" name="Sheet3" state="hidden"/>
* <sheet r:id="rId4" sheetId="4" name="Sheet4"/>
* </sheets>
* <definedNames/>
* <calcPr calcId="125725"/>
* </workbook>
*--------------------------------------------------------------------*
CLEAR me->mt_ref_formulae. " ins issue#284
*--------------------------------------------------------------------*
* §1 Get the position of files related to this workbook
* Entry into this method is with the filename of the workbook
*--------------------------------------------------------------------*
CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'
EXPORTING
full_name = iv_workbook_full_filename
IMPORTING
stripped_name = lv_filename
file_path = lv_path.
CONCATENATE lv_path '_rels/' lv_filename '.rels'
INTO lv_full_filename.
lo_rels_workbook = me->get_ixml_from_zip_archive( lv_full_filename ).
lo_node ?= lo_rels_workbook->find_from_name( 'Relationship' ). "#EC NOTEXT
WHILE lo_node IS BOUND.
me->fill_struct_from_attributes( EXPORTING ip_element = lo_node CHANGING cp_structure = ls_relationship ).
CASE ls_relationship-type.
*--------------------------------------------------------------------*
* §2.1 Shared strings - This holds all strings that are used in all worksheets
*--------------------------------------------------------------------*
WHEN lcv_shared_strings.
CONCATENATE lv_path ls_relationship-target
INTO lv_full_filename.
me->load_shared_strings( lv_full_filename ).
*--------------------------------------------------------------------*
* §2.3 Worksheets
* For each worksheet in the workbook one entry appears here to point to the file that holds the content of this worksheet
* Shared strings and styles have to be present before we can start with creating the worksheets
* thus we only store this information for use when parsing the workbookfile for sheetinformations
*--------------------------------------------------------------------*
WHEN lcv_worksheet.
APPEND ls_relationship TO lt_worksheets.
*--------------------------------------------------------------------*
* §2.2 Styles - This holds the styles that are used in all worksheets
*--------------------------------------------------------------------*
WHEN lcv_styles.
CONCATENATE lv_path ls_relationship-target
INTO lv_full_filename.
me->load_styles( ip_path = lv_full_filename
ip_excel = io_excel ).
me->load_dxf_styles( iv_path = lv_full_filename
io_excel = io_excel ).
when lcv_theme.
CONCATENATE lv_path ls_relationship-target
INTO lv_full_filename.
me->load_theme(
exporting
iv_path = lv_full_filename
ip_excel = io_excel " Excel creator
).
WHEN OTHERS.
ENDCASE.
lo_node ?= lo_node->get_next( ).
ENDWHILE.
*--------------------------------------------------------------------*
* §3 Some information held in the workbookfile
*--------------------------------------------------------------------*
lo_workbook = me->get_ixml_from_zip_archive( iv_workbook_full_filename ).
*--------------------------------------------------------------------*
* §3.1 Names and order of of worksheets
*--------------------------------------------------------------------*
lo_node ?= lo_workbook->find_from_name( 'sheet' ).
lv_workbook_index = 1.
WHILE lo_node IS BOUND.
me->fill_struct_from_attributes( EXPORTING
ip_element = lo_node
CHANGING
cp_structure = ls_sheet ).
*--------------------------------------------------------------------*
* Create new worksheet in workbook with correct name
*--------------------------------------------------------------------*
lv_worksheet_title = ls_sheet-name.
IF lv_workbook_index = 1. " First sheet has been added automatically by creating io_excel
lo_worksheet = io_excel->get_active_worksheet( ).
lo_worksheet->set_title( lv_worksheet_title ).
ELSE.
lo_worksheet = io_excel->add_new_worksheet( lv_worksheet_title ).
ENDIF.
*--------------------------------------------------------------------*
* #232 - Read worksheetstate hidden/veryHidden - begin of coding
* Set status hidden if necessary
*--------------------------------------------------------------------*
CASE ls_sheet-state.
WHEN lcv_worksheet_state_hidden.
lo_worksheet->zif_excel_sheet_properties~hidden = zif_excel_sheet_properties=>c_hidden.
WHEN lcv_worksheet_state_veryhidden.
lo_worksheet->zif_excel_sheet_properties~hidden = zif_excel_sheet_properties=>c_veryhidden.
ENDCASE.
*--------------------------------------------------------------------*
* #232 - Read worksheetstate hidden/veryHidden - end of coding
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* Load worksheetdata
*--------------------------------------------------------------------*
READ TABLE lt_worksheets ASSIGNING <worksheet> WITH KEY id = ls_sheet-id.
IF sy-subrc = 0.
<worksheet>-sheetid = ls_sheet-sheetid. "ins #235 - repeat rows/cols - needed to identify correct sheet
CONCATENATE lv_path <worksheet>-target
INTO lv_worksheet_path.
me->load_worksheet( ip_path = lv_worksheet_path
io_worksheet = lo_worksheet ).
<worksheet>-worksheet = lo_worksheet.
ENDIF.
lo_node ?= lo_node->get_next( ).
ADD 1 TO lv_workbook_index.
ENDWHILE.
SORT lt_worksheets BY sheetid. " needed for localSheetid -referencing
*--------------------------------------------------------------------*
* #284: Set active worksheet - Resolve referenced formulae to
* explicit formulae those cells
*--------------------------------------------------------------------*
me->resolve_referenced_formulae( ).
" ins issue#284
*--------------------------------------------------------------------*
* #229: Set active worksheet - begin coding
* §3.2 Active worksheet
*--------------------------------------------------------------------*
lv_zexcel_active_worksheet = 1. " First sheet = active sheet if nothing else specified.
lo_node ?= lo_workbook->find_from_name( 'workbookView' ).
IF lo_node IS BOUND.
lv_active_sheet_string = lo_node->get_attribute( 'activeTab' ).
TRY.
lv_zexcel_active_worksheet = lv_active_sheet_string + 1. " EXCEL numbers the sheets from 0 onwards --> index into worksheettable is increased by one
CATCH cx_sy_conversion_error. "#EC NO_HANDLER - error here --> just use the default 1st sheet
ENDTRY.
ENDIF.
io_excel->set_active_sheet_index( lv_zexcel_active_worksheet ).
*--------------------------------------------------------------------*
* #229: Set active worksheet - end coding
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* §3.3 Defined names
* So far I have encountered these
* - named ranges - sheetlocal
* - named ranges - workbookglobal
* - autofilters - sheetlocal ( special range )
* - repeat rows/cols - sheetlocal ( special range )
*
*--------------------------------------------------------------------*
lo_node ?= lo_workbook->find_from_name( 'definedName' ).
WHILE lo_node IS BOUND.
CLEAR lo_range. "ins issue #235 - repeat rows/cols
me->fill_struct_from_attributes( EXPORTING
ip_element = lo_node
CHANGING
cp_structure = ls_range ).
lv_range_value = lo_node->get_value( ).
IF ls_range-localsheetid IS NOT INITIAL. " issue #163+
* READ TABLE lt_worksheets ASSIGNING <worksheet> WITH KEY id = ls_range-localsheetid. "del issue #235 - repeat rows/cols " issue #163+
* lo_range = <worksheet>-worksheet->add_new_range( ). "del issue #235 - repeat rows/cols " issue #163+
*--------------------------------------------------------------------*
* issue#235 - repeat rows/columns - begin
*--------------------------------------------------------------------*
lv_tabix = ls_range-localsheetid + 1.
READ TABLE lt_worksheets ASSIGNING <worksheet> INDEX lv_tabix.
IF sy-subrc = 0.
CASE ls_range-name.
*--------------------------------------------------------------------*
* insert autofilters
*--------------------------------------------------------------------*
WHEN zcl_excel_autofilters=>c_autofilter.
lo_autofilter = io_excel->add_new_autofilter( io_sheet = <worksheet>-worksheet ) .
zcl_excel_common=>convert_range2column_a_row( EXPORTING i_range = lv_range_value
IMPORTING e_column_start = lv_col_start_alpha
e_column_end = lv_col_end_alpha
e_row_start = ls_area-row_start
e_row_end = ls_area-row_end ).
ls_area-col_start = zcl_excel_common=>convert_column2int( lv_col_start_alpha ).
ls_area-col_end = zcl_excel_common=>convert_column2int( lv_col_end_alpha ).
lo_autofilter->set_filter_area( is_area = ls_area ).
*--------------------------------------------------------------------*
* repeat print rows/columns
*--------------------------------------------------------------------*
WHEN zif_excel_sheet_printsettings=>gcv_print_title_name.
lo_range = <worksheet>-worksheet->add_new_range( ).
*--------------------------------------------------------------------*
* This might be a temporary solution. Maybe ranges get be reworked
* to support areas consisting of multiple rectangles
* But for now just split the range into row and columnpart
*--------------------------------------------------------------------*
CLEAR:lv_range_value_1,
lv_range_value_2.
IF lv_range_value IS INITIAL.
* Empty --> nothing to do
ELSE.
IF lv_range_value(1) = `'`. " Escaped
lv_regex = `^('[^']*')+![^,]*,`.
ELSE.
lv_regex = `^[^!]*![^,]*,`.
ENDIF.
* Split into two ranges if necessary
FIND REGEX lv_regex IN lv_range_value MATCH LENGTH sy-fdpos.
IF sy-subrc = 0 AND sy-fdpos > 0.
lv_range_value_2 = lv_range_value+sy-fdpos.
SUBTRACT 1 FROM sy-fdpos.
lv_range_value_1 = lv_range_value(sy-fdpos).
ELSE.
lv_range_value_1 = lv_range_value.
ENDIF.
ENDIF.
* 1st range
zcl_excel_common=>convert_range2column_a_row( EXPORTING i_range = lv_range_value_1
IMPORTING e_column_start = lv_col_start_alpha
e_column_end = lv_col_end_alpha
e_row_start = lv_row_start
e_row_end = lv_row_end ).
IF lv_col_start_alpha IS NOT INITIAL.
<worksheet>-worksheet->zif_excel_sheet_printsettings~set_print_repeat_columns( iv_columns_from = lv_col_start_alpha
iv_columns_to = lv_col_end_alpha ).
ENDIF.
IF lv_row_start IS NOT INITIAL.
<worksheet>-worksheet->zif_excel_sheet_printsettings~set_print_repeat_rows( iv_rows_from = lv_row_start
iv_rows_to = lv_row_end ).
ENDIF.
* 2nd range
zcl_excel_common=>convert_range2column_a_row( EXPORTING i_range = lv_range_value_2
IMPORTING e_column_start = lv_col_start_alpha
e_column_end = lv_col_end_alpha
e_row_start = lv_row_start
e_row_end = lv_row_end ).
IF lv_col_start_alpha IS NOT INITIAL.
<worksheet>-worksheet->zif_excel_sheet_printsettings~set_print_repeat_columns( iv_columns_from = lv_col_start_alpha
iv_columns_to = lv_col_end_alpha ).
ENDIF.
IF lv_row_start IS NOT INITIAL.
<worksheet>-worksheet->zif_excel_sheet_printsettings~set_print_repeat_rows( iv_rows_from = lv_row_start
iv_rows_to = lv_row_end ).
ENDIF.
WHEN OTHERS.
ENDCASE.
ENDIF.
*--------------------------------------------------------------------*
* issue#235 - repeat rows/columns - end
*--------------------------------------------------------------------*
ELSE. " issue #163+
lo_range = io_excel->add_new_range( ). " issue #163+
ENDIF. " issue #163+
* lo_range = ip_excel->add_new_range( ). " issue #163-
IF lo_range IS BOUND. "ins issue #235 - repeat rows/cols
lo_range->name = ls_range-name.
lo_range->set_range_value( lv_range_value ).
ENDIF. "ins issue #235 - repeat rows/cols
lo_node ?= lo_node->get_next( ).
ENDWHILE.
endmethod.
METHOD load_worksheet.
*--------------------------------------------------------------------*
* ToDos:
* 2do§1 Header/footer
*
* Please don't just delete these ToDos if they are not
* needed but leave a comment that states this
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker,
* - ...
* changes: renaming variables to naming conventions
* aligning code (started)
* add a list of open ToDos here
* adding comments to explain what we are trying to achieve (started)
*--------------------------------------------------------------------*
* issue #345 - Dump on small pagemargins
* Took the chance to modularize this very long method
* by extracting the code that needed correction into
* own method ( load_worksheet_pagemargins )
*--------------------------------------------------------------------*
TYPES: BEGIN OF lty_cell,
r TYPE string,
t TYPE string,
s TYPE string,
END OF lty_cell.
TYPES: BEGIN OF lty_column,
min TYPE string,
max TYPE string,
width TYPE float,
customwidth TYPE string,
style TYPE string,
bestfit TYPE string,
collapsed TYPE string,
hidden TYPE string,
outlinelevel TYPE string,
END OF lty_column.
TYPES: BEGIN OF lty_sheetview,
showgridlines TYPE zexcel_show_gridlines,
tabselected TYPE string,
zoomscalenormal TYPE string,
workbookviewid TYPE string,
showrowcolheaders TYPE string,
END OF lty_sheetview.
TYPES: BEGIN OF lty_mergecell,
ref TYPE string,
END OF lty_mergecell.
TYPES: BEGIN OF lty_row,
r TYPE string,
customheight TYPE string,
ht TYPE float,
spans TYPE string,
thickbot TYPE string,
customformat TYPE string,
thicktop TYPE string,
collapsed TYPE string,
hidden TYPE string,
outlinelevel TYPE string,
END OF lty_row.
TYPES: BEGIN OF lty_page_setup,
id TYPE string,
orientation TYPE string,
scale TYPE string,
fittoheight TYPE string,
fittowidth TYPE string,
END OF lty_page_setup.
TYPES: BEGIN OF lty_sheetformatpr,
customheight TYPE string,
defaultrowheight TYPE string,
customwidth TYPE string,
defaultcolwidth TYPE string,
END OF lty_sheetformatpr.
TYPES: BEGIN OF lty_headerfooter,
alignwithmargins TYPE string,
differentoddeven TYPE string,
END OF lty_headerfooter.
TYPES: BEGIN OF lty_tabcolor,
rgb TYPE string,
theme TYPE string,
END OF lty_tabcolor.
TYPES: BEGIN OF lty_datavalidation,
type TYPE zexcel_data_val_type,
allowblank TYPE flag,
showinputmessage TYPE flag,
showerrormessage TYPE flag,
showdropdown TYPE flag,
operator TYPE zexcel_data_val_operator,
formula1 TYPE zexcel_validation_formula1,
formula2 TYPE zexcel_validation_formula1,
sqref TYPE string,
cell_column TYPE zexcel_cell_column_alpha,
cell_column_to TYPE zexcel_cell_column_alpha,
cell_row TYPE zexcel_cell_row,
cell_row_to TYPE zexcel_cell_row,
error TYPE string,
errortitle TYPE string,
prompt TYPE string,
prompttitle TYPE string,
errorstyle TYPE zexcel_data_val_error_style,
END OF lty_datavalidation.
CONSTANTS: lc_xml_attr_true TYPE string VALUE 'true',
lc_xml_attr_true_int TYPE string VALUE '1',
lc_rel_drawing TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing',
lc_rel_hyperlink TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink',
lc_rel_printer TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings'.
DATA: lo_ixml_worksheet TYPE REF TO if_ixml_document,
lo_ixml_cells TYPE REF TO if_ixml_node_collection,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml_iterator2 TYPE REF TO if_ixml_node_iterator,
lo_ixml_row_elem TYPE REF TO if_ixml_element,
lo_ixml_cell_elem TYPE REF TO if_ixml_element,
ls_cell TYPE lty_cell,
lv_index TYPE i,
lo_ixml_value_elem TYPE REF TO if_ixml_element,
lo_ixml_formula_elem TYPE REF TO if_ixml_element,
lv_cell_value TYPE zexcel_cell_value,
lv_cell_formula TYPE zexcel_cell_formula,
lv_cell_column TYPE zexcel_cell_column_alpha,
lv_cell_row TYPE zexcel_cell_row,
lo_excel_style TYPE REF TO zcl_excel_style,
lv_style_guid TYPE zexcel_cell_style,
lo_ixml_imension_elem TYPE REF TO if_ixml_element, "#+234
lv_dimension_range TYPE string, "#+234
lo_ixml_sheetview_elem TYPE REF TO if_ixml_element,
ls_sheetview TYPE lty_sheetview,
lo_ixml_pane_elem TYPE REF TO if_ixml_element,
ls_excel_pane TYPE zexcel_pane,
lv_pane_cell_row TYPE zexcel_cell_row,
lv_pane_cell_col_a TYPE zexcel_cell_column_alpha,
lv_pane_cell_col TYPE zexcel_cell_column,
lo_ixml_mergecells TYPE REF TO if_ixml_node_collection,
lo_ixml_mergecell_elem TYPE REF TO if_ixml_element,
ls_mergecell TYPE lty_mergecell,
lv_merge_column_start TYPE zexcel_cell_column_alpha,
lv_merge_column_end TYPE zexcel_cell_column_alpha,
lv_merge_row_start TYPE zexcel_cell_row,
lv_merge_row_end TYPE zexcel_cell_row,
lo_ixml_sheetformatpr_elem TYPE REF TO if_ixml_element,
ls_sheetformatpr TYPE lty_sheetformatpr,
lv_height TYPE float,
lo_ixml_headerfooter_elem TYPE REF TO if_ixml_element,
ls_headerfooter TYPE lty_headerfooter,
ls_odd_header TYPE zexcel_s_worksheet_head_foot,
ls_odd_footer TYPE zexcel_s_worksheet_head_foot,
ls_even_header TYPE zexcel_s_worksheet_head_foot,
ls_even_footer TYPE zexcel_s_worksheet_head_foot,
lo_ixml_hf_value_elem TYPE REF TO if_ixml_element,
lo_ixml_pagesetup_elem TYPE REF TO if_ixml_element,
lo_ixml_sheetpr TYPE REF TO if_ixml_element,
lv_fit_to_page TYPE string,
ls_pagesetup TYPE lty_page_setup,
lo_ixml_columns TYPE REF TO if_ixml_node_collection,
lo_ixml_column_elem TYPE REF TO if_ixml_element,
ls_column TYPE lty_column,
lv_column_alpha TYPE zexcel_cell_column_alpha,
lo_column TYPE REF TO zcl_excel_column,
lv_outline_level TYPE int4,
lo_ixml_tabcolor TYPE REF TO if_ixml_element,
ls_tabcolor TYPE lty_tabcolor,
ls_excel_s_tabcolor TYPE zexcel_s_tabcolor,
lo_ixml_rows TYPE REF TO if_ixml_node_collection,
ls_row TYPE lty_row,
lv_max_col TYPE i, "for use with SPANS element
* lv_min_col TYPE i, "for use with SPANS element " not in use currently
lv_max_col_s TYPE char10, "for use with SPANS element
lv_min_col_s TYPE char10, "for use with SPANS element
lo_row TYPE REF TO zcl_excel_row,
*--- End of current code aligning -------------------------------------------------------------------
lv_path TYPE string,
lo_ixml_node TYPE REF TO if_ixml_element,
ls_relationship TYPE t_relationship,
lo_ixml_rels_worksheet TYPE REF TO if_ixml_document,
lv_rels_worksheet_path TYPE string,
lv_stripped_name TYPE chkfile,
lv_dirname TYPE string,
lt_external_hyperlinks TYPE gtt_external_hyperlinks,
ls_external_hyperlink LIKE LINE OF lt_external_hyperlinks,
lo_ixml_datavalidations TYPE REF TO if_ixml_node_collection,
lo_ixml_datavalidation_elem TYPE REF TO if_ixml_element,
ls_datavalidation TYPE lty_datavalidation,
lo_data_validation TYPE REF TO zcl_excel_data_validation,
lv_datavalidation_range TYPE string,
lt_datavalidation_range TYPE TABLE OF string.
*--------------------------------------------------------------------*
* §2 We need to read the the file "\\_rels\.rels" because it tells
* us where in this folder structure the data for the workbook
* is located in the xlsx zip-archive
*
* The xlsx Zip-archive has generally the following folder structure:
* <root> |
* |--> _rels
* |--> doc_Props
* |--> xl |
* |--> _rels
* |--> theme
* |--> worksheets
*--------------------------------------------------------------------*
" Read Workbook Relationships
CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'
EXPORTING
full_name = ip_path
IMPORTING
stripped_name = lv_stripped_name
file_path = lv_dirname.
CONCATENATE lv_dirname '_rels/' lv_stripped_name '.rels'
INTO lv_rels_worksheet_path.
TRY. " +#222 _rels/xxx.rels might not be present. If not found there can be no drawings --> just ignore this section
lo_ixml_rels_worksheet = me->get_ixml_from_zip_archive( lv_rels_worksheet_path ).
lo_ixml_node ?= lo_ixml_rels_worksheet->find_from_name( 'Relationship' ).
CATCH zcx_excel. "#EC NO_HANDLER +#222
" +#222 No errorhandling necessary - node will be unbound if error occurs
ENDTRY. " +#222
WHILE lo_ixml_node IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_node
CHANGING
cp_structure = ls_relationship ).
CONCATENATE lv_dirname ls_relationship-target INTO lv_path.
lv_path = resolve_path( lv_path ).
CASE ls_relationship-type.
WHEN lc_rel_drawing.
" Read Drawings
* Issue # 339 Not all drawings are in the path mentioned below.
* Some Excel elements like textfields (which we don't support ) have a drawing-part in the relationsships
* but no "xl/drawings/_rels/drawing____.xml.rels" part.
* Since we don't support these there is no need to read them. Catching exceptions thrown
* in the "load_worksheet_drawing" shouldn't lead to an abortion of the reading
TRY.
me->load_worksheet_drawing( ip_path = lv_path
io_worksheet = io_worksheet ).
CATCH zcx_excel. "--> then ignore it
ENDTRY.
WHEN lc_rel_printer.
" Read Printer settings
WHEN lc_rel_hyperlink.
MOVE-CORRESPONDING ls_relationship TO ls_external_hyperlink.
INSERT ls_external_hyperlink INTO TABLE lt_external_hyperlinks.
WHEN OTHERS.
ENDCASE.
lo_ixml_node ?= lo_ixml_node->get_next( ).
ENDWHILE.
lo_ixml_worksheet = me->get_ixml_from_zip_archive( ip_path ).
lo_ixml_tabcolor ?= lo_ixml_worksheet->find_from_name( 'tabColor' ).
IF lo_ixml_tabcolor IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_tabcolor
CHANGING
cp_structure = ls_tabcolor ).
* Theme not supported yet
IF ls_tabcolor-rgb IS NOT INITIAL.
ls_excel_s_tabcolor-rgb = ls_tabcolor-rgb.
io_worksheet->set_tabcolor( ls_excel_s_tabcolor ).
ENDIF.
ENDIF.
lo_ixml_rows = lo_ixml_worksheet->get_elements_by_tag_name( name = 'row' ).
lo_ixml_iterator = lo_ixml_rows->create_iterator( ).
lo_ixml_row_elem ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml_row_elem IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_row_elem
CHANGING
cp_structure = ls_row ).
SPLIT ls_row-spans AT ':' INTO lv_min_col_s lv_max_col_s.
lv_index = lv_max_col_s.
IF lv_index > lv_max_col.
lv_max_col = lv_index.
ENDIF.
lv_cell_row = ls_row-r.
IF ls_row-customheight = '1'
OR ls_row-collapsed = lc_xml_attr_true
OR ls_row-collapsed = lc_xml_attr_true_int
OR ls_row-hidden = lc_xml_attr_true
OR ls_row-hidden = lc_xml_attr_true_int
OR ls_row-outlinelevel > '0'.
lo_row = io_worksheet->get_row( lv_cell_row ).
IF ls_row-customheight = '1'.
lo_row->set_row_height( ls_row-ht ).
ENDIF.
IF ls_row-collapsed = lc_xml_attr_true
OR ls_row-collapsed = lc_xml_attr_true_int.
lo_row->set_collapsed( abap_true ).
ENDIF.
IF ls_row-hidden = lc_xml_attr_true
OR ls_row-hidden = lc_xml_attr_true_int.
lo_row->set_visible( abap_false ).
ENDIF.
IF ls_row-outlinelevel > ''.
* outline_level = condense( row-outlineLevel ). "For basis 7.02 and higher
CONDENSE ls_row-outlinelevel.
lv_outline_level = ls_row-outlinelevel.
IF lv_outline_level > 0.
lo_row->set_outline_level( lv_outline_level ).
ENDIF.
ENDIF.
ENDIF.
lo_ixml_cells = lo_ixml_row_elem->get_elements_by_tag_name( name = 'c' ).
lo_ixml_iterator2 = lo_ixml_cells->create_iterator( ).
lo_ixml_cell_elem ?= lo_ixml_iterator2->get_next( ).
WHILE lo_ixml_cell_elem IS BOUND.
CLEAR: lv_cell_value,
lv_cell_formula,
lv_style_guid.
fill_struct_from_attributes( EXPORTING ip_element = lo_ixml_cell_elem CHANGING cp_structure = ls_cell ).
lo_ixml_value_elem = lo_ixml_cell_elem->find_from_name( name = 'v' ).
CASE ls_cell-t.
WHEN 's'. " String values are stored as index in shared string table
lv_index = lo_ixml_value_elem->get_value( ) + 1.
READ TABLE shared_strings INTO lv_cell_value INDEX lv_index.
WHEN 'inlineStr'. " inlineStr values are kept in special node
lo_ixml_value_elem = lo_ixml_cell_elem->find_from_name( name = 'is' ).
IF lo_ixml_value_elem IS BOUND.
lv_cell_value = lo_ixml_value_elem->get_value( ).
ENDIF.
WHEN OTHERS. "other types are stored directly
IF lo_ixml_value_elem IS BOUND.
lv_cell_value = lo_ixml_value_elem->get_value( ).
ENDIF.
ENDCASE.
CLEAR lv_style_guid.
"read style based on index
IF ls_cell-s IS NOT INITIAL.
lv_index = ls_cell-s + 1.
READ TABLE styles INTO lo_excel_style INDEX lv_index.
IF sy-subrc = 0.
lv_style_guid = lo_excel_style->get_guid( ).
ENDIF.
ENDIF.
lo_ixml_formula_elem = lo_ixml_cell_elem->find_from_name( name = 'f' ).
IF lo_ixml_formula_elem IS BOUND.
lv_cell_formula = lo_ixml_formula_elem->get_value( ).
*--------------------------------------------------------------------*
* Begin of insertion issue#284 - Copied formulae not
*--------------------------------------------------------------------*
DATA: BEGIN OF ls_formula_attributes,
ref TYPE string,
si TYPE i,
t TYPE string,
END OF ls_formula_attributes,
ls_ref_formula TYPE ty_ref_formulae.
fill_struct_from_attributes( EXPORTING ip_element = lo_ixml_formula_elem CHANGING cp_structure = ls_formula_attributes ).
IF ls_formula_attributes-t = 'shared'.
zcl_excel_common=>convert_columnrow2column_a_row( EXPORTING
i_columnrow = ls_cell-r
IMPORTING
e_column = lv_cell_column
e_row = lv_cell_row ).
TRY.
CLEAR ls_ref_formula.
ls_ref_formula-sheet = io_worksheet.
ls_ref_formula-row = lv_cell_row.
ls_ref_formula-column = zcl_excel_common=>convert_column2int( lv_cell_column ).
ls_ref_formula-si = ls_formula_attributes-si.
ls_ref_formula-ref = ls_formula_attributes-ref.
ls_ref_formula-formula = lv_cell_formula.
INSERT ls_ref_formula INTO TABLE me->mt_ref_formulae.
CATCH cx_root.
BREAK-POINT.
ENDTRY.
ENDIF.
*--------------------------------------------------------------------*
* End of insertion issue#284 - Copied formulae not
*--------------------------------------------------------------------*
ENDIF.
IF lv_cell_value IS NOT INITIAL
OR lv_cell_formula IS NOT INITIAL
OR lv_style_guid IS NOT INITIAL.
zcl_excel_common=>convert_columnrow2column_a_row( EXPORTING
i_columnrow = ls_cell-r
IMPORTING
e_column = lv_cell_column
e_row = lv_cell_row ).
io_worksheet->set_cell( ip_column = lv_cell_column " cell_elem Column
ip_row = lv_cell_row " cell_elem row_elem
ip_value = lv_cell_value " cell_elem Value
ip_formula = lv_cell_formula
ip_data_type = ls_cell-t
ip_style = lv_style_guid ).
ENDIF.
lo_ixml_cell_elem ?= lo_ixml_iterator2->get_next( ).
ENDWHILE.
lo_ixml_row_elem ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
*--------------------------------------------------------------------*
*#234 - column width not read correctly - begin of coding
* reason - libre office doesn't use SPAN in row - definitions
*--------------------------------------------------------------------*
IF lv_max_col = 0.
lo_ixml_imension_elem = lo_ixml_worksheet->find_from_name( name = 'dimension' ).
IF lo_ixml_imension_elem IS BOUND.
lv_dimension_range = lo_ixml_imension_elem->get_attribute( 'ref' ).
IF lv_dimension_range CS ':'.
REPLACE REGEX '\D+\d+:(\D+)\d+' IN lv_dimension_range WITH '$1'. " Get max column
ELSE.
REPLACE REGEX '(\D+)\d+' IN lv_dimension_range WITH '$1'. " Get max column
ENDIF.
lv_max_col = zcl_excel_common=>convert_column2int( lv_dimension_range ).
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
*#234 - column width not read correctly - end of coding
*--------------------------------------------------------------------*
"Get the customized column width
lo_ixml_columns = lo_ixml_worksheet->get_elements_by_tag_name( name = 'col' ).
lo_ixml_iterator = lo_ixml_columns->create_iterator( ).
lo_ixml_column_elem ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml_column_elem IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_column_elem
CHANGING
cp_structure = ls_column ).
lo_ixml_column_elem ?= lo_ixml_iterator->get_next( ).
IF ls_column-customwidth = lc_xml_attr_true
OR ls_column-customwidth = lc_xml_attr_true_int
OR ls_column-bestfit = lc_xml_attr_true
OR ls_column-bestfit = lc_xml_attr_true_int
OR ls_column-collapsed = lc_xml_attr_true
OR ls_column-collapsed = lc_xml_attr_true_int
OR ls_column-hidden = lc_xml_attr_true
OR ls_column-hidden = lc_xml_attr_true_int
OR ls_column-outlinelevel > ''
OR ls_column-style > ''.
lv_index = ls_column-min.
WHILE lv_index <= ls_column-max AND lv_index <= lv_max_col.
lv_column_alpha = zcl_excel_common=>convert_column2alpha( lv_index ).
lo_column = io_worksheet->get_column( lv_column_alpha ).
IF ls_column-customwidth = lc_xml_attr_true
OR ls_column-customwidth = lc_xml_attr_true_int
OR ls_column-width IS NOT INITIAL. "+#234
lo_column->set_width( ls_column-width ).
ENDIF.
IF ls_column-bestfit = lc_xml_attr_true
OR ls_column-bestfit = lc_xml_attr_true_int.
lo_column->set_auto_size( abap_true ).
ENDIF.
IF ls_column-collapsed = lc_xml_attr_true
OR ls_column-collapsed = lc_xml_attr_true_int.
lo_column->set_collapsed( abap_true ).
ENDIF.
IF ls_column-hidden = lc_xml_attr_true
OR ls_column-hidden = lc_xml_attr_true_int.
lo_column->set_visible( abap_false ).
ENDIF.
IF ls_column-outlinelevel > ''.
* outline_level = condense( column-outlineLevel ).
CONDENSE ls_column-outlinelevel.
lv_outline_level = ls_column-outlinelevel.
IF lv_outline_level > 0.
lo_column->set_outline_level( lv_outline_level ).
ENDIF.
ENDIF.
IF ls_column-style > ''.
sy-index = ls_column-style + 1.
READ TABLE styles INTO lo_excel_style INDEX sy-index.
DATA: dummy_zexcel_cell_style TYPE zexcel_cell_style.
dummy_zexcel_cell_style = lo_excel_style->get_guid( ).
lo_column->set_column_style_by_guid( dummy_zexcel_cell_style ).
ENDIF.
ADD 1 TO lv_index.
ENDWHILE.
ENDIF.
* issue #367 - hide columns from
IF ls_column-max = zcl_excel_common=>c_excel_sheet_max_col. " Max = very right column
IF ls_column-hidden = 1 " all hidden
AND ls_column-min > 0.
io_worksheet->zif_excel_sheet_properties~hide_columns_from = zcl_excel_common=>convert_column2alpha( ls_column-min ).
ELSEIF ls_column-style > ''.
sy-index = ls_column-style + 1.
READ TABLE styles INTO lo_excel_style INDEX sy-index.
dummy_zexcel_cell_style = lo_excel_style->get_guid( ).
* Set style for remaining columns
io_worksheet->zif_excel_sheet_properties~set_style( dummy_zexcel_cell_style ).
ENDIF.
ENDIF.
ENDWHILE.
"Now we need to get information from the sheetView node
lo_ixml_sheetview_elem = lo_ixml_worksheet->find_from_name( name = 'sheetView' ).
fill_struct_from_attributes( EXPORTING ip_element = lo_ixml_sheetview_elem CHANGING cp_structure = ls_sheetview ).
IF ls_sheetview-showgridlines IS INITIAL OR
ls_sheetview-showgridlines = lc_xml_attr_true OR
ls_sheetview-showgridlines = lc_xml_attr_true_int.
"If the attribute is not specified or set to true, we will show grid lines
ls_sheetview-showgridlines = abap_true.
ELSE.
ls_sheetview-showgridlines = abap_false.
ENDIF.
io_worksheet->set_show_gridlines( ls_sheetview-showgridlines ).
"Add merge cell information
lo_ixml_mergecells = lo_ixml_worksheet->get_elements_by_tag_name( name = 'mergeCell' ).
lo_ixml_iterator = lo_ixml_mergecells->create_iterator( ).
lo_ixml_mergecell_elem ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml_mergecell_elem IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_mergecell_elem
CHANGING
cp_structure = ls_mergecell ).
zcl_excel_common=>convert_range2column_a_row( EXPORTING
i_range = ls_mergecell-ref
IMPORTING
e_column_start = lv_merge_column_start
e_column_end = lv_merge_column_end
e_row_start = lv_merge_row_start
e_row_end = lv_merge_row_end ).
lo_ixml_mergecell_elem ?= lo_ixml_iterator->get_next( ).
io_worksheet->set_merge( EXPORTING
ip_column_start = lv_merge_column_start
ip_column_end = lv_merge_column_end
ip_row = lv_merge_row_start
ip_row_to = lv_merge_row_end ).
ENDWHILE.
" read sheet format properties
lo_ixml_sheetformatpr_elem = lo_ixml_worksheet->find_from_name( 'sheetFormatPr' ).
IF lo_ixml_sheetformatpr_elem IS NOT INITIAL.
fill_struct_from_attributes( EXPORTING ip_element = lo_ixml_sheetformatpr_elem CHANGING cp_structure = ls_sheetformatpr ).
IF ls_sheetformatpr-customheight = '1'.
lv_height = ls_sheetformatpr-defaultrowheight.
lo_row = io_worksheet->get_default_row( ).
lo_row->set_row_height( lv_height ).
ENDIF.
" TODO... column
ENDIF.
" Read in page margins
me->load_worksheet_pagemargins( EXPORTING
io_ixml_worksheet = lo_ixml_worksheet
io_worksheet = io_worksheet ).
* FitToPage
lo_ixml_sheetpr ?= lo_ixml_worksheet->find_from_name( 'pageSetUpPr' ).
IF lo_ixml_sheetpr IS BOUND.
lv_fit_to_page = lo_ixml_sheetpr->get_attribute_ns( 'fitToPage' ).
IF lv_fit_to_page IS NOT INITIAL.
io_worksheet->sheet_setup->fit_to_page = 'X'.
ENDIF.
ENDIF.
" Read in page setup
lo_ixml_pagesetup_elem = lo_ixml_worksheet->find_from_name( 'pageSetup' ).
IF lo_ixml_pagesetup_elem IS NOT INITIAL.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_pagesetup_elem
CHANGING
cp_structure = ls_pagesetup ).
io_worksheet->sheet_setup->orientation = ls_pagesetup-orientation.
io_worksheet->sheet_setup->scale = ls_pagesetup-scale.
IF io_worksheet->sheet_setup->fit_to_page = 'X'.
IF ls_pagesetup-fittowidth IS NOT INITIAL.
io_worksheet->sheet_setup->fit_to_width = ls_pagesetup-fittowidth.
ELSE.
io_worksheet->sheet_setup->fit_to_width = 1. " Default if not given - Excel doesn't write this to xml
ENDIF.
IF ls_pagesetup-fittoheight IS NOT INITIAL.
io_worksheet->sheet_setup->fit_to_height = ls_pagesetup-fittoheight.
ELSE.
io_worksheet->sheet_setup->fit_to_height = 1. " Default if not given - Excel doesn't write this to xml
ENDIF.
ENDIF.
ENDIF.
" Read header footer
lo_ixml_headerfooter_elem = lo_ixml_worksheet->find_from_name( 'headerFooter' ).
IF lo_ixml_headerfooter_elem IS NOT INITIAL.
fill_struct_from_attributes( EXPORTING ip_element = lo_ixml_headerfooter_elem CHANGING cp_structure = ls_headerfooter ).
io_worksheet->sheet_setup->diff_oddeven_headerfooter = ls_headerfooter-differentoddeven.
lo_ixml_hf_value_elem = lo_ixml_headerfooter_elem->find_from_name( 'oddFooter' ).
IF lo_ixml_hf_value_elem IS NOT INITIAL.
ls_odd_footer-left_value = lo_ixml_hf_value_elem->get_value( ).
ENDIF.
* 2do§1 Header/footer
" TODO.. get the rest.
io_worksheet->sheet_setup->set_header_footer( ip_odd_header = ls_odd_header
ip_odd_footer = ls_odd_footer
ip_even_header = ls_even_header
ip_even_footer = ls_even_footer ).
ENDIF.
" Start fix 194 Read attributes HIDDEN, OUTLINELEVEL, COLLAPSED in ZCL_EXCEL_READER_2007
" Read pane
lo_ixml_pane_elem = lo_ixml_sheetview_elem->find_from_name( name = 'pane' ).
IF lo_ixml_pane_elem IS BOUND.
fill_struct_from_attributes( EXPORTING ip_element = lo_ixml_pane_elem CHANGING cp_structure = ls_excel_pane ).
" Issue #194
" Replace REGEX with method from the common class
zcl_excel_common=>convert_columnrow2column_a_row( EXPORTING
i_columnrow = ls_excel_pane-topleftcell
IMPORTING
e_column = lv_pane_cell_col_a " Cell Column
e_row = lv_pane_cell_row ). " Natural number
lv_pane_cell_col = zcl_excel_common=>convert_column2int( lv_pane_cell_col_a ).
SUBTRACT 1 FROM: lv_pane_cell_col,
lv_pane_cell_row.
IF lv_pane_cell_col > 0
AND lv_pane_cell_row > 0.
io_worksheet->freeze_panes( ip_num_rows = lv_pane_cell_row
ip_num_columns = lv_pane_cell_col ).
ELSEIF lv_pane_cell_row > 0.
io_worksheet->freeze_panes( ip_num_rows = lv_pane_cell_row ).
ELSE.
io_worksheet->freeze_panes( ip_num_columns = lv_pane_cell_col ).
ENDIF.
ENDIF.
" End fix 194 Read attributes HIDDEN, OUTLINELEVEL, COLLAPSED in ZCL_EXCEL_READER_2007
" Start fix 276 Read data validations
lo_ixml_datavalidations = lo_ixml_worksheet->get_elements_by_tag_name( name = 'dataValidation' ).
lo_ixml_iterator = lo_ixml_datavalidations->create_iterator( ).
lo_ixml_datavalidation_elem ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml_datavalidation_elem IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_datavalidation_elem
CHANGING
cp_structure = ls_datavalidation ).
CLEAR lo_ixml_formula_elem.
lo_ixml_formula_elem = lo_ixml_datavalidation_elem->find_from_name( name = 'formula1' ).
IF lo_ixml_formula_elem IS BOUND.
ls_datavalidation-formula1 = lo_ixml_formula_elem->get_value( ).
ENDIF.
CLEAR lo_ixml_formula_elem.
lo_ixml_formula_elem = lo_ixml_datavalidation_elem->find_from_name( name = 'formula2' ).
IF lo_ixml_formula_elem IS BOUND.
ls_datavalidation-formula2 = lo_ixml_formula_elem->get_value( ).
ENDIF.
SPLIT ls_datavalidation-sqref AT space INTO TABLE lt_datavalidation_range.
LOOP AT lt_datavalidation_range INTO lv_datavalidation_range.
zcl_excel_common=>convert_range2column_a_row( EXPORTING
i_range = lv_datavalidation_range
IMPORTING
e_column_start = ls_datavalidation-cell_column
e_column_end = ls_datavalidation-cell_column_to
e_row_start = ls_datavalidation-cell_row
e_row_end = ls_datavalidation-cell_row_to ).
lo_data_validation = io_worksheet->add_new_data_validation( ).
lo_data_validation->type = ls_datavalidation-type.
lo_data_validation->allowblank = ls_datavalidation-allowblank.
IF ls_datavalidation-showinputmessage IS INITIAL.
lo_data_validation->showinputmessage = abap_false.
ELSE.
lo_data_validation->showinputmessage = abap_true.
ENDIF.
IF ls_datavalidation-showerrormessage IS INITIAL.
lo_data_validation->showerrormessage = abap_false.
ELSE.
lo_data_validation->showerrormessage = abap_true.
ENDIF.
IF ls_datavalidation-showdropdown IS INITIAL.
lo_data_validation->showdropdown = abap_false.
ELSE.
lo_data_validation->showdropdown = abap_true.
ENDIF.
lo_data_validation->operator = ls_datavalidation-operator.
lo_data_validation->formula1 = ls_datavalidation-formula1.
lo_data_validation->formula2 = ls_datavalidation-formula2.
lo_data_validation->prompttitle = ls_datavalidation-prompttitle.
lo_data_validation->prompt = ls_datavalidation-prompt.
lo_data_validation->errortitle = ls_datavalidation-errortitle.
lo_data_validation->error = ls_datavalidation-error.
lo_data_validation->errorstyle = ls_datavalidation-errorstyle.
lo_data_validation->cell_row = ls_datavalidation-cell_row.
lo_data_validation->cell_row_to = ls_datavalidation-cell_row_to.
lo_data_validation->cell_column = ls_datavalidation-cell_column.
lo_data_validation->cell_column_to = ls_datavalidation-cell_column_to.
ENDLOOP.
lo_ixml_datavalidation_elem ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
" End fix 276 Read data validations
" Read hyperlinks
TRY.
me->load_worksheet_hyperlinks( io_ixml_worksheet = lo_ixml_worksheet
io_worksheet = io_worksheet
it_external_hyperlinks = lt_external_hyperlinks ).
CATCH zcx_excel. " Ignore Hyperlink reading errors - pass everything we were able to identify
ENDTRY.
TRY.
me->fill_row_outlines( io_worksheet = io_worksheet ).
CATCH zcx_excel. " Ignore Hyperlink reading errors - pass everything we were able to identify
ENDTRY.
" Issue #366 - conditional formatting
TRY.
me->load_worksheet_cond_format( io_ixml_worksheet = lo_ixml_worksheet
io_worksheet = io_worksheet ).
CATCH zcx_excel. " Ignore Hyperlink reading errors - pass everything we were able to identify
ENDTRY.
" Issue #377 - pagebreaks
TRY.
me->load_worksheet_pagebreaks( io_ixml_worksheet = lo_ixml_worksheet
io_worksheet = io_worksheet ).
CATCH zcx_excel. " Ignore pagebreak reading errors - pass everything we were able to identify
ENDTRY.
ENDMETHOD.
METHOD load_worksheet_cond_format.
DATA: lo_ixml_cond_formats TYPE REF TO if_ixml_node_collection,
lo_ixml_cond_format TYPE REF TO if_ixml_element,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml_rules TYPE REF TO if_ixml_node_collection,
lo_ixml_rule TYPE REF TO if_ixml_element,
lo_ixml_iterator2 TYPE REF TO if_ixml_node_iterator,
lo_style_cond TYPE REF TO zcl_excel_style_cond,
lo_style_cond2 TYPE REF TO zcl_excel_style_cond.
DATA: lv_area TYPE string,
lt_areas TYPE STANDARD TABLE OF string WITH NON-UNIQUE DEFAULT KEY,
lv_area_start_row TYPE zexcel_cell_row,
lv_area_end_row TYPE zexcel_cell_row,
lv_area_start_col TYPE zexcel_cell_column_alpha,
lv_area_end_col TYPE zexcel_cell_column_alpha,
lv_rule TYPE zexcel_condition_rule.
* FIELD-SYMBOLS: <ls_external_hyperlink> LIKE LINE OF it_external_hyperlinks.
lo_ixml_cond_formats = io_ixml_worksheet->get_elements_by_tag_name( name = 'conditionalFormatting' ).
lo_ixml_iterator = lo_ixml_cond_formats->create_iterator( ).
lo_ixml_cond_format ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml_cond_format IS BOUND.
CLEAR: lv_area,
lo_ixml_rule,
lo_style_cond.
*--------------------------------------------------------------------*
* Get type of rule
*--------------------------------------------------------------------*
lo_ixml_rules = io_ixml_worksheet->get_elements_by_tag_name( name = 'cfRule' ).
lo_ixml_iterator2 = lo_ixml_rules->create_iterator( ).
lo_ixml_rule ?= lo_ixml_iterator2->get_next( ).
WHILE lo_ixml_rule IS BOUND.
lv_rule = lo_ixml_rule->get_attribute_ns( 'type' ).
CLEAR lo_style_cond.
*--------------------------------------------------------------------*
* Depending on ruletype get additional information
*--------------------------------------------------------------------*
CASE lv_rule.
WHEN zcl_excel_style_cond=>c_rule_cellis.
lo_style_cond = io_worksheet->add_new_style_cond( ).
load_worksheet_cond_format_ci( io_ixml_rule = lo_ixml_rule
io_style_cond = lo_style_cond ).
WHEN zcl_excel_style_cond=>c_rule_databar.
lo_style_cond = io_worksheet->add_new_style_cond( ).
load_worksheet_cond_format_db( io_ixml_rule = lo_ixml_rule
io_style_cond = lo_style_cond ).
WHEN zcl_excel_style_cond=>c_rule_expression.
lo_style_cond = io_worksheet->add_new_style_cond( ).
load_worksheet_cond_format_ex( io_ixml_rule = lo_ixml_rule
io_style_cond = lo_style_cond ).
WHEN zcl_excel_style_cond=>c_rule_iconset.
lo_style_cond = io_worksheet->add_new_style_cond( ).
load_worksheet_cond_format_is( io_ixml_rule = lo_ixml_rule
io_style_cond = lo_style_cond ).
WHEN zcl_excel_style_cond=>c_rule_colorscale.
lo_style_cond = io_worksheet->add_new_style_cond( ).
load_worksheet_cond_format_cs( io_ixml_rule = lo_ixml_rule
io_style_cond = lo_style_cond ).
WHEN zcl_excel_style_cond=>c_rule_top10.
lo_style_cond = io_worksheet->add_new_style_cond( ).
load_worksheet_cond_format_t10( io_ixml_rule = lo_ixml_rule
io_style_cond = lo_style_cond ).
WHEN zcl_excel_style_cond=>c_rule_above_average.
lo_style_cond = io_worksheet->add_new_style_cond( ).
load_worksheet_cond_format_aa( io_ixml_rule = lo_ixml_rule
io_style_cond = lo_style_cond ).
WHEN OTHERS.
ENDCASE.
IF lo_style_cond IS BOUND.
lo_style_cond->rule = lv_rule.
lo_style_cond->priority = lo_ixml_rule->get_attribute_ns( 'priority' ).
*--------------------------------------------------------------------*
* Set area to which conditional formatting belongs
*--------------------------------------------------------------------*
lv_area = lo_ixml_cond_format->get_attribute_ns( 'sqref' ).
SPLIT lv_area AT space INTO TABLE lt_areas.
DELETE lt_areas WHERE table_line IS INITIAL.
LOOP AT lt_areas INTO lv_area.
zcl_excel_common=>convert_range2column_a_row( EXPORTING i_range = lv_area
IMPORTING e_column_start = lv_area_start_col
e_column_end = lv_area_end_col
e_row_start = lv_area_start_row
e_row_end = lv_area_end_row ).
lo_style_cond->add_range( ip_start_column = lv_area_start_col
ip_stop_column = lv_area_end_col
ip_start_row = lv_area_start_row
ip_stop_row = lv_area_end_row ).
ENDLOOP.
ENDIF.
lo_ixml_rule ?= lo_ixml_iterator2->get_next( ).
ENDWHILE.
lo_ixml_cond_format ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_worksheet_cond_format_aa.
DATA: lv_dxf_style_index TYPE i,
val TYPE string.
FIELD-SYMBOLS: <ls_dxf_style> LIKE LINE OF me->mt_dxf_styles.
*--------------------------------------------------------------------*
* above or below average
*--------------------------------------------------------------------*
val = io_ixml_rule->get_attribute_ns( 'aboveAverage' ).
IF val = '0'. " 0 = below average
io_style_cond->mode_above_average-above_average = space.
ELSE.
io_style_cond->mode_above_average-above_average = 'X'. " Not present or <> 0 --> we use above average
ENDIF.
*--------------------------------------------------------------------*
* Equal average also?
*--------------------------------------------------------------------*
CLEAR val.
val = io_ixml_rule->get_attribute_ns( 'equalAverage' ).
IF val = '1'. " 0 = below average
io_style_cond->mode_above_average-equal_average = 'X'.
ELSE.
io_style_cond->mode_above_average-equal_average = ' '. " Not present or <> 1 --> we use not equal average
ENDIF.
*--------------------------------------------------------------------*
* Standard deviation instead of value ( 2nd stddev, 3rd stdev )
*--------------------------------------------------------------------*
CLEAR val.
val = io_ixml_rule->get_attribute_ns( 'stdDev' ).
CASE val.
WHEN 1
OR 2
OR 3. " These seem to be supported by excel - don't try anything more
io_style_cond->mode_above_average-standard_deviation = val.
ENDCASE.
*--------------------------------------------------------------------*
* Cell formatting for top10
*--------------------------------------------------------------------*
lv_dxf_style_index = io_ixml_rule->get_attribute_ns( 'dxfId' ).
READ TABLE me->mt_dxf_styles ASSIGNING <ls_dxf_style> WITH KEY dxf = lv_dxf_style_index.
IF sy-subrc = 0.
io_style_cond->mode_above_average-cell_style = <ls_dxf_style>-guid.
ENDIF.
ENDMETHOD.
METHOD load_worksheet_cond_format_ci.
DATA: lo_ixml_nodes TYPE REF TO if_ixml_node_collection,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml TYPE REF TO if_ixml_element,
lv_dxf_style_index TYPE i,
lo_excel_style LIKE LINE OF me->styles.
FIELD-SYMBOLS: <ls_dxf_style> LIKE LINE OF me->mt_dxf_styles.
io_style_cond->mode_cellis-operator = io_ixml_rule->get_attribute_ns( 'operator' ).
lv_dxf_style_index = io_ixml_rule->get_attribute_ns( 'dxfId' ).
READ TABLE me->mt_dxf_styles ASSIGNING <ls_dxf_style> WITH KEY dxf = lv_dxf_style_index.
IF sy-subrc = 0.
io_style_cond->mode_cellis-cell_style = <ls_dxf_style>-guid.
ENDIF.
lo_ixml_nodes ?= io_ixml_rule->get_elements_by_tag_name( 'formula' ).
lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
lo_ixml ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml IS BOUND.
CASE sy-index.
WHEN 1.
io_style_cond->mode_cellis-formula = lo_ixml->get_value( ).
WHEN 2.
io_style_cond->mode_cellis-formula2 = lo_ixml->get_value( ).
WHEN OTHERS.
EXIT.
ENDCASE.
lo_ixml ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_worksheet_cond_format_cs.
DATA: lo_ixml_nodes TYPE REF TO if_ixml_node_collection,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml TYPE REF TO if_ixml_element.
lo_ixml_nodes ?= io_ixml_rule->get_elements_by_tag_name( 'cfvo' ).
lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
lo_ixml ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml IS BOUND.
CASE sy-index.
WHEN 1.
io_style_cond->mode_colorscale-cfvo1_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_colorscale-cfvo1_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN 2.
io_style_cond->mode_colorscale-cfvo2_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_colorscale-cfvo2_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN 3.
io_style_cond->mode_colorscale-cfvo3_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_colorscale-cfvo2_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN OTHERS.
EXIT.
ENDCASE.
lo_ixml ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
lo_ixml_nodes ?= io_ixml_rule->get_elements_by_tag_name( 'color' ).
lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
lo_ixml ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml IS BOUND.
CASE sy-index.
WHEN 1.
io_style_cond->mode_colorscale-colorrgb1 = lo_ixml->get_attribute_ns( 'rgb' ).
WHEN 2.
io_style_cond->mode_colorscale-colorrgb2 = lo_ixml->get_attribute_ns( 'rgb' ).
WHEN 3.
io_style_cond->mode_colorscale-colorrgb3 = lo_ixml->get_attribute_ns( 'rgb' ).
WHEN OTHERS.
EXIT.
ENDCASE.
lo_ixml ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_worksheet_cond_format_db.
DATA: lo_ixml_nodes TYPE REF TO if_ixml_node_collection,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml TYPE REF TO if_ixml_element.
lo_ixml ?= io_ixml_rule->find_from_name( 'color' ).
IF lo_ixml IS BOUND.
io_style_cond->mode_databar-colorrgb = lo_ixml->get_attribute_ns( 'rgb' ).
ENDIF.
lo_ixml_nodes ?= io_ixml_rule->get_elements_by_tag_name( 'cfvo' ).
lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
lo_ixml ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml IS BOUND.
CASE sy-index.
WHEN 1.
io_style_cond->mode_databar-cfvo1_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_databar-cfvo1_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN 2.
io_style_cond->mode_databar-cfvo2_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_databar-cfvo2_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN OTHERS.
EXIT.
ENDCASE.
lo_ixml ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_worksheet_cond_format_ex.
DATA: lo_ixml_nodes TYPE REF TO if_ixml_node_collection,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml TYPE REF TO if_ixml_element,
lv_dxf_style_index TYPE i,
lo_excel_style LIKE LINE OF me->styles.
FIELD-SYMBOLS: <ls_dxf_style> LIKE LINE OF me->mt_dxf_styles.
lv_dxf_style_index = io_ixml_rule->get_attribute_ns( 'dxfId' ).
READ TABLE me->mt_dxf_styles ASSIGNING <ls_dxf_style> WITH KEY dxf = lv_dxf_style_index.
IF sy-subrc = 0.
io_style_cond->mode_expression-cell_style = <ls_dxf_style>-guid.
ENDIF.
lo_ixml_nodes ?= io_ixml_rule->get_elements_by_tag_name( 'formula' ).
lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
lo_ixml ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml IS BOUND.
CASE sy-index.
WHEN 1.
io_style_cond->mode_expression-formula = lo_ixml->get_value( ).
WHEN OTHERS.
EXIT.
ENDCASE.
lo_ixml ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_worksheet_cond_format_is.
DATA: lo_ixml_nodes TYPE REF TO if_ixml_node_collection,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml TYPE REF TO if_ixml_element,
lo_ixml_rule_iconset TYPE REF TO if_ixml_element.
lo_ixml_rule_iconset ?= io_ixml_rule->get_first_child( ).
io_style_cond->mode_iconset-iconset = lo_ixml_rule_iconset->get_attribute_ns( 'iconSet' ).
io_style_cond->mode_iconset-showvalue = lo_ixml_rule_iconset->get_attribute_ns( 'showValue' ).
lo_ixml_nodes ?= lo_ixml_rule_iconset->get_elements_by_tag_name( 'cfvo' ).
lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
lo_ixml ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml IS BOUND.
CASE sy-index.
WHEN 1.
io_style_cond->mode_iconset-cfvo1_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_iconset-cfvo1_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN 2.
io_style_cond->mode_iconset-cfvo2_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_iconset-cfvo2_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN 3.
io_style_cond->mode_iconset-cfvo3_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_iconset-cfvo3_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN 4.
io_style_cond->mode_iconset-cfvo4_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_iconset-cfvo4_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN 5.
io_style_cond->mode_iconset-cfvo5_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_iconset-cfvo5_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN OTHERS.
EXIT.
ENDCASE.
lo_ixml ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_worksheet_cond_format_t10.
DATA: lv_dxf_style_index TYPE i.
FIELD-SYMBOLS: <ls_dxf_style> LIKE LINE OF me->mt_dxf_styles.
io_style_cond->mode_top10-topxx_count = io_ixml_rule->get_attribute_ns( 'rank' ). " Top10, Top20, Top 50...
io_style_cond->mode_top10-percent = io_ixml_rule->get_attribute_ns( 'percent' ). " Top10 percent instead of Top10 values
IF io_style_cond->mode_top10-percent = '1'.
io_style_cond->mode_top10-percent = 'X'.
ELSE.
io_style_cond->mode_top10-percent = ' '.
ENDIF.
io_style_cond->mode_top10-bottom = io_ixml_rule->get_attribute_ns( 'bottom' ). " Bottom10 instead of Top10
IF io_style_cond->mode_top10-bottom = '1'.
io_style_cond->mode_top10-bottom = 'X'.
ELSE.
io_style_cond->mode_top10-bottom = ' '.
ENDIF.
*--------------------------------------------------------------------*
* Cell formatting for top10
*--------------------------------------------------------------------*
lv_dxf_style_index = io_ixml_rule->get_attribute_ns( 'dxfId' ).
READ TABLE me->mt_dxf_styles ASSIGNING <ls_dxf_style> WITH KEY dxf = lv_dxf_style_index.
IF sy-subrc = 0.
io_style_cond->mode_top10-cell_style = <ls_dxf_style>-guid.
ENDIF.
ENDMETHOD.
method LOAD_WORKSHEET_DRAWING.
TYPES: BEGIN OF t_c_nv_pr,
name TYPE string,
id TYPE string,
END OF t_c_nv_pr.
TYPES: BEGIN OF t_blip,
cstate TYPE string,
embed TYPE string,
END OF t_blip.
TYPES: BEGIN OF t_chart,
id TYPE string,
END OF t_chart.
CONSTANTS: lc_xml_attr_true TYPE string VALUE 'true',
lc_xml_attr_true_int TYPE string VALUE '1'.
CONSTANTS: lc_rel_chart TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart',
lc_rel_image TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image'.
DATA: drawing TYPE REF TO if_ixml_document,
anchors TYPE REF TO if_ixml_node_collection,
node TYPE REF TO if_ixml_element,
coll_length TYPE i,
iterator TYPE REF TO if_ixml_node_iterator,
anchor_elem TYPE REF TO if_ixml_element,
relationship TYPE t_relationship,
rel_drawings TYPE t_rel_drawings,
rel_drawing TYPE t_rel_drawing,
rels_drawing TYPE REF TO if_ixml_document,
rels_drawing_path TYPE string,
stripped_name TYPE chkfile,
dirname TYPE string,
path TYPE string,
path2 TYPE text255,
file_ext2 TYPE char10.
" Read Workbook Relationships
CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'
EXPORTING
full_name = ip_path
IMPORTING
stripped_name = stripped_name
file_path = dirname.
CONCATENATE dirname '_rels/' stripped_name '.rels'
INTO rels_drawing_path.
rels_drawing_path = resolve_path( rels_drawing_path ).
rels_drawing = me->get_ixml_from_zip_archive( rels_drawing_path ).
node ?= rels_drawing->find_from_name( 'Relationship' ).
WHILE node IS BOUND.
fill_struct_from_attributes( EXPORTING ip_element = node CHANGING cp_structure = relationship ).
rel_drawing-id = relationship-id.
CONCATENATE dirname relationship-target INTO path.
path = resolve_path( path ).
rel_drawing-content = me->get_from_zip_archive( path ). "------------> This is for template usage
path2 = path.
zcl_excel_common=>split_file( EXPORTING ip_file = path2
IMPORTING ep_extension = file_ext2 ).
rel_drawing-file_ext = file_ext2.
"-------------Added by Alessandro Iannacci - Should load graph xml
CASE relationship-type.
WHEN lc_rel_chart.
"Read chart xml
rel_drawing-content_xml = me->get_ixml_from_zip_archive( path ).
WHEN OTHERS.
ENDCASE.
"----------------------------
APPEND rel_drawing TO rel_drawings.
node ?= node->get_next( ).
ENDWHILE.
drawing = me->get_ixml_from_zip_archive( ip_path ).
* one-cell anchor **************
anchors = drawing->get_elements_by_tag_name( name = 'oneCellAnchor' namespace = 'xdr' ).
coll_length = anchors->get_length( ).
iterator = anchors->create_iterator( ).
DO coll_length TIMES.
anchor_elem ?= iterator->get_next( ).
CALL METHOD me->load_drawing_anchor
EXPORTING
io_anchor_element = anchor_elem
io_worksheet = io_worksheet
it_related_drawings = rel_drawings.
ENDDO.
* two-cell anchor ******************
anchors = drawing->get_elements_by_tag_name( name = 'twoCellAnchor' namespace = 'xdr' ).
coll_length = anchors->get_length( ).
iterator = anchors->create_iterator( ).
DO coll_length TIMES.
anchor_elem ?= iterator->get_next( ).
CALL METHOD me->load_drawing_anchor
EXPORTING
io_anchor_element = anchor_elem
io_worksheet = io_worksheet
it_related_drawings = rel_drawings.
ENDDO.
endmethod.
METHOD load_worksheet_hyperlinks.
DATA: lo_ixml_hyperlinks TYPE REF TO if_ixml_node_collection,
lo_ixml_hyperlink TYPE REF TO if_ixml_element,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lv_row TYPE zexcel_cell_row,
lv_column TYPE zexcel_cell_column_alpha,
lo_hyperlink TYPE REF TO zcl_excel_hyperlink,
lv_value TYPE zexcel_cell_value.
DATA: BEGIN OF ls_hyperlink,
ref TYPE string,
display TYPE string,
location TYPE string,
tooltip TYPE string,
r_id TYPE string,
END OF ls_hyperlink.
FIELD-SYMBOLS: <ls_external_hyperlink> LIKE LINE OF it_external_hyperlinks.
lo_ixml_hyperlinks = io_ixml_worksheet->get_elements_by_tag_name( name = 'hyperlink' ).
lo_ixml_iterator = lo_ixml_hyperlinks->create_iterator( ).
lo_ixml_hyperlink ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml_hyperlink IS BOUND.
CLEAR ls_hyperlink.
CLEAR lo_hyperlink.
ls_hyperlink-ref = lo_ixml_hyperlink->get_attribute_ns( 'ref' ).
ls_hyperlink-display = lo_ixml_hyperlink->get_attribute_ns( 'display' ).
ls_hyperlink-location = lo_ixml_hyperlink->get_attribute_ns( 'location' ).
ls_hyperlink-tooltip = lo_ixml_hyperlink->get_attribute_ns( 'tooltip' ).
ls_hyperlink-r_id = lo_ixml_hyperlink->get_attribute( name = 'id'
namespace = 'r' ).
IF ls_hyperlink-r_id IS INITIAL. " Internal link
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = ls_hyperlink-location ).
ELSE. " External link
READ TABLE it_external_hyperlinks ASSIGNING <ls_external_hyperlink> WITH TABLE KEY id = ls_hyperlink-r_id.
IF sy-subrc = 0.
lo_hyperlink = zcl_excel_hyperlink=>create_external_link( iv_url = <ls_external_hyperlink>-target ).
ENDIF.
ENDIF.
IF lo_hyperlink IS BOUND. " because of unsupported external links
zcl_excel_common=>convert_columnrow2column_a_row( EXPORTING
i_columnrow = ls_hyperlink-ref
IMPORTING
e_row = lv_row
e_column = lv_column ).
* Currently it is not allowed to pass a hyperlink w/o text, but text has already been read.
* So just reread it and be done with it
io_worksheet->get_cell( EXPORTING
ip_column = lv_column
ip_row = lv_row
IMPORTING
ep_value = lv_value ).
io_worksheet->set_cell( ip_column = lv_column
ip_row = lv_row
ip_value = lv_value
ip_hyperlink = lo_hyperlink ).
ENDIF.
lo_ixml_hyperlink ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_worksheet_pagebreaks.
DATA: lo_node TYPE REF TO if_ixml_element,
lo_ixml_rowbreaks TYPE REF TO if_ixml_node_collection,
lo_ixml_colbreaks TYPE REF TO if_ixml_node_collection,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml_rowbreak TYPE REF TO if_ixml_element,
lo_ixml_colbreak TYPE REF TO if_ixml_element,
lo_style_cond TYPE REF TO zcl_excel_style_cond,
lv_count TYPE i.
DATA: lt_pagebreaks TYPE STANDARD TABLE OF zcl_excel_worksheet_pagebreaks=>ts_pagebreak_at,
lo_pagebreaks TYPE REF TO zcl_excel_worksheet_pagebreaks.
FIELD-SYMBOLS: <ls_pagebreak_row> LIKE LINE OF lt_pagebreaks.
FIELD-SYMBOLS: <ls_pagebreak_col> LIKE LINE OF lt_pagebreaks.
*--------------------------------------------------------------------*
* Get minimal number of cells where to add pagebreaks
* Since rows and columns are handled in separate nodes
* Build table to identify these cells
*--------------------------------------------------------------------*
lo_node ?= io_ixml_worksheet->find_from_name( 'rowBreaks' ).
check lo_node is bound.
lo_ixml_rowbreaks = lo_node->get_elements_by_tag_name( name = 'brk' ).
lo_ixml_iterator = lo_ixml_rowbreaks->create_iterator( ).
lo_ixml_rowbreak ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml_rowbreak IS BOUND.
APPEND INITIAL LINE TO lt_pagebreaks ASSIGNING <ls_pagebreak_row>.
<ls_pagebreak_row>-cell_row = lo_ixml_rowbreak->get_attribute_ns( 'id' ).
lo_ixml_rowbreak ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
CHECK <ls_pagebreak_row> IS ASSIGNED.
lo_node ?= io_ixml_worksheet->find_from_name( 'colBreaks' ).
check lo_node is bound.
lo_ixml_colbreaks = lo_node->get_elements_by_tag_name( name = 'brk' ).
lo_ixml_iterator = lo_ixml_colbreaks->create_iterator( ).
lo_ixml_colbreak ?= lo_ixml_iterator->get_next( ).
CLEAR lv_count.
WHILE lo_ixml_colbreak IS BOUND.
ADD 1 TO lv_count.
READ TABLE lt_pagebreaks INDEX lv_count ASSIGNING <ls_pagebreak_col>.
IF sy-subrc <> 0.
APPEND INITIAL LINE TO lt_pagebreaks ASSIGNING <ls_pagebreak_col>.
<ls_pagebreak_col>-cell_row = <ls_pagebreak_row>-cell_row.
ENDIF.
<ls_pagebreak_col>-cell_column = lo_ixml_colbreak->get_attribute_ns( 'id' ).
lo_ixml_colbreak ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
*--------------------------------------------------------------------*
* Finally add each pagebreak
*--------------------------------------------------------------------*
lo_pagebreaks = io_worksheet->get_pagebreaks( ).
LOOP AT lt_pagebreaks ASSIGNING <ls_pagebreak_row>.
lo_pagebreaks->add_pagebreak( ip_column = <ls_pagebreak_row>-cell_column
ip_row = <ls_pagebreak_row>-cell_row ).
ENDLOOP.
ENDMETHOD.
METHOD load_worksheet_pagemargins.
TYPES: BEGIN OF lty_page_margins,
footer TYPE string,
header TYPE string,
bottom TYPE string,
top TYPE string,
right TYPE string,
left TYPE string,
END OF lty_page_margins.
DATA:lo_ixml_pagemargins_elem TYPE REF TO if_ixml_element,
ls_pagemargins TYPE lty_page_margins.
lo_ixml_pagemargins_elem = io_ixml_worksheet->find_from_name( 'pageMargins' ).
IF lo_ixml_pagemargins_elem IS NOT INITIAL.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_pagemargins_elem
CHANGING
cp_structure = ls_pagemargins ).
io_worksheet->sheet_setup->margin_bottom = zcl_excel_common=>excel_string_to_number( ls_pagemargins-bottom ).
io_worksheet->sheet_setup->margin_footer = zcl_excel_common=>excel_string_to_number( ls_pagemargins-footer ).
io_worksheet->sheet_setup->margin_header = zcl_excel_common=>excel_string_to_number( ls_pagemargins-header ).
io_worksheet->sheet_setup->margin_left = zcl_excel_common=>excel_string_to_number( ls_pagemargins-left ).
io_worksheet->sheet_setup->margin_right = zcl_excel_common=>excel_string_to_number( ls_pagemargins-right ).
io_worksheet->sheet_setup->margin_top = zcl_excel_common=>excel_string_to_number( ls_pagemargins-top ).
ENDIF.
ENDMETHOD.
METHOD read_from_applserver.
DATA: lv_filelength TYPE i,
lt_binary_data TYPE STANDARD TABLE OF x255 WITH NON-UNIQUE DEFAULT KEY,
ls_binary_data LIKE LINE OF lt_binary_data,
lv_filename TYPE string,
lv_max_length_line TYPE i,
lv_actual_length_line TYPE i,
lv_errormessage TYPE string.
MOVE i_filename TO lv_filename.
DESCRIBE FIELD ls_binary_data LENGTH lv_max_length_line IN BYTE MODE.
OPEN DATASET lv_filename FOR INPUT IN BINARY MODE.
IF sy-subrc <> 0.
lv_errormessage = 'A problem occured when reading the file'(001).
RAISE EXCEPTION TYPE zcx_excel
EXPORTING
error = lv_errormessage.
ENDIF.
WHILE sy-subrc = 0.
READ DATASET lv_filename INTO ls_binary_data MAXIMUM LENGTH lv_max_length_line ACTUAL LENGTH lv_actual_length_line.
APPEND ls_binary_data TO lt_binary_data.
lv_filelength = lv_filelength + lv_actual_length_line.
ENDWHILE.
CLOSE DATASET lv_filename.
*--------------------------------------------------------------------*
* Binary data needs to be provided as XSTRING for further processing
*--------------------------------------------------------------------*
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length = lv_filelength
IMPORTING
buffer = r_excel_data
TABLES
binary_tab = lt_binary_data.
ENDMETHOD.
METHOD read_from_local_file.
DATA: lv_filelength TYPE i,
lt_binary_data TYPE STANDARD TABLE OF x255 WITH NON-UNIQUE DEFAULT KEY,
ls_binary_data LIKE LINE OF lt_binary_data,
lv_filename TYPE string,
lv_errormessage TYPE string.
MOVE i_filename TO lv_filename.
cl_gui_frontend_services=>gui_upload( EXPORTING
filename = lv_filename
filetype = 'BIN' " We are basically working with zipped directories --> force binary read
IMPORTING
filelength = lv_filelength
CHANGING
data_tab = lt_binary_data
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19 ).
IF sy-subrc <> 0.
lv_errormessage = 'A problem occured when reading the file'(001).
RAISE EXCEPTION TYPE zcx_excel
EXPORTING
error = lv_errormessage.
ENDIF.
*--------------------------------------------------------------------*
* Binary data needs to be provided as XSTRING for further processing
*--------------------------------------------------------------------*
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length = lv_filelength
IMPORTING
buffer = r_excel_data
TABLES
binary_tab = lt_binary_data.
ENDMETHOD.
method RESOLVE_PATH.
*--------------------------------------------------------------------*
* ToDos:
* 2do§1 Determine whether the replacement should be done
* iterative to allow /../../.. or something alike
* 2do§2 Determine whether /./ has to be supported as well
* 2do§3 Create unit-test for this method
*
* Please don't just delete these ToDos if they are not
* needed but leave a comment that states this
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-11
* - ...
* changes: replaced previous coding by regular expression
* adding comments to explain what we are trying to achieve
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* §1 This routine will receive a path, that may have a relative pathname (/../) included somewhere
* The output should be a resolved path without relative references
* Example: Input xl/worksheets/../drawings/drawing1.xml
* Output xl/drawings/drawing1.xml
*--------------------------------------------------------------------*
rp_result = ip_path.
*--------------------------------------------------------------------*
* §1 Remove relative pathnames
*--------------------------------------------------------------------*
* Regular expression [^/]*/\.\./
* [^/]* --> any number of characters other than /
* followed by /\.\./ --> the sequence /../
* ==> worksheets/../ will be found in the example
*--------------------------------------------------------------------*
REPLACE REGEX '[^/]*/\.\./' IN rp_result WITH ``.
endmethod.
method RESOLVE_REFERENCED_FORMULAE.
TYPES: BEGIN OF ty_referenced_cells,
sheet TYPE REF TO zcl_excel_worksheet,
si TYPE i,
row_from TYPE i,
row_to TYPE i,
col_from TYPE i,
col_to TYPE i,
formula TYPE string,
ref_cell TYPE char10,
END OF ty_referenced_cells.
DATA: ls_ref_formula LIKE LINE OF me->mt_ref_formulae,
lts_referenced_cells TYPE SORTED TABLE OF ty_referenced_cells WITH NON-UNIQUE KEY sheet si row_from row_to col_from col_to,
ls_referenced_cell LIKE LINE OF lts_referenced_cells,
lv_col_from TYPE zexcel_cell_column_alpha,
lv_col_to TYPE zexcel_cell_column_alpha,
lv_resulting_formula TYPE string,
lv_current_cell TYPE char10.
me->mt_ref_formulae = me->mt_ref_formulae.
*--------------------------------------------------------------------*
* Get referenced Cells, Build ranges for easy lookup
*--------------------------------------------------------------------*
LOOP AT me->mt_ref_formulae INTO ls_ref_formula WHERE ref <> space.
CLEAR ls_referenced_cell.
ls_referenced_cell-sheet = ls_ref_formula-sheet.
ls_referenced_cell-si = ls_ref_formula-si.
ls_referenced_cell-formula = ls_ref_formula-formula.
TRY.
zcl_excel_common=>convert_range2column_a_row( EXPORTING i_range = ls_ref_formula-ref
IMPORTING e_column_start = lv_col_from
e_column_end = lv_col_to
e_row_start = ls_referenced_cell-row_from
e_row_end = ls_referenced_cell-row_to ).
ls_referenced_cell-col_from = zcl_excel_common=>convert_column2int( lv_col_from ).
ls_referenced_cell-col_to = zcl_excel_common=>convert_column2int( lv_col_to ).
CLEAR ls_referenced_cell-ref_cell.
TRY.
ls_referenced_cell-ref_cell(3) = zcl_excel_common=>convert_column2alpha( ls_ref_formula-column ).
ls_referenced_cell-ref_cell+3 = ls_ref_formula-row.
CONDENSE ls_referenced_cell-ref_cell NO-GAPS.
CATCH zcx_excel.
ENDTRY.
INSERT ls_referenced_cell INTO TABLE lts_referenced_cells.
CATCH zcx_excel.
ENDTRY.
ENDLOOP.
* break x0009004.
*--------------------------------------------------------------------*
* For each referencing cell determine the referenced cell
* and resolve the formula
*--------------------------------------------------------------------*
LOOP AT me->mt_ref_formulae INTO ls_ref_formula WHERE ref = space.
CLEAR lv_current_cell.
TRY.
lv_current_cell(3) = zcl_excel_common=>convert_column2alpha( ls_ref_formula-column ).
lv_current_cell+3 = ls_ref_formula-row.
CONDENSE lv_current_cell NO-GAPS.
CATCH zcx_excel.
ENDTRY.
LOOP AT lts_referenced_cells INTO ls_referenced_cell WHERE sheet = ls_ref_formula-sheet
AND si = ls_ref_formula-si
AND row_from <= ls_ref_formula-row
AND row_to >= ls_ref_formula-row
AND col_from <= ls_ref_formula-column
AND col_to >= ls_ref_formula-column.
TRY.
lv_resulting_formula = zcl_excel_common=>determine_resulting_formula( iv_reference_cell = ls_referenced_cell-ref_cell
iv_reference_formula = ls_referenced_cell-formula
iv_current_cell = lv_current_cell ).
ls_referenced_cell-sheet->set_cell_formula( ip_column = ls_ref_formula-column
ip_row = ls_ref_formula-row
ip_formula = lv_resulting_formula ).
CATCH zcx_excel.
ENDTRY.
EXIT.
ENDLOOP.
ENDLOOP.
endmethod.
method ZIF_EXCEL_READER~CAN_READ_FILE.
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmöcker, (done) 2012-11-07
* - ...
* changes: nothing done in code
* but started discussion about killing this method
*--------------------------------------------------------------------*
* For now always Unknown
r_readable = abap_undefined.
endmethod.
METHOD zif_excel_reader~load.
*--------------------------------------------------------------------*
* ToDos:
* 2do§1 Map Document Properties to ZCL_EXCEL
*--------------------------------------------------------------------*
CONSTANTS: lcv_core_properties TYPE string VALUE 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties',
lcv_office_document TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument'.
DATA: lo_rels TYPE REF TO if_ixml_document,
lo_node TYPE REF TO if_ixml_element,
ls_relationship TYPE t_relationship.
*--------------------------------------------------------------------*
* §1 Create EXCEL-Object we want to return to caller
* §2 We need to read the the file "\\_rels\.rels" because it tells
* us where in this folder structure the data for the workbook
* is located in the xlsx zip-archive
*
* The xlsx Zip-archive has generally the following folder structure:
* <root> |
* |--> _rels
* |--> doc_Props
* |--> xl |
* |--> _rels
* |--> theme
* |--> worksheets
* §3 Extracting from this the path&file where the workbook is located
* Following is an example how this file could be set up
* <?xml version="1.0" encoding="UTF-8" standalone="true"?>
* <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
* <Relationship Target="docProps/app.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Id="rId3"/>
* <Relationship Target="docProps/core.xml" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Id="rId2"/>
* <Relationship Target="xl/workbook.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Id="rId1"/>
* </Relationships>
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* §1 Create EXCEL-Object we want to return to caller
*--------------------------------------------------------------------*
IF iv_zcl_excel_classname IS INITIAL.
CREATE OBJECT r_excel.
ELSE.
CREATE OBJECT r_excel TYPE (iv_zcl_excel_classname).
ENDIF.
zip = create_zip_archive( i_xlsx_binary = i_excel2007
i_use_alternate_zip = i_use_alternate_zip ).
*--------------------------------------------------------------------*
* §2 Get file in folderstructure
*--------------------------------------------------------------------*
lo_rels = get_ixml_from_zip_archive( '_rels/.rels' ).
*--------------------------------------------------------------------*
* §3 Cycle through the Relationship Tags and use the ones we need
*--------------------------------------------------------------------*
lo_node ?= lo_rels->find_from_name( 'Relationship' ). "#EC NOTEXT
WHILE lo_node IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node
CHANGING
cp_structure = ls_relationship ).
CASE ls_relationship-type.
WHEN lcv_office_document.
*--------------------------------------------------------------------*
* Parse workbook - main part here
*--------------------------------------------------------------------*
load_workbook( iv_workbook_full_filename = ls_relationship-target
io_excel = r_excel ).
WHEN lcv_core_properties.
" 2do§1 Map Document Properties to ZCL_EXCEL
WHEN OTHERS.
ENDCASE.
lo_node ?= lo_node->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD zif_excel_reader~load_file.
DATA: lv_excel_data TYPE xstring.
*--------------------------------------------------------------------*
* Read file into binary string
*--------------------------------------------------------------------*
IF i_from_applserver = abap_true.
lv_excel_data = read_from_applserver( i_filename ).
ELSE.
lv_excel_data = read_from_local_file( i_filename ).
ENDIF.
*--------------------------------------------------------------------*
* Parse Excel data into ZCL_EXCEL object from binary string
*--------------------------------------------------------------------*
r_excel = zif_excel_reader~load( i_excel2007 = lv_excel_data
i_use_alternate_zip = i_use_alternate_zip
iv_zcl_excel_classname = iv_zcl_excel_classname ).
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
5097,
62,
6369,
34,
3698,
62,
15675,
1137,
62,
12726,
6770,
198,
220,
1171,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1168,
5097,
62,
6369,
34,
3698,
62,
15675,
1137,
62,
12726,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
220,
2099,
12,
7742,
82,
22631,
5805,
764,
628,
220,
20314,
1168,
5064,
62,
6369,
34,
3698,
62,
15675,
1137,
764,
628,
220,
1398,
12,
24396,
82,
376,
8267,
62,
46126,
62,
10913,
2662,
62,
1404,
5446,
9865,
3843,
1546,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
4061,
62,
36,
2538,
10979,
2099,
1006,
284,
16876,
62,
10426,
5805,
62,
36,
2538,
10979,
198,
220,
220,
220,
5609,
198,
220,
220,
220,
220,
220,
5145,
8697,
62,
46126,
11335,
2099,
15529,
764,
198,
24326,
2665,
13,
628,
220,
3858,
25,
198,
9,
1,
9,
6861,
6805,
286,
1398,
1168,
5097,
62,
6369,
34,
3698,
62,
15675,
1137,
62,
12726,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
220,
220,
220,
347,
43312,
3963,
256,
62,
39468,
1056,
11,
198,
220,
220,
220,
220,
220,
4686,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
2496,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
2496,
14171,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
2499,
25473,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
5225,
25473,
11,
198,
220,
220,
220,
220,
220,
9629,
312,
220,
220,
220,
41876,
4731,
11,
220,
220,
220,
220,
366,
1040,
1303,
22370,
532,
9585,
15274,
14,
4033,
82,
532,
2622,
284,
5911,
3376,
9629,
198,
220,
220,
220,
23578,
3963,
256,
62,
39468,
1056,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
347,
43312,
3963,
256,
62,
7753,
9641,
11,
198,
220,
220,
220,
220,
220,
598,
3672,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
15436,
863,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
1877,
7287,
863,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
374,
929,
11249,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
14873,
12453,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
23578,
3963,
256,
62,
7753,
9641,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
347,
43312,
3963,
256,
62,
21760,
11,
198,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
9629,
312,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
4686,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
1181,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
23578,
3963,
256,
62,
21760,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
347,
43312,
3963,
256,
62,
1818,
2070,
1050,
11,
198,
220,
220,
220,
220,
220,
14873,
12453,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
4277,
43810,
9641,
41876,
4731,
11,
198,
220,
220,
220,
23578,
3963,
256,
62,
1818,
2070,
1050,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
347,
43312,
3963,
256,
62,
21760,
1050,
11,
198,
220,
220,
220,
220,
220,
14873,
12453,
41876,
4731,
11,
198,
220,
220,
220,
23578,
3963,
256,
62,
21760,
1050,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
347,
43312,
3963,
256,
62,
9521,
11,
198,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
7104,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
220,
220,
220,
220,
220,
220,
366,
28463,
276,
351,
2071,
1303,
22370,
780,
5231,
1659,
346,
1010,
1422,
470,
38836,
48476,
740,
198,
220,
220,
220,
220,
220,
17205,
25473,
312,
41876,
4731,
11,
220,
220,
220,
220,
220,
220,
366,
2071,
1303,
24136,
198,
220,
220,
220,
23578,
3963,
256,
62,
9521,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
256,
62,
69,
2171,
220,
220,
41876,
49053,
9795,
43679,
3963,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
7635,
62,
20797,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
256,
62,
65,
6361,
41876,
49053,
9795,
43679,
3963,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
7635,
62,
65,
6361,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
256,
62,
10331,
82,
220,
220,
41876,
49053,
9795,
43679,
3963,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
7635,
62,
10331,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
256,
62,
7635,
62,
5420,
82,
41876,
49053,
9795,
43679,
3963,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
7635,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
347,
43312,
3963,
256,
62,
8043,
11,
198,
220,
220,
220,
220,
220,
41497,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
46140,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
7505,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
34791,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
23578,
3963,
256,
62,
8043,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
347,
43312,
3963,
256,
62,
2411,
62,
19334,
278,
11,
198,
220,
220,
220,
220,
220,
4686,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
2695,
220,
220,
220,
220,
41876,
2124,
8841,
11,
198,
220,
220,
220,
220,
220,
2393,
62,
2302,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
2695,
62,
19875,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
22897,
11
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_advent2020_day18_rename DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_advent2020_rename .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ADVENT2020_DAY18_RENAME IMPLEMENTATION.
METHOD zif_advent2020_rename~solve.
output = 'todo'.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
324,
1151,
42334,
62,
820,
1507,
62,
918,
480,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
324,
1151,
42334,
62,
918,
480,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
2885,
53,
3525,
42334,
62,
26442,
1507,
62,
49,
1677,
10067,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
324,
1151,
42334,
62,
918,
480,
93,
82,
6442,
13,
628,
220,
220,
220,
5072,
796,
705,
83,
24313,
4458,
628,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*&---------------------------------------------------------------------*
*& Include /USI/BAL_DEMO_02_O01
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module PBO_0100 OUTPUT
*&---------------------------------------------------------------------*
*& PBO for screen 0100 (Popup 'Maintain task text')
*&---------------------------------------------------------------------*
MODULE pbo_0100 OUTPUT.
lcl_popup_maintain_task=>singleton->on_pbo( ).
ENDMODULE.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
40348,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1220,
2937,
40,
14,
33,
1847,
62,
39429,
46,
62,
2999,
62,
46,
486,
198,
9,
5,
10097,
30934,
9,
198,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
19937,
350,
8202,
62,
39103,
16289,
30076,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
350,
8202,
329,
3159,
5534,
405,
357,
16979,
929,
705,
44,
32725,
4876,
2420,
11537,
198,
9,
5,
10097,
30934,
9,
198,
33365,
24212,
279,
2127,
62,
39103,
16289,
30076,
13,
198,
220,
300,
565,
62,
12924,
929,
62,
76,
32725,
62,
35943,
14804,
12215,
10565,
3784,
261,
62,
79,
2127,
7,
6739,
198,
10619,
33365,
24212,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_faker_provider_phone DEFINITION
PUBLIC
INHERITING FROM zcl_faker_provider
ABSTRACT .
PUBLIC SECTION.
METHODS number
RETURNING VALUE(r_result) TYPE string.
PROTECTED SECTION.
DATA _formats TYPE string_table.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_faker_provider_phone IMPLEMENTATION.
METHOD number.
r_result = numerify( _formats[ random( lines( _formats ) ) ] ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
69,
3110,
62,
15234,
1304,
62,
4862,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
69,
3110,
62,
15234,
1304,
198,
220,
9564,
18601,
10659,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
1271,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
42865,
4808,
687,
1381,
41876,
4731,
62,
11487,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
69,
3110,
62,
15234,
1304,
62,
4862,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
1271,
13,
198,
220,
220,
220,
374,
62,
20274,
796,
5470,
1958,
7,
4808,
687,
1381,
58,
4738,
7,
3951,
7,
4808,
687,
1381,
1267,
1267,
2361,
6739,
198,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_anagram DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS anagram
IMPORTING
input TYPE string
candidates TYPE string_table
RETURNING
VALUE(result) TYPE string_table.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_anagram IMPLEMENTATION.
METHOD anagram.
* add solution here
ENDMETHOD.
ENDCLASS. | [
31631,
1976,
565,
62,
272,
6713,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
281,
6713,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
5871,
220,
220,
220,
41876,
4731,
62,
11487,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
4731,
62,
11487,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
272,
6713,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
281,
6713,
13,
198,
9,
751,
4610,
994,
198,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
"! <p class="shorttext synchronized" lang="en">Value constants for CDS annotations</p>
INTERFACE zif_sat_c_cds_anno_value
PUBLIC .
CONSTANTS:
"! <p class="shorttext synchronized" lang="en">Constants for 'Environment.systemField'</p>
BEGIN OF c_environment_system_field,
user TYPE string VALUE '#USER',
date TYPE string VALUE '#SYSTEM_DATE',
time TYPE string VALUE '#SYSTEM_TIME',
language TYPE string VALUE '#SYSTEM_LANGUAGE',
client TYPE string VALUE '#CLIENT',
END OF c_environment_system_field.
ENDINTERFACE.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
11395,
38491,
329,
327,
5258,
37647,
3556,
79,
29,
198,
41358,
49836,
1976,
361,
62,
49720,
62,
66,
62,
66,
9310,
62,
1236,
78,
62,
8367,
198,
220,
44731,
764,
198,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
34184,
1187,
329,
705,
31441,
13,
10057,
15878,
6,
3556,
79,
29,
198,
220,
220,
220,
347,
43312,
3963,
269,
62,
38986,
62,
10057,
62,
3245,
11,
198,
220,
220,
220,
220,
220,
2836,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
2,
29904,
3256,
198,
220,
220,
220,
220,
220,
3128,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
2,
23060,
25361,
62,
35,
6158,
3256,
198,
220,
220,
220,
220,
220,
640,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
2,
23060,
25361,
62,
34694,
3256,
198,
220,
220,
220,
220,
220,
3303,
41876,
4731,
26173,
8924,
705,
2,
23060,
25361,
62,
43,
15567,
52,
11879,
3256,
198,
220,
220,
220,
220,
220,
5456,
220,
220,
41876,
4731,
26173,
8924,
705,
2,
5097,
28495,
3256,
198,
220,
220,
220,
23578,
3963,
269,
62,
38986,
62,
10057,
62,
3245,
13,
198,
10619,
41358,
49836,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ycl_addict_class DEFINITION
PUBLIC
FINAL
CREATE PRIVATE .
PUBLIC SECTION.
TYPES clsname_list TYPE STANDARD TABLE OF seoclsname WITH EMPTY KEY.
TYPES dok_text_list TYPE STANDARD TABLE OF dok_text WITH EMPTY KEY.
TYPES clsname_range TYPE RANGE OF seoclsname.
TYPES cmpname_range TYPE RANGE OF seocompo-cmpname.
TYPES cmptype_range TYPE RANGE OF seocompo-cmptype.
TYPES mtdtype_range TYPE RANGE OF seocompo-mtdtype.
TYPES: BEGIN OF component_param_dict,
cmpname_rng TYPE cmpname_range,
cmptype_rng TYPE cmptype_range,
mtdtype_rng TYPE mtdtype_range,
END OF component_param_dict.
TYPES: BEGIN OF component_dict,
cmpname TYPE seocmpname,
cmptype TYPE seocmptype,
mtdtype TYPE seomtdtype,
END OF component_dict,
component_set TYPE HASHED TABLE OF component_dict
WITH UNIQUE KEY primary_key COMPONENTS cmpname,
component_sort TYPE SORTED TABLE OF component_dict
WITH UNIQUE KEY primary_key COMPONENTS cmpname,
component_list TYPE STANDARD TABLE OF component_dict WITH EMPTY KEY.
CONSTANTS: BEGIN OF cmptype,
method TYPE seocmptype VALUE '1',
END OF cmptype.
CONSTANTS: BEGIN OF method,
constructor TYPE seocpdname VALUE 'CONSTRUCTOR',
END OF method.
DATA def TYPE seoclass READ-ONLY.
CLASS-METHODS check_class_existence
IMPORTING !clsname TYPE seoclsname
RAISING ycx_addict_table_content.
CLASS-METHODS check_class_has_interface
IMPORTING !class TYPE seoclsname
!interface TYPE seoclsname
RAISING ycx_addict_table_content.
CLASS-METHODS convert_prgname_to_clsname
IMPORTING !prgname TYPE clike
RETURNING VALUE(clsname) TYPE seoclsname.
CLASS-METHODS get_class_name
IMPORTING !obj TYPE REF TO object
RETURNING VALUE(result) TYPE seoclsname.
CLASS-METHODS get_deepest_exception
IMPORTING !cx TYPE REF TO cx_root
RETURNING VALUE(result) TYPE REF TO cx_root.
CLASS-METHODS get_instance
IMPORTING !clsname TYPE seoclsname
RETURNING VALUE(obj) TYPE REF TO ycl_addict_class
RAISING ycx_addict_table_content.
METHODS accept
IMPORTING !visitor TYPE REF TO yif_addict_class_visitor
RAISING ycx_addict_class_method.
METHODS dequeue_exec.
METHODS enqueue_exec RAISING ycx_addict_lock.
METHODS get_components
IMPORTING !param TYPE component_param_dict OPTIONAL
EXPORTING !cmp_hash TYPE component_set
!cmp_sort TYPE component_sort
!cmp_std TYPE component_list.
METHODS get_immediate_subclass_names RETURNING VALUE(output) TYPE clsname_list.
METHODS get_instanceable_subclasses RETURNING VALUE(output) TYPE clsname_list.
METHODS get_recursive_subclass_names RETURNING VALUE(output) TYPE clsname_list.
METHODS get_text RETURNING VALUE(output) TYPE seoclasstx.
METHODS is_in_call_stack RETURNING VALUE(stack) TYPE abap_bool.
METHODS search_class_doc
IMPORTING !words TYPE dok_text_list
RETURNING VALUE(hit) TYPE abap_bool.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES: BEGIN OF multiton_dict,
clsname TYPE seoclsname,
obj TYPE REF TO ycl_addict_class,
END OF multiton_dict,
multiton_set TYPE HASHED TABLE OF multiton_dict
WITH UNIQUE KEY primary_key COMPONENTS clsname.
CONSTANTS: BEGIN OF doku_id,
class TYPE dokil-id VALUE 'CL',
END OF doku_id.
CONSTANTS: BEGIN OF doku_typ,
class TYPE dokil-typ VALUE 'E',
END OF doku_typ.
CONSTANTS: BEGIN OF table,
def TYPE tabname VALUE 'SEOCLASS',
rel TYPE tabname VALUE 'SEOMETAREL',
END OF table.
DATA dokil TYPE dokil.
DATA txt TYPE seoclasstx.
DATA component_std TYPE component_list.
DATA dokil_read TYPE abap_bool.
DATA txt_read TYPE abap_bool.
DATA component_read TYPE abap_bool.
CLASS-DATA multiton TYPE multiton_set.
METHODS read_dokil.
ENDCLASS.
CLASS ycl_addict_class IMPLEMENTATION.
METHOD accept.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Accepts a visitor
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
visitor->visit( me ).
ENDMETHOD.
METHOD check_class_existence.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Ensures that the provided class exists
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
get_instance( clsname ).
ENDMETHOD.
METHOD check_class_has_interface.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Ensures that the class has the given interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DATA(cls) = get_instance( interface )->get_instanceable_subclasses( ).
CHECK NOT line_exists( cls[ table_line = class ] ).
RAISE EXCEPTION TYPE ycx_addict_table_content
EXPORTING
objectid = CONV #( |{ class } { interface }| )
tabname = table-rel
textid = ycx_addict_table_content=>no_entry_for_objectid.
ENDMETHOD.
METHOD convert_prgname_to_clsname.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Converts program name to class name
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
clsname = prgname+0(30).
REPLACE ALL OCCURRENCES OF '=' IN clsname WITH space.
ENDMETHOD.
METHOD dequeue_exec.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Dequeues class for execution
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
CALL FUNCTION 'DEQUEUE_EYADDICT_CLSNAME'
EXPORTING
clsname = me->def-clsname.
ENDMETHOD.
METHOD enqueue_exec.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Enqueues class for execution
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
CALL FUNCTION 'ENQUEUE_EYADDICT_CLSNAME'
EXPORTING
clsname = me->def-clsname
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3
##FM_SUBRC_OK.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE ycx_addict_lock
EXPORTING
textid = ycx_addict_lock=>locked_by_user
bname = CONV #( sy-msgv1 ).
ENDIF.
ENDMETHOD.
METHOD get_components.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns components of class
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
IF me->component_read = abap_false. " Lazy initialization
SELECT * FROM seocompo
WHERE clsname = @me->def-clsname
INTO CORRESPONDING FIELDS OF TABLE @me->component_std.
me->component_read = abap_true.
ENDIF.
cmp_std = me->component_std.
DELETE cmp_std WHERE NOT (
cmpname IN param-cmpname_rng AND
cmptype IN param-cmptype_rng AND
mtdtype IN param-mtdtype_rng ).
IF cmp_hash IS REQUESTED.
cmp_hash = cmp_std.
ENDIF.
IF cmp_sort IS REQUESTED.
cmp_sort = cmp_std.
ENDIF.
ENDMETHOD.
METHOD get_immediate_subclass_names.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns immediate children classes
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
output = ycl_addict_class_inheritance=>get_instance( )->get_immediate_subclasses( def-clsname ).
ENDMETHOD.
METHOD get_class_name.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns class name of the given object
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
CHECK obj IS NOT INITIAL.
DATA(long_class_name) = cl_abap_classdescr=>get_class_name( obj ).
REPLACE ALL OCCURRENCES OF '\CLASS=' IN long_class_name WITH space.
result = long_class_name.
ENDMETHOD.
METHOD get_deepest_exception.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns the deepest exception object
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
result = COND #( WHEN cx->previous IS INITIAL
THEN cx
ELSE get_deepest_exception( cx->previous ) ).
ENDMETHOD.
METHOD get_instance.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Factory
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
ASSIGN ycl_addict_class=>multiton[ KEY primary_key COMPONENTS
clsname = clsname ]
TO FIELD-SYMBOL(<multiton>).
IF sy-subrc <> 0.
DATA(multiton) = VALUE multiton_dict( clsname = clsname ).
multiton-obj = NEW #( ).
SELECT SINGLE * FROM seoclass
WHERE clsname = @multiton-clsname
INTO @multiton-obj->def.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE ycx_addict_table_content
EXPORTING
textid = ycx_addict_table_content=>no_entry_for_objectid
objectid = CONV #( multiton-clsname )
tabname = ycl_addict_class=>table-def.
ENDIF.
INSERT multiton INTO TABLE ycl_addict_class=>multiton ASSIGNING <multiton>.
ENDIF.
obj = <multiton>-obj.
ENDMETHOD.
METHOD get_instanceable_subclasses.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns subclasses which are instanceable
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
output = ycl_addict_class_inheritance=>get_instance( )->get_instanceable_subclasses( me->def-clsname ).
ENDMETHOD.
METHOD get_recursive_subclass_names.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns subclass names in a recursive manner
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
output = ycl_addict_class_inheritance=>get_instance( )->get_recursive_subclasses( me->def-clsname ).
ENDMETHOD.
METHOD get_text.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns text of class
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
IF me->txt_read = abap_false. " Lazy initialization
SELECT SINGLE * FROM seoclasstx
WHERE clsname = @me->def-clsname AND
langu = @sy-langu
INTO @me->txt.
IF sy-subrc <> 0.
SELECT SINGLE * FROM seoclasstx
WHERE clsname = @me->def-clsname
INTO @me->txt ##WARN_OK . "#EC CI_NOORDER
ENDIF.
me->txt_read = abap_true.
ENDIF.
output = me->txt.
ENDMETHOD.
METHOD is_in_call_stack.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Tells if the class is in the call stack
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DATA cs TYPE sys_callst.
CALL FUNCTION 'SYSTEM_CALLSTACK'
IMPORTING
et_callstack = cs.
ASSERT cs IS NOT INITIAL. " Can't be
DATA(progname_pattern) = |{ me->def-clsname }*|.
LOOP AT cs TRANSPORTING NO FIELDS
WHERE progname CP progname_pattern.
stack = abap_true.
RETURN.
ENDLOOP.
ENDMETHOD.
METHOD read_dokil.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Reads dokil table (lazy)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
CHECK me->dokil_read = abap_false.
me->dokil_read = abap_true.
SELECT SINGLE * FROM dokil
WHERE id = @me->doku_id-class AND
object = @me->def-clsname AND
langu = @sy-langu AND
typ = @me->doku_typ-class
INTO @me->dokil .
IF sy-subrc <> 0.
RETURN.
ENDIF.
SELECT SINGLE * FROM dokil "#EC CI_GENBUFF
WHERE id = @me->doku_id-class AND "#EC CI_NOORDER
object = @me->def-clsname AND
typ = @me->doku_typ-class
INTO @me->dokil ##WARN_OK.
ENDMETHOD.
METHOD search_class_doc.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Search class documentation
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DATA hitlist TYPE STANDARD TABLE OF tline.
CHECK words IS NOT INITIAL.
read_dokil( ).
IF me->dokil IS INITIAL.
RETURN.
ENDIF.
LOOP AT words ASSIGNING FIELD-SYMBOL(<word>).
CALL FUNCTION 'DOCU_SEARCH_TEXT'
EXPORTING
id = me->dokil-id
langu = me->dokil-langu
object = me->dokil-object
typ = me->dokil-typ
searchstring = <word>
TABLES
hitlist = hitlist.
CHECK hitlist IS NOT INITIAL.
hit = abap_true.
RETURN.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
565,
62,
2860,
713,
62,
4871,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
4810,
3824,
6158,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
537,
82,
3672,
62,
4868,
41876,
49053,
9795,
43679,
3963,
384,
420,
7278,
3672,
13315,
38144,
9936,
35374,
13,
198,
220,
220,
220,
24412,
47,
1546,
466,
74,
62,
5239,
62,
4868,
41876,
49053,
9795,
43679,
3963,
466,
74,
62,
5239,
13315,
38144,
9936,
35374,
13,
628,
220,
220,
220,
24412,
47,
1546,
537,
82,
3672,
62,
9521,
41876,
371,
27746,
3963,
384,
420,
7278,
3672,
13,
198,
220,
220,
220,
24412,
47,
1546,
269,
3149,
3672,
62,
9521,
41876,
371,
27746,
3963,
384,
420,
3361,
78,
12,
48991,
3672,
13,
198,
220,
220,
220,
24412,
47,
1546,
12067,
457,
2981,
62,
9521,
41876,
371,
27746,
3963,
384,
420,
3361,
78,
12,
11215,
457,
2981,
13,
198,
220,
220,
220,
24412,
47,
1546,
285,
8671,
4906,
62,
9521,
41876,
371,
27746,
3963,
384,
420,
3361,
78,
12,
76,
8671,
4906,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
7515,
62,
17143,
62,
11600,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
3149,
3672,
62,
81,
782,
41876,
269,
3149,
3672,
62,
9521,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12067,
457,
2981,
62,
81,
782,
41876,
12067,
457,
2981,
62,
9521,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
8671,
4906,
62,
81,
782,
41876,
285,
8671,
4906,
62,
9521,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
7515,
62,
17143,
62,
11600,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
7515,
62,
11600,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
3149,
3672,
41876,
384,
420,
3149,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12067,
457,
2981,
41876,
384,
420,
76,
457,
2981,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
8671,
4906,
41876,
384,
296,
8671,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
7515,
62,
11600,
11,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7515,
62,
2617,
220,
41876,
367,
11211,
1961,
43679,
3963,
7515,
62,
11600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
4725,
33866,
8924,
35374,
4165,
62,
2539,
24301,
1340,
15365,
269,
3149,
3672,
11,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7515,
62,
30619,
41876,
311,
9863,
1961,
43679,
3963,
7515,
62,
11600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
4725,
33866,
8924,
35374,
4165,
62,
2539,
24301,
1340,
15365,
269,
3149,
3672,
11,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7515,
62,
4868,
41876,
49053,
9795,
43679,
3963,
7515,
62,
11600,
13315,
38144,
9936,
35374,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
347,
43312,
3963,
12067,
457,
2981,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2446,
41876,
384,
420,
76,
457,
2981,
26173,
8924,
705,
16,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
12067,
457,
2981,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
347,
43312,
3963,
2446,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23772,
41876,
384,
420,
30094,
3672,
26173,
8924,
705,
10943,
46126,
1581,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
2446,
13,
628,
220,
220,
220,
42865,
825,
41876,
384,
420,
31172,
20832,
12,
1340,
11319,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
2198,
62,
4871,
62,
41084,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
5145,
565,
82,
3672,
41876,
384,
420,
7278,
3672,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
331,
66,
87,
62,
2860,
713,
62,
11487,
62,
11299,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
2198,
62,
4871,
62,
10134,
62,
39994,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
5145,
4871,
220,
220,
220,
220,
41876,
384,
420,
7278,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
39994,
41876,
384,
420,
7278,
3672,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
331,
66,
87,
62,
2860,
713,
62,
11487,
62,
11299,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
10385,
62,
1050,
70,
3672,
62,
1462,
62,
565,
82,
3672,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
5145,
1050,
70,
3672,
220,
220,
220,
220,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
565,
82,
3672,
8,
41876,
384,
420,
7278,
3672,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
4871,
62,
3672,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
5145,
26801,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
2134,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
384,
420,
7278,
3672,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
22089,
395,
62,
1069,
4516,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
5145,
66,
87,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
43213,
62,
15763,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
4526,
37,
5390,
43213,
62,
15763,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
39098,
198,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ltcl_test_base DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT ABSTRACT.
PUBLIC SECTION.
PROTECTED SECTION.
METHODS:
add_file IMPORTING iv_url TYPE string
iv_content TYPE string OPTIONAL.
DATA:
mo_asset_manager TYPE REF TO zcl_abapgit_gui_asset_manager,
mo_cut TYPE REF TO zcl_abapgit_gui_css_processor.
PRIVATE SECTION.
METHODS:
setup,
teardown.
ENDCLASS.
CLASS ltcl_test_base IMPLEMENTATION.
METHOD setup.
CREATE OBJECT mo_asset_manager.
CREATE OBJECT mo_cut EXPORTING ii_asset_manager = mo_asset_manager.
ENDMETHOD.
METHOD teardown.
FREE: mo_cut, mo_asset_manager.
ENDMETHOD.
METHOD add_file.
mo_asset_manager->register_asset(
iv_url = iv_url
iv_type = 'text/css'
iv_inline = iv_content ).
ENDMETHOD.
ENDCLASS.
CLASS ltcl_single_file DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT INHERITING FROM ltcl_test_base.
PUBLIC SECTION.
METHODS:
test_file_exists FOR TESTING,
test_file_does_not_exist FOR TESTING,
test_empty_file FOR TESTING,
test_no_variables FOR TESTING RAISING zcx_abapgit_exception,
test_simple_variables FOR TESTING RAISING zcx_abapgit_exception,
test_complex_variables FOR TESTING RAISING zcx_abapgit_exception,
test_overwrite FOR TESTING RAISING zcx_abapgit_exception.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ltcl_single_file IMPLEMENTATION.
METHOD test_file_exists.
add_file( iv_url = 'does/exist.css'
iv_content = |body \{\}\n| ).
mo_cut->add_file( 'does/exist.css' ).
TRY.
mo_cut->process( ).
CATCH zcx_abapgit_exception.
cl_abap_unit_assert=>fail( ).
ENDTRY.
ENDMETHOD.
METHOD test_file_does_not_exist.
mo_cut->add_file( 'not/existing.css' ).
TRY.
mo_cut->process( ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_exception ##NO_HANDLER.
ENDTRY.
ENDMETHOD.
METHOD test_empty_file.
add_file( 'does/exist.css' ).
mo_cut->add_file( 'does/exist.css' ).
TRY.
mo_cut->process( ).
cl_abap_unit_assert=>fail( ). " Assetman fails on empty content
CATCH zcx_abapgit_exception ##NO_HANDLER.
ENDTRY.
ENDMETHOD.
METHOD test_no_variables.
DATA: lv_content TYPE string.
lv_content =
`body {\n` &&
` font-family: 'Arial', serif;\n` &&
` background: #000000;\n` &&
` color: #ffffff;\n` &&
`}\n`.
add_file( iv_url = 'novars.css'
iv_content = lv_content ).
mo_cut->add_file( 'novars.css' ).
cl_abap_unit_assert=>assert_equals( act = mo_cut->process( )
exp = lv_content ).
ENDMETHOD.
METHOD test_simple_variables.
DATA: lv_content TYPE string,
lv_expected TYPE string.
lv_content =
`:root {\n` &&
` --my-bg-color: #123456;\n` &&
`}\n` &&
`body {\n` &&
` font-family: 'Arial', serif;\n` &&
` background: var(--my-bg-color);\n` &&
` color: #ffffff;\n` &&
`}\n`.
add_file( iv_url = 'simple.css'
iv_content = lv_content ).
lv_expected =
`:root {\n` &&
` --my-bg-color: #123456;\n` &&
`}\n` &&
`body {\n` &&
` font-family: 'Arial', serif;\n` &&
` background: #123456;\n` &&
` color: #ffffff;\n` &&
`}\n`.
mo_cut->add_file( 'simple.css' ).
cl_abap_unit_assert=>assert_equals( act = mo_cut->process( )
exp = lv_expected ).
ENDMETHOD.
METHOD test_complex_variables.
DATA: lv_content TYPE string,
lv_expected TYPE string.
lv_content =
`:root {\n` &&
` --primary-color: #0099FF;\n` &&
` --dark-percentage: 15%;\n` &&
` --primary-color-dark: calc(var(--primary-color) + var(--dark-percentage));\n` &&
` --my-bg-color: var(--primary-color-dark);\n` &&
`}\n` &&
`body {\n` &&
` font-family: 'Arial', serif;\n` &&
` background: var(--my-bg-color);\n` &&
` color: #ffffff;\n` &&
`}\n`.
add_file( iv_url = 'complex.css'
iv_content = lv_content ).
lv_expected =
`:root {\n` &&
` --primary-color: #0099FF;\n` &&
` --dark-percentage: 15%;\n` &&
` --primary-color-dark: calc(#0099FF + 15%);\n` &&
` --my-bg-color: calc(#0099FF + 15%);\n` &&
`}\n` &&
`body {\n` &&
` font-family: 'Arial', serif;\n` &&
` background: calc(#0099FF + 15%);\n` &&
` color: #ffffff;\n` &&
`}\n`.
mo_cut->add_file( 'complex.css' ).
cl_abap_unit_assert=>assert_equals( act = mo_cut->process( )
exp = lv_expected ).
ENDMETHOD.
METHOD test_overwrite.
DATA: lv_content TYPE string,
lv_expected TYPE string.
lv_content =
`:root {\n` &&
` --var3: 5;\n` &&
` --var1: var(--var2);\n` &&
` --var2: var(--var3);\n` &&
` --var3: 1;\n` &&
`}\n` &&
`body {\n` &&
` width: var(--var1);\n` &&
`}\n`.
add_file( iv_url = 'overwrite.css'
iv_content = lv_content ).
lv_expected =
`:root {\n` &&
` --var3: 5;\n` &&
` --var1: 1;\n` &&
` --var2: 1;\n` &&
` --var3: 1;\n` &&
`}\n` &&
`body {\n` &&
` width: 1;\n` &&
`}\n`.
mo_cut->add_file( 'overwrite.css' ).
cl_abap_unit_assert=>assert_equals( act = mo_cut->process( )
exp = lv_expected ).
ENDMETHOD.
ENDCLASS.
CLASS ltcl_multiple_files DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT INHERITING FROM ltcl_test_base.
PUBLIC SECTION.
METHODS:
test_overwrite FOR TESTING RAISING zcx_abapgit_exception.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ltcl_multiple_files IMPLEMENTATION.
METHOD test_overwrite.
DATA: lv_file1 TYPE string,
lv_file2 TYPE string,
lv_expected TYPE string.
lv_file1 =
`:root {\n` &&
` --var3: 5;\n` &&
` --var1: var(--var2);\n` &&
` --var2: var(--var3);\n` &&
` --var3: 6;\n` &&
`}\n` &&
`body {\n` &&
` width: var(--var1);\n` &&
`}\n`.
REPLACE ALL OCCURRENCES OF '\n' IN lv_file1 WITH cl_abap_char_utilities=>newline.
add_file( iv_url = 'file1.css'
iv_content = lv_file1 ).
mo_cut->add_file( 'file1.css' ).
lv_file2 =
`:root {\n` &&
` --var3: 19;\n` &&
`}\n`.
REPLACE ALL OCCURRENCES OF '\n' IN lv_file2 WITH cl_abap_char_utilities=>newline.
add_file( iv_url = 'file2.css'
iv_content = lv_file2 ).
mo_cut->add_file( 'file2.css' ).
lv_expected =
`:root {\n` &&
` --var3: 5;\n` &&
` --var1: 19;\n` &&
` --var2: 19;\n` &&
` --var3: 6;\n` &&
`}\n` &&
`body {\n` &&
` width: 19;\n` &&
`}\n` &&
`\n` &&
`:root {\n` &&
` --var3: 19;\n` &&
`}\n`.
REPLACE ALL OCCURRENCES OF '\n' IN lv_expected WITH cl_abap_char_utilities=>newline.
cl_abap_unit_assert=>assert_equals( act = mo_cut->process( )
exp = lv_expected ).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
9288,
62,
8692,
5550,
20032,
17941,
7473,
43001,
2751,
45698,
42,
49277,
43638,
5805,
7597,
360,
4261,
6234,
6006,
9863,
9564,
18601,
10659,
13,
198,
220,
44731,
44513,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
751,
62,
7753,
30023,
9863,
2751,
21628,
62,
6371,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
11299,
41876,
4731,
39852,
2849,
1847,
13,
198,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
6941,
62,
562,
316,
62,
37153,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
562,
316,
62,
37153,
11,
198,
220,
220,
220,
220,
220,
6941,
62,
8968,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
25471,
62,
41341,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
573,
446,
593,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
9288,
62,
8692,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
6941,
62,
562,
316,
62,
37153,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
6941,
62,
8968,
7788,
15490,
2751,
21065,
62,
562,
316,
62,
37153,
796,
6941,
62,
562,
316,
62,
37153,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
573,
446,
593,
13,
198,
220,
220,
220,
17189,
25,
6941,
62,
8968,
11,
6941,
62,
562,
316,
62,
37153,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
751,
62,
7753,
13,
198,
220,
220,
220,
6941,
62,
562,
316,
62,
37153,
3784,
30238,
62,
562,
316,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
6371,
796,
21628,
62,
6371,
198,
220,
220,
220,
220,
220,
21628,
62,
4906,
796,
705,
5239,
14,
25471,
6,
198,
220,
220,
220,
220,
220,
21628,
62,
45145,
796,
21628,
62,
11299,
6739,
198,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
29762,
62,
7753,
5550,
20032,
17941,
7473,
43001,
2751,
45698,
42,
49277,
43638,
5805,
7597,
360,
4261,
6234,
6006,
9863,
3268,
16879,
2043,
2751,
16034,
300,
83,
565,
62,
9288,
62,
8692,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
1332,
62,
7753,
62,
1069,
1023,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
62,
7753,
62,
22437,
62,
1662,
62,
38476,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
62,
28920,
62,
7753,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
62,
3919,
62,
25641,
2977,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
1332,
62,
36439,
62,
25641,
2977,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
1332,
62,
41887,
62,
25641,
2977,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
1332,
62,
2502,
13564,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
29762,
62,
7753,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
1332,
62,
7753,
62,
1069,
1023,
13,
198,
220,
220,
220,
751,
62,
7753,
7,
21628,
62,
6371,
796,
705,
22437,
14,
38476,
13,
25471,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
11299,
796,
930,
2618,
3467,
31478,
32239,
77,
91,
6739,
198,
220,
220,
220,
6941,
62,
8968,
3784,
2860,
62,
7753,
7,
705,
22437,
14,
38476,
13,
25471,
6,
6739,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
6941,
62,
8968,
3784,
14681,
7,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
6739,
198,
220,
220,
220,
23578,
40405,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
62,
7753,
62,
22437,
62,
1662,
62,
38476,
13,
198,
220,
220,
220,
6941,
62,
8968,
3784,
2860,
62,
7753,
7,
705,
1662,
14,
25687,
13,
25471,
6,
6739,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
6941,
62,
8968,
3784,
14681,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
22492,
15285,
62,
39,
6981,
39878,
13,
198,
220,
220,
220,
23578,
40405,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
62,
28920,
62,
7753,
13,
198,
220,
220,
220,
751,
62,
7753,
7,
705,
22437,
14,
38476,
13,
25471,
6,
6739,
198,
220,
220,
220,
6941,
62,
8968,
3784,
2860,
62,
7753,
7,
705,
22437,
14,
38476,
13,
25471,
6,
6739,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
6941,
62,
8968,
3784,
14681,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
6739,
366,
31433,
805,
10143,
319,
6565,
2695,
198,
220,
220,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
22492,
15285,
62,
39,
6981,
39878,
13,
198,
220,
220,
220,
23578
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS y_check_test_seam_usage DEFINITION PUBLIC INHERITING FROM y_check_base CREATE PUBLIC.
PUBLIC SECTION.
METHODS constructor.
PROTECTED SECTION.
METHODS inspect_tokens REDEFINITION.
ENDCLASS.
CLASS Y_CHECK_TEST_SEAM_USAGE IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
settings-pseudo_comment = '"#EC TEST_SEAM_USAGE' ##NO_TEXT.
settings-disable_threshold_selection = abap_true.
settings-threshold = 0.
settings-documentation = |{ c_docs_path-checks }test-seam-usage.md|.
set_check_message( '"TEST-SEAM" statement should no longer be used!' ).
ENDMETHOD.
METHOD inspect_tokens.
CHECK get_token_abs( statement-from ) = 'TEST-SEAM'.
DATA(check_configuration) = detect_check_configuration( statement ).
raise_error( statement_level = statement-level
statement_index = index
statement_from = statement-from
check_configuration = check_configuration ).
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
62,
9122,
62,
9288,
62,
325,
321,
62,
26060,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
331,
62,
9122,
62,
8692,
29244,
6158,
44731,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
23772,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
10104,
62,
83,
482,
641,
23848,
36,
20032,
17941,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
575,
62,
50084,
62,
51,
6465,
62,
5188,
2390,
62,
2937,
11879,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
6739,
628,
220,
220,
220,
6460,
12,
7752,
12003,
62,
23893,
796,
705,
1,
2,
2943,
43001,
62,
5188,
2390,
62,
2937,
11879,
6,
22492,
15285,
62,
32541,
13,
198,
220,
220,
220,
6460,
12,
40223,
62,
400,
10126,
62,
49283,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
6460,
12,
400,
10126,
796,
657,
13,
198,
220,
220,
220,
6460,
12,
22897,
341,
796,
930,
90,
269,
62,
31628,
62,
6978,
12,
42116,
1782,
9288,
12,
325,
321,
12,
26060,
13,
9132,
91,
13,
628,
220,
220,
220,
900,
62,
9122,
62,
20500,
7,
705,
1,
51,
6465,
12,
5188,
2390,
1,
2643,
815,
645,
2392,
307,
973,
13679,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
10104,
62,
83,
482,
641,
13,
198,
220,
220,
220,
5870,
25171,
651,
62,
30001,
62,
8937,
7,
2643,
12,
6738,
1267,
796,
705,
51,
6465,
12,
5188,
2390,
4458,
628,
220,
220,
220,
42865,
7,
9122,
62,
11250,
3924,
8,
796,
4886,
62,
9122,
62,
11250,
3924,
7,
2643,
6739,
628,
220,
220,
220,
5298,
62,
18224,
7,
2643,
62,
5715,
796,
2643,
12,
5715,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2643,
62,
9630,
796,
6376,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2643,
62,
6738,
796,
2643,
12,
6738,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2198,
62,
11250,
3924,
796,
2198,
62,
11250,
3924,
6739,
198,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
"! Example annotation with one attribute
CLASS zcl_aap_example_annotation DEFINITION
PUBLIC
FINAL
INHERITING FROM zcl_aap_annotation_base
CREATE PUBLIC
GLOBAL FRIENDS zif_aap_annotation_resolver.
PUBLIC SECTION.
DATA:
mv_attribute TYPE string VALUE `Initial value` READ-ONLY.
PROTECTED SECTION.
METHODS:
get_bindable_attributes REDEFINITION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_aap_example_annotation IMPLEMENTATION.
METHOD get_bindable_attributes.
* rt_attributes = VALUE #( ( CONV #( 'MV_ATTRIBUTE' ) ) ).
rt_attributes = build_attribute_list(
it_attribute_refs = VALUE #( ( REF #( mv_attribute ) ) )
io_instance = me
).
ENDMETHOD.
ENDCLASS.
| [
40484,
17934,
23025,
351,
530,
11688,
198,
31631,
1976,
565,
62,
64,
499,
62,
20688,
62,
1236,
14221,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
64,
499,
62,
1236,
14221,
62,
8692,
198,
220,
29244,
6158,
44731,
198,
220,
10188,
9864,
1847,
48167,
1677,
5258,
1976,
361,
62,
64,
499,
62,
1236,
14221,
62,
411,
14375,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
285,
85,
62,
42348,
41876,
4731,
26173,
8924,
4600,
24243,
1988,
63,
20832,
12,
1340,
11319,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
651,
62,
21653,
540,
62,
1078,
7657,
23848,
36,
20032,
17941,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
64,
499,
62,
20688,
62,
1236,
14221,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
651,
62,
21653,
540,
62,
1078,
7657,
13,
198,
9,
220,
220,
220,
374,
83,
62,
1078,
7657,
796,
26173,
8924,
1303,
7,
357,
7102,
53,
1303,
7,
705,
44,
53,
62,
1404,
5446,
9865,
37780,
6,
1267,
1267,
6739,
198,
220,
220,
220,
374,
83,
62,
1078,
7657,
796,
1382,
62,
42348,
62,
4868,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
42348,
62,
5420,
82,
796,
26173,
8924,
1303,
7,
357,
4526,
37,
1303,
7,
285,
85,
62,
42348,
1267,
1267,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
39098,
220,
220,
220,
220,
220,
220,
796,
502,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6739,
198,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*----------------------------------------------------------------------*
* CLASS lcl_Test DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS ltcl_test DEFINITION FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS
FINAL.
PRIVATE SECTION.
* ================
DATA: mt_code TYPE string_table,
ms_result TYPE scirest_ad,
mo_check TYPE REF TO zcl_aoc_check_01.
METHODS:
setup,
export_import FOR TESTING,
test001_01 FOR TESTING,
test001_02 FOR TESTING,
test001_03 FOR TESTING,
test001_04 FOR TESTING,
test001_05 FOR TESTING,
test001_06 FOR TESTING,
test001_07 FOR TESTING,
test001_08 FOR TESTING,
test001_09 FOR TESTING,
test001_10 FOR TESTING,
test001_11 FOR TESTING,
test001_12 FOR TESTING,
test001_13 FOR TESTING,
test001_14 FOR TESTING,
test001_15 FOR TESTING,
test001_16 FOR TESTING,
test001_17 FOR TESTING,
test001_18 FOR TESTING,
test001_19 FOR TESTING,
test001_20 FOR TESTING,
test001_21 FOR TESTING,
test001_22 FOR TESTING,
test001_23 FOR TESTING,
test001_24 FOR TESTING.
ENDCLASS. "lcl_Test
*----------------------------------------------------------------------*
* CLASS lcl_Test IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS ltcl_test IMPLEMENTATION.
* ==============================
DEFINE _code.
APPEND &1 TO mt_code.
END-OF-DEFINITION.
METHOD setup.
CREATE OBJECT mo_check.
zcl_aoc_unit_test=>set_check( mo_check ).
ENDMETHOD. "setup
METHOD export_import.
zcl_aoc_unit_test=>export_import( mo_check ).
ENDMETHOD.
METHOD test001_01.
* ===========
_code 'IF 1 = 2. '.
_code ' IF 3 = 4. '.
_code ' WRITE: ''foo''.'.
_code ' ENDIF. '.
_code 'ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD. "test1
METHOD test001_02.
* ===========
_code 'IF 1 = 2 AND 3 = 4.'.
_code ' WRITE: ''foo''. '.
_code 'ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD. "test2
METHOD test001_03.
* ===========
_code 'IF 1 = 2. '.
_code ' WRITE: ''bar''. '.
_code ' IF 3 = 4. '.
_code ' WRITE: ''foo''.'.
_code ' ENDIF. '.
_code 'ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD. "test001_03
METHOD test001_04.
* ===========
_code 'IF 1 = 2. '.
_code ' WRITE: ''foo''. '.
_code 'ENDIF. '.
_code 'IF 3 = 4. '.
_code ' WRITE: ''bar''. '.
_code 'ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD. "test001_04
METHOD test001_05.
_code 'IF 1 = 2. '.
_code ' IF 3 = 4. '.
_code ' WRITE: ''foo''.'.
_code ' ELSE. '.
_code ' WRITE: ''bar''.'.
_code ' ENDIF. '.
_code 'ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD. "test001_05
METHOD test001_06.
_code 'IF 1 = 2. '.
_code ' IF 3 = 4. '.
_code ' WRITE: ''foo''.'.
_code ' ENDIF. '.
_code ' IF 5 = 7. '.
_code ' WRITE: ''bar''.'.
_code ' ENDIF. '.
_code 'ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD. "test001_06
METHOD test001_07.
_code 'IF 1 = 2. '.
_code ' WRITE: ''foo''. '.
_code ' IF 1 = 2. '.
_code ' IF 3 = 4. '.
_code ' WRITE: ''foo''.'.
_code ' ENDIF. '.
_code ' ENDIF. '.
_code ' WRITE: ''foo''. '.
_code 'ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD. "test001_07
METHOD test001_08.
_code 'IF 1 = 2. '.
_code ' WRITE: ''foo''. '.
_code 'ELSE. '.
_code ' IF 3 = 4. '.
_code ' WRITE: ''foo''.'.
_code ' ELSE. '.
_code ' WRITE: ''foo''.'.
_code ' ENDIF. '.
_code 'ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD.
METHOD test001_09.
_code 'IF 1 = 2. '.
_code ' WRITE: ''foo''. '.
_code 'ELSEIF 3 = 4. '.
_code ' WRITE: ''foo''. '.
_code 'ELSE. '.
_code ' WRITE: ''foo''. '.
_code 'ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
METHOD test001_10.
_code 'IF 1 = 2. '.
_code ' WRITE: ''foo''. '.
_code 'ELSE. '.
_code ' IF 3 = 4. '.
_code ' WRITE: ''foo''.'.
_code ' ELSE. '.
_code ' WRITE: ''foo''.'.
_code ' ENDIF. '.
_code ' WRITE: ''foo''. '.
_code 'ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
METHOD test001_11.
_code 'LOOP AT lt_foo ASSIGNING <ls_foo>.'.
_code ' IF 1 = 2.'.
_code ' CONTINUE.'.
_code ' ENDIF.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
METHOD test001_12.
_code 'IF 1 = 2.'.
_code ' IF 3 = 4.'.
_code ' WRITE: ''foo''.'.
_code ' ENDIF.'.
_code 'ELSEIF 5 = 6.'.
_code ' IF 7 = 8.'.
_code ' WRITE: ''foo''.'.
_code ' ENDIF.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
METHOD test001_13.
_code ' IF 1 = ''a''. '.
_code ' " comment '.
_code ' IF 1 = 2. '.
_code ' ENDIF. '.
_code ' ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD.
METHOD test001_14.
_code ' IF 1 = ''a''. '.
_code '* comment '.
_code ' IF 1 = 2. '.
_code ' ENDIF. '.
_code ' ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD.
METHOD test001_15.
_code ' IF 1 = ''a''. '.
_code '* comment1 '.
_code '* comment2 '.
_code ' IF 1 = 2. '.
_code ' ENDIF. '.
_code ' ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD.
METHOD test001_16.
_code ' IF 1 = " comment'.
_code '''a''. '.
_code ' IF 1 = 2. '.
_code ' ENDIF. '.
_code ' ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD.
METHOD test001_17.
_code 'IF sy-subrc <> 0.'.
_code ' MESSAGE ''foobar'' TYPE ''E''.'.
_code 'ENDIF.'.
_code 'IF 1 = 2.'.
_code ' " blah'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
METHOD test001_18.
_code ' IF 1 = ''a''. '.
_code ' IF 1 = 2. '.
_code ' WRITE foo.'.
_code ' WRITE bar.'.
_code ' ENDIF. '.
_code '* comment1 '.
_code ' ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD.
METHOD test001_19.
_code 'IF 1 = 2. '.
_code ' WRITE foo. '.
_code 'ELSE. '.
_code ' IF 1 = 2. '.
_code ' WRITE foo. '.
_code ' ELSEIF 1 = 2.'.
_code ' WRITE foo. '.
_code ' ENDIF. '.
_code '* comment '.
_code 'ENDIF. '.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD.
METHOD test001_20.
_code 'IF 1 = 2.'.
_code 'ELSEIF lv_string IS INITIAL.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
METHOD test001_21.
_code 'IF ws_layo-cwidth_opt IS INITIAL.'.
_code ' IF ls_fcat-col_opt IS NOT INITIAL.'.
_code ' ls_fieldcatalog-is_optimized = abap_true.'.
_code ' ENDIF.'.
_code 'ELSE.'.
_code ' ls_fieldcatalog-is_optimized = abap_true.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
METHOD test001_22.
_code 'IF iv_mode = blah.'.
_code ' lv_count = lines( lt_dates ). " sdf'.
_code ' IF lv_count = 1. " dsf'.
_code ' EXIT.'.
_code ' ELSEIF lv_count > 1. " sdf'.
_code ' WRITE foo.'.
_code ' ENDIF.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
METHOD test001_23.
_code 'IF iv_mode = blah.'.
_code ' IF lv_count = 1. " dsf'.
_code ' EXIT.'.
_code ' ELSEIF lv_count > 1. " sdf'.
_code ' WRITE foo.'.
_code ' ENDIF.'.
_code 'ELSE.'.
_code ' lv_count = lines( lt_dates ). " sdf'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
METHOD test001_24.
_code 'DATA: iv_commit TYPE zcommit_type,'.
_code ' lv_message TYPE string,'.
_code ' lv_dummy_message TYPE string ##NEEDED.'.
_code ''.
_code 'IF iv_commit IS INITIAL.'.
_code ' lv_message = ''foobar'' ##NO_TEXT.'.
_code 'ENDIF.'.
_code ''.
_code 'IF 2 = 2.'.
_code ' WRITE iv_commit.'.
_code ' IF sy-subrc EQ 0.'.
_code ' WRITE iv_commit.'.
_code ' ELSE.'.
_code ' WRITE iv_commit.'.
_code ' IF sy-subrc NE 0.'.
_code ' " blah blah'.
_code ' WRITE iv_commit.'.
_code ' ENDIF.'.
_code ' ENDIF.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
ENDCLASS. "lcl_Test
| [
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
14402,
5550,
20032,
17941,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
31631,
300,
83,
565,
62,
9288,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
198,
220,
25261,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
9,
796,
25609,
18604,
628,
220,
220,
220,
42865,
25,
45079,
62,
8189,
220,
220,
41876,
4731,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13845,
62,
20274,
41876,
629,
557,
301,
62,
324,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6941,
62,
9122,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
9122,
62,
486,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
10784,
62,
11748,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
486,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
2999,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
3070,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
3023,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
2713,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
3312,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
2998,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
2919,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
2931,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
940,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
1157,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
1065,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
1485,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
1415,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
1314,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
1433,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
1558,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
1507,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
1129,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
1238,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
2481,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
1828,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
1954,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
1731,
7473,
43001,
2751,
13,
198,
198,
10619,
31631,
13,
220,
220,
220,
220,
220,
220,
366,
75,
565,
62,
14402,
198,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
14402,
30023,
2538,
10979,
6234,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
31631,
300,
83,
565,
62,
9288,
30023,
2538,
10979,
6234,
13,
198,
9,
36658,
25609,
28,
628,
220,
23449,
8881,
4808,
8189,
13,
198,
220,
220,
220,
43504,
10619,
1222,
16,
5390,
45079,
62,
8189,
13,
198,
220,
23578,
12,
19238,
12,
7206,
20032,
17941,
13,
628,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
6941,
62,
9122,
13,
198,
220,
220,
220,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
2617,
62,
9122,
7,
6941,
62,
9122,
6739,
198,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
40406,
628,
220,
337,
36252,
10784,
62,
11748,
13,
198,
220,
220,
220,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
39344,
62,
11748,
7,
6941,
62,
9122,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
8298,
62,
486,
13,
198,
9,
796,
2559,
855,
628,
220,
220,
220,
4808,
8189,
705,
5064,
352,
796,
362,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45302,
198,
220,
220,
220,
4808,
8189,
705,
220,
16876,
513,
796,
604,
13,
220,
220,
220,
220,
220,
220,
220,
45302,
198,
220,
220,
220,
4808,
8189,
705,
220,
220,
220,
44423,
25,
10148,
21943,
7061,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
220,
23578,
5064,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45302,
198,
220,
220,
220,
4808,
8189,
705,
10619,
5064,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45302,
628,
220,
220,
220,
13845,
62,
20274,
796,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
9122,
7,
45079,
62,
8189,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
1033,
796,
705,
8298,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
719,
796,
13845,
62,
20274,
12,
8189,
6739,
628,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9288,
16,
628,
220,
337,
36252,
1332,
8298,
62,
2999,
13,
198,
9,
796,
2559,
855,
628,
220,
220,
220,
4808,
8189,
705,
5064,
352,
796,
362,
5357,
513,
796,
604,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
220,
44423,
25,
10148,
21943,
35384,
220,
45302,
198,
220,
220,
220,
4808,
8189,
705,
10619,
5064,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45302,
628,
220,
220,
220,
13845,
62,
20274,
796,
1976,
565
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_dbbr_virtual_elem_handler DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
"! <p class="shorttext synchronized" lang="en">Determine fields needed for virtual element calculation</p>
"!
"! @parameter it_fields | <p class="shorttext synchronized" lang="en">Field list</p>
"! @parameter io_cds_view | <p class="shorttext synchronized" lang="en">CDS view name</p>
"! @parameter rt_requested_elements | <p class="shorttext synchronized" lang="en">List of requested elements</p>
METHODS determine_requested_elements
IMPORTING
io_cds_view TYPE REF TO zcl_sat_cds_view
it_fields TYPE zdbbr_tabfield_info_ui_itab
RETURNING
VALUE(rt_requested_elements) TYPE stringtab.
"! <p class="shorttext synchronized" lang="en">Determine if virtual element calculation is needed</p>
"!
"! @parameter iv_entity_name | <p class="shorttext synchronized" lang="en">CDS view name</p>
"! @parameter it_fields | <p class="shorttext synchronized" lang="en">Field list</p>
"! @raising zcx_dbbr_application_exc | <p class="shorttext synchronized" lang="en">DB browser exception</p>
METHODS adjust_requested
IMPORTING
iv_entity_name TYPE zsat_cds_view_name
it_fields TYPE zdbbr_tabfield_info_ui_itab
RAISING
zcx_dbbr_application_exc.
"! <p class="shorttext synchronized" lang="en">Calculate virtual elements</p>
"!
"! @parameter iv_entity_name | <p class="shorttext synchronized" lang="en">CDS view name</p>
"! @parameter ct_data | <p class="shorttext synchronized" lang="en">List of data </p>
"! @raising zcx_dbbr_application_exc | <p class="shorttext synchronized" lang="en">DB browser exception</p>
METHODS calculate_elements
IMPORTING
iv_entity_name TYPE zsat_cds_view_name
CHANGING
ct_data TYPE REF TO data
RAISING
zcx_dbbr_application_exc.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES ty_t_sorted_string TYPE SORTED TABLE OF string WITH UNIQUE DEFAULT KEY.
CONSTANTS:
BEGIN OF c_annotation_objectmodel,
virtual_elem_calc_by TYPE string VALUE 'OBJECTMODEL.VIRTUALELEMENTCALCULATEDBY',
END OF c_annotation_objectmodel,
c_meth_get_calculation_info TYPE string VALUE 'IF_SADL_EXIT_CALC_ELEMENT_READ~GET_CALCULATION_INFO'.
DATA mo_sadl_exit_handler TYPE REF TO lcl_sadl_exit_handler.
"! <p class="shorttext synchronized" lang="en">Get sadl exit handler instance</p>
"!
"! @parameter iv_entity_name | <p class="shorttext synchronized" lang="en">CDS view name</p>
"! @parameter ro_sadl_exit_handler | <p class="shorttext synchronized" lang="en">Reference to SADL exit handler</p>
METHODS get_sadl_exit_handler
IMPORTING
iv_entity_name TYPE zsat_cds_view_name
RETURNING
VALUE(ro_sadl_exit_handler) TYPE REF TO lcl_sadl_exit_handler.
ENDCLASS.
CLASS zcl_dbbr_virtual_elem_handler IMPLEMENTATION.
METHOD get_sadl_exit_handler.
IF mo_sadl_exit_handler IS INITIAL.
mo_sadl_exit_handler = NEW #( iv_entity_name ).
ENDIF.
ro_sadl_exit_handler = mo_sadl_exit_handler.
ENDMETHOD.
METHOD determine_requested_elements.
DATA: lt_exit_class TYPE TABLE OF classname,
lo_exit_class TYPE REF TO object,
lt_requested_elements TYPE ty_t_sorted_string.
DATA(lt_annotation) = io_cds_view->get_annotations(
it_annotation_name = VALUE #( ( sign = 'I' option = 'EQ' low = c_annotation_objectmodel-virtual_elem_calc_by ) ) ).
LOOP AT lt_annotation ASSIGNING FIELD-SYMBOL(<ls_annotation>).
IF line_exists( it_fields[ fieldname = <ls_annotation>-fieldname ] ).
lt_exit_class = VALUE #( BASE lt_exit_class ( CONV #( <ls_annotation>-value+5 ) ) ).
ENDIF.
ENDLOOP.
SORT lt_exit_class.
DELETE ADJACENT DUPLICATES FROM lt_exit_class.
DATA(lt_calc_elements) = VALUE ty_t_sorted_string(
FOR ls_field IN it_fields WHERE ( is_text_field = abap_false ) ( CONV #( ls_field-fieldname ) ) ).
LOOP AT lt_exit_class ASSIGNING FIELD-SYMBOL(<lv_exit_class>).
TRY.
CREATE OBJECT lo_exit_class TYPE (<lv_exit_class>).
CALL METHOD lo_exit_class->(c_meth_get_calculation_info)
EXPORTING
it_requested_calc_elements = lt_calc_elements
iv_entity = CONV string( io_cds_view->mv_view_name )
IMPORTING
et_requested_orig_elements = lt_requested_elements.
CATCH cx_sy_create_object_error
cx_sy_ref_is_initial
cx_sy_dyn_call_error.
ENDTRY.
rt_requested_elements = VALUE #( BASE rt_requested_elements ( LINES OF lt_requested_elements ) ).
ENDLOOP.
ENDMETHOD.
METHOD calculate_elements.
get_sadl_exit_handler( iv_entity_name )->calculate_elements( CHANGING ct_data = ct_data ).
ENDMETHOD.
METHOD adjust_requested.
DATA(lt_requested) = VALUE stringtab( FOR ls_field IN it_fields ( CONV #( ls_field-fieldname ) ) ).
get_sadl_exit_handler( iv_entity_name )->adjust_requested( CHANGING ct_requested_element = lt_requested ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
9945,
1671,
62,
32844,
62,
68,
10671,
62,
30281,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
35,
2357,
3810,
7032,
2622,
329,
7166,
5002,
17952,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
340,
62,
25747,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
15878,
1351,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
33245,
62,
66,
9310,
62,
1177,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
34,
5258,
1570,
1438,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
374,
83,
62,
25927,
276,
62,
68,
3639,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
8053,
286,
9167,
4847,
3556,
79,
29,
198,
220,
220,
220,
337,
36252,
50,
5004,
62,
25927,
276,
62,
68,
3639,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
66,
9310,
62,
1177,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
49720,
62,
66,
9310,
62,
1177,
198,
220,
220,
220,
220,
220,
220,
220,
340,
62,
25747,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
9945,
1671,
62,
8658,
3245,
62,
10951,
62,
9019,
62,
270,
397,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
25927,
276,
62,
68,
3639,
8,
41876,
4731,
8658,
13,
628,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
35,
2357,
3810,
611,
7166,
5002,
17952,
318,
2622,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
26858,
62,
3672,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
34,
5258,
1570,
1438,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
340,
62,
25747,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
15878,
1351,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
2488,
32741,
1976,
66,
87,
62,
9945,
1671,
62,
31438,
62,
41194,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
11012,
6444,
6631,
3556,
79,
29,
198,
220,
220,
220,
337,
36252,
50,
4532,
62,
25927,
276,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
26858,
62,
3672,
41876,
1976,
49720,
62,
66,
9310,
62,
1177,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
340,
62,
25747,
220,
220,
220,
220,
220,
41876,
1976,
9945,
1671,
62,
8658,
3245,
62,
10951,
62,
9019,
62,
270,
397,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
9945,
1671,
62,
31438,
62,
41194,
13,
628,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
9771,
3129,
378,
7166,
4847,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
26858,
62,
3672,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
34,
5258,
1570,
1438,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
269,
83,
62,
7890,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
8053,
286,
1366,
7359,
79,
29,
198,
220,
220,
220,
366,
0,
2488,
32741,
1976,
66,
87,
62,
9945,
1671,
62,
31438,
62,
41194,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
11012,
6444,
6631,
3556,
79,
29,
198,
220,
220,
220,
337,
36252,
50,
15284,
62,
68,
3639,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
26858,
62,
3672,
41876,
1976,
49720,
62,
66,
9310,
62,
1177,
62,
3672,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
269,
83,
62,
7890,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1366,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
9945,
1671,
62,
31438,
62,
41194,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
1259,
62,
83,
62,
82,
9741,
62,
8841,
41876,
311,
9863,
1961,
43679,
3963,
4731,
13315,
4725,
33866,
8924,
5550,
38865,
35374,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
1236,
14221,
62,
15252,
19849,
11,
198,
220,
220,
220,
220,
220,
220,
220,
7166,
62,
68,
10671,
62,
9948,
66,
62,
1525,
41876,
4731,
26173,
8924,
705,
9864,
23680,
33365,
3698,
13,
53,
48771,
52,
21358,
2538,
10979,
34,
1847,
34,
6239,
11617,
17513,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
1236,
14221,
62,
15252,
19849,
11,
198,
220,
220,
220,
220,
220,
269,
62,
76,
2788,
62,
1136,
62,
9948,
14902,
62,
10951,
41876,
4731,
26173,
8924,
705,
5064,
62,
50,
2885,
43,
62,
6369,
2043,
62,
34,
1847,
34,
62,
36,
2538,
10979,
62,
15675,
93,
18851,
62,
34,
1847,
34,
6239,
6234,
62,
10778,
4458,
628,
220,
220,
220,
42865,
6941,
62,
82,
324,
75,
62,
37023,
62,
30281,
41876,
4526,
37,
5390,
300,
565,
62,
82,
324,
75,
62,
37023,
62,
30281,
13,
628,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
3855,
6507,
75,
8420,
21360,
4554,
3556,
79,
29
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
FUNCTION-POOL zgtt_sof. "MESSAGE-ID ..
TYPE-POOLS:
trxas,
abap.
TYPES: BEGIN OF gtys_vtts_vtsp,
tsrfo TYPE tsrfo.
INCLUDE STRUCTURE vtspvb.
TYPES: END OF gtys_vtts_vtsp.
TYPES: gtyt_vtts_vtsp TYPE STANDARD TABLE OF gtys_vtts_vtsp.
TYPES: gtyt_message_log TYPE STANDARD TABLE OF bapiret2.
DATA:
gv_evtcnt TYPE /saptrx/evtcnt. "#EC NEEDED
CONSTANTS:
* General
gc_true TYPE boole_d VALUE 'X',
gc_false TYPE boole_d VALUE ' ',
gc_true_condition TYPE char1 VALUE 'T',
gc_false_condition TYPE char1 VALUE 'F',
gc_insert TYPE updkz_d VALUE 'I',
gc_update TYPE updkz_d VALUE 'U',
gc_delete TYPE updkz_d VALUE 'D',
gc_aot_yn_ote TYPE /saptrx/aotype VALUE 'YN_OTE',
gc_complete TYPE char1 VALUE 'C',
gc_partyp_cntl TYPE /saptrx/aspartyp VALUE 'C',
gc_partyp_evt TYPE /saptrx/aspartyp VALUE ' ',
gc_act_set TYPE /saptrx/action VALUE 'S',
gc_act_change TYPE /saptrx/action VALUE 'C',
gc_datacs_dlv TYPE /saptrx/data_code_set VALUE 'DLV',
gc_datacs_bill TYPE /saptrx/data_code_set VALUE 'BILL',
gc_msg_class TYPE symsgid VALUE '/SAPTRX/ASC',
gc_msg_type_e TYPE bapi_mtype VALUE 'E',
gc_msg_val_aot TYPE symsgv VALUE 'AOT',
gc_msg_val_et TYPE symsgv VALUE 'ET',
gc_msg_no_087 TYPE symsgno VALUE '087',
gc_msg_no_088 TYPE symsgno VALUE '088',
* Business Process Type
gc_bpt_sales_order_header_new TYPE /saptrx/strucdataname VALUE 'SALES_ORDER_HEADER_NEW',
gc_bpt_sales_order_header_old TYPE /saptrx/strucdataname VALUE 'SALES_ORDER_HEADER_OLD',
gc_bpt_sales_order_items_new TYPE /saptrx/strucdataname VALUE 'SALES_ORDER_ITEMS_NEW',
gc_bpt_sales_order_items_old TYPE /saptrx/strucdataname VALUE 'SALES_ORDER_ITEMS_OLD',
gc_bpt_schedule_line_item_new TYPE /saptrx/strucdataname VALUE 'SCHEDULE_LINE_ITEMS_NEW',
gc_bpt_schedule_line_item_old TYPE /saptrx/strucdataname VALUE 'SCHEDULE_LINE_ITEMS_OLD',
gc_bpt_business_data_new TYPE /saptrx/strucdataname VALUE 'BUSINESS_DATA_NEW',
gc_bpt_business_data_old TYPE /saptrx/strucdataname VALUE 'BUSINESS_DATA_OLD',
gc_bpt_partners_new TYPE /saptrx/strucdataname VALUE 'PARTNERS_NEW',
gc_bpt_partners_old TYPE /saptrx/strucdataname VALUE 'PARTNERS_OLD',
gc_bpt_header_status_new TYPE /saptrx/strucdataname VALUE 'HEADER_STATUS_NEW',
gc_bpt_header_status_old TYPE /saptrx/strucdataname VALUE 'HEADER_STATUS_OLD',
gc_bpt_item_status_new TYPE /saptrx/strucdataname VALUE 'ITEM_STATUS_NEW',
gc_bpt_item_status_old TYPE /saptrx/strucdataname VALUE 'ITEM_STATUS_OLD',
gc_bpt_document_flow_new TYPE /saptrx/strucdataname VALUE 'DOCUMENT_FLOW_NEW',
gc_bpt_document_flow_old TYPE /saptrx/strucdataname VALUE 'DOCUMENT_FLOW_OLD',
gc_bpt_delivery_item_new TYPE /saptrx/strucdataname VALUE 'DELIVERY_ITEM_NEW',
gc_bpt_delivery_item_old TYPE /saptrx/strucdataname VALUE 'DELIVERY_ITEM_OLD',
gc_bpt_delivery_item_stat_new TYPE /saptrx/strucdataname VALUE 'DELIVERY_ITEM_STATUS_NEW',
gc_bpt_delivery_item_stat_old TYPE /saptrx/strucdataname VALUE 'DELIVERY_ITEM_STATUS_OLD',
gc_bpt_invoice_item_new TYPE /saptrx/strucdataname VALUE 'INVOICE_ITEM_NEW',
gc_bpt_invoice_header_new TYPE /saptrx/strucdataname VALUE 'INVOICE_HEADER_NEW',
gc_bpt_invoice_header_old TYPE /saptrx/strucdataname VALUE 'INVOICE_HEADER_OLD',
gc_bpt_cleared_item TYPE /saptrx/strucdataname VALUE 'CLEARED_ITEM',
gc_bpt_purchase_item_new TYPE /saptrx/strucdataname VALUE 'PURCHASE_ITEM_NEW',
gc_bpt_purchase_header_new TYPE /saptrx/strucdataname VALUE 'PURCHASE_ORDER_HEADER_NEW',
gc_bpt_purchase_header_old TYPE /saptrx/strucdataname VALUE 'PURCHASE_ORDER_HEADER_OLD',
gc_bpt_po_account_assign_new TYPE /saptrx/strucdataname VALUE 'PO_ACCOUNT_ASSIGNMENT_NEW',
gc_bpt_po_sched_line_item_new TYPE /saptrx/strucdataname VALUE 'PO_SCHED_LINE_ITEM_NEW',
gc_bpt_po_sched_line_item_old TYPE /saptrx/strucdataname VALUE 'PO_SCHED_LINE_ITEM_OLD',
gc_bpt_shipment_header_new TYPE /saptrx/strucdataname VALUE 'SHIPMENT_HEADER_NEW',
gc_bpt_shipment_header_old TYPE /saptrx/strucdataname VALUE 'SHIPMENT_HEADER_OLD',
gc_bpt_shipment_item_new TYPE /saptrx/strucdataname VALUE 'SHIPMENT_ITEM_NEW',
gc_bpt_shipment_item_old TYPE /saptrx/strucdataname VALUE 'SHIPMENT_ITEM_OLD',
gc_bpt_delivery_item TYPE /saptrx/strucdataname VALUE 'DELIVERY_ITEM',
gc_bpt_shipment_leg_new TYPE /saptrx/strucdataname VALUE 'SHIPMENT_LEG_NEW',
gc_bpt_shipment_leg_old TYPE /saptrx/strucdataname VALUE 'SHIPMENT_LEG_OLD',
gc_bpt_shipment_item_leg_new TYPE /saptrx/strucdataname VALUE 'SHIPMENT_ITEM_LEG_NEW',
gc_bpt_shipment_item_leg_old TYPE /saptrx/strucdataname VALUE 'SHIPMENT_ITEM_LEG_OLD',
gc_bpt_material_segment TYPE /saptrx/strucdataname VALUE 'MATERIAL_SEGMENT',
gc_bpt_material_header TYPE /saptrx/strucdataname VALUE 'MATERIAL_HEADER',
gc_bpt_wo_header_new TYPE /saptrx/strucdataname VALUE 'WO_HEADER_NEW',
gc_bpt_wo_header_old TYPE /saptrx/strucdataname VALUE 'WO_HEADER_OLD',
gc_bpt_wo_status_new TYPE /saptrx/strucdataname VALUE 'WO_STATUS_NEW',
gc_bpt_wo_status_old TYPE /saptrx/strucdataname VALUE 'WO_STATUS_OLD',
gc_bpt_clearing_doc_header TYPE /saptrx/strucdataname VALUE 'CLEARING_DOC_HEADER',
* Event ID
gc_evtid_yn_so_bill_blk TYPE /saptrx/ev_evtid VALUE 'YN_SO_BILL_BLK',
gc_evtid_yn_so_dlv_blk TYPE /saptrx/ev_evtid VALUE 'YN_SO_DLV_BLK',
gc_evtid_yn_so_reject TYPE /saptrx/ev_evtid VALUE 'YN_SO_REJECT',
gc_evtid_yn_dlv_gi TYPE /saptrx/ev_evtid VALUE 'YN_DLV_GI',
gc_evtid_yn_shpmt_plan TYPE /saptrx/ev_evtid VALUE 'YN_SHPMT_PLAN',
gc_evtid_yn_shpmt_start TYPE /saptrx/ev_evtid VALUE 'YN_SHPMT_START',
gc_evtid_yn_shpmt_end TYPE /saptrx/ev_evtid VALUE 'YN_SHPMT_END',
gc_evtid_yn_fi_payment TYPE /saptrx/ev_evtid VALUE 'YN_FI_PAYMENT',
* Additional constants D2O
gc_trxcod_yn_so_header TYPE /saptrx/trxcod VALUE 'YN_SO_HEADER',
gc_evtid_yn_so_ready TYPE /saptrx/ev_evtid VALUE 'YN_SO_READY',
gc_evtid_yn_so_create TYPE /saptrx/ev_evtid VALUE 'YN_SO_CREATE',
gc_evtid_yn_so_bill_unblk TYPE /saptrx/ev_evtid VALUE 'YN_SO_BILL_UNBLK',
gc_evtid_yn_so_dlv_unblk TYPE /saptrx/ev_evtid VALUE 'YN_SO_DLV_UNBLK',
gc_evtid_yn_dlv_create TYPE /saptrx/ev_evtid VALUE 'YN_SO_DLV_CREATE',
gc_bpt_delivery_header_new TYPE /saptrx/strucdataname VALUE 'DELIVERY_HEADER_NEW',
gc_bpt_delivery_header_old TYPE /saptrx/strucdataname VALUE 'DELIVERY_HEADER_OLD',
gc_bpt_delivery_hdrstatus_new TYPE /saptrx/strucdataname VALUE 'DELIVERY_HDR_STATUS_NEW',
gc_bpt_delivery_hdrstatus_old TYPE /saptrx/strucdataname VALUE 'DELIVERY_HDR_STATUS_OLD',
gc_aot_zn_ote TYPE /saptrx/aotype VALUE 'ZN_OTE',
gc_partial_dlv TYPE char1 VALUE 'B',
* Tracking Code set
gc_trxcod_yn_so_item TYPE /saptrx/trxcod VALUE 'YN_SO_ITEM',
gc_trxcod_yn_dlv_no TYPE /saptrx/trxcod VALUE 'YN_DLV_NO',
gc_trxcod_yn_bill_no TYPE /saptrx/trxcod VALUE 'YN_BILL_NO',
gc_trxcod_yn_shpmt_no TYPE /saptrx/trxcod VALUE 'YN_SHPMT_NO',
* Control Parameter Name
gc_cp_yn_so_bl_blk_ind TYPE /saptrx/paramname VALUE 'YN_SO_BL_BLK_IND',
gc_cp_yn_so_dl_blk_ind TYPE /saptrx/paramname VALUE 'YN_SO_DL_BLK_IND',
gc_cp_yn_so_dl_blk_full TYPE /saptrx/paramname VALUE 'YN_SO_FULL_DL_BLK_IND',
gc_cp_yn_so_dl_compl TYPE /saptrx/paramname VALUE 'YN_SO_DL_COMPL',
gc_cp_yn_so_incoterm1 TYPE /saptrx/paramname VALUE 'YN_SO_INCOTERM1',
gc_cp_yn_so_incotermloc1 TYPE /saptrx/paramname VALUE 'YN_SO_INCOTERM_LOCATION',
gc_cp_yn_so_incotermversion TYPE /saptrx/paramname VALUE 'YN_SO_INCOTERM_VERSION',
gc_cp_yn_so_incoterm2 TYPE /saptrx/paramname VALUE 'YN_SO_INCOTERM2',
gc_cp_yn_so_po_no TYPE /saptrx/paramname VALUE 'YN_SO_PO_NO',
gc_cp_yn_so_po_date TYPE /saptrx/paramname VALUE 'YN_SO_PO_DATE',
gc_cp_yn_so_bill_date TYPE /saptrx/paramname VALUE 'YN_SO_BILL_DATE',
gc_cp_yn_so_cust_grp TYPE /saptrx/paramname VALUE 'YN_SO_CUST_GRP',
gc_cp_yn_so_ship_to TYPE /saptrx/paramname VALUE 'YN_SO_SHIPTO',
gc_cp_yn_so_ship_to_txt TYPE /saptrx/paramname VALUE 'YN_SO_SHIPTO_TXT',
gc_cp_yn_so_sold_to TYPE /saptrx/paramname VALUE 'YN_SO_SOLDTO',
gc_cp_yn_so_sold_to_txt TYPE /saptrx/paramname VALUE 'YN_SO_SOLDTO_TXT',
gc_cp_yn_so_sold_to_mail TYPE /saptrx/paramname VALUE 'YN_SO_SOLDTO_MAIL',
gc_cp_yn_so_bill_to TYPE /saptrx/paramname VALUE 'YN_SO_BILLTO',
gc_cp_yn_so_bill_to_txt TYPE /saptrx/paramname VALUE 'YN_SO_BILLTO_TXT',
gc_cp_yn_so_payer TYPE /saptrx/paramname VALUE 'YN_SO_PAYER',
gc_cp_yn_so_payer_txt TYPE /saptrx/paramname VALUE 'YN_SO_PAYER_TXT',
gc_cp_yn_so_fwd TYPE /saptrx/paramname VALUE 'YN_SO_FWD',
gc_cp_yn_so_fwd_txt TYPE /saptrx/paramname VALUE 'YN_SO_FWD_TXT',
gc_cp_yn_so_full_dlv TYPE /saptrx/paramname VALUE 'YN_SO_FULL_DLV_IND',
gc_cp_yn_so_subseq_doc_ind TYPE /saptrx/paramname VALUE 'YN_SO_SUBSEQ_DOC_IND',
gc_cp_yn_shpmt_no TYPE /saptrx/paramname VALUE 'YN_SHPMT_NO',
gc_cp_yn_shpmt_cont_id TYPE /saptrx/paramname VALUE 'YN_SHPMT_CONT_ID',
gc_cp_yn_account_no TYPE /saptrx/paramname VALUE 'YN_ACCOUNT_NO',
gc_cp_yn_so_no TYPE /saptrx/paramname VALUE 'YN_SO_NO',
gc_cp_yn_so_item_no TYPE /saptrx/paramname VALUE 'YN_SO_ITEM_NO',
gc_cp_yn_material_no TYPE /saptrx/paramname VALUE 'YN_MATERIAL_NO',
gc_cp_yn_material_txt TYPE /saptrx/paramname VALUE 'YN_MATERIAL_TXT',
gc_cp_yn_plant TYPE /saptrx/paramname VALUE 'YN_PLANT',
gc_cp_yn_quantity TYPE /saptrx/paramname VALUE 'YN_QUANTITY',
gc_cp_yn_pick_quantity TYPE /saptrx/paramname VALUE 'YN_PICK_QUANTITY',
gc_cp_yn_pack_quantity TYPE /saptrx/paramname VALUE 'YN_PACK_QUANTITY',
gc_cp_yn_pod_quantity TYPE /saptrx/paramname VALUE 'YN_POD_QUANTITY',
gc_cp_yn_qty_unit TYPE /saptrx/paramname VALUE 'YN_QTY_UNIT',
gc_cp_yn_ean_upc TYPE /saptrx/paramname VALUE 'YN_EAN_UPC',
gc_cp_yn_net_value TYPE /saptrx/paramname VALUE 'YN_NET_VALUE',
gc_cp_yn_reject_status TYPE /saptrx/paramname VALUE 'YN_REJECTION_STATUS',
gc_cp_yn_net_value_curr TYPE /saptrx/paramname VALUE 'YN_NET_VALUE_CURRENCY',
gc_cp_yn_doc_date TYPE /saptrx/paramname VALUE 'YN_DOCUMENT_DATE',
gc_cp_yn_act_datetime TYPE /saptrx/paramname VALUE 'ACTUAL_BUSINESS_DATETIME',
gc_cp_yn_act_timezone TYPE /saptrx/paramname VALUE 'ACTUAL_BUSINESS_TIMEZONE',
gc_cp_yn_de_no TYPE /saptrx/paramname VALUE 'YN_DLV_NO',
gc_cp_yn_de_item_no TYPE /saptrx/paramname VALUE 'YN_DLV_ITEM_NO',
gc_cp_yn_de_ship_to TYPE /saptrx/paramname VALUE 'YN_DLV_SHIPTO',
gc_cp_yn_de_plndelivery_date TYPE /saptrx/paramname VALUE 'YN_DLV_PLAN_DELIVERY_DATE',
gc_cp_yn_de_tot_weight TYPE /saptrx/paramname VALUE 'YN_DLV_TOTAL_WEIGHT',
gc_cp_yn_de_gross_weight TYPE /saptrx/paramname VALUE 'YN_DLV_GROSS_WEIGHT',
gc_cp_yn_de_net_weight TYPE /saptrx/paramname VALUE 'YN_DLV_NET_WEIGHT',
gc_cp_yn_de_tot_weight_uom TYPE /saptrx/paramname VALUE 'YN_DLV_TOTAL_WEIGHT_UOM',
gc_cp_yn_de_gross_weight_uom TYPE /saptrx/paramname VALUE 'YN_DLV_GROSS_WEIGHT_UOM',
gc_cp_yn_de_vol TYPE /saptrx/paramname VALUE 'YN_DLV_VOLUME',
gc_cp_yn_de_vol_uom TYPE /saptrx/paramname VALUE 'YN_DLV_VOLUME_UOM',
gc_cp_yn_dgoods TYPE /saptrx/paramname VALUE 'YN_DLV_DANGEROUS_GOODS',
gc_cp_yn_de_pick_status TYPE /saptrx/paramname VALUE 'YN_DLV_PICK_STATUS',
gc_cp_yn_de_pack_status TYPE /saptrx/paramname VALUE 'YN_DLV_PACK_STATUS',
gc_cp_yn_de_trans_status TYPE /saptrx/paramname VALUE 'YN_DLV_TRANSPORTATION_STATUS',
gc_cp_yn_de_gi_status TYPE /saptrx/paramname VALUE 'YN_DLV_GOODS_ISSUE_STATUS',
gc_cp_yn_de_pod_status TYPE /saptrx/paramname VALUE 'YN_DLV_POD_STATUS',
gc_cp_yn_de_asso_soitem_no TYPE /saptrx/paramname VALUE 'YN_DLV_ASSO_SOITEM_NO',
gc_cp_yn_de_warehouse_no TYPE /saptrx/paramname VALUE 'YN_DLV_WAREHOUSE_NO',
gc_cp_yn_de_door_no TYPE /saptrx/paramname VALUE 'YN_DLV_DOOR_NO',
gc_cp_yn_de_door_txt TYPE /saptrx/paramname VALUE 'YN_DLV_DOOR_TEXT',
gc_cp_yn_de_shp_pnt TYPE /saptrx/paramname VALUE 'YN_DLV_SHIPPING_POINT',
gc_cp_yn_de_shp_pnt_loctype TYPE /saptrx/paramname VALUE 'YN_DLV_DEPARTURE_LOCATION_TYPE',
gc_cp_yn_de_shp_addr TYPE /saptrx/paramname VALUE 'YN_DLV_DEPARTURE_ADDRESS',
gc_cp_yn_de_shp_countryiso TYPE /saptrx/paramname VALUE 'YN_DLV_DEPARTURE_COUNTRY',
gc_cp_yn_de_dest TYPE /saptrx/paramname VALUE 'YN_DLV_DESTINATION',
gc_cp_yn_de_dest_loctype TYPE /saptrx/paramname VALUE 'YN_DLV_DESTINATION_LOCATION_TYPE',
gc_cp_yn_de_dest_addr TYPE /saptrx/paramname VALUE 'YN_DLV_DESTINATION_ADDRESS',
gc_cp_yn_de_dest_countryiso TYPE /saptrx/paramname VALUE 'YN_DLV_DESTINATION_COUNTRY',
gc_cp_yn_de_dest_email TYPE /saptrx/paramname VALUE 'YN_DLV_DESTINATION_EMAIL',
gc_cp_yn_de_dest_tele TYPE /saptrx/paramname VALUE 'YN_DLV_DESTINATION_TELEPHONE',
gc_cp_yn_de_bol_no TYPE /saptrx/paramname VALUE 'YN_DLV_BILL_OF_LADING',
gc_cp_yn_de_inco1 TYPE /saptrx/paramname VALUE 'YN_DLV_INCOTERMS',
gc_cp_yn_de_inco2_l TYPE /saptrx/paramname VALUE 'YN_DLV_INCO_LOCATION',
gc_cp_yn_de_incov TYPE /saptrx/paramname VALUE 'YN_DLV_INCO_VERSION',
gc_cp_yn_shp_no TYPE /saptrx/paramname VALUE 'YN_SHP_NO',
gc_cp_yn_shp_sa_erp_id TYPE /saptrx/paramname VALUE 'YN_SHP_SA_ERP_ID',
gc_cp_yn_shp_sa_lbn_id TYPE /saptrx/paramname VALUE 'YN_SHP_SA_LBN_ID',
gc_cp_yn_shp_contain_dg TYPE /saptrx/paramname VALUE 'YN_SHP_CONTAIN_DGOODS',
gc_cp_yn_shp_inco1 TYPE /saptrx/paramname VALUE 'YN_SHP_INCOTERMS',
gc_cp_yn_shp_fa_track_id TYPE /saptrx/paramname VALUE 'YN_SHP_FA_TRACKING_ID',
gc_cp_yn_shp_shipping_type TYPE /saptrx/paramname VALUE 'YN_SHP_SHIPPING_TYPE',
gc_cp_yn_shp_trans_mode TYPE /saptrx/paramname VALUE 'YN_SHP_TRANSPORTATION_MODE',
gc_cp_yn_shp_container_id TYPE /saptrx/paramname VALUE 'YN_SHP_CONTAINER_ID',
gc_cp_yn_shp_truck_id TYPE /saptrx/paramname VALUE 'YN_SHP_TRUCK_ID',
gc_cp_yn_shp_res_value TYPE /saptrx/paramname VALUE 'YN_SHP_TRACKED_RESOURCE_VALUE',
gc_cp_yn_shp_res_id TYPE /saptrx/paramname VALUE 'YN_SHP_TRACKED_RESOURCE_ID',
gc_cp_yn_shp_res_tp_id TYPE /saptrx/paramname VALUE 'YN_SHP_RESOURCE_TP_ID',
gc_cp_yn_shp_res_tp_cnt TYPE /saptrx/paramname VALUE 'YN_SHP_RESOURCE_TP_LINE_COUNT',
gc_cp_yn_shp_stops_line_cnt TYPE /saptrx/paramname VALUE 'YN_SHP_LINE_COUNT',
gc_cp_yn_shp_stops_stop_id TYPE /saptrx/paramname VALUE 'YN_SHP_STOP_ID',
gc_cp_yn_shp_stops_ordinal_no TYPE /saptrx/paramname VALUE 'YN_SHP_ORDINAL_NO',
gc_cp_yn_shp_stops_loc_cat TYPE /saptrx/paramname VALUE 'YN_SHP_LOC_CATEGORY',
gc_cp_yn_shp_stops_loc_id TYPE /saptrx/paramname VALUE 'YN_SHP_LOC_ID',
gc_cp_yn_shp_stops_loc_type TYPE /saptrx/paramname VALUE 'YN_SHP_LOC_TYPE',
gc_cp_yn_shp_stops_load_pnt TYPE /saptrx/paramname VALUE 'YN_SHP_LOADING_POINT',
gc_cp_yn_shp_stops_unload_pnt TYPE /saptrx/paramname VALUE 'YN_SHP_UNLOADING_POINT',
gc_cp_yn_shp_stops_lgort TYPE /saptrx/paramname VALUE 'YN_SHP_STORAGE_LOCATION',
gc_cp_yn_shp_warehouse_no TYPE /saptrx/paramname VALUE 'YN_SHP_WAREHOUSE_NO',
gc_cp_yn_shp_gate_no TYPE /saptrx/paramname VALUE 'YN_SHP_GATE_NO',
gc_cp_yn_shp_gate_txt TYPE /saptrx/paramname VALUE 'YN_SHP_GATE_TEXT',
gc_cp_yn_shp_stage_seq TYPE /saptrx/paramname VALUE 'YN_SHP_STAGE_SEQUENCE',
gc_cp_yn_shp_stops_pln_evt_dt TYPE /saptrx/paramname VALUE 'YN_SHP_STOP_PLAN_DATETIME',
gc_cp_yn_shp_stops_pln_evt_tz TYPE /saptrx/paramname VALUE 'YN_SHP_STOP_PLAN_TIMEZONE',
gc_cp_yn_shp_stop_id TYPE /saptrx/paramname VALUE 'YN_SHP_VP_STOP_ID',
gc_cp_yn_shp_stop_id_ord_no TYPE /saptrx/paramname VALUE 'YN_SHP_VP_STOP_ORD_NO',
gc_cp_yn_shp_stop_id_loc_id TYPE /saptrx/paramname VALUE 'YN_SHP_VP_STOP_LOC_ID',
gc_cp_yn_shp_stop_id_loc_type TYPE /saptrx/paramname VALUE 'YN_SHP_VP_STOP_LOC_TYPE',
gc_cp_yn_shp_departure_dt TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_DEP_BUS_DATETIME',
gc_cp_yn_shp_departure_tz TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_DEP_BUS_TIMEZONE',
gc_cp_yn_shp_departure_locid TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_DEP_LOC_ID',
gc_cp_yn_shp_departure_loctype TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_DEP_LOC_TYPE',
gc_cp_yn_shp_arrival_dt TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_AR_BUS_DATETIME',
gc_cp_yn_shp_arrival_tz TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_AR_BUS_TIMEZONE',
gc_cp_yn_shp_arrival_locid TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_AR_LOC_ID',
gc_cp_yn_shp_arrival_loctype TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_AR_LOC_TYPE',
gc_cp_yn_so_header_item_no TYPE /saptrx/paramname VALUE 'YN_SO_HDR_ITM_NO',
gc_cp_yn_so_header_item_cnt TYPE /saptrx/paramname VALUE 'YN_SO_HDR_ITM_LINE_COUNT',
gc_cp_yn_so_schedule_item_cnt TYPE /saptrx/paramname VALUE 'YN_SO_SCH_ITM_LINE_COUNT',
gc_cp_yn_so_schedule_dlv_date TYPE /saptrx/paramname VALUE 'YN_SO_SCH_ITM_DLV_DATE',
gc_cp_yn_so_schedule_conf_qty TYPE /saptrx/paramname VALUE 'YN_SO_SCH_ITM_CONF_QTY',
gc_cp_yn_so_schedule_ordr_uom TYPE /saptrx/paramname VALUE 'YN_SO_SCH_ITM_ORDER_UOM',
gc_cp_yn_de_header_item_no TYPE /saptrx/paramname VALUE 'YN_DLV_HDR_ITM_NO',
gc_cp_yn_de_header_item_cnt TYPE /saptrx/paramname VALUE 'YN_DLV_HDR_ITM_LINE_COUNT',
gc_cp_yn_shp_dlv_no TYPE /saptrx/paramname VALUE 'YN_SHP_HDR_DLV_NO',
gc_cp_yn_shp_dlv_cnt TYPE /saptrx/paramname VALUE 'YN_SHP_HDR_DLV_LINE_COUNT',
gc_cp_yn_shp_carrier_ref_type TYPE /saptrx/paramname VALUE 'YN_SHP_CARRIER_REF_TYPE',
gc_cp_yn_shp_carrier_ref_value TYPE /saptrx/paramname VALUE 'YN_SHP_CARRIER_REF_VALUE',
* Event Message Parameters
gc_ev_yn_document TYPE /saptrx/paramname VALUE 'YN_DOCUMENT',
* Sales Order
gc_parvw_ag TYPE parvw VALUE 'AG', " Sold-to Party
gc_parvw_we TYPE parvw VALUE 'WE', " Ship-to Party
gc_parvw_re TYPE parvw VALUE 'RE', " Bill-to Party
gc_parvw_rg TYPE parvw VALUE 'RG', " Payer
gc_parvw_sp TYPE parvw VALUE 'SP', " Forwarding Agent
gc_cmgst_a TYPE cmgst VALUE 'A',
gc_cmgst_b TYPE cmgst VALUE 'B',
gc_cmgst_c TYPE cmgst VALUE 'C',
gc_cmgst_d TYPE cmgst VALUE 'D',
* Shipment
gc_leg_ind_1 TYPE laufk VALUE '1', " Preliminary Leg
gc_leg_ind_2 TYPE laufk VALUE '2', " Main leg
gc_leg_ind_3 TYPE laufk VALUE '3', " Subsequent leg
gc_leg_ind_4 TYPE laufk VALUE '4', " Direct Leg
gc_tstyp_3 TYPE tstyp VALUE '3', " Stage Category: Border
* Production Order
gc_aufty_pp TYPE auftyp VALUE '10',
gc_stat_rel TYPE j_status VALUE 'I0002',
* Purchase Order
gc_vgart_we TYPE vgart VALUE 'WE',
gc_del_loekz TYPE eloek VALUE 'L',
gc_shkzg_s TYPE shkzg VALUE 'S',
* Billing
gc_rfbsk_c TYPE rfbsk VALUE 'C',
gc_vbtyp_cancel TYPE vbtyp VALUE 'N',
* Payment
gc_koart_d TYPE koart VALUE 'D',
gc_awtyp_vbrk TYPE awtyp VALUE 'VBRK'.
| [
42296,
4177,
2849,
12,
16402,
3535,
1976,
70,
926,
62,
568,
69,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
44,
1546,
4090,
8264,
12,
2389,
11485,
198,
198,
25216,
12,
16402,
3535,
50,
25,
198,
220,
491,
87,
292,
11,
198,
220,
450,
499,
13,
198,
198,
9936,
47,
1546,
25,
347,
43312,
3963,
308,
774,
82,
62,
36540,
912,
62,
85,
912,
79,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
256,
27891,
6513,
41876,
256,
27891,
6513,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
3268,
5097,
52,
7206,
19269,
18415,
11335,
410,
912,
79,
85,
65,
13,
198,
9936,
47,
1546,
25,
220,
23578,
3963,
308,
774,
82,
62,
36540,
912,
62,
85,
912,
79,
13,
198,
9936,
47,
1546,
25,
220,
308,
774,
83,
62,
36540,
912,
62,
85,
912,
79,
41876,
49053,
9795,
43679,
3963,
308,
774,
82,
62,
36540,
912,
62,
85,
912,
79,
13,
198,
9936,
47,
1546,
25,
308,
774,
83,
62,
20500,
62,
6404,
41876,
49053,
9795,
43679,
3963,
275,
499,
557,
83,
17,
13,
628,
198,
26947,
25,
198,
220,
308,
85,
62,
1990,
23047,
429,
41876,
1220,
82,
2373,
40914,
14,
1990,
23047,
429,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
36465,
1961,
628,
198,
10943,
2257,
1565,
4694,
25,
198,
9,
3611,
198,
220,
308,
66,
62,
7942,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1489,
2305,
62,
67,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
705,
55,
3256,
198,
220,
308,
66,
62,
9562,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1489,
2305,
62,
67,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
705,
46083,
198,
220,
308,
66,
62,
7942,
62,
31448,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1149,
16,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
705,
51,
3256,
198,
220,
308,
66,
62,
9562,
62,
31448,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1149,
16,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
705,
37,
3256,
198,
220,
308,
66,
62,
28463,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
2325,
74,
89,
62,
67,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
705,
40,
3256,
198,
220,
308,
66,
62,
19119,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
2325,
74,
89,
62,
67,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
705,
52,
3256,
198,
220,
308,
66,
62,
33678,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
2325,
74,
89,
62,
67,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
705,
35,
3256,
198,
220,
308,
66,
62,
64,
313,
62,
2047,
62,
1258,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
64,
8690,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
705,
40760,
62,
23051,
3256,
198,
220,
308,
66,
62,
20751,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1149,
16,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
705,
34,
3256,
198,
220,
308,
66,
62,
3911,
4464,
62,
66,
429,
75,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
292,
3911,
4464,
220,
220,
220,
220,
220,
26173,
8924,
705,
34,
3256,
198,
220,
308,
66,
62,
3911,
4464,
62,
1990,
83,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
292,
3911,
4464,
220,
220,
220,
220,
220,
26173,
8924,
705,
46083,
198,
220,
308,
66,
62,
529,
62,
2617,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
2673,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
705,
50,
3256,
198,
220,
308,
66,
62,
529,
62,
3803,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
2673,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
705,
34,
3256,
198,
220,
308,
66,
62,
19608,
16436,
62,
67,
6780,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
7890,
62,
8189,
62,
2617,
26173,
8924,
705,
19260,
53,
3256,
198,
220,
308,
66,
62,
19608,
16436,
62,
35546,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
7890,
62,
8189,
62,
2617,
26173,
8924,
705,
39888,
3256,
198,
220,
308,
66,
62,
19662,
62,
4871,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
827,
19662,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
31051,
50,
2969,
5446,
55,
14,
42643
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ltcl_test DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
PUBLIC SECTION.
INTERFACES zif_otlp_span_processor.
PRIVATE SECTION.
METHODS trace FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_test IMPLEMENTATION.
METHOD zif_otlp_span_processor~on_end.
* todo
RETURN.
ENDMETHOD.
METHOD trace.
DATA(lo_cut) = NEW zcl_otlp_tracer_provider( ).
lo_cut->add_span_processor( me ).
DATA(lo_span) = lo_cut->get_tracer( 'tracerName' )->start_span(
iv_name = 'spanName'
iv_kind = zif_otlp_model_trace=>gc_span_kind-producer ).
lo_span->end( ).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
9288,
5550,
20032,
17941,
7473,
43001,
2751,
360,
4261,
6234,
6006,
9863,
45698,
42,
49277,
43638,
5805,
7597,
25261,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
313,
34431,
62,
12626,
62,
41341,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
12854,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
10619,
31631,
13,
628,
198,
31631,
300,
83,
565,
62,
9288,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
1976,
361,
62,
313,
34431,
62,
12626,
62,
41341,
93,
261,
62,
437,
13,
198,
9,
284,
4598,
198,
220,
220,
220,
30826,
27064,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
12854,
13,
628,
220,
220,
220,
42865,
7,
5439,
62,
8968,
8,
796,
12682,
1976,
565,
62,
313,
34431,
62,
2213,
11736,
62,
15234,
1304,
7,
6739,
198,
220,
220,
220,
2376,
62,
8968,
3784,
2860,
62,
12626,
62,
41341,
7,
502,
6739,
628,
220,
220,
220,
42865,
7,
5439,
62,
12626,
8,
796,
2376,
62,
8968,
3784,
1136,
62,
2213,
11736,
7,
705,
2213,
11736,
5376,
6,
1267,
3784,
9688,
62,
12626,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
3672,
796,
705,
12626,
5376,
6,
198,
220,
220,
220,
220,
220,
21628,
62,
11031,
796,
1976,
361,
62,
313,
34431,
62,
19849,
62,
40546,
14804,
36484,
62,
12626,
62,
11031,
12,
18230,
2189,
6739,
628,
220,
220,
220,
2376,
62,
12626,
3784,
437,
7,
6739,
628,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_user_master_record DEFINITION
PUBLIC
FINAL
CREATE PRIVATE .
PUBLIC SECTION.
CLASS-METHODS:
get_instance
IMPORTING
!iv_user TYPE uname
RETURNING
VALUE(ro_user) TYPE REF TO zcl_abapgit_user_master_record.
METHODS:
constructor
IMPORTING
!iv_user TYPE uname,
get_name
RETURNING
VALUE(rv_name) TYPE zif_abapgit_definitions=>ty_git_user-name,
get_email
RETURNING
VALUE(rv_email) TYPE zif_abapgit_definitions=>ty_git_user-email.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_user,
user TYPE uname,
o_user TYPE REF TO zcl_abapgit_user_master_record,
END OF ty_user.
CLASS-DATA:
gt_user TYPE HASHED TABLE OF ty_user
WITH UNIQUE KEY user.
DATA:
ms_user TYPE zif_abapgit_definitions=>ty_git_user.
ENDCLASS.
CLASS zcl_abapgit_user_master_record IMPLEMENTATION.
METHOD constructor.
DATA: lt_return TYPE TABLE OF bapiret2,
ls_address TYPE bapiaddr3,
lt_smtp TYPE TABLE OF bapiadsmtp,
ls_smtp TYPE bapiadsmtp,
lt_dev_clients TYPE SORTED TABLE OF mandt WITH UNIQUE KEY table_line,
lv_not_found TYPE abap_bool.
FIELD-SYMBOLS: <lv_dev_client> LIKE LINE OF lt_dev_clients.
CALL FUNCTION 'BAPI_USER_GET_DETAIL'
EXPORTING
username = iv_user
IMPORTING
address = ls_address
TABLES
return = lt_return
addsmtp = lt_smtp.
LOOP AT lt_return TRANSPORTING NO FIELDS WHERE type CA 'EA'.
lv_not_found = abap_true.
EXIT.
ENDLOOP.
IF lv_not_found = abap_false.
" Choose the first email from SU01
SORT lt_smtp BY consnumber ASCENDING.
LOOP AT lt_smtp INTO ls_smtp.
ms_user-email = ls_smtp-e_mail.
EXIT.
ENDLOOP.
" Attempt to use the full name from SU01
ms_user-name = ls_address-fullname.
ELSE.
" Try other development clients
SELECT mandt INTO TABLE lt_dev_clients
FROM t000
WHERE cccategory = 'C'
AND mandt <> sy-mandt
ORDER BY PRIMARY KEY.
LOOP AT lt_dev_clients ASSIGNING <lv_dev_client>.
SELECT SINGLE p~name_text a~smtp_addr INTO (ms_user-name,ms_user-email)
FROM usr21 AS u
INNER JOIN adrp AS p ON p~persnumber = u~persnumber
AND p~client = u~mandt
INNER JOIN adr6 AS a ON a~persnumber = u~persnumber
AND a~addrnumber = u~addrnumber
AND a~client = u~mandt
CLIENT SPECIFIED
WHERE u~mandt = <lv_dev_client>
AND u~bname = iv_user
AND p~date_from <= sy-datum
AND p~date_to >= sy-datum
AND a~date_from <= sy-datum.
IF sy-subrc = 0.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD get_email.
rv_email = ms_user-email.
ENDMETHOD.
METHOD get_instance.
DATA: ls_user TYPE ty_user.
FIELD-SYMBOLS: <ls_user> TYPE ty_user.
READ TABLE gt_user ASSIGNING <ls_user>
WITH KEY user = iv_user.
IF sy-subrc <> 0.
ls_user-user = iv_user.
CREATE OBJECT ls_user-o_user
EXPORTING
iv_user = iv_user.
INSERT ls_user
INTO TABLE gt_user
ASSIGNING <ls_user>.
ENDIF.
ro_user = <ls_user>-o_user.
ENDMETHOD.
METHOD get_name.
rv_name = ms_user-name.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
7220,
62,
9866,
62,
22105,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
4810,
3824,
6158,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
25,
198,
220,
220,
220,
220,
220,
651,
62,
39098,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
7220,
220,
220,
220,
220,
220,
220,
41876,
555,
480,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
7220,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
7220,
62,
9866,
62,
22105,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
7220,
41876,
555,
480,
11,
628,
220,
220,
220,
220,
220,
651,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
3672,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
18300,
62,
7220,
12,
3672,
11,
628,
220,
220,
220,
220,
220,
651,
62,
12888,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
12888,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
18300,
62,
7220,
12,
12888,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
7220,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2836,
220,
220,
41876,
555,
480,
11,
198,
220,
220,
220,
220,
220,
220,
220,
267,
62,
7220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
7220,
62,
9866,
62,
22105,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
7220,
13,
628,
220,
220,
220,
42715,
12,
26947,
25,
198,
220,
220,
220,
220,
220,
308,
83,
62,
7220,
41876,
367,
11211,
1961,
43679,
3963,
1259,
62,
7220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
4725,
33866,
8924,
35374,
2836,
13,
628,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
13845,
62,
7220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
18300,
62,
7220,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
7220,
62,
9866,
62,
22105,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
42865,
25,
300,
83,
62,
7783,
220,
220,
220,
220,
220,
41876,
43679,
3963,
275,
499,
557,
83,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
21975,
220,
220,
220,
220,
41876,
275,
15042,
29851,
18,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
5796,
34788,
220,
220,
220,
220,
220,
220,
220,
41876,
43679,
3963,
275,
15042,
5643,
16762,
79,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
5796,
34788,
220,
220,
220,
220,
220,
220,
220,
41876,
275,
15042,
5643,
16762,
79,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
7959,
62,
565,
2334,
41876,
311,
9863,
1961,
43679,
3963,
6855,
83,
13315,
4725,
33866,
8924,
35374,
3084,
62,
1370,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
1662,
62,
9275,
220,
220,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
6780,
62,
7959,
62,
16366,
29,
34178,
48920,
3963,
300,
83,
62,
7959,
62,
565,
2334,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
33,
17614,
62,
29904,
62,
18851,
62,
35,
20892,
4146,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
20579,
796,
21628,
62,
7220,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
2209,
220,
796,
43979,
62,
21975,
198,
220,
220,
220,
220,
220,
309,
6242,
28378,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
220,
220,
796,
300,
83,
62,
7783,
198,
220,
220,
220,
220,
220,
220,
220,
751,
5796,
34788,
220,
796,
300,
83,
62,
5796,
34788,
13,
198,
220,
220,
220,
17579,
3185,
5161,
300,
83,
62,
7783,
48213,
4303,
9863,
2751,
8005,
18930,
3698,
5258,
33411,
2099,
7257,
705,
16412,
4458,
198,
220,
220,
220,
220,
220,
300,
85,
62,
1662,
62,
9275,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
7788,
2043,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
16876,
300,
85,
62,
1662,
62,
9275,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
220,
220,
366,
17489,
262,
717,
3053,
422,
13558,
486,
198,
220,
220,
220,
220,
220,
311,
9863,
300,
83,
62,
5796,
34788,
11050,
762,
17618,
25400,
10619,
2751,
13,
628,
220,
220,
220,
220,
220,
17579,
3185,
5161,
300,
83,
62,
5796,
34788,
39319,
43979,
62,
5796,
34788,
13,
198,
220,
220,
220,
220,
220,
220,
220,
13845,
62,
7220,
12,
12888,
796,
43979,
62,
5796,
34788,
12,
68,
62,
4529,
13,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
2043,
13,
198,
220,
220,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
220,
220,
366,
25770,
284,
779,
262,
1336,
1438,
422,
13558,
486,
198,
220,
220,
220,
220,
220,
13845,
62,
7220,
12,
3672,
796,
43979,
62,
21975,
12,
12853,
3672,
13,
628,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
366,
9993,
584,
2478,
7534,
198,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*&---------------------------------------------------------------------*
*& Include ZALL_PAIRS_TC01
*&---------------------------------------------------------------------*
* This contains the definitions/implementations of the test classes, and
* any test doubles needed to get them working. The test doubles come
* first naturally
*----------------------------------------------------------------------*
CLASS lcl_mock_persistency_layer DEFINITION INHERITING FROM lcl_persistency_layer.
PUBLIC SECTION.
METHODS: get_data REDEFINITION.
ENDCLASS.
CLASS lcl_mock_persistency_layer IMPLEMENTATION.
METHOD get_data.
*--------------------------------------------------------------------*
* 06.10 - Inserting Variables into a Test Double
*--------------------------------------------------------------------*
et_configuration[] = VALUE g_tt_configuration(
( variable_name = 'Monster Model'(007) count = 1 possible_value = 'BTNK' ) "Bolts Through Neck
( variable_name = 'Monster Model'(007) count = 2 possible_value = 'KLKL') "Killer Klown
( variable_name = 'Monster Model'(007) count = 3 possible_value = 'ISDD' ) "Ice Skating Dead
( variable_name = 'Evilness'(008) count = 1 possible_value = 'EVIL' )
( variable_name = 'Evilness'(008) count = 2 possible_value = 'VERY' )
( variable_name = 'Brain Size'(009) count = 1 possible_value = 'SMALL' )
( variable_name = 'Brain Size'(009) count = 2 possible_value = 'MICRO' )
( variable_name = 'Scariness'(010) count = 1 possible_value = 'NORM' )
( variable_name = 'Scariness'(010) count = 2 possible_value = 'BANK' )
( variable_name = 'Usage'(011) count = 1 possible_value = 'NORM' ) "Scares Peasants
( variable_name = 'Usage'(011) count = 2 possible_value = 'PLUM' ) "It's the PLUMBER!
( variable_name = 'Color'(012) count = 1 possible_value = 'BLUE' )
( variable_name = 'Color'(012) count = 2 possible_value = 'GREEN' ) ).
ENDMETHOD.
ENDCLASS.
CLASS lcl_test_class DEFINITION FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT
FINAL.
PUBLIC SECTION.
PRIVATE SECTION.
DATA: mo_class_under_test TYPE REF TO lcl_all_pairs,
mo_mock_pers_layer TYPE REF TO lcl_mock_persistency_layer.
METHODS: setup,
*--------------------------------------------------------------------*
* IT SHOULD.....
* Calculate the mapping correctly
* Process the first two columns correctly
* Get All Pairs when you add Brain Size as an extra variable
* Get All Pairs when you add Scariness as an extra variable
* Get All Pairs when you add Usage as an extra variable
* Get All Pairs when you add Color as an extra variable
*--------------------------------------------------------------------*
calculate_mapping FOR TESTING,
process_first_two_columns FOR TESTING,
get_ap_for_brain_size FOR TESTING,
get_ap_for_scariness FOR TESTING,
get_ap_for_usage FOR TESTING,
get_ap_for_color FOR TESTING,
* Helper Methods
given_monster_options,
when_mapping_is_calculated,
then_mapping_is_correct,
given_mapping_calculated,
when_first_2_columns_filled,
then_first_2_columns_are_ok,
given_first_2_columns_filled,
when_brain_size_added,
then_aps_for_brain_size_ok,
given_brain_size_added,
when_scariness_added,
then_aps_for_scariness_ok,
given_scariness_added,
when_usage_added,
then_aps_for_usage_ok,
given_usage_added,
when_color_added,
then_aps_for_color_ok.
ENDCLASS.
CLASS lcl_test_class IMPLEMENTATION.
DEFINE pair_is_in_a_test_case.
cl_abap_unit_assert=>assert_equals(
exp = abap_true
act = mo_class_under_test->pair_is_in_test_case(
variable_1 = &1
first_value = &2
variable_2 = &3
second_value = &4 )
msg = | Pair { &1 } / { &2 } + { &3 } / { &4 } not in any test case| ).
END-OF-DEFINITION.
METHOD setup.
CREATE OBJECT mo_mock_pers_layer.
CREATE OBJECT mo_class_under_test.
TRY.
mo_class_under_test->mt_configuration = mo_mock_pers_layer->get_data( ).
CATCH zcx_excel.
cl_abap_unit_assert=>fail( ).
ENDTRY.
ENDMETHOD.
METHOD calculate_mapping.
given_monster_options( ).
when_mapping_is_calculated( ).
then_mapping_is_correct( ).
ENDMETHOD.
METHOD process_first_two_columns.
given_monster_options( ).
given_mapping_calculated( ).
when_first_2_columns_filled( ).
then_first_2_columns_are_ok( ).
ENDMETHOD.
METHOD get_ap_for_brain_size.
given_monster_options( ).
given_mapping_calculated( ).
given_first_2_columns_filled( ).
when_brain_size_added( ).
then_aps_for_brain_size_ok( ).
ENDMETHOD.
METHOD get_ap_for_scariness.
given_monster_options( ).
given_mapping_calculated( ).
given_first_2_columns_filled( ).
given_brain_size_added( ).
when_scariness_added( ).
then_aps_for_scariness_ok( ).
ENDMETHOD.
METHOD get_ap_for_usage.
given_monster_options( ).
given_mapping_calculated( ).
given_first_2_columns_filled( ).
given_brain_size_added( ).
given_scariness_added( ).
when_usage_added( ).
then_aps_for_usage_ok( ).
ENDMETHOD.
METHOD get_ap_for_color.
given_monster_options( ).
given_mapping_calculated( ).
given_first_2_columns_filled( ).
given_brain_size_added( ).
given_scariness_added( ).
given_usage_added( ).
when_color_added( ).
then_aps_for_color_ok( ).
ENDMETHOD.
METHOD given_monster_options ##needed.
* This does nothing, it just makes the unit tests look like English
* The actual monster options are created during SETUP before each test
ENDMETHOD.
METHOD when_mapping_is_calculated.
mo_class_under_test->calculate_mapping( ).
ENDMETHOD.
METHOD then_mapping_is_correct.
* The mapping table should now have one line for each variables saying how many distinct values
* there are.
cl_abap_unit_assert=>assert_equals( act = lines( mo_class_under_test->mt_mapping )
exp = 6
msg = 'Incorrect Number of Lines in Mapping Table' ).
* The variables with the most distinct values should be first in the table
DATA(first_entry) = mo_class_under_test->mt_mapping[ 1 ].
cl_abap_unit_assert=>assert_equals( act = first_entry-variable_name
exp = 'Monster Model'
msg = 'Incorrect 1st Entry in Mapping Table' ).
cl_abap_unit_assert=>assert_equals( act = first_entry-value_count
exp = 3
msg = 'Incorrect Value Count in Mapping Table' ).
ENDMETHOD.
METHOD given_mapping_calculated.
mo_class_under_test->calculate_mapping( ).
ENDMETHOD.
METHOD when_first_2_columns_filled.
mo_class_under_test->process_first_two_columns( ).
ENDMETHOD.
METHOD then_first_2_columns_are_ok.
*--------------------------------------------------------------------*
* At this point we have all possible combinations of the first and second variables in the
* test case table, and also in the "all pairs" table
* We check if this is the case using a Unit Test
*--------------------------------------------------------------------*
cl_abap_unit_assert=>assert_equals( act = lines( mo_class_under_test->mt_test_cases )
exp = 6
msg = 'Incorrect Number of Lines in Test Case Table' ).
cl_abap_unit_assert=>assert_equals( act = lines( mo_class_under_test->mt_pairs )
exp = 6
msg = 'Incorrect Number of Lines in All Pairs Table' ).
ENDMETHOD.
METHOD given_first_2_columns_filled.
mo_class_under_test->process_first_two_columns( ).
ENDMETHOD.
METHOD when_brain_size_added.
mo_class_under_test->insert_new_column( 3 ).
ENDMETHOD.
METHOD then_aps_for_brain_size_ok.
*--------------------------------------------------------------------*
* The new variable BRAIN SIZE has be added to the equation with
* two possible values - SMALL & MICRO
* We are expecting at least one test case in te list that pairs each possible
* value of BRAIN SIZE with each possible value of MODEL
* We are expecting at least one test case in te list that pairs each possible
* value of BRAIN SIZE with each possible value of EVILNESS
* A single test case can cater for more than one set of pairs
*--------------------------------------------------------------------*
* Pairs for BRAIN SIZE / MODEL
pair_is_in_a_test_case :
'Brain Size' 'SMALL' 'Monster Model' 'BTNK',
'Brain Size' 'SMALL' 'Monster Model' 'KLKL',
'Brain Size' 'SMALL' 'Monster Model' 'ISDD',
'Brain Size' 'MICRO' 'Monster Model' 'BTNK',
'Brain Size' 'MICRO' 'Monster Model' 'KLKL',
'Brain Size' 'MICRO' 'Monster Model' 'ISDD',
* Pairs for BRAIN SIZE / EVILNESS
'Brain Size' 'SMALL' 'Evilness' 'EVIL',
'Brain Size' 'SMALL' 'Evilness' 'VERY',
'Brain Size' 'MICRO' 'Evilness' 'EVIL',
'Brain Size' 'MICRO' 'Evilness' 'VERY'.
* The new pairs can be slotted into the existing 6 test cases
cl_abap_unit_assert=>assert_equals( act = lines( mo_class_under_test->mt_test_cases )
exp = 6
msg = 'Incorrect Number of Lines in Test Case Table' ).
ENDMETHOD.
METHOD given_brain_size_added.
mo_class_under_test->insert_new_column( 3 ).
ENDMETHOD.
METHOD when_scariness_added.
mo_class_under_test->insert_new_column( 4 ).
ENDMETHOD.
METHOD then_aps_for_scariness_ok.
*--------------------------------------------------------------------*
* The new variable SCARINESS has be added to the equation with
* two possible values - NORM & BANK
* Note that the amount of pairs being tested for increases in a
* linear manner as opposed to a geometric manner
*--------------------------------------------------------------------*
* Pairs for SCARINESS / MODEL
pair_is_in_a_test_case :
'Scariness' 'NORM' 'Monster Model' 'BTNK',
'Scariness' 'NORM' 'Monster Model' 'KLKL',
'Scariness' 'NORM' 'Monster Model' 'ISDD',
'Scariness' 'BANK' 'Monster Model' 'BTNK',
'Scariness' 'BANK' 'Monster Model' 'KLKL',
'Scariness' 'BANK' 'Monster Model' 'ISDD',
* Pairs for SCARINESS / EVIL
'Scariness' 'NORM' 'Evilness' 'EVIL',
'Scariness' 'NORM' 'Evilness' 'VERY',
'Scariness' 'BANK' 'Evilness' 'EVIL',
'Scariness' 'BANK' 'Evilness' 'VERY',
* Pairs for SCARINESS / BRAIN SIZE
'Scariness' 'NORM' 'Brain Size' 'SMALL',
'Scariness' 'NORM' 'Brain Size' 'MICRO',
'Scariness' 'BANK' 'Brain Size' 'SMALL',
'Scariness' 'BANK' 'Brain Size' 'MICRO'.
* The new pairs can be slotted into the existing 6 test cases
cl_abap_unit_assert=>assert_equals( act = lines( mo_class_under_test->mt_test_cases )
exp = 6
msg = 'Incorrect Number of Lines in Test Case Table' ).
ENDMETHOD.
METHOD given_scariness_added.
mo_class_under_test->insert_new_column( 4 ).
ENDMETHOD.
METHOD when_usage_added.
mo_class_under_test->insert_new_column( 5 ).
ENDMETHOD.
METHOD then_aps_for_usage_ok.
*--------------------------------------------------------------------*
* The new variable USAGE has be added to the equation with
* two possible values - NORM & PLUM i.e. Normal & IT'S THE PLUMBER!
*--------------------------------------------------------------------*
* Pairs for USAGE / MODEL
pair_is_in_a_test_case :
'Usage' 'NORM' 'Monster Model' 'BTNK',
'Usage' 'NORM' 'Monster Model' 'KLKL',
'Usage' 'NORM' 'Monster Model' 'ISDD',
'Usage' 'PLUM' 'Monster Model' 'BTNK',
'Usage' 'PLUM' 'Monster Model' 'KLKL',
'Usage' 'PLUM' 'Monster Model' 'ISDD',
* Pairs for USAGE / EVIL
'Usage' 'NORM' 'Evilness' 'EVIL',
'Usage' 'NORM' 'Evilness' 'VERY',
'Usage' 'PLUM' 'Evilness' 'EVIL',
'Usage' 'PLUM' 'Evilness' 'VERY',
* Pairs for USAGE / BRAIN SIZE
'Usage' 'NORM' 'Brain Size' 'SMALL',
'Usage' 'NORM' 'Brain Size' 'MICRO',
'Usage' 'PLUM' 'Brain Size' 'SMALL',
'Usage' 'PLUM' 'Brain Size' 'MICRO',
* Pairs for USAGE / SCARINESS
'Usage' 'NORM' 'Scariness' 'NORM',
'Usage' 'NORM' 'Scariness' 'BANK',
'Usage' 'PLUM' 'Scariness' 'NORM',
'Usage' 'PLUM' 'Scariness' 'BANK'.
* The new pairs can be slotted into the existing 6 test cases
cl_abap_unit_assert=>assert_equals( act = lines( mo_class_under_test->mt_test_cases )
exp = 6
msg = 'Incorrect Number of Lines in Test Case Table' ).
ENDMETHOD.
METHOD given_usage_added.
mo_class_under_test->insert_new_column( 5 ).
ENDMETHOD.
METHOD when_color_added.
mo_class_under_test->insert_new_column( 6 ).
ENDMETHOD.
METHOD then_aps_for_color_ok.
*--------------------------------------------------------------------*
* The new variable COLOR has be added to the equation with
* two possible values - BLUE & GREEN
*--------------------------------------------------------------------*
* Pairs for COLOR / MODEL
pair_is_in_a_test_case :
'Color' 'BLUE' 'Monster Model' 'BTNK',
'Color' 'BLUE' 'Monster Model' 'KLKL',
'Color' 'BLUE' 'Monster Model' 'ISDD',
'Color' 'GREEN' 'Monster Model' 'BTNK',
'Color' 'GREEN' 'Monster Model' 'KLKL',
'Color' 'GREEN' 'Monster Model' 'ISDD',
* Pairs for COLOR / EVIL
'Color' 'BLUE' 'Evilness' 'EVIL',
'Color' 'BLUE' 'Evilness' 'VERY',
'Color' 'GREEN' 'Evilness' 'EVIL',
'Color' 'GREEN' 'Evilness' 'VERY',
* Pairs for COLOR / BRAIN SIZE
'Color' 'BLUE' 'Brain Size' 'SMALL',
'Color' 'BLUE' 'Brain Size' 'MICRO',
'Color' 'GREEN' 'Brain Size' 'SMALL',
'Color' 'GREEN' 'Brain Size' 'MICRO',
* Pairs for COLOR / SCARINESS
'Color' 'BLUE' 'Scariness' 'NORM',
'Color' 'BLUE' 'Scariness' 'BANK',
'Color' 'GREEN' 'Scariness' 'NORM',
'Color' 'GREEN' 'Scariness' 'BANK',
* Pairs for COLOR / USAGE
'Color' 'BLUE' 'Usage' 'NORM',
'Color' 'BLUE' 'Usage' 'PLUM',
'Color' 'GREEN' 'Usage' 'NORM',
'Color' 'GREEN' 'Usage' 'PLUM'.
* All good things come to an end. We have reached te stage where we have so
* many variables we need two new test cases. If all the new variables had more
* than two values we would have got here sooner
cl_abap_unit_assert=>assert_equals( act = lines( mo_class_under_test->mt_test_cases )
exp = 8
msg = 'Incorrect Number of Lines in Test Case Table' ).
ENDMETHOD.
ENDCLASS."LCL_TEST_CLASS
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
40348,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1168,
7036,
62,
4537,
4663,
50,
62,
4825,
486,
198,
9,
5,
10097,
30934,
9,
198,
9,
770,
4909,
262,
17336,
14,
320,
26908,
602,
286,
262,
1332,
6097,
11,
290,
198,
9,
597,
1332,
21938,
2622,
284,
651,
606,
1762,
13,
383,
1332,
21938,
1282,
198,
9,
717,
8752,
198,
9,
10097,
23031,
9,
198,
31631,
300,
565,
62,
76,
735,
62,
19276,
396,
1387,
62,
29289,
5550,
20032,
17941,
3268,
16879,
2043,
2751,
16034,
300,
565,
62,
19276,
396,
1387,
62,
29289,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
651,
62,
7890,
23848,
36,
20032,
17941,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
565,
62,
76,
735,
62,
19276,
396,
1387,
62,
29289,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
651,
62,
7890,
13,
198,
9,
10097,
650,
9,
198,
9,
9130,
13,
940,
532,
35835,
278,
15965,
2977,
656,
257,
6208,
11198,
198,
9,
10097,
650,
9,
198,
220,
220,
220,
2123,
62,
11250,
3924,
21737,
796,
26173,
8924,
308,
62,
926,
62,
11250,
3924,
7,
198,
220,
220,
220,
357,
7885,
62,
3672,
796,
705,
40872,
9104,
6,
7,
25816,
8,
954,
796,
352,
1744,
62,
8367,
796,
705,
19313,
46888,
6,
1267,
366,
33,
349,
912,
9561,
34726,
198,
220,
220,
220,
357,
7885,
62,
3672,
796,
705,
40872,
9104,
6,
7,
25816,
8,
954,
796,
362,
1744,
62,
8367,
796,
705,
42,
43,
42,
43,
11537,
220,
366,
42,
4665,
14770,
593,
198,
220,
220,
220,
357,
7885,
62,
3672,
796,
705,
40872,
9104,
6,
7,
25816,
8,
954,
796,
513,
1744,
62,
8367,
796,
705,
1797,
16458,
6,
1267,
366,
23709,
3661,
803,
5542,
198,
220,
220,
220,
357,
7885,
62,
3672,
796,
705,
48477,
1108,
6,
7,
25257,
8,
220,
220,
220,
220,
220,
954,
796,
352,
1744,
62,
8367,
796,
705,
20114,
4146,
6,
1267,
198,
220,
220,
220,
357,
7885,
62,
3672,
796,
705,
48477,
1108,
6,
7,
25257,
8,
220,
220,
220,
220,
220,
954,
796,
362,
1744,
62,
8367,
796,
705,
5959,
56,
6,
1267,
198,
220,
220,
220,
357,
7885,
62,
3672,
796,
705,
44687,
12849,
6,
7,
28694,
8,
220,
220,
220,
954,
796,
352,
1744,
62,
8367,
796,
705,
12310,
7036,
6,
1267,
198,
220,
220,
220,
357,
7885,
62,
3672,
796,
705,
44687,
12849,
6,
7,
28694,
8,
220,
220,
220,
954,
796,
362,
1744,
62,
8367,
796,
705,
49884,
13252,
6,
1267,
198,
220,
220,
220,
357,
7885,
62,
3672,
796,
705,
44433,
1272,
6,
7,
20943,
8,
220,
220,
220,
220,
954,
796,
352,
1744,
62,
8367,
796,
705,
35510,
44,
6,
1267,
198,
220,
220,
220,
357,
7885,
62,
3672,
796,
705,
44433,
1272,
6,
7,
20943,
8,
220,
220,
220,
220,
954,
796,
362,
1744,
62,
8367,
796,
705,
33,
15154,
6,
1267,
198,
220,
220,
220,
357,
7885,
62,
3672,
796,
705,
28350,
6,
7,
28555,
8,
220,
220,
220,
220,
220,
220,
220,
220,
954,
796,
352,
1744,
62,
8367,
796,
705,
35510,
44,
6,
1267,
366,
3351,
3565,
2631,
292,
1187,
198,
220,
220,
220,
357,
7885,
62,
3672,
796,
705,
28350,
6,
7,
28555,
8,
220,
220,
220,
220,
220,
220,
220,
220,
954,
796,
362,
1744,
62,
8367,
796,
705,
6489,
5883,
6,
1267,
366,
1026,
338,
262,
9297,
5883,
13246,
0,
198,
220,
220,
220,
357,
7885,
62,
3672,
796,
705,
10258,
6,
7,
30206,
8,
220,
220,
220,
220,
220,
220,
220,
220,
954,
796,
352,
1744,
62,
8367,
796,
705,
9148,
8924,
6,
1267,
198,
220,
220,
220,
357,
7885,
62,
3672,
796,
705,
10258,
6,
7,
30206,
8,
220,
220,
220,
220,
220,
220,
220,
220,
954,
796,
362,
1744,
62,
8367,
796,
705,
43016,
6,
1267,
6739,
628,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
300,
565,
62,
9288,
62,
4871,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
220,
45698,
42,
49277,
43638,
5805,
7597,
198,
220,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
220,
25261,
13,
628,
220,
44731,
44513,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
6941,
62,
4871,
62,
4625,
62,
9288,
41876,
4526,
37,
5390,
300,
565,
62,
439,
62,
79,
3468,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6941,
62,
76,
735,
62,
19276,
62,
29289,
220,
41876,
4526,
37,
5390,
300,
565,
62,
76,
735,
62,
19276,
396,
1387,
62,
29289,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
9058,
11,
198,
9,
10097,
650,
9,
198,
9,
7283,
40312,
12359,
198,
9,
27131,
378,
262,
16855,
9380,
198,
9,
10854,
262,
717,
734,
15180,
9380,
198,
9,
3497,
1439,
350,
3468,
618,
345,
751,
14842,
12849,
355,
281,
3131,
7885,
198,
9,
3497,
1439,
350,
3468,
618,
345,
751,
12089,
1272,
355,
281,
3131,
7885,
198,
9,
3497,
1439,
350,
3468,
618,
345,
751,
29566,
355,
281,
3131,
7885,
198,
9,
3497,
1439,
350,
3468,
618,
345,
751,
5315,
355,
281,
3131,
7885,
198,
9,
10097,
650,
9,
198,
220,
220,
220,
220,
220,
15284,
62,
76,
5912,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1429,
62,
11085,
62,
11545,
62,
28665,
82,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
651,
62,
499,
62,
1640,
62,
27825,
62,
7857,
220,
220,
220,
220,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
651,
62,
499,
62,
1640,
62,
13034,
1272,
220,
220,
220,
220,
220,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
651,
62,
499,
62,
1640,
62,
26060,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
651,
62,
499,
62,
1640,
62,
8043,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
43001,
2751,
11,
198,
9,
5053,
525,
25458,
198,
220,
220,
220,
220,
220,
1813,
62,
39050,
62,
25811,
11,
198,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
"! Factory class for the object family:
"! - Class
"! - Function group
"! - Function module
"! - Program
CLASS zcl_timem_object_factory DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
CONSTANTS:
BEGIN OF gc_object_type,
program TYPE ztimem_object_type VALUE 'PROG',
program_includes TYPE ztimem_object_type VALUE 'PRGI',
class TYPE ztimem_object_type VALUE 'CLAS',
function_group TYPE ztimem_object_type VALUE 'FUGR',
function TYPE ztimem_object_type VALUE 'FUNC',
transport_request TYPE ztimem_object_type VALUE 'TR',
END OF gc_object_type .
"! Creates and returns an instance to the requested object
"! @parameter i_object_type | Object type
"! @parameter i_object_name | Object name
METHODS get_instance
IMPORTING
!object_type TYPE ztimem_object_type
!object_name TYPE sobj_name
RETURNING
VALUE(result) TYPE REF TO zif_timem_object
RAISING
zcx_timem .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_TIMEM_OBJECT_FACTORY IMPLEMENTATION.
METHOD get_instance.
result = SWITCH #(
object_type
WHEN gc_object_type-program THEN NEW zcl_timem_object_prog( object_name )
WHEN gc_object_type-program_includes THEN NEW zcl_timem_object_prog_includes( object_name )
WHEN gc_object_type-class THEN NEW zcl_timem_object_clas( CONV #( object_name ) )
WHEN gc_object_type-function_group THEN NEW zcl_timem_object_fugr( CONV #( object_name ) )
WHEN gc_object_type-function THEN NEW zcl_timem_object_func( CONV #( object_name ) )
WHEN gc_object_type-transport_request THEN NEW zcl_timem_object_tr( CONV #( object_name ) ) ).
IF result IS NOT BOUND OR NOT result->check_exists( ).
RAISE EXCEPTION TYPE zcx_timem
EXPORTING
textid = zcx_timem=>object_not_found.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
40484,
19239,
1398,
329,
262,
2134,
1641,
25,
198,
40484,
532,
5016,
198,
40484,
532,
15553,
1448,
198,
40484,
532,
15553,
8265,
198,
40484,
532,
6118,
198,
31631,
1976,
565,
62,
16514,
368,
62,
15252,
62,
69,
9548,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
308,
66,
62,
15252,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1430,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
16514,
368,
62,
15252,
62,
4906,
26173,
8924,
705,
4805,
7730,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
1430,
62,
42813,
220,
41876,
1976,
16514,
368,
62,
15252,
62,
4906,
26173,
8924,
705,
4805,
18878,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
1398,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
16514,
368,
62,
15252,
62,
4906,
26173,
8924,
705,
5097,
1921,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
2163,
62,
8094,
220,
220,
220,
41876,
1976,
16514,
368,
62,
15252,
62,
4906,
26173,
8924,
705,
37,
7340,
49,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
2163,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
16514,
368,
62,
15252,
62,
4906,
26173,
8924,
705,
42296,
34,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4839,
62,
25927,
41876,
1976,
16514,
368,
62,
15252,
62,
4906,
26173,
8924,
705,
5446,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
308,
66,
62,
15252,
62,
4906,
764,
628,
220,
220,
220,
366,
0,
7921,
274,
290,
5860,
281,
4554,
284,
262,
9167,
2134,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
1312,
62,
15252,
62,
4906,
930,
9515,
2099,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
1312,
62,
15252,
62,
3672,
930,
9515,
1438,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
39098,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
15252,
62,
4906,
220,
41876,
1976,
16514,
368,
62,
15252,
62,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
15252,
62,
3672,
220,
41876,
27355,
73,
62,
3672,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
16514,
368,
62,
15252,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
16514,
368,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
51,
3955,
3620,
62,
9864,
23680,
62,
37,
10659,
15513,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
651,
62,
39098,
13,
198,
220,
220,
220,
1255,
796,
12672,
31949,
1303,
7,
198,
220,
220,
220,
220,
220,
2134,
62,
4906,
198,
220,
220,
220,
220,
220,
42099,
308,
66,
62,
15252,
62,
4906,
12,
23065,
42243,
12682,
1976,
565,
62,
16514,
368,
62,
15252,
62,
1676,
70,
7,
2134,
62,
3672,
1267,
198,
220,
220,
220,
220,
220,
42099,
308,
66,
62,
15252,
62,
4906,
12,
23065,
62,
42813,
42243,
12682,
1976,
565,
62,
16514,
368,
62,
15252,
62,
1676,
70,
62,
42813,
7,
2134,
62,
3672,
1267,
198,
220,
220,
220,
220,
220,
42099,
308,
66,
62,
15252,
62,
4906,
12,
4871,
42243,
12682,
1976,
565,
62,
16514,
368,
62,
15252,
62,
565,
292,
7,
7102,
53,
1303,
7,
2134,
62,
3672,
1267,
1267,
198,
220,
220,
220,
220,
220,
42099,
308,
66,
62,
15252,
62,
4906,
12,
8818,
62,
8094,
42243,
12682,
1976,
565,
62,
16514,
368,
62,
15252,
62,
69,
1018,
81,
7,
7102,
53,
1303,
7,
2134,
62,
3672,
1267,
1267,
198,
220,
220,
220,
220,
220,
42099,
308,
66,
62,
15252,
62,
4906,
12,
8818,
42243,
12682,
1976,
565,
62,
16514,
368,
62,
15252,
62,
20786,
7,
7102,
53,
1303,
7,
2134,
62,
3672,
1267,
1267,
198,
220,
220,
220,
220,
220,
42099,
308,
66,
62,
15252,
62,
4906,
12,
7645,
634,
62,
25927,
42243,
12682,
1976,
565,
62,
16514,
368,
62,
15252,
62,
2213,
7,
7102,
53,
1303,
7,
2134,
62,
3672,
1267,
1267,
6739,
198,
220,
220,
220,
16876,
1255,
3180,
5626,
347,
15919,
6375,
5626,
1255,
3784,
9122,
62,
1069,
1023,
7,
6739,
198,
220,
220,
220,
220,
220,
17926,
24352,
7788,
42006,
2849,
41876,
1976,
66,
87,
62,
16514,
368,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2420,
312,
796,
1976,
66,
87,
62,
16514,
368,
14804,
15252,
62,
1662,
62,
9275,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
23578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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_prime_factors DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
TYPES integertab TYPE STANDARD TABLE OF i WITH EMPTY KEY.
METHODS factors
IMPORTING
input TYPE int8
RETURNING
VALUE(result) TYPE integertab.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_prime_factors IMPLEMENTATION.
METHOD factors.
" add solution here
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
35505,
62,
22584,
669,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
4132,
861,
397,
41876,
49053,
9795,
43679,
3963,
1312,
13315,
38144,
9936,
35374,
13,
198,
220,
220,
220,
337,
36252,
50,
5087,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
493,
23,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
4132,
861,
397,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
198,
10619,
31631,
13,
628,
198,
31631,
1976,
565,
62,
35505,
62,
22584,
669,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
5087,
13,
198,
220,
220,
220,
366,
751,
4610,
994,
198,
220,
23578,
49273,
13,
628,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_leap DEFINITION PUBLIC.
PUBLIC SECTION.
METHODS leap
IMPORTING
year TYPE i
RETURNING
VALUE(result) TYPE abap_bool.
ENDCLASS.
CLASS zcl_leap IMPLEMENTATION.
METHOD leap.
IF year MOD 4 = 0 AND year MOD 100 <> 0.
result = abap_true.
ELSEIF year MOD 400 = 0.
result = abap_true.
ELSE.
result = abap_false.
ENDIF.
ENDMETHOD.
ENDCLASS. | [
31631,
1976,
565,
62,
293,
499,
5550,
20032,
17941,
44731,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
16470,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
614,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
10619,
31631,
13,
198,
198,
31631,
1976,
565,
62,
293,
499,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
16470,
13,
198,
220,
220,
220,
16876,
614,
19164,
604,
796,
657,
5357,
614,
19164,
1802,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
1255,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
17852,
5188,
5064,
614,
19164,
7337,
796,
657,
13,
198,
220,
220,
220,
220,
220,
1255,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
1255,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*&---------------------------------------------------------------------*
*& Include Z_MONSTER_ADL_CD01
*&---------------------------------------------------------------------*
************************************************************************
* Class Definitions
************************************************************************
*----------------------------------------------------------------------*
* CLASS lcl_persistency_layer DEFINITION
*----------------------------------------------------------------------*
CLASS lcl_persistency_layer DEFINITION.
PUBLIC SECTION.
METHODS: constructor,
get_data EXPORTING et_output_data TYPE g_tt_output_data.
ENDCLASS. "lcl_persistency_layer DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_model DEFINITION
*----------------------------------------------------------------------*
CLASS lcl_model DEFINITION INHERITING FROM zcl_bc_model.
PUBLIC SECTION.
DATA: mo_persistency_layer TYPE REF TO lcl_persistency_layer,
mt_output_data TYPE g_tt_output_data.
METHODS: constructor IMPORTING io_access_class TYPE REF TO lcl_persistency_layer OPTIONAL,
data_retrieval,
prepare_data_for_ouput,
fill_user_commands REDEFINITION,
fill_editable_fields REDEFINITION,
fill_hidden_fields REDEFINITION,
fill_technical_fields REDEFINITION,
fill_hotspot_fields REDEFINITION,
fill_subtotal_fields REDEFINITION,
fill_field_texts REDEFINITION,
fill_checkbox_fields REDEFINITION,
user_command REDEFINITION,
allocate_monster IMPORTING is_output_data TYPE g_typ_alv_output_data.
ENDCLASS. "lcl_model DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_view DEFINITION
*----------------------------------------------------------------------*
* We want a subclass whereby we can add extra features specific to
* this application only
*----------------------------------------------------------------------*
CLASS lcl_view DEFINITION INHERITING FROM zcl_bc_view_salv_table.
PUBLIC SECTION.
METHODS make_column_editable REDEFINITION.
ENDCLASS. "lcl_view DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_controller DEFINITION
*----------------------------------------------------------------------*
CLASS lcl_controller DEFINITION.
PUBLIC SECTION.
INTERFACES zif_bc_controller.
ALIASES: on_user_command FOR zif_bc_controller~on_user_command.
DATA: mo_model TYPE REF TO lcl_model,
mo_view TYPE REF TO zif_bc_alv_report_view.
METHODS : constructor IMPORTING io_model TYPE REF TO lcl_model
io_view TYPE REF TO zif_bc_alv_report_view,
on_data_changed FOR EVENT data_changed OF lcl_model.
PRIVATE SECTION.
METHODS : make_column_editable IMPORTING id_column_name TYPE dd03l-fieldname
CHANGING ct_fcat TYPE lvc_t_fcat.
ENDCLASS. "lcl_controller DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_application DEFINITION
*----------------------------------------------------------------------*
CLASS lcl_application DEFINITION.
PUBLIC SECTION.
CLASS-DATA: mo_model TYPE REF TO lcl_model,
mo_controller TYPE REF TO lcl_controller,
mo_view TYPE REF TO zif_bc_alv_report_view.
CLASS-METHODS: main.
ENDCLASS. "lcl_application DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_selections DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_selections DEFINITION.
PUBLIC SECTION.
DATA: s_date TYPE RANGE OF ztmonster_adl-due_date,
s_cstl TYPE RANGE OF ztmonster_adl-castle_number,
p_vari TYPE disvariant-variant.
METHODS : constructor IMPORTING
is_date LIKE s_date
is_cstl LIKE s_cstl
ip_vari LIKE p_vari.
ENDCLASS. "lcl_selections DEFINITION
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
40348,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1168,
62,
27857,
41809,
62,
2885,
43,
62,
8610,
486,
198,
9,
5,
10097,
30934,
9,
198,
17174,
17174,
4557,
198,
9,
5016,
45205,
198,
17174,
17174,
4557,
198,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
19276,
396,
1387,
62,
29289,
5550,
20032,
17941,
198,
9,
10097,
23031,
9,
198,
31631,
300,
565,
62,
19276,
396,
1387,
62,
29289,
5550,
20032,
17941,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
23772,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
651,
62,
7890,
7788,
15490,
2751,
2123,
62,
22915,
62,
7890,
41876,
308,
62,
926,
62,
22915,
62,
7890,
13,
198,
198,
10619,
31631,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
75,
565,
62,
19276,
396,
1387,
62,
29289,
5550,
20032,
17941,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
19849,
5550,
20032,
17941,
198,
9,
10097,
23031,
9,
198,
31631,
300,
565,
62,
19849,
5550,
20032,
17941,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
15630,
62,
19849,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
42865,
25,
6941,
62,
19276,
396,
1387,
62,
29289,
41876,
4526,
37,
5390,
300,
565,
62,
19276,
396,
1387,
62,
29289,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45079,
62,
22915,
62,
7890,
220,
220,
220,
220,
220,
220,
41876,
308,
62,
926,
62,
22915,
62,
7890,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
23772,
30023,
9863,
2751,
33245,
62,
15526,
62,
4871,
41876,
4526,
37,
5390,
300,
565,
62,
19276,
396,
1387,
62,
29289,
39852,
2849,
1847,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
1186,
380,
18206,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8335,
62,
7890,
62,
1640,
62,
280,
1996,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
62,
7220,
62,
9503,
1746,
220,
220,
220,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
62,
276,
4674,
62,
25747,
220,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
62,
30342,
62,
25747,
220,
220,
220,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
62,
47944,
62,
25747,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
62,
17398,
13059,
62,
25747,
220,
220,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
62,
7266,
23350,
62,
25747,
220,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
62,
3245,
62,
5239,
82,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
62,
9122,
3524,
62,
25747,
220,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2836,
62,
21812,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31935,
62,
39050,
30023,
9863,
2751,
318,
62,
22915,
62,
7890,
41876,
308,
62,
28004,
62,
282,
85,
62,
22915,
62,
7890,
13,
198,
198,
10619,
31631,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
75,
565,
62,
19849,
5550,
20032,
17941,
198,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
1177,
5550,
20032,
17941,
198,
9,
10097,
23031,
9,
198,
9,
775,
765,
257,
47611,
23482,
356,
460,
751,
3131,
3033,
2176,
284,
198,
9,
428,
3586,
691,
198,
9,
10097,
23031,
9,
198,
31631,
300,
565,
62,
1177,
5550,
20032,
17941,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
15630,
62,
1177,
62,
21680,
85,
62,
11487,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
787,
62,
28665,
62,
276,
4674,
23848,
36,
20032,
17941,
13,
198,
198,
10619,
31631,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
75,
565,
62,
1177,
5550,
20032,
17941,
198,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
36500,
5550,
20032,
17941,
198,
9,
10097,
23031,
9,
198,
31631,
300,
565,
62,
36500,
5550,
20032,
17941,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
15630,
62,
36500,
13,
628,
220,
220,
220,
8355,
43429,
1546,
25,
319,
62,
7220,
62,
21812,
7473,
1976,
361,
62,
15630,
62,
36500,
93,
261,
62,
7220,
62,
21812,
13,
628,
220,
220,
220,
42865,
25,
6941,
62,
19849,
41876,
4526,
37,
5390,
300,
565,
62,
19849,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6941,
62,
1177,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
15630,
62,
282,
85,
62,
13116,
62,
1177,
13,
628,
220,
220,
220,
337,
36252,
50,
1058,
23772,
220,
30023,
9863,
2751,
33245,
62,
19849,
41876,
4526,
37,
5390,
300,
565,
62,
19849,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
1177,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
15630,
62,
282,
85,
62,
13116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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_gui_page_stage DEFINITION
PUBLIC
FINAL
CREATE PUBLIC INHERITING FROM zcl_abapgit_gui_page.
PUBLIC SECTION.
INTERFACES: zif_abapgit_gui_page_hotkey.
CONSTANTS: BEGIN OF c_action,
stage_all TYPE string VALUE 'stage_all',
stage_commit TYPE string VALUE 'stage_commit',
stage_filter TYPE string VALUE 'stage_filter',
END OF c_action.
METHODS:
constructor
IMPORTING
io_repo TYPE REF TO zcl_abapgit_repo_online
iv_seed TYPE string OPTIONAL
RAISING zcx_abapgit_exception,
zif_abapgit_gui_event_handler~on_event REDEFINITION.
PROTECTED SECTION.
METHODS:
render_content REDEFINITION,
scripts REDEFINITION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_changed_by,
item TYPE zif_abapgit_definitions=>ty_item,
name TYPE xubname,
END OF ty_changed_by .
TYPES:
ty_changed_by_tt TYPE SORTED TABLE OF ty_changed_by WITH UNIQUE KEY item.
TYPES:
BEGIN OF ty_transport,
item TYPE zif_abapgit_definitions=>ty_item,
transport TYPE trkorr,
END OF ty_transport,
ty_transport_tt TYPE SORTED TABLE OF ty_transport WITH UNIQUE KEY item.
DATA mo_repo TYPE REF TO zcl_abapgit_repo_online .
DATA ms_files TYPE zif_abapgit_definitions=>ty_stage_files .
DATA mv_seed TYPE string . " Unique page id to bind JS sessionStorage
DATA mv_filter_value TYPE string.
METHODS find_changed_by
IMPORTING
!it_local TYPE zif_abapgit_definitions=>ty_files_item_tt
RETURNING
VALUE(rt_changed_by) TYPE ty_changed_by_tt .
METHODS find_transports
IMPORTING
it_local TYPE zif_abapgit_definitions=>ty_files_item_tt
RETURNING
VALUE(rt_transports) TYPE ty_transport_tt.
METHODS render_list
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS render_file
IMPORTING
!iv_context TYPE string
!is_file TYPE zif_abapgit_definitions=>ty_file
!is_item TYPE zif_abapgit_definitions=>ty_item OPTIONAL
!iv_changed_by TYPE xubname OPTIONAL
!iv_transport TYPE trkorr OPTIONAL
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS render_actions
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS process_stage_list
IMPORTING
!it_postdata TYPE cnht_post_data_tab
!io_stage TYPE REF TO zcl_abapgit_stage
RAISING
zcx_abapgit_exception .
METHODS build_menu
RETURNING
VALUE(ro_menu) TYPE REF TO zcl_abapgit_html_toolbar .
METHODS get_page_patch
IMPORTING iv_getdata TYPE clike
iv_prev_page TYPE clike
RETURNING VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_PAGE_STAGE IMPLEMENTATION.
METHOD build_menu.
CREATE OBJECT ro_menu.
IF lines( ms_files-local ) > 0.
ro_menu->add( iv_txt = |All diffs|
iv_act = |{ zif_abapgit_definitions=>c_action-go_diff }?key={ mo_repo->get_key( ) }| ).
ENDIF.
ENDMETHOD.
METHOD constructor.
DATA lv_ts TYPE timestamp.
super->constructor( ).
ms_control-page_title = 'STAGE'.
mo_repo = io_repo.
ms_files = zcl_abapgit_factory=>get_stage_logic( )->get( mo_repo ).
mv_seed = iv_seed.
IF mv_seed IS INITIAL. " Generate based on time unless obtained from diff page
GET TIME STAMP FIELD lv_ts.
mv_seed = |stage{ lv_ts }|.
ENDIF.
ms_control-page_menu = build_menu( ).
ENDMETHOD.
METHOD find_changed_by.
DATA: ls_local LIKE LINE OF it_local,
ls_changed_by LIKE LINE OF rt_changed_by.
FIELD-SYMBOLS: <ls_changed_by> LIKE LINE OF rt_changed_by.
LOOP AT it_local INTO ls_local WHERE NOT item IS INITIAL.
ls_changed_by-item = ls_local-item.
INSERT ls_changed_by INTO TABLE rt_changed_by.
ENDLOOP.
LOOP AT rt_changed_by ASSIGNING <ls_changed_by>.
TRY.
<ls_changed_by>-name = to_lower( zcl_abapgit_objects=>changed_by( <ls_changed_by>-item ) ).
CATCH zcx_abapgit_exception.
ENDTRY.
ENDLOOP.
ENDMETHOD.
METHOD find_transports.
DATA: li_cts_api TYPE REF TO zif_abapgit_cts_api,
ls_new LIKE LINE OF rt_transports.
FIELD-SYMBOLS: <ls_local> LIKE LINE OF it_local.
li_cts_api = zcl_abapgit_factory=>get_cts_api( ).
TRY.
LOOP AT it_local ASSIGNING <ls_local> WHERE item IS NOT INITIAL.
IF <ls_local>-item-obj_type IS NOT INITIAL AND
<ls_local>-item-obj_name IS NOT INITIAL AND
<ls_local>-item-devclass IS NOT INITIAL.
IF li_cts_api->is_chrec_possible_for_package( <ls_local>-item-devclass ) = abap_false.
EXIT. " Assume all other objects are also in packages without change recording
ELSEIF li_cts_api->is_object_type_lockable( <ls_local>-item-obj_type ) = abap_true AND
li_cts_api->is_object_locked_in_transport( iv_object_type = <ls_local>-item-obj_type
iv_object_name = <ls_local>-item-obj_name ) = abap_true.
ls_new-item = <ls_local>-item.
ls_new-transport = li_cts_api->get_current_transport_for_obj(
iv_object_type = <ls_local>-item-obj_type
iv_object_name = <ls_local>-item-obj_name
iv_resolve_task_to_request = abap_false ).
INSERT ls_new INTO TABLE rt_transports.
ENDIF.
ENDIF.
ENDLOOP.
CATCH zcx_abapgit_exception.
ASSERT 1 = 2.
ENDTRY.
ENDMETHOD.
METHOD get_page_patch.
DATA: lo_page TYPE REF TO zcl_abapgit_gui_page_diff,
lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
lo_stage TYPE REF TO zcl_abapgit_stage.
zcl_abapgit_html_action_utils=>file_obj_decode(
EXPORTING
iv_string = iv_getdata
IMPORTING
ev_key = lv_key ).
CREATE OBJECT lo_stage.
CREATE OBJECT lo_page
EXPORTING
iv_key = lv_key
iv_patch_mode = abap_true
io_stage = lo_stage.
ri_page = lo_page.
ENDMETHOD.
METHOD process_stage_list.
DATA: lv_string TYPE string,
lt_fields TYPE tihttpnvp,
ls_file TYPE zif_abapgit_definitions=>ty_file.
FIELD-SYMBOLS: <ls_file> LIKE LINE OF ms_files-local,
<ls_item> LIKE LINE OF lt_fields.
CONCATENATE LINES OF it_postdata INTO lv_string.
lt_fields = zcl_abapgit_html_action_utils=>parse_fields( lv_string ).
IF lines( lt_fields ) = 0.
zcx_abapgit_exception=>raise( 'process_stage_list: empty list' ).
ENDIF.
LOOP AT lt_fields ASSIGNING <ls_item>.
zcl_abapgit_path=>split_file_location(
EXPORTING
iv_fullpath = <ls_item>-name
IMPORTING
ev_path = ls_file-path
ev_filename = ls_file-filename ).
CASE <ls_item>-value.
WHEN zcl_abapgit_stage=>c_method-add.
READ TABLE ms_files-local ASSIGNING <ls_file>
WITH KEY file-path = ls_file-path
file-filename = ls_file-filename.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |process_stage_list: unknown file { ls_file-path }{ ls_file-filename }| ).
ENDIF.
io_stage->add( iv_path = <ls_file>-file-path
iv_filename = <ls_file>-file-filename
iv_data = <ls_file>-file-data ).
WHEN zcl_abapgit_stage=>c_method-ignore.
io_stage->ignore( iv_path = ls_file-path
iv_filename = ls_file-filename ).
WHEN zcl_abapgit_stage=>c_method-rm.
io_stage->rm( iv_path = ls_file-path
iv_filename = ls_file-filename ).
WHEN zcl_abapgit_stage=>c_method-skip.
" Do nothing
WHEN OTHERS.
zcx_abapgit_exception=>raise( |process_stage_list: unknown method { <ls_item>-value }| ).
ENDCASE.
ENDLOOP.
ENDMETHOD.
METHOD render_actions.
DATA: lv_local_count TYPE i,
lv_add_all_txt TYPE string,
lv_param TYPE string,
ls_file TYPE zif_abapgit_definitions=>ty_file.
CREATE OBJECT ro_html.
lv_local_count = lines( ms_files-local ).
IF lv_local_count > 0.
lv_add_all_txt = |Add all and commit ({ lv_local_count })|.
" Otherwise empty, but the element (id) is preserved for JS
ENDIF.
ro_html->add( '<table class="w100 margin-v5"><tr>' ).
" Action buttons
ro_html->add( '<td class="indent5em">' ).
ro_html->add_a( iv_act = 'errorStub(event)' " Will be reinit by JS
iv_typ = zif_abapgit_html=>c_action_type-onclick
iv_id = 'commitButton'
iv_style = 'display: none'
iv_txt = 'Commit (<span id="fileCounter"></span>)'
iv_opt = zif_abapgit_html=>c_html_opt-strong ) ##NO_TEXT.
ro_html->add_a( iv_act = |{ c_action-stage_all }|
iv_id = 'commitAllButton'
iv_txt = lv_add_all_txt ) ##NO_TEXT.
lv_param = zcl_abapgit_html_action_utils=>file_encode( iv_key = mo_repo->get_key( )
ig_file = ls_file ).
ro_html->add( '</td>' ).
ro_html->add( '<td class="pad-sides">' ).
ro_html->add_a(
iv_txt = |Patch|
iv_act = |{ zif_abapgit_definitions=>c_action-go_patch }?{ lv_param }| ).
ro_html->add( '</td>' ).
" Filter bar
ro_html->add( '<td class="right">' ).
ro_html->add( '<input class="stage-filter" id="objectSearch"' &&
' type="search" placeholder="Filter objects"' &&
| value={ mv_filter_value }>| ).
ro_html->add( '</td>' ).
ro_html->add( '</tr>' ).
ro_html->add( '</table>' ).
ENDMETHOD.
METHOD render_content.
CREATE OBJECT ro_html.
ro_html->add( '<div class="repo">' ).
ro_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top( mo_repo ) ).
ro_html->add( zcl_abapgit_gui_chunk_lib=>render_js_error_banner( ) ).
ro_html->add( '<div class="stage-container">' ).
ro_html->add( render_actions( ) ).
ro_html->add( render_list( ) ).
ro_html->add( '</div>' ).
ro_html->add( '</div>' ).
ENDMETHOD.
METHOD render_file.
DATA: lv_param TYPE string,
lv_filename TYPE string,
lv_transport_string TYPE string,
lv_transport_html TYPE string.
CREATE OBJECT ro_html.
lv_transport_string = iv_transport.
lv_filename = is_file-path && is_file-filename.
* make sure whitespace is preserved in the DOM
REPLACE ALL OCCURRENCES OF ` ` IN lv_filename WITH ' '.
ro_html->add( |<tr class="{ iv_context }">| ).
CASE iv_context.
WHEN 'local'.
lv_param = zcl_abapgit_html_action_utils=>file_encode(
iv_key = mo_repo->get_key( )
ig_file = is_file ).
lv_filename = zcl_abapgit_html=>a(
iv_txt = lv_filename
iv_act = |{ zif_abapgit_definitions=>c_action-go_diff }?{ lv_param }| ).
IF iv_transport IS NOT INITIAL.
lv_transport_html = zcl_abapgit_html=>a(
iv_txt = lv_transport_string
iv_act = |{ zif_abapgit_definitions=>c_action-jump_transport }?{ iv_transport }| ).
ENDIF.
ro_html->add( |<td class="type">{ is_item-obj_type }</td>| ).
ro_html->add( |<td class="name">{ lv_filename }</td>| ).
ro_html->add( |<td class="user">{ iv_changed_by }</td>| ).
ro_html->add( |<td class="transport">{ lv_transport_html }</td>| ).
WHEN 'remote'.
ro_html->add( '<td class="type">-</td>' ). " Dummy for object type
ro_html->add( |<td class="name">{ lv_filename }</td>| ).
ro_html->add( '<td></td>' ). " Dummy for changed-by
ro_html->add( '<td></td>' ). " Dummy for transport
ENDCASE.
ro_html->add( |<td class="status">?</td>| ).
ro_html->add( '<td class="cmd"></td>' ). " Command added in JS
ro_html->add( '</tr>' ).
ENDMETHOD.
METHOD render_list.
DATA: lt_changed_by TYPE ty_changed_by_tt,
ls_changed_by LIKE LINE OF lt_changed_by,
lt_transports TYPE ty_transport_tt,
ls_transport LIKE LINE OF lt_transports.
FIELD-SYMBOLS: <ls_remote> LIKE LINE OF ms_files-remote,
<ls_local> LIKE LINE OF ms_files-local.
CREATE OBJECT ro_html.
ro_html->add( '<table id="stageTab" class="stage_tab w100">' ).
lt_changed_by = find_changed_by( ms_files-local ).
lt_transports = find_transports( ms_files-local ).
" Local changes
LOOP AT ms_files-local ASSIGNING <ls_local>.
AT FIRST.
ro_html->add( '<thead><tr class="local">' ).
ro_html->add( '<th>Type</th>' ).
ro_html->add( '<th>Files to add (click to see diff)</th>' ).
ro_html->add( '<th>Changed by</th>' ).
ro_html->add( '<th>Transport</th>' ).
ro_html->add( '<th></th>' ). " Status
ro_html->add( '<th class="cmd">' ).
ro_html->add( '<a>add</a>↓ <a>reset</a>↓' ).
ro_html->add( '</th>' ).
ro_html->add( '</tr></thead>' ).
ro_html->add( '<tbody>' ).
ENDAT.
READ TABLE lt_changed_by INTO ls_changed_by WITH KEY item = <ls_local>-item. "#EC CI_SUBRC
READ TABLE lt_transports INTO ls_transport WITH KEY item = <ls_local>-item. "#EC CI_SUBRC
ro_html->add( render_file(
iv_context = 'local'
is_file = <ls_local>-file
is_item = <ls_local>-item
iv_changed_by = ls_changed_by-name
iv_transport = ls_transport-transport ) ).
CLEAR ls_transport.
AT LAST.
ro_html->add( '</tbody>' ).
ENDAT.
ENDLOOP.
" Remote changes
LOOP AT ms_files-remote ASSIGNING <ls_remote>.
AT FIRST.
ro_html->add( '<thead><tr class="remote">' ).
ro_html->add( '<th></th>' ). " Type
ro_html->add( '<th colspan="3">Files to remove or non-code</th>' ).
ro_html->add( '<th></th>' ). " Status
ro_html->add( '<th class="cmd">' ).
ro_html->add( '<a>ignore</a>↓ <a>remove</a>↓ <a>reset</a>↓' ).
ro_html->add( '</th>' ).
ro_html->add( '</tr></thead>' ).
ro_html->add( '<tbody>' ).
ENDAT.
ro_html->add( render_file(
iv_context = 'remote'
is_file = <ls_remote> ) ).
AT LAST.
ro_html->add( '</tbody>' ).
ENDAT.
ENDLOOP.
ro_html->add( '</table>' ).
ENDMETHOD.
METHOD scripts.
ro_html = super->scripts( ).
ro_html->add( 'var gStageParams = {' ).
ro_html->add( | seed: "{ mv_seed }",| ). " Unique page id
ro_html->add( ' formAction: "stage_commit",' ).
ro_html->add( ' ids: {' ).
ro_html->add( ' stageTab: "stageTab",' ).
ro_html->add( ' commitBtn: "commitButton",' ).
ro_html->add( ' commitAllBtn: "commitAllButton",' ).
ro_html->add( ' objectSearch: "objectSearch",' ).
ro_html->add( ' fileCounter: "fileCounter"' ).
ro_html->add( ' }' ).
ro_html->add( '}' ).
ro_html->add( 'var gHelper = new StageHelper(gStageParams);' ).
ENDMETHOD.
METHOD zif_abapgit_gui_page_hotkey~get_hotkey_actions.
DATA: ls_hotkey_action TYPE zif_abapgit_gui_page_hotkey=>ty_hotkey_action.
ls_hotkey_action-name = |Patch|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_patch.
ls_hotkey_action-default_hotkey = |p|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
DATA: lo_stage TYPE REF TO zcl_abapgit_stage,
lv_string TYPE string,
lt_fields TYPE tihttpnvp.
FIELD-SYMBOLS: <ls_file> LIKE LINE OF ms_files-local.
CREATE OBJECT lo_stage.
CLEAR: ei_page, ev_state.
CASE iv_action.
WHEN c_action-stage_all.
LOOP AT ms_files-local ASSIGNING <ls_file>.
lo_stage->add( iv_path = <ls_file>-file-path
iv_filename = <ls_file>-file-filename
iv_data = <ls_file>-file-data ).
ENDLOOP.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_commit
EXPORTING
io_repo = mo_repo
io_stage = lo_stage.
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN c_action-stage_commit.
process_stage_list( it_postdata = it_postdata io_stage = lo_stage ).
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_commit
EXPORTING
io_repo = mo_repo
io_stage = lo_stage.
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN c_action-stage_filter.
CONCATENATE LINES OF it_postdata INTO lv_string.
lt_fields = zcl_abapgit_html_action_utils=>parse_fields( lv_string ).
zcl_abapgit_html_action_utils=>get_field( EXPORTING iv_name = 'filterValue'
it_field = lt_fields
CHANGING cg_field = mv_filter_value ).
ev_state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-go_patch. " Go Patch page
ei_page = get_page_patch(
iv_getdata = iv_getdata
iv_prev_page = iv_prev_page ).
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN OTHERS.
super->zif_abapgit_gui_event_handler~on_event(
EXPORTING
iv_action = iv_action
iv_prev_page = iv_prev_page
iv_getdata = iv_getdata
it_postdata = it_postdata
IMPORTING
ei_page = ei_page
ev_state = ev_state ).
ENDCASE.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
14247,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
8940,
2539,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
347,
43312,
3963,
269,
62,
2673,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3800,
62,
439,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
14247,
62,
439,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3800,
62,
41509,
41876,
4731,
26173,
8924,
705,
14247,
62,
41509,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3800,
62,
24455,
41876,
4731,
26173,
8924,
705,
14247,
62,
24455,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
2673,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
260,
7501,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
28826,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
62,
30281,
93,
261,
62,
15596,
23848,
36,
20032,
17941,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
8543,
62,
11299,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
14750,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
40985,
62,
1525,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2378,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
41876,
2124,
549,
3672,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
40985,
62,
1525,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
40985,
62,
1525,
62,
926,
41876,
311,
9863,
1961,
43679,
3963,
1259,
62,
40985,
62,
1525,
13315,
4725,
33866,
8924,
35374,
2378,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
7645,
634,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2378,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4839,
41876,
491,
74,
38890,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
7645,
634,
11,
198,
220,
220,
220,
220,
220,
1259,
62,
7645,
634,
62,
926,
41876,
311,
9863,
1961,
43679,
3963,
1259,
62,
7645,
634,
13315,
4725,
33866,
8924,
35374,
2378,
13,
628,
220,
220,
220,
42865,
6941,
62,
260,
7501,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
764,
198,
220,
220,
220,
42865,
13845,
62,
16624,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
14247,
62,
16624,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
28826,
41876,
4731,
764,
220,
220,
366,
30015,
2443,
4686,
284,
11007,
26755,
6246,
31425,
198,
220,
220,
220,
42865,
285,
85,
62,
24455,
62,
8367,
41876,
4731,
13,
628,
220,
220,
220,
337,
36252,
50,
1064,
62,
40985,
62,
1525,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
12001,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
62,
9186,
62,
926,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
40985,
62,
1525,
8,
41876,
1259,
62,
40985,
62,
1525,
62,
926,
764,
198,
220,
220,
220,
337,
36252,
50,
1064,
62,
7645,
3742,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
340,
62,
12001,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
62,
9186,
62,
926,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
7645,
3742,
8,
41876,
1259,
62,
7645,
634,
62,
926,
13,
198,
220,
220,
220,
337,
36252,
50,
8543,
62,
4868,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
6494,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
764,
198,
220,
220,
220,
337,
36252,
50,
8543,
62,
7753,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
22866,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
7753,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
7753,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
9186,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
"! FastRWebABAPConnector Class
"!
"! Copyright (c) 2016 Florian Pfeffer
"!
"! Licensed under the Apache License, Version 2.0 (the "License");
"! you may not use this file except in compliance with the License.
"! You may obtain a copy of the License at
"!
"! http://www.apache.org/licenses/LICENSE-2.0
"!
"! Unless required by applicable law or agreed to in writing, software
"! distributed under the License is distributed on an "AS IS" BASIS,
"! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"! See the License for the specific language governing permissions and
"! limitations under the License.
"!
CLASS zz_cl_fastrweb_connector DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zz_if_fastrweb_connector.
ALIASES execute_script FOR zz_if_fastrweb_connector~execute_rscript.
"! constructor
"! @parameter iv_result_type | result type
"! @parameter iv_destination | destination
"! @parameter iv_rscript_path | path to R script
METHODS constructor IMPORTING iv_result_type TYPE string
iv_destination TYPE rfcdest
iv_rscript_path TYPE string.
PROTECTED SECTION.
PRIVATE SECTION.
"! default timeout 5000s
CONSTANTS mc_default_timeout TYPE i VALUE 5000.
"! result type
DATA mv_result_type TYPE string.
"! RFC destination
DATA mv_destination TYPE rfcdest.
"! path to R script
DATA mv_rscript_path TYPE string.
"! http client
DATA mo_http_client TYPE REF TO if_http_client.
"! result type - setter
"! @parameter iv_result_type | result type
METHODS set_result_type IMPORTING iv_result_type TYPE string.
"! result type - getter
"! @parameter rv_result_type | result type
METHODS get_result_type RETURNING VALUE(rv_result_type) TYPE string.
"! destination - setter
"! @parameter iv_destination | destination
METHODS set_destination IMPORTING iv_destination TYPE rfcdest.
"! destination - getter
"! @parameter rv_destination | destination
METHODS get_destination RETURNING VALUE(rv_destination) TYPE rfcdest.
"! R script path - setter
"! @parameter iv_rscript_path | R script path
METHODS set_rscript_path IMPORTING iv_rscript_path TYPE string.
"! R script path - getter
"! @parameter rv_rscript_path | R script path
METHODS get_rscript_path RETURNING VALUE(rv_rscript_path) TYPE string.
"! http client - setter
"! @parameter io_http_client | http client
METHODS set_http_client IMPORTING io_http_client TYPE REF TO if_http_client.
"! http client - getter
"! @parameter ro_http_client |
METHODS get_http_client RETURNING VALUE(ro_http_client) TYPE REF TO if_http_client.
"! execute R script - inner logic
"! @parameter it_parameter | parameter
"! @parameter ct_result | result
"! @raising cx_t100_msg | exception
METHODS inner_execute_rscript IMPORTING it_parameter TYPE zz_if_fastrweb_connector=>mtt_key_value
CHANGING ct_result TYPE zz_if_fastrweb_connector=>mtt_key_value
RAISING cx_t100_msg.
"! create http client
"! @raising cx_t100_msg | exception
METHODS create_http_client RAISING cx_t100_msg.
"! prepare http request
"! @parameter it_parameter | parameter
METHODS prepare_http_request IMPORTING it_parameter TYPE zz_if_fastrweb_connector=>mtt_key_value.
"! send http request
"! @raising cx_t100_msg | exception
METHODS send_http_request RAISING cx_t100_msg.
"! handle http response
"! @parameter ct_result | result
"! @raising cx_t100_msg | exception
METHODS handle_http_response CHANGING ct_result TYPE zz_if_fastrweb_connector=>mtt_key_value
RAISING cx_t100_msg.
"! cleanup
"! @raising cx_t100_msg | exception
METHODS cleanup RAISING cx_t100_msg.
"! helper for exception raising
"! @raising cx_t100_msg | exception
METHODS raise_cx_t100_msg RAISING cx_t100_msg.
"! transform to JSON string
METHODS transform_to_json_string IMPORTING ir_data TYPE REF TO data
RETURNING VALUE(rv_json_string) TYPE string.
"! transform from JSON string
METHODS transform_from_json_string IMPORTING iv_json_string TYPE string
CHANGING cr_data TYPE REF TO data.
ENDCLASS.
CLASS zz_cl_fastrweb_connector IMPLEMENTATION.
METHOD constructor.
set_result_type( iv_result_type ).
set_destination( iv_destination ).
set_rscript_path( iv_rscript_path ).
ENDMETHOD.
METHOD set_result_type.
mv_result_type = iv_result_type.
ENDMETHOD.
METHOD get_result_type.
rv_result_type = mv_result_type.
ENDMETHOD.
METHOD set_destination.
mv_destination = iv_destination.
ENDMETHOD.
METHOD get_destination.
rv_destination = mv_destination.
ENDMETHOD.
METHOD set_rscript_path.
mv_rscript_path = iv_rscript_path.
ENDMETHOD.
METHOD get_rscript_path.
rv_rscript_path = mv_rscript_path.
ENDMETHOD.
METHOD set_http_client.
mo_http_client = io_http_client.
ENDMETHOD.
METHOD get_http_client.
ro_http_client = mo_http_client.
ENDMETHOD.
METHOD zz_if_fastrweb_connector~execute_rscript.
inner_execute_rscript( EXPORTING it_parameter = it_parameter CHANGING ct_result = ct_result ).
ENDMETHOD.
METHOD inner_execute_rscript.
create_http_client( ).
prepare_http_request( it_parameter = it_parameter ).
send_http_request( ).
handle_http_response( CHANGING ct_result = ct_result ).
cleanup( ).
ENDMETHOD.
METHOD create_http_client.
cl_http_client=>create_by_destination(
EXPORTING
destination = get_destination( )
IMPORTING
client = DATA(lo_http_client)
EXCEPTIONS
argument_not_found = 1
destination_not_found = 2
destination_no_authority = 3
plugin_not_active = 4
internal_error = 5
OTHERS = 6 ).
IF sy-subrc <> 0.
raise_cx_t100_msg( ).
ENDIF.
set_http_client( lo_http_client ).
ENDMETHOD.
METHOD prepare_http_request.
get_http_client( )->request->set_version( if_http_request=>co_protocol_version_1_1 ).
get_http_client( )->request->set_method( method = if_http_request=>co_request_method_get ).
IF NOT it_parameter[] IS INITIAL.
DATA(lv_parameter) = REDUCE string( INIT res = || FOR ls_par IN it_parameter NEXT res = res && ls_par-key && '=' && transform_to_json_string( ls_par-value ) && '&' ).
DATA(lv_length) = strlen( lv_parameter ) - 1.
lv_parameter = lv_parameter+0(lv_length).
lv_parameter = '?' && lv_parameter.
ENDIF.
cl_http_utility=>set_request_uri( request = get_http_client( )->request
uri = get_rscript_path( ) && lv_parameter ).
ENDMETHOD.
METHOD send_http_request.
get_http_client( )->send(
EXPORTING
timeout = mc_default_timeout
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
http_invalid_timeout = 4
OTHERS = 5 ).
IF sy-subrc <> 0.
raise_cx_t100_msg( ).
ENDIF.
ENDMETHOD.
METHOD handle_http_response.
get_http_client( )->receive(
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
OTHERS = 4 ).
IF sy-subrc <> 0.
raise_cx_t100_msg( ).
ENDIF.
get_http_client( )->response->get_status( IMPORTING reason = DATA(lv_http_reason) ).
IF lv_http_reason <> if_http_status=>reason_200.
RETURN.
ENDIF.
IF line_exists( ct_result[ key = zz_if_fastrweb_connector=>mc_result_key ] ).
CASE get_result_type( ).
WHEN zz_if_fastrweb_connector=>mc_result_type_json.
transform_from_json_string( EXPORTING iv_json_string = get_http_client( )->response->get_cdata( )
CHANGING cr_data = ct_result[ key = zz_if_fastrweb_connector=>mc_result_key ]-value ).
WHEN zz_if_fastrweb_connector=>mc_result_type_image.
FIELD-SYMBOLS <la_any> TYPE any.
DATA(lr_data) = ct_result[ key = zz_if_fastrweb_connector=>mc_result_key ]-value.
ASSIGN lr_data->* TO <la_any>.
IF <la_any> IS ASSIGNED.
<la_any> = get_http_client( )->response->get_data( ).
ENDIF.
ENDCASE.
ENDIF.
ENDMETHOD.
METHOD cleanup.
get_http_client( )->close(
EXCEPTIONS
http_invalid_state = 1
OTHERS = 2 ).
IF sy-subrc <> 0.
raise_cx_t100_msg( ).
ENDIF.
ENDMETHOD.
METHOD raise_cx_t100_msg.
RAISE EXCEPTION TYPE cx_t100_msg
EXPORTING
t100_msgid = sy-msgid
t100_msgno = sy-msgno
t100_msgv1 = CONV string( sy-msgv1 )
t100_msgv2 = CONV string( sy-msgv2 )
t100_msgv3 = CONV string( sy-msgv3 )
t100_msgv4 = CONV string( sy-msgv4 ).
ENDMETHOD.
METHOD transform_to_json_string.
FIELD-SYMBOLS <la_any> TYPE any.
DATA(lo_json_writer) = cl_sxml_string_writer=>create( type = if_sxml=>co_xt_json ).
ASSIGN ir_data->* TO <la_any>.
IF sy-subrc <> 0.
RETURN.
ENDIF.
CALL TRANSFORMATION id SOURCE data = <la_any>
RESULT XML lo_json_writer.
DATA(lv_json_xstring) = lo_json_writer->get_output( ).
DATA(lo_converter) = cl_abap_conv_in_ce=>create( input = lv_json_xstring ).
lo_converter->read( IMPORTING data = rv_json_string ).
ENDMETHOD.
METHOD transform_from_json_string.
FIELD-SYMBOLS <la_any> TYPE any.
IF iv_json_string IS INITIAL.
RETURN.
ENDIF.
ASSIGN cr_data->* TO <la_any>.
IF sy-subrc <> 0.
RETURN.
ENDIF.
CALL TRANSFORMATION id SOURCE XML iv_json_string
RESULT data = <la_any>.
ENDMETHOD.
ENDCLASS. | [
40484,
12549,
49,
13908,
6242,
2969,
34525,
5016,
198,
40484,
198,
40484,
15069,
357,
66,
8,
1584,
4432,
666,
350,
5036,
36761,
198,
40484,
198,
40484,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
40484,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
40484,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
40484,
198,
40484,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
40484,
198,
40484,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
40484,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
40484,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
40484,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
40484,
11247,
739,
262,
13789,
13,
198,
40484,
198,
31631,
1976,
89,
62,
565,
62,
7217,
81,
12384,
62,
8443,
273,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
89,
62,
361,
62,
7217,
81,
12384,
62,
8443,
273,
13,
198,
220,
220,
220,
8355,
43429,
1546,
12260,
62,
12048,
7473,
1976,
89,
62,
361,
62,
7217,
81,
12384,
62,
8443,
273,
93,
41049,
62,
81,
12048,
13,
628,
220,
220,
220,
366,
0,
23772,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
20274,
62,
4906,
930,
1255,
2099,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
16520,
1883,
930,
10965,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
81,
12048,
62,
6978,
930,
3108,
284,
371,
4226,
198,
220,
220,
220,
337,
36252,
50,
23772,
30023,
9863,
2751,
21628,
62,
20274,
62,
4906,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16520,
1883,
220,
41876,
374,
69,
10210,
395,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
81,
12048,
62,
6978,
41876,
4731,
13,
628,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
366,
0,
4277,
26827,
23336,
82,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
36650,
62,
12286,
62,
48678,
41876,
1312,
26173,
8924,
23336,
13,
628,
220,
220,
220,
366,
0,
1255,
2099,
198,
220,
220,
220,
42865,
285,
85,
62,
20274,
62,
4906,
41876,
4731,
13,
198,
220,
220,
220,
366,
0,
30978,
10965,
198,
220,
220,
220,
42865,
285,
85,
62,
16520,
1883,
41876,
374,
69,
10210,
395,
13,
198,
220,
220,
220,
366,
0,
3108,
284,
371,
4226,
198,
220,
220,
220,
42865,
285,
85,
62,
81,
12048,
62,
6978,
41876,
4731,
13,
198,
220,
220,
220,
366,
0,
2638,
5456,
198,
220,
220,
220,
42865,
6941,
62,
4023,
62,
16366,
41876,
4526,
37,
5390,
611,
62,
4023,
62,
16366,
13,
628,
220,
220,
220,
366,
0,
1255,
2099,
532,
900,
353,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
20274,
62,
4906,
930,
1255,
2099,
198,
220,
220,
220,
337,
36252,
50,
900,
62,
20274,
62,
4906,
30023,
9863,
2751,
21628,
62,
20274,
62,
4906,
41876,
4731,
13,
628,
220,
220,
220,
366,
0,
1255,
2099,
532,
651,
353,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
374,
85,
62,
20274,
62,
4906,
930,
1255,
2099,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
20274,
62,
4906,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
20274,
62,
4906,
8,
41876,
4731,
13,
628,
220,
220,
220,
366,
0,
10965,
532,
900,
353,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
16520,
1883,
930,
10965,
198,
220,
220,
220,
337,
36252,
50,
900,
62,
16520,
1883,
30023,
9863,
2751,
21628,
62,
16520,
1883,
41876,
374,
69,
10210,
395,
13,
198,
220,
220,
220,
366,
0,
10965,
532,
651,
353,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
374,
85,
62,
16520,
1883,
930,
10965,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
16520,
1883,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
16520,
1883,
8,
41876,
374,
69,
10210,
395,
13,
628,
220,
220,
220,
366,
0,
371,
4226,
3108,
532,
900,
353,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
81,
12048,
62,
6978,
930,
371,
4226,
3108,
198,
220,
220,
220,
337,
36252,
50,
900,
62,
81,
12048,
62,
6978,
30023,
9863,
2751,
21628,
62,
81,
12048,
62,
6978,
41876,
4731,
13,
198,
220,
220,
220,
366,
0,
371,
4226,
3108,
532,
651,
353,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
374,
85,
62,
81,
12048,
62,
6978,
930,
371,
4226,
3108,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
81,
12048,
62,
6978,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
81,
12048,
62,
6978,
8,
41876,
4731,
13,
628,
220,
220,
220,
366,
0,
2638,
5456,
532,
900,
353,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
33245,
62,
4023,
62,
16366,
930,
2638,
5456,
198,
220,
220,
220,
337,
36252,
50,
900,
62,
4023,
62,
16366,
30023,
9863,
2751,
33245,
62,
4023,
62,
16366,
41876,
4526,
37,
5390,
611,
62,
4023,
62,
16366,
13,
198,
220,
220,
220,
366,
0,
2638,
5456,
532,
651,
353,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
686,
62,
4023,
62,
16366,
930,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
4023,
62,
16366,
30826,
4261,
15871,
26173,
8924,
7,
305,
62,
4023,
62,
16366,
8,
41876,
4526,
37,
5390,
611,
62,
4023,
62,
16366,
13,
628,
220,
220,
220,
366,
0,
12260,
371,
4226,
532,
8434,
9156,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
340
] | [
1,
1,
1,
1,
1,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_FUNCTION_GROUP_SCREENS. "MESSAGE-ID ..
* INCLUDE LZ_KOITKA_SCREENSD... " Local class definition
DATA: gv_integer_input TYPE i,
gv_numeric_input TYPE n LENGTH 4,
gv_dec_input TYPE p LENGTH 4 DECIMALS 2.
| [
42296,
4177,
2849,
12,
16402,
3535,
1168,
62,
42296,
4177,
2849,
62,
46846,
62,
6173,
2200,
16938,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
44,
1546,
4090,
8264,
12,
2389,
11485,
198,
198,
9,
3268,
5097,
52,
7206,
406,
57,
62,
22328,
2043,
25123,
62,
6173,
2200,
1677,
10305,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
10714,
1398,
6770,
198,
26947,
25,
308,
85,
62,
41433,
62,
15414,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
308,
85,
62,
77,
39223,
62,
15414,
41876,
299,
406,
49494,
604,
11,
198,
220,
220,
220,
220,
220,
308,
85,
62,
12501,
62,
15414,
41876,
279,
406,
49494,
604,
27196,
3955,
23333,
362,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
DATA lsbp LIKE LINE OF it_bp_root.
DATA ls_message LIKE LINE OF ct_validationmessage.
DATA ls_tax_num LIKE LINE OF it_bp_tax_num.
DATA lv_digits TYPE string VALUE '0123456789'.
DATA lv_message TYPE string.
DATA: lv_len_tax TYPE i, lv_tax_digits TYPE string.
LOOP AT it_bp_tax_num INTO ls_tax_num.
*TAX Number validation for Country 'XX'
*where YYY is the tax type
IF ls_tax_num-bptaxtype = 'YYY' OR ls_tax_num-bptaxtypeforedit = 'YYY'.
IF ls_tax_num-bptaxnumber(1) <> 'C' AND ls_tax_num-bptaxnumber(1) <> 'I'.
*You need to create the repository of error messages
CLEAR lv_message.
SELECT SINGLE FROM yy1messageclassXX FIELDS description
WHERE code = '001' INTO @lv_message.
IF sy-subrc = 0.
ls_message-msgv1 = lv_message.
ELSE.
ls_message-msgv1 = 'The Tax Number must start with "C" or "I"'.
ENDIF.
ls_message-msgty = 'E'.
APPEND ls_message TO ct_validationmessage.
ELSE.
lv_len_tax = STRLEN( ls_tax_num-bptaxnumber ).
IF lv_len_tax <> 12.
CLEAR lv_message.
SELECT SINGLE FROM yy1_message_class_XX FIELDS description
WHERE code = '002' INTO @lv_message.
IF sy-subrc = 0.
ls_message-msgv1 = lv_message.
ELSE.
ls_message-msgv1 = 'The length of the Tax Number must be 12. '.
ENDIF.
CLEAR lv_message.
SELECT SINGLE FROM yy1_message_class_XX FIELDS description
WHERE code = '003' INTO @lv_message.
IF sy-subrc = 0.
ls_message-msgv2 = lv_message.
ELSE.
ls_message-msgv2 = 'It must start with "C" or "I" + 11 digits'.
ENDIF.
ls_message-msgty = 'E'.
APPEND ls_message TO ct_validationmessage.
ELSE.
lv_tax_digits = ls_tax_num-bptaxnumber+1.
IF NOT lv_tax_digits CA lv_digits.
CLEAR lv_message.
SELECT SINGLE FROM yy1_message_class_XX FIELDS description
WHERE code = '001' INTO @lv_message.
IF sy-subrc = 0.
ls_message-msgv1 = lv_message.
ELSE.
ls_message-msgv1 = 'The Tax Number must start with "C" or "I" '.
ENDIF.
CLEAR lv_message.
SELECT SINGLE FROM yy1_message_class_XX FIELDS description
WHERE code = '004' INTO @lv_message.
IF sy-subrc = 0.
ls_message-msgv2 = lv_message.
ELSE.
ls_message-msgv2 = 'and followed by 11 digits'.
ENDIF.
ls_message-msgty = 'E'.
APPEND ls_message TO ct_validationmessage.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
| [
26947,
300,
36299,
79,
34178,
48920,
3963,
340,
62,
46583,
62,
15763,
13,
220,
198,
26947,
43979,
62,
20500,
34178,
48920,
3963,
269,
83,
62,
12102,
341,
20500,
13,
198,
26947,
43979,
62,
19290,
62,
22510,
34178,
48920,
3963,
340,
62,
46583,
62,
19290,
62,
22510,
13,
198,
26947,
300,
85,
62,
12894,
896,
41876,
4731,
26173,
8924,
705,
486,
1954,
2231,
3134,
4531,
4458,
198,
26947,
300,
85,
62,
20500,
41876,
4731,
13,
198,
26947,
25,
300,
85,
62,
11925,
62,
19290,
41876,
1312,
11,
300,
85,
62,
19290,
62,
12894,
896,
41876,
4731,
13,
198,
198,
21982,
3185,
5161,
340,
62,
46583,
62,
19290,
62,
22510,
39319,
43979,
62,
19290,
62,
22510,
13,
198,
198,
9,
5603,
55,
7913,
21201,
329,
12946,
705,
8051,
6,
198,
9,
3003,
575,
26314,
318,
262,
1687,
2099,
220,
198,
5064,
43979,
62,
19290,
62,
22510,
12,
65,
32283,
742,
2981,
796,
705,
26314,
56,
6,
6375,
43979,
62,
19290,
62,
22510,
12,
65,
32283,
742,
2981,
754,
5266,
796,
705,
26314,
56,
4458,
220,
198,
5064,
43979,
62,
19290,
62,
22510,
12,
65,
457,
897,
17618,
7,
16,
8,
1279,
29,
705,
34,
6,
5357,
43979,
62,
19290,
62,
22510,
12,
65,
457,
897,
17618,
7,
16,
8,
1279,
29,
705,
40,
4458,
198,
9,
1639,
761,
284,
2251,
262,
16099,
286,
4049,
6218,
220,
198,
29931,
1503,
300,
85,
62,
20500,
13,
220,
198,
198,
46506,
311,
2751,
2538,
16034,
331,
88,
16,
20500,
4871,
8051,
18930,
3698,
5258,
6764,
198,
47357,
2438,
796,
705,
8298,
6,
39319,
2488,
6780,
62,
20500,
13,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
20500,
12,
19662,
85,
16,
796,
300,
85,
62,
20500,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
20500,
12,
19662,
85,
16,
796,
705,
464,
9241,
7913,
1276,
923,
351,
366,
34,
1,
393,
366,
40,
1,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
220,
220,
43979,
62,
20500,
12,
19662,
774,
796,
705,
36,
4458,
198,
220,
220,
220,
220,
220,
43504,
10619,
43979,
62,
20500,
5390,
269,
83,
62,
12102,
341,
20500,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
3698,
5188,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
11925,
62,
19290,
796,
3563,
7836,
1677,
7,
43979,
62,
19290,
62,
22510,
12,
65,
457,
897,
17618,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16876,
300,
85,
62,
11925,
62,
19290,
1279,
29,
1105,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30301,
1503,
300,
85,
62,
20500,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33493,
311,
2751,
2538,
16034,
331,
88,
16,
62,
20500,
62,
4871,
62,
8051,
18930,
3698,
5258,
6764,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33411,
2438,
796,
705,
21601,
6,
39319,
2488,
6780,
62,
20500,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
20500,
12,
19662,
85,
16,
796,
300,
85,
62,
20500,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
20500,
12,
19662,
85,
16,
796,
705,
464,
4129,
286,
262,
9241,
7913,
1276,
307,
1105,
13,
45302,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30301,
1503,
300,
85,
62,
20500,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33493,
311,
2751,
2538,
16034,
331,
88,
16,
62,
20500,
62,
4871,
62,
8051,
18930,
3698,
5258,
6764,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33411,
2438,
796,
705,
11245,
6,
39319,
2488,
6780,
62,
20500,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
report zajson_perf_test.
**********************************************************************
* CONTRIB from https://github.com/sbcgua/benchmarks
**********************************************************************
class lcl_benchmark definition final.
public section.
methods constructor
importing
io_object type ref to object
iv_method type string
iv_times type i.
methods run
raising
cx_static_check.
methods print.
private section.
data mo_object type ref to object.
data mv_method type string.
data mv_times type i.
data mv_diff type tzntstmpl.
endclass.
class lcl_benchmark implementation.
method constructor.
mo_object = io_object.
mv_method = to_upper( iv_method ).
mv_times = iv_times.
endmethod.
method run.
data lv_sta_time type timestampl.
data lv_end_time type timestampl.
get time stamp field lv_sta_time.
do mv_times times.
call method mo_object->(mv_method).
enddo.
get time stamp field lv_end_time.
mv_diff = cl_abap_tstmp=>subtract(
tstmp1 = lv_end_time
tstmp2 = lv_sta_time ).
endmethod.
method print.
data lv_rounds type string.
data lv_result type string.
lv_rounds = |rounds: { mv_times }|.
lv_result = |result: { mv_diff }|.
write: /(30) mv_method, (20) lv_rounds, lv_result.
uline.
endmethod.
endclass.
**********************************************************************
* RUNNER
**********************************************************************
class lcl_runner_base definition.
public section.
methods run
importing
iv_method type string
iv_times type i optional
raising
cx_static_check.
protected section.
data mv_num_rounds type i.
endclass.
class lcl_runner_base implementation.
method run.
data lo_benchmark type ref to lcl_benchmark.
data lv_times type i.
if iv_times > 0.
lv_times = iv_times.
else.
lv_times = mv_num_rounds.
endif.
create object lo_benchmark
exporting
io_object = me
iv_method = iv_method
iv_times = lv_times.
lo_benchmark->run( ).
lo_benchmark->print( ).
endmethod.
endclass.
**********************************************************************
* END OF CONTRIB from https://github.com/sbcgua/benchmarks
**********************************************************************
class lcl_app definition final inheriting from lcl_runner_base.
public section.
methods parse_plain_obj raising cx_static_check.
methods parse_aff_chkc raising cx_static_check.
methods parse_aff_chkc_xslt raising cx_static_check.
methods parse_deep_obj raising cx_static_check.
methods parse_array raising cx_static_check.
methods parse_long_array raising cx_static_check.
methods parse_complex raising cx_static_check.
methods to_abap_plain_obj raising cx_static_check.
methods to_abap_aff_chkc raising cx_static_check.
methods to_abap_aff_chkc_xslt raising cx_static_check.
methods to_abap_deep_obj raising cx_static_check.
methods to_abap_array raising cx_static_check.
methods to_abap_long_array raising cx_static_check.
methods to_abap_complex raising cx_static_check.
class-methods main.
methods prepare.
methods prepare_parsed raising cx_static_check.
methods prepare_complex.
methods prepare_components
importing
iv_fields type i
returning
value(rt_components) type cl_abap_structdescr=>component_table.
methods prepare_json_object
importing
iv_fields type i
iv_start_data type i default 0
returning
value(rv_str) type string.
methods prepare_long_array.
methods prepare_long_array_container
importing
iv_fields type i.
methods prepare_long_array_str
importing
iv_fields type i
iv_lines type i.
data mv_json_plain_obj type string.
data mv_json_aff_chkc type string.
data mv_json_aff_chkc_xstr type xstring.
data mv_json_aff_chkc_tabl type string_table.
data mv_json_deep type string.
data mv_json_array type string.
data mv_json_long_array type string.
data mv_json_complex type string.
data mr_complex_data type ref to data.
data mr_long_array type ref to data.
data mo_plain_obj type ref to zif_ajson.
data mo_aff_chkc type ref to zif_ajson.
data mo_deep type ref to zif_ajson.
data mo_array type ref to zif_ajson.
data mo_long_array type ref to zif_ajson.
data mo_complex type ref to zif_ajson.
data mo_json_writer type ref to cl_sxml_string_writer.
data mo_json_reader type ref to if_sxml_reader.
data ST_RESULT type abap_trans_resbind_tab.
types:
begin of ty_fragment,
string type string,
number type i,
float type f,
end of ty_fragment,
tt_fragment type standard table of ty_fragment with default key,
begin of ty_plain.
include type ty_fragment.
types:
boolean type abap_bool,
false type abap_bool,
null type string,
date type string, " ??? TODO
str1 type string,
str2 type string,
end of ty_plain,
begin of ty_deep1.
include type ty_fragment.
types: deep type ty_fragment,
end of ty_deep1,
begin of ty_deep2.
include type ty_fragment.
types: deep type ty_deep1,
end of ty_deep2,
begin of ty_deep3.
include type ty_fragment.
types: deep type ty_deep2,
end of ty_deep3.
endclass.
class lcl_app implementation.
method prepare.
mv_json_plain_obj =
'{' &&
' "string": "abc",' &&
' "number": 123,' &&
' "float": 123.45,' &&
' "boolean": true,' &&
' "false": false,' &&
' "null": null,' &&
' "date": "2020-03-15",' &&
' "str1": "hello",' &&
' "str2": "world"' &&
'}'.
mv_json_aff_chkc_tabl = value #(
( `{` )
( ` "formatversion": "1",`)
( `"header": {` )
( ` "description": "Example CHKC for ABAP file formats",` )
( ` "abapLanguageVersion": "cloudDevelopment",` )
( ` "originallanguage": "en"` )
( ` },` )
( ` "parentcategory": "SYCM_S4H_READINESS"` )
( `}` )
).
mv_json_aff_chkc = concat_lines_of( table = mv_json_aff_chkc_tabl ).
mv_json_aff_chkc_xstr = cl_abap_codepage=>convert_to( mv_json_aff_chkc ).
mv_json_deep =
'{' &&
' "string": "abc",' &&
' "number": 123,' &&
' "float": 123.45,' &&
' "deep" : {' &&
' "string": "abc",' &&
' "number": 223,' &&
' "float": 123.45,' &&
' "deep" : {' &&
' "string": "abc",' &&
' "number": 323,' &&
' "float": 123.45,' &&
' "deep" : {' &&
' "string": "abc",' &&
' "number": 423, ' &&
' "float": 123.45 ' &&
' }' &&
' }' &&
' }' &&
'}'.
mv_json_array = '['.
do 10 times.
if sy-index <> 1.
mv_json_array = mv_json_array && `, `.
endif.
mv_json_array = mv_json_array &&
'{' &&
' "string": "abc", ' &&
' "number": 123, ' &&
' "float": 123.45 ' &&
'}'.
enddo.
mv_json_array = mv_json_array && ']'.
prepare_complex( ).
prepare_long_array( ).
endmethod.
method prepare_complex.
constants lc_fields type i value 256.
constants lc_tabrows type i value 256.
data lo_long_struc type ref to cl_abap_structdescr.
data lo_long_table type ref to cl_abap_tabledescr.
data lt_components type cl_abap_structdescr=>component_table.
data lv_data type i.
data lo_complex_type type ref to cl_abap_structdescr.
data ls_comp like line of lt_components.
lt_components = prepare_components( lc_fields ).
lo_long_struc = cl_abap_structdescr=>create( lt_components ).
lo_long_table = cl_abap_tabledescr=>create( lo_long_struc ).
ls_comp-type ?= lo_long_table.
ls_comp-name = 'TAB'.
append ls_comp to lt_components.
lo_complex_type = cl_abap_structdescr=>create( lt_components ).
create data mr_complex_data type handle lo_complex_type.
" Data
mv_json_complex = prepare_json_object(
iv_fields = lc_fields
iv_start_data = lv_data ).
lv_data = lv_data + lc_fields.
mv_json_complex = replace( val = mv_json_complex sub = '}' with = `, "TAB": [` ).
data lt_tab type string_table.
do lc_tabrows times.
append prepare_json_object(
iv_fields = lc_fields
iv_start_data = lv_data ) to lt_tab.
lv_data = lv_data + lc_fields.
enddo.
mv_json_complex = mv_json_complex && concat_lines_of( table = lt_tab sep = `, ` ) && `]}`.
endmethod.
method prepare_long_array.
constants lc_fields type i value 20.
constants lc_tabrows type i value 5000.
prepare_long_array_container( iv_fields = lc_fields ).
prepare_long_array_str(
iv_fields = lc_fields
iv_lines = lc_tabrows ).
endmethod.
method prepare_components.
data lo_field_type type ref to cl_abap_datadescr.
data ls_comp like line of rt_components.
lo_field_type ?= cl_abap_typedescr=>describe_by_name( 'CHAR10' ).
ls_comp-type = lo_field_type.
do iv_fields times.
ls_comp-name = |C{ sy-index }|.
append ls_comp to rt_components.
enddo.
endmethod.
method prepare_long_array_container.
data lo_long_struc type ref to cl_abap_structdescr.
data lo_long_table type ref to cl_abap_tabledescr.
data lt_components type cl_abap_structdescr=>component_table.
lt_components = prepare_components( iv_fields ).
lo_long_struc = cl_abap_structdescr=>create( lt_components ).
lo_long_table = cl_abap_tabledescr=>create( lo_long_struc ).
create data mr_long_array type handle lo_long_table.
endmethod.
method prepare_json_object.
data lv_data type i.
data lt_tab type string_table.
data lv_tmp type string.
lv_data = iv_start_data.
do iv_fields times.
lv_data = lv_data + 1.
lv_tmp = |"C{ sy-index }": "{ lv_data }"|.
append lv_tmp to lt_tab.
enddo.
rv_str = `{` && concat_lines_of( table = lt_tab sep = `, ` ) && `}`.
endmethod.
method prepare_long_array_str.
data lt_tab type string_table.
data lv_data type i.
do iv_lines times.
append prepare_json_object(
iv_fields = iv_fields
iv_start_data = lv_data ) to lt_tab.
lv_data = lv_data + iv_fields.
enddo.
mv_json_long_array = `[` && concat_lines_of( table = lt_tab sep = `, ` ) && `]`.
endmethod.
method prepare_parsed.
mo_plain_obj = zcl_ajson=>parse( mv_json_plain_obj ).
mo_aff_chkc = zcl_ajson=>parse( mv_json_aff_chkc ).
mo_deep = zcl_ajson=>parse( mv_json_deep ).
mo_array = zcl_ajson=>parse( mv_json_array ).
mo_complex = zcl_ajson=>parse( mv_json_complex ).
mo_long_array = zcl_ajson=>parse( mv_json_long_array ).
mo_json_writer = cl_sxml_string_writer=>create( type = if_sxml=>co_xt_json ).
field-symbols <st_result> like line of ST_RESULT.
append initial line to ST_RESULT assigning <st_result>.
<st_result>-name = 'ROOT'.
data data type zif_aff_chkc_v1=>ty_main.
get reference of data into <st_result>-value.
mo_json_reader = cl_sxml_string_reader=>create( mv_json_aff_chkc_xstr ).
endmethod.
method parse_plain_obj.
data lo_json type ref to zif_ajson.
lo_json = zcl_ajson=>parse( mv_json_plain_obj ).
endmethod.
method parse_aff_chkc.
data lo_json type ref to zif_ajson.
lo_json = zcl_ajson=>parse( mv_json_aff_chkc ).
endmethod.
method parse_aff_chkc_xslt.
endmethod.
method parse_deep_obj.
data lo_json type ref to zif_ajson.
lo_json = zcl_ajson=>parse( mv_json_deep ).
endmethod.
method parse_array.
data lo_json type ref to zif_ajson.
lo_json = zcl_ajson=>parse( mv_json_array ).
endmethod.
method parse_long_array.
data lo_json type ref to zif_ajson.
lo_json = zcl_ajson=>parse( mv_json_long_array ).
endmethod.
method parse_complex.
data lo_json type ref to zif_ajson.
lo_json = zcl_ajson=>parse( mv_json_complex ).
endmethod.
method to_abap_plain_obj.
data ls_target type ty_plain.
mo_plain_obj->to_abap( importing ev_container = ls_target ).
endmethod.
method to_abap_aff_chkc.
data ls_target type zif_aff_chkc_v1=>ty_main.
mo_aff_chkc->to_abap( importing ev_container = ls_target ).
endmethod.
method to_abap_aff_chkc_xslt.
" fill ABAP type with (previously parsed) data
call transformation ('CHKC_JSON')
source xml mo_json_reader
result (st_result).
endmethod.
method to_abap_deep_obj.
data ls_target type ty_deep3.
mo_deep->to_abap( importing ev_container = ls_target ).
endmethod.
method to_abap_array.
data ls_target type tt_fragment.
mo_array->to_abap( importing ev_container = ls_target ).
endmethod.
method to_abap_long_array.
field-symbols <data> type any.
assign mr_long_array->* to <data>.
mo_long_array->to_abap( importing ev_container = <data> ).
endmethod.
method to_abap_complex.
field-symbols <data> type any.
assign mr_complex_data->* to <data>.
mo_complex->to_abap( importing ev_container = <data> ).
endmethod.
method main.
data lo_app type ref to lcl_app.
data lx type ref to cx_root.
data lv_tmp type string.
create object lo_app.
lo_app->mv_num_rounds = 1000.
lv_tmp = |{ sy-datum+0(4) }-{ sy-datum+4(2) }-{ sy-datum+6(2) }|.
write: / 'Date', lv_tmp.
try.
lo_app->prepare( ).
lo_app->run( 'parse_plain_obj' ).
lo_app->run( 'parse_aff_chkc' ).
lo_app->run( 'parse_aff_chkc_xslt' ).
lo_app->run( 'parse_deep_obj' ).
lo_app->run( 'parse_array' ).
lo_app->run(
iv_method = 'parse_long_array'
iv_times = 5 ).
lo_app->run(
iv_method = 'parse_complex'
iv_times = 5 ).
lo_app->prepare_parsed( ).
lo_app->run( 'to_abap_plain_obj' ).
lo_app->run( 'to_abap_aff_chkc' ).
lo_app->run( 'to_abap_aff_chkc_xslt' ).
lo_app->run( 'to_abap_deep_obj' ).
lo_app->run( 'to_abap_array' ).
lo_app->run(
iv_method = 'to_abap_long_array'
iv_times = 5 ).
lo_app->run(
iv_method = 'to_abap_complex'
iv_times = 5 ).
catch cx_root into lx.
lv_tmp = lx->get_text( ).
write: / 'Exception raised:', lv_tmp.
endtry.
endmethod.
endclass.
start-of-selection.
lcl_app=>main( ).
| [
13116,
1976,
1228,
1559,
62,
525,
69,
62,
9288,
13,
198,
198,
17174,
17174,
2466,
1174,
198,
9,
27342,
9865,
422,
3740,
1378,
12567,
13,
785,
14,
82,
15630,
5162,
64,
14,
26968,
14306,
198,
17174,
17174,
2466,
1174,
198,
198,
4871,
300,
565,
62,
26968,
4102,
6770,
2457,
13,
198,
220,
1171,
2665,
13,
198,
220,
220,
220,
5050,
23772,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
15252,
2099,
1006,
284,
2134,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
24396,
2099,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
22355,
220,
2099,
1312,
13,
198,
220,
220,
220,
5050,
1057,
198,
220,
220,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
5050,
3601,
13,
628,
220,
2839,
2665,
13,
198,
220,
220,
220,
1366,
6941,
62,
15252,
2099,
1006,
284,
2134,
13,
198,
220,
220,
220,
1366,
285,
85,
62,
24396,
2099,
4731,
13,
198,
220,
220,
220,
1366,
285,
85,
62,
22355,
2099,
1312,
13,
198,
220,
220,
220,
1366,
285,
85,
62,
26069,
2099,
256,
89,
429,
301,
76,
489,
13,
198,
437,
4871,
13,
198,
198,
4871,
300,
565,
62,
26968,
4102,
7822,
13,
628,
220,
2446,
23772,
13,
198,
220,
220,
220,
6941,
62,
15252,
796,
33245,
62,
15252,
13,
198,
220,
220,
220,
285,
85,
62,
24396,
796,
284,
62,
45828,
7,
21628,
62,
24396,
6739,
198,
220,
220,
220,
285,
85,
62,
22355,
796,
21628,
62,
22355,
13,
198,
220,
886,
24396,
13,
628,
220,
2446,
1057,
13,
198,
220,
220,
220,
1366,
300,
85,
62,
38031,
62,
2435,
2099,
4628,
395,
321,
489,
13,
198,
220,
220,
220,
1366,
300,
85,
62,
437,
62,
2435,
2099,
4628,
395,
321,
489,
13,
628,
220,
220,
220,
651,
640,
17977,
2214,
300,
85,
62,
38031,
62,
2435,
13,
198,
220,
220,
220,
466,
285,
85,
62,
22355,
1661,
13,
198,
220,
220,
220,
220,
220,
869,
2446,
6941,
62,
15252,
3784,
7,
76,
85,
62,
24396,
737,
198,
220,
220,
220,
886,
4598,
13,
198,
220,
220,
220,
651,
640,
17977,
2214,
300,
85,
62,
437,
62,
2435,
13,
628,
220,
220,
220,
285,
85,
62,
26069,
220,
796,
537,
62,
397,
499,
62,
83,
301,
3149,
14804,
7266,
83,
974,
7,
198,
220,
220,
220,
220,
220,
256,
301,
3149,
16,
796,
300,
85,
62,
437,
62,
2435,
198,
220,
220,
220,
220,
220,
256,
301,
3149,
17,
796,
300,
85,
62,
38031,
62,
2435,
6739,
628,
220,
886,
24396,
13,
628,
220,
2446,
3601,
13,
198,
220,
220,
220,
1366,
300,
85,
62,
744,
82,
2099,
4731,
13,
198,
220,
220,
220,
1366,
300,
85,
62,
20274,
2099,
4731,
13,
198,
220,
220,
220,
300,
85,
62,
744,
82,
796,
930,
744,
82,
25,
1391,
285,
85,
62,
22355,
1782,
91,
13,
198,
220,
220,
220,
300,
85,
62,
20274,
796,
930,
20274,
25,
1391,
285,
85,
62,
26069,
1782,
91,
13,
198,
220,
220,
220,
3551,
25,
1220,
7,
1270,
8,
285,
85,
62,
24396,
11,
357,
1238,
8,
300,
85,
62,
744,
82,
11,
300,
85,
62,
20274,
13,
198,
220,
220,
220,
334,
1370,
13,
198,
220,
886,
24396,
13,
198,
198,
437,
4871,
13,
198,
198,
17174,
17174,
2466,
1174,
198,
9,
32494,
21479,
198,
17174,
17174,
2466,
1174,
198,
198,
4871,
300,
565,
62,
16737,
62,
8692,
6770,
13,
198,
220,
1171,
2665,
13,
628,
220,
220,
220,
5050,
1057,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
24396,
2099,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
22355,
2099,
1312,
11902,
198,
220,
220,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
12708,
62,
9122,
13,
628,
220,
6861,
2665,
13,
198,
220,
220,
220,
1366,
285,
85,
62,
22510,
62,
744,
82,
2099,
1312,
13,
198,
198,
437,
4871,
13,
198,
198,
4871,
300,
565,
62,
16737,
62,
8692,
7822,
13,
628,
220,
2446,
1057,
13,
628,
220,
220,
220,
1366,
2376,
62,
26968,
4102,
2099,
1006,
284,
300,
565,
62,
26968,
4102,
13,
198,
220,
220,
220,
1366,
300,
85,
62,
22355,
2099,
1312,
13,
628,
220,
220,
220,
611,
21628,
62,
22355,
1875,
657,
13,
198,
220,
220,
220,
220,
220,
300,
85,
62,
22355,
796,
21628,
62,
22355,
13,
198,
220,
220,
220,
2073,
13,
198,
220,
220,
220,
220,
220,
300,
85,
62,
22355,
796,
285,
85,
62,
22510,
62,
744,
82,
13,
198,
220,
220,
220,
45762,
13,
628,
220,
220,
220,
2251,
2134,
2376,
62,
26968,
4102,
198,
220,
220,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
15252,
796,
502,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
24396,
796,
21628,
62,
24396,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
22355,
220,
796,
300,
85,
62,
22355,
13,
628,
220,
220,
220,
2376,
62,
26968,
4102,
3784,
5143,
7,
6739,
198,
220,
220,
220,
2376,
62,
26968,
4102,
3784,
4798,
7,
6739,
628,
220,
886,
24396,
13,
198,
198,
437,
4871,
13,
198,
198,
17174,
17174,
2466,
1174,
198,
9,
23578,
3963,
27342,
9865,
422,
3740,
1378,
12567,
13,
785,
14,
82,
15630,
5162,
64,
14,
26968,
14306,
198,
17174,
17174,
2466,
1174,
198,
198,
4871,
300,
565,
62,
1324,
6770,
2457,
10639,
1780,
422,
300,
565,
62,
16737,
62,
8692,
13,
198,
220,
1171,
2665,
13,
628,
220,
220,
220,
5050,
21136,
62,
25638,
62,
26801,
8620,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
5050,
21136,
62,
2001,
62,
354,
74,
66,
8620,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
5050,
21136,
62,
2001,
62,
354,
74,
66,
62,
34223,
2528,
8620,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
5050,
21136,
62,
22089,
62,
26801,
8620,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
5050,
21136,
62,
18747,
8620,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
5050,
21136
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_objects_super DEFINITION
PUBLIC
ABSTRACT
CREATE PUBLIC .
PUBLIC SECTION.
CONSTANTS c_user_unknown TYPE xubname VALUE 'UNKNOWN'.
METHODS constructor
IMPORTING
!is_item TYPE zif_abapgit_definitions=>ty_item
!iv_language TYPE spras .
CLASS-METHODS jump_adt
IMPORTING
!iv_obj_name TYPE zif_abapgit_definitions=>ty_item-obj_name
!iv_obj_type TYPE zif_abapgit_definitions=>ty_item-obj_type
!iv_sub_obj_name TYPE zif_abapgit_definitions=>ty_item-obj_name OPTIONAL
!iv_sub_obj_type TYPE zif_abapgit_definitions=>ty_item-obj_type OPTIONAL
!iv_line_number TYPE i OPTIONAL
RAISING
zcx_abapgit_exception .
PROTECTED SECTION.
DATA ms_item TYPE zif_abapgit_definitions=>ty_item .
DATA mv_language TYPE spras .
METHODS get_metadata
RETURNING
VALUE(rs_metadata) TYPE zif_abapgit_definitions=>ty_metadata .
METHODS corr_insert
IMPORTING
!iv_package TYPE devclass
!ig_object_class TYPE any OPTIONAL
RAISING
zcx_abapgit_exception .
METHODS tadir_insert
IMPORTING
!iv_package TYPE devclass
RAISING
zcx_abapgit_exception .
METHODS jump_se11
RAISING
zcx_abapgit_exception .
METHODS exists_a_lock_entry_for
IMPORTING
!iv_lock_object TYPE string
!iv_argument TYPE seqg3-garg OPTIONAL
RETURNING
VALUE(rv_exists_a_lock_entry) TYPE abap_bool
RAISING
zcx_abapgit_exception .
METHODS set_default_package
IMPORTING
!iv_package TYPE devclass .
METHODS serialize_longtexts
IMPORTING
!ii_xml TYPE REF TO zif_abapgit_xml_output
!iv_longtext_id TYPE dokil-id OPTIONAL
!it_dokil TYPE zif_abapgit_definitions=>ty_dokil_tt OPTIONAL
RAISING
zcx_abapgit_exception .
METHODS deserialize_longtexts
IMPORTING
!ii_xml TYPE REF TO zif_abapgit_xml_input
RAISING
zcx_abapgit_exception .
METHODS delete_longtexts
IMPORTING
!iv_longtext_id TYPE dokil-id
RAISING
zcx_abapgit_exception .
METHODS is_active
RETURNING
VALUE(rv_active) TYPE abap_bool
RAISING
zcx_abapgit_exception .
METHODS delete_ddic
IMPORTING
VALUE(iv_objtype) TYPE string
VALUE(iv_no_ask) TYPE abap_bool DEFAULT abap_true
VALUE(iv_no_ask_delete_append) TYPE abap_bool DEFAULT abap_false
RAISING
zcx_abapgit_exception .
METHODS serialize_lxe_texts
IMPORTING
!ii_xml TYPE REF TO zif_abapgit_xml_output
RAISING
zcx_abapgit_exception .
METHODS deserialize_lxe_texts
IMPORTING
!ii_xml TYPE REF TO zif_abapgit_xml_input
RAISING
zcx_abapgit_exception .
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_abapgit_objects_super IMPLEMENTATION.
METHOD constructor.
ms_item = is_item.
ASSERT NOT ms_item IS INITIAL.
mv_language = iv_language.
ASSERT NOT mv_language IS INITIAL.
ENDMETHOD.
METHOD corr_insert.
DATA: lv_object TYPE string,
lv_object_class TYPE string.
IF ig_object_class IS NOT INITIAL.
lv_object_class = ig_object_class.
IF ig_object_class = 'DICT'.
CONCATENATE ms_item-obj_type ms_item-obj_name INTO lv_object.
ELSE.
lv_object = ms_item-obj_name.
ENDIF.
ELSE.
lv_object_class = ms_item-obj_type.
lv_object = ms_item-obj_name.
ENDIF.
CALL FUNCTION 'RS_CORR_INSERT'
EXPORTING
object = lv_object
object_class = lv_object_class
devclass = iv_package
master_language = mv_language
global_lock = abap_true
mode = 'I'
suppress_dialog = abap_true
EXCEPTIONS
cancelled = 1
permission_failure = 2
unknown_objectclass = 3
OTHERS = 4.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD delete_ddic.
DATA: lv_objname TYPE rsedd0-ddobjname,
lv_objtype TYPE rsedd0-ddobjtype.
lv_objname = ms_item-obj_name.
lv_objtype = iv_objtype.
TRY.
CALL FUNCTION 'RS_DD_DELETE_OBJ'
EXPORTING
no_ask = iv_no_ask
objname = lv_objname
objtype = lv_objtype
no_ask_delete_append = iv_no_ask_delete_append
EXCEPTIONS
not_executed = 1
object_not_found = 2
object_not_specified = 3
permission_failure = 4
dialog_needed = 5
OTHERS = 6.
CATCH cx_sy_dyn_call_param_not_found.
" no_ask_delete_append not available in lower releases
CALL FUNCTION 'RS_DD_DELETE_OBJ'
EXPORTING
no_ask = iv_no_ask
objname = lv_objname
objtype = lv_objtype
EXCEPTIONS
not_executed = 1
object_not_found = 2
object_not_specified = 3
permission_failure = 4
dialog_needed = 5
OTHERS = 6.
ENDTRY.
IF sy-subrc = 5.
zcx_abapgit_exception=>raise( |Object { ms_item-obj_type } { ms_item-obj_name
} has dependencies and must be deleted manually| ).
ELSEIF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error deleting { ms_item-obj_type } { ms_item-obj_name }| ).
ENDIF.
ENDMETHOD.
METHOD delete_longtexts.
zcl_abapgit_factory=>get_longtexts( )->delete(
iv_longtext_id = iv_longtext_id
iv_object_name = ms_item-obj_name ).
ENDMETHOD.
METHOD deserialize_longtexts.
zcl_abapgit_factory=>get_longtexts( )->deserialize(
ii_xml = ii_xml
iv_main_language = mv_language ).
ENDMETHOD.
METHOD deserialize_lxe_texts.
zcl_abapgit_factory=>get_lxe_texts( )->deserialize(
iv_object_type = ms_item-obj_type
iv_object_name = ms_item-obj_name
ii_xml = ii_xml ).
ENDMETHOD.
METHOD exists_a_lock_entry_for.
DATA: lt_lock_entries TYPE STANDARD TABLE OF seqg3.
CALL FUNCTION 'ENQUEUE_READ'
EXPORTING
guname = '*'
garg = iv_argument
TABLES
enq = lt_lock_entries
EXCEPTIONS
communication_failure = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
READ TABLE lt_lock_entries TRANSPORTING NO FIELDS
WITH KEY gobj = iv_lock_object.
IF sy-subrc = 0.
rv_exists_a_lock_entry = abap_true.
ENDIF.
ENDMETHOD.
METHOD get_metadata.
DATA: lv_class TYPE string.
lv_class = cl_abap_classdescr=>describe_by_object_ref( me )->get_relative_name( ).
REPLACE FIRST OCCURRENCE OF 'ZCL_ABAPGIT' IN lv_class WITH 'LCL'.
rs_metadata-class = lv_class.
rs_metadata-version = 'v1.0.0'.
ENDMETHOD.
METHOD is_active.
DATA: lt_messages TYPE STANDARD TABLE OF sprot_u WITH DEFAULT KEY,
lt_e071_tadirs TYPE STANDARD TABLE OF e071 WITH DEFAULT KEY,
ls_e071_tadir LIKE LINE OF lt_e071_tadirs.
ms_item-inactive = abap_false.
ls_e071_tadir-object = ms_item-obj_type.
ls_e071_tadir-obj_name = ms_item-obj_name.
INSERT ls_e071_tadir INTO TABLE lt_e071_tadirs.
CALL FUNCTION 'RS_INACTIVE_OBJECTS_WARNING'
EXPORTING
suppress_protocol = abap_false
with_program_includes = abap_false
suppress_dictionary_check = abap_false
TABLES
p_e071 = lt_e071_tadirs
p_xmsg = lt_messages.
IF lt_messages IS NOT INITIAL.
ms_item-inactive = abap_true.
ENDIF.
rv_active = boolc( ms_item-inactive = abap_false ).
ENDMETHOD.
METHOD jump_adt.
DATA: lv_adt_link TYPE string,
lx_error TYPE REF TO cx_root.
TRY.
lv_adt_link = zcl_abapgit_adt_link=>generate(
iv_obj_name = iv_obj_name
iv_obj_type = iv_obj_type
iv_sub_obj_name = iv_sub_obj_name
iv_line_number = iv_line_number ).
zcl_abapgit_ui_factory=>get_frontend_services( )->execute( iv_document = lv_adt_link ).
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise( iv_text = 'ADT Jump Error'
ix_previous = lx_error ).
ENDTRY.
ENDMETHOD.
METHOD jump_se11.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ms_item-obj_name
object_type = ms_item-obj_type
devclass = ms_item-devclass
in_new_window = abap_true
EXCEPTIONS
not_executed = 1
invalid_object_type = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Jump to SE11 failed (subrc={ sy-subrc } ).| ).
ENDIF.
ENDMETHOD.
METHOD serialize_longtexts.
zcl_abapgit_factory=>get_longtexts( )->serialize(
iv_object_name = ms_item-obj_name
iv_longtext_id = iv_longtext_id
it_dokil = it_dokil
ii_xml = ii_xml ).
ENDMETHOD.
METHOD serialize_lxe_texts.
IF ii_xml->i18n_params( )-main_language_only = abap_true OR
ii_xml->i18n_params( )-translation_languages IS INITIAL.
RETURN.
ENDIF.
zcl_abapgit_factory=>get_lxe_texts( )->serialize(
iv_object_type = ms_item-obj_type
iv_object_name = ms_item-obj_name
ii_xml = ii_xml ).
ENDMETHOD.
METHOD set_default_package.
" In certain cases we need to set the package package via ABAP memory
" because we can't supply it via the APIs.
"
" Set default package, see function module RS_CORR_INSERT FORM get_current_devclass.
"
" We use ABAP memory instead the SET parameter because it is
" more reliable. SET parameter doesn't work when multiple objects
" are deserialized which uses the ABAP memory mechanism.
" We don't need to reset the memory as it is done in above mentioned form routine.
EXPORT current_devclass FROM iv_package TO MEMORY ID 'EUK'.
ENDMETHOD.
METHOD tadir_insert.
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_test_modus = abap_false
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = ms_item-obj_type
wi_tadir_obj_name = ms_item-obj_name
wi_tadir_author = sy-uname
wi_tadir_devclass = iv_package
wi_tadir_masterlang = mv_language
iv_delflag = abap_false
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
9564,
18601,
10659,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
7220,
62,
34680,
41876,
2124,
549,
3672,
26173,
8924,
705,
4944,
44706,
4458,
628,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
9186,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
16129,
41876,
7500,
292,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
4391,
62,
324,
83,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26801,
62,
3672,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26801,
62,
4906,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
12,
26801,
62,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
7266,
62,
26801,
62,
3672,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
12,
26801,
62,
3672,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
7266,
62,
26801,
62,
4906,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
12,
26801,
62,
4906,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
1370,
62,
17618,
220,
41876,
1312,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
42865,
13845,
62,
9186,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
16129,
41876,
7500,
292,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
38993,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
38993,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
38993,
764,
198,
220,
220,
220,
337,
36252,
50,
1162,
81,
62,
28463,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26495,
220,
220,
220,
220,
220,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
328,
62,
15252,
62,
4871,
41876,
597,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
36264,
343,
62,
28463,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26495,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
4391,
62,
325,
1157,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
7160,
62,
64,
62,
5354,
62,
13000,
62,
1640,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
5354,
62,
15252,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
49140,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
33756,
70,
18,
12,
70,
853,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
1069,
1023,
62,
64,
62,
5354,
62,
13000,
8,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
900,
62,
12286,
62,
26495,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26495,
41876,
1614,
4871,
764,
198,
220,
220,
220,
337,
36252,
50,
11389,
1096,
62,
6511,
5239,
82,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
19875,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19875,
62,
22915,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
6511,
5239,
62,
312,
41876,
466,
34553,
12,
312,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
67,
482,
346,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
67,
482,
346,
62,
926,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
748,
48499,
1096,
62,
6511,
5239,
82,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
19875,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19875,
62,
15414,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_html_action_utils DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS parse_fields
IMPORTING
!iv_string TYPE clike
RETURNING
VALUE(rt_fields) TYPE tihttpnvp .
CLASS-METHODS parse_fields_upper_case_name
IMPORTING
!iv_string TYPE clike
RETURNING
VALUE(rt_fields) TYPE tihttpnvp .
CLASS-METHODS get_field
IMPORTING
!iv_name TYPE string
!it_field TYPE tihttpnvp
!iv_decode TYPE abap_bool DEFAULT abap_false
CHANGING
!cg_field TYPE any .
CLASS-METHODS jump_encode
IMPORTING
!iv_obj_type TYPE tadir-object
!iv_obj_name TYPE tadir-obj_name
RETURNING
VALUE(rv_string) TYPE string .
CLASS-METHODS jump_decode
IMPORTING
!iv_string TYPE clike
EXPORTING
!ev_obj_type TYPE tadir-object
!ev_obj_name TYPE tadir-obj_name
RAISING
zcx_abapgit_exception .
CLASS-METHODS dir_encode
IMPORTING
!iv_path TYPE string
RETURNING
VALUE(rv_string) TYPE string .
CLASS-METHODS dir_decode
IMPORTING
!iv_string TYPE clike
RETURNING
VALUE(rv_path) TYPE string
RAISING
zcx_abapgit_exception .
CLASS-METHODS file_encode
IMPORTING
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
!ig_file TYPE any
RETURNING
VALUE(rv_string) TYPE string .
CLASS-METHODS obj_encode
IMPORTING
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
!ig_object TYPE any
RETURNING
VALUE(rv_string) TYPE string .
CLASS-METHODS file_obj_decode
IMPORTING
!iv_string TYPE clike
EXPORTING
!ev_key TYPE zif_abapgit_persistence=>ty_repo-key
!eg_file TYPE any "assuming ty_file
!eg_object TYPE any "assuming ty_item
RAISING
zcx_abapgit_exception .
CLASS-METHODS dbkey_encode
IMPORTING
!is_key TYPE zif_abapgit_persistence=>ty_content
RETURNING
VALUE(rv_string) TYPE string .
CLASS-METHODS dbkey_decode
IMPORTING
!iv_string TYPE clike
RETURNING
VALUE(rs_key) TYPE zif_abapgit_persistence=>ty_content .
CLASS-METHODS stage_decode
IMPORTING
!iv_getdata TYPE clike
EXPORTING
!ev_key TYPE zif_abapgit_persistence=>ty_repo-key
!ev_seed TYPE string
RAISING
zcx_abapgit_exception .
PROTECTED SECTION.
PRIVATE SECTION.
CLASS-METHODS field_keys_to_upper
CHANGING
!ct_fields TYPE tihttpnvp .
CLASS-METHODS add_field
IMPORTING
!iv_name TYPE string
!ig_field TYPE any
CHANGING
!ct_field TYPE tihttpnvp .
CLASS-METHODS unescape
IMPORTING
!iv_string TYPE string
RETURNING
VALUE(rv_string) TYPE string .
ENDCLASS.
CLASS ZCL_ABAPGIT_HTML_ACTION_UTILS IMPLEMENTATION.
METHOD add_field.
DATA ls_field LIKE LINE OF ct_field.
FIELD-SYMBOLS <lg_src> TYPE any.
ls_field-name = iv_name.
CASE cl_abap_typedescr=>describe_by_data( ig_field )->kind.
WHEN cl_abap_typedescr=>kind_elem.
ls_field-value = ig_field.
WHEN cl_abap_typedescr=>kind_struct.
ASSIGN COMPONENT iv_name OF STRUCTURE ig_field TO <lg_src>.
ASSERT <lg_src> IS ASSIGNED.
ls_field-value = <lg_src>.
WHEN OTHERS.
ASSERT 0 = 1.
ENDCASE.
APPEND ls_field TO ct_field.
ENDMETHOD.
METHOD dbkey_decode.
DATA: lt_fields TYPE tihttpnvp.
lt_fields = parse_fields_upper_case_name( cl_http_utility=>unescape_url( |{ iv_string }| ) ).
get_field( EXPORTING iv_name = 'TYPE' it_field = lt_fields CHANGING cg_field = rs_key-type ).
get_field( EXPORTING iv_name = 'VALUE' it_field = lt_fields CHANGING cg_field = rs_key-value ).
ENDMETHOD.
METHOD dbkey_encode.
DATA: lt_fields TYPE tihttpnvp.
add_field( EXPORTING iv_name = 'TYPE' ig_field = is_key-type CHANGING ct_field = lt_fields ).
add_field( EXPORTING iv_name = 'VALUE' ig_field = is_key-value CHANGING ct_field = lt_fields ).
rv_string = cl_http_utility=>if_http_utility~fields_to_string( lt_fields ).
ENDMETHOD.
METHOD dir_decode.
DATA: lt_fields TYPE tihttpnvp.
lt_fields = parse_fields( iv_string ).
get_field( EXPORTING iv_name = 'PATH' it_field = lt_fields CHANGING cg_field = rv_path ).
ENDMETHOD.
METHOD dir_encode.
DATA: lt_fields TYPE tihttpnvp.
add_field( EXPORTING iv_name = 'PATH' ig_field = iv_path CHANGING ct_field = lt_fields ).
rv_string = cl_http_utility=>if_http_utility~fields_to_string( lt_fields ).
ENDMETHOD.
METHOD field_keys_to_upper.
FIELD-SYMBOLS <ls_field> LIKE LINE OF ct_fields.
LOOP AT ct_fields ASSIGNING <ls_field>.
<ls_field>-name = to_upper( <ls_field>-name ).
ENDLOOP.
ENDMETHOD.
METHOD file_encode.
DATA: lt_fields TYPE tihttpnvp.
add_field( EXPORTING iv_name = 'KEY' ig_field = iv_key CHANGING ct_field = lt_fields ).
add_field( EXPORTING iv_name = 'PATH' ig_field = ig_file CHANGING ct_field = lt_fields ).
add_field( EXPORTING iv_name = 'FILENAME' ig_field = ig_file CHANGING ct_field = lt_fields ).
rv_string = cl_http_utility=>if_http_utility~fields_to_string( lt_fields ).
ENDMETHOD.
METHOD file_obj_decode.
DATA: lt_fields TYPE tihttpnvp.
ASSERT eg_file IS SUPPLIED OR eg_object IS SUPPLIED OR ev_key IS SUPPLIED.
CLEAR: ev_key, eg_file, eg_object.
lt_fields = parse_fields_upper_case_name( iv_string ).
get_field( EXPORTING iv_name = 'KEY' it_field = lt_fields CHANGING cg_field = ev_key ).
IF eg_file IS SUPPLIED.
get_field( EXPORTING iv_name = 'PATH' it_field = lt_fields CHANGING cg_field = eg_file ).
get_field( EXPORTING iv_name = 'FILENAME' it_field = lt_fields CHANGING cg_field = eg_file ).
ENDIF.
IF eg_object IS SUPPLIED.
get_field( EXPORTING iv_name = 'OBJ_TYPE' it_field = lt_fields CHANGING cg_field = eg_object ).
get_field( EXPORTING iv_name = 'OBJ_NAME' it_field = lt_fields iv_decode = abap_true
CHANGING cg_field = eg_object ).
ENDIF.
ENDMETHOD.
METHOD get_field.
DATA: lv_value TYPE string.
FIELD-SYMBOLS: <ls_field> LIKE LINE OF it_field,
<lg_dest> TYPE any.
READ TABLE it_field ASSIGNING <ls_field> WITH KEY name = iv_name.
IF sy-subrc IS NOT INITIAL.
RETURN.
ENDIF.
lv_value = <ls_field>-value.
IF iv_decode = abap_true.
* URL decode, not sure why some are decoded automatically
REPLACE ALL OCCURRENCES OF '%3d' IN lv_value WITH '='.
ENDIF.
CASE cl_abap_typedescr=>describe_by_data( cg_field )->kind.
WHEN cl_abap_typedescr=>kind_elem.
cg_field = lv_value.
WHEN cl_abap_typedescr=>kind_struct.
ASSIGN COMPONENT iv_name OF STRUCTURE cg_field TO <lg_dest>.
ASSERT <lg_dest> IS ASSIGNED.
<lg_dest> = lv_value.
WHEN OTHERS.
ASSERT 0 = 1.
ENDCASE.
ENDMETHOD.
METHOD jump_decode.
DATA: lt_fields TYPE tihttpnvp.
lt_fields = parse_fields( iv_string ).
get_field( EXPORTING iv_name = 'TYPE' it_field = lt_fields CHANGING cg_field = ev_obj_type ).
get_field( EXPORTING iv_name = 'NAME' it_field = lt_fields CHANGING cg_field = ev_obj_name ).
ENDMETHOD.
METHOD jump_encode.
DATA: lt_fields TYPE tihttpnvp.
add_field( EXPORTING iv_name = 'TYPE' ig_field = iv_obj_type CHANGING ct_field = lt_fields ).
add_field( EXPORTING iv_name = 'NAME' ig_field = iv_obj_name CHANGING ct_field = lt_fields ).
rv_string = cl_http_utility=>if_http_utility~fields_to_string( lt_fields ).
ENDMETHOD.
METHOD obj_encode.
DATA: lt_fields TYPE tihttpnvp.
add_field( EXPORTING iv_name = 'KEY' ig_field = iv_key CHANGING ct_field = lt_fields ).
add_field( EXPORTING iv_name = 'OBJ_TYPE' ig_field = ig_object CHANGING ct_field = lt_fields ).
add_field( EXPORTING iv_name = 'OBJ_NAME' ig_field = ig_object CHANGING ct_field = lt_fields ).
rv_string = cl_http_utility=>if_http_utility~fields_to_string( lt_fields ).
ENDMETHOD.
METHOD parse_fields.
DATA: lt_substrings TYPE stringtab,
ls_field LIKE LINE OF rt_fields.
FIELD-SYMBOLS: <lv_substring> LIKE LINE OF lt_substrings.
SPLIT iv_string AT '&' INTO TABLE lt_substrings.
LOOP AT lt_substrings ASSIGNING <lv_substring>.
CLEAR: ls_field.
ls_field-name = substring_before( val = <lv_substring>
sub = '=' ).
ls_field-name = unescape( ls_field-name ).
ls_field-value = substring_after( val = <lv_substring>
sub = '=' ).
ls_field-value = unescape( ls_field-value ).
INSERT ls_field INTO TABLE rt_fields.
ENDLOOP.
ENDMETHOD.
METHOD parse_fields_upper_case_name.
rt_fields = parse_fields( iv_string ).
field_keys_to_upper( CHANGING ct_fields = rt_fields ).
ENDMETHOD.
METHOD stage_decode.
DATA: lt_fields TYPE tihttpnvp.
lt_fields = parse_fields_upper_case_name( iv_getdata ).
get_field( EXPORTING iv_name = 'KEY' it_field = lt_fields CHANGING cg_field = ev_key ).
get_field( EXPORTING iv_name = 'SEED' it_field = lt_fields CHANGING cg_field = ev_seed ).
ASSERT NOT ev_key IS INITIAL.
ENDMETHOD.
METHOD unescape.
* do not use cl_http_utility as it does strange things with the encoding
rv_string = iv_string.
* todo, more to be added here
REPLACE ALL OCCURRENCES OF '%3F' IN rv_string WITH '?'.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
2673,
62,
26791,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
21136,
62,
25747,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8841,
220,
220,
220,
220,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
25747,
8,
41876,
46668,
4023,
77,
36133,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
21136,
62,
25747,
62,
45828,
62,
7442,
62,
3672,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8841,
220,
220,
220,
220,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
25747,
8,
41876,
46668,
4023,
77,
36133,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
3245,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
3245,
220,
41876,
46668,
4023,
77,
36133,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
12501,
1098,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
66,
70,
62,
3245,
220,
41876,
597,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
4391,
62,
268,
8189,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26801,
62,
4906,
220,
220,
220,
220,
41876,
36264,
343,
12,
15252,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26801,
62,
3672,
220,
220,
220,
220,
41876,
36264,
343,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8841,
8,
41876,
4731,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
4391,
62,
12501,
1098,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8841,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
1990,
62,
26801,
62,
4906,
41876,
36264,
343,
12,
15252,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
1990,
62,
26801,
62,
3672,
41876,
36264,
343,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
26672,
62,
268,
8189,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
6978,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8841,
8,
41876,
4731,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
26672,
62,
12501,
1098,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8841,
220,
220,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
6978,
8,
41876,
4731,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
2393,
62,
268,
8189,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
328,
62,
7753,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
597,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8841,
8,
41876,
4731,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
26181,
62,
268,
8189,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
328,
62,
15252,
220,
220,
220,
220,
220,
220,
41876,
597,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8841,
8,
41876,
4731,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
2393,
62,
26801,
62,
12501,
1098,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8841,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
1990,
62,
2539,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
1533,
62,
7753,
220,
220,
41876,
597,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
32935,
1259,
62,
7753,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
1533,
62,
15252,
41876
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
INTERFACE zif_app_rule
PUBLIC .
METHODS get_new_context_rule
RETURNING VALUE(rr_result) TYPE REF TO zif_app_rule
RAISING zcx_app_exception.
METHODS get_new_hl_context_rule
RETURNING VALUE(rr_result) TYPE REF TO zif_app_rule
RAISING zcx_app_exception.
METHODS get_context_rule
RETURNING VALUE(rr_result) TYPE REF TO zif_app_rule
RAISING zcx_app_exception.
METHODS get_hl_context_rule
RETURNING VALUE(rr_result) TYPE REF TO zif_app_rule
RAISING zcx_app_exception.
METHODS get_prev_rule
RETURNING VALUE(rr_result) TYPE REF TO zif_app_rule.
METHODS get_next_rule
RETURNING VALUE(rr_result) TYPE REF TO zif_app_rule.
METHODS init
IMPORTING
ir_token_ext TYPE REF TO zapp_s_stokesx_ext
ir_t_source TYPE REF TO sourcetable
ir_t_statement TYPE REF TO sstmnt_tab
ir_t_structure TYPE REF TO sstruc_tab
ir_rule_data TYPE REF TO zapp_s_rule
ir_settings type ref to zif_app_settings
ir_context_rule TYPE REF TO zif_app_rule OPTIONAL
ir_hl_context_rule TYPE REF TO zif_app_rule OPTIONAL
ir_prev_rule TYPE REF TO zif_app_rule OPTIONAL
RAISING zcx_app_exception.
METHODS is_new_line_req
RETURNING VALUE(rv_result) TYPE abap_bool
RAISING zcx_app_exception.
METHODS get_cur_row
RETURNING VALUE(rv_result) TYPE i
RAISING zcx_app_exception.
METHODS set_cur_row
IMPORTING iv_cur_row TYPE i
RAISING zcx_app_exception.
METHODS get_end_row
RETURNING VALUE(rv_result) TYPE i
RAISING zcx_app_exception.
METHODS get_cur_offset_start
RETURNING VALUE(rv_result) TYPE i
RAISING zcx_app_exception.
METHODS set_cur_offset_start
IMPORTING iv_cur_offset_start TYPE i
RAISING zcx_app_exception.
METHODS get_cur_offset_end
RETURNING VALUE(rv_result) TYPE i
RAISING zcx_app_exception.
METHODS get_text
RETURNING VALUE(rt_result) TYPE sourcetable
RAISING zcx_app_exception.
METHODS get_new_line_indent
RETURNING VALUE(rv_result) TYPE i
RAISING zcx_app_exception.
METHODS get_new_statement_indent
RETURNING VALUE(rv_result) TYPE i
RAISING zcx_app_exception.
METHODS set_next_rule
IMPORTING
ir_next_rule TYPE REF TO zif_app_rule
RAISING zcx_app_exception.
METHODS get_token_ext
RETURNING VALUE(rr_result) TYPE REF TO zapp_s_stokesx_ext.
METHODS validate
RAISING zcx_app_exception.
METHODS is_end_of_statement
RETURNING VALUE(rv_result) TYPE abap_bool
RAISING zcx_app_exception.
METHODS get_new_context
RETURNING VALUE(rv_result) TYPE zapp_d_context
RAISING zcx_app_exception.
METHODS get_new_hl_context
RETURNING VALUE(rv_result) TYPE zapp_d_hl_context
RAISING zcx_app_exception.
METHODS get_rule_data
RETURNING VALUE(rr_result) TYPE REF TO zapp_s_rule
RAISING zcx_app_exception.
METHODS has_multline_delimiter
RETURNING VALUE(rv_result) TYPE abap_bool
RAISING zcx_app_exception.
METHODS set_additional_indent
IMPORTING iv_indent TYPE i
RAISING zcx_app_exception.
METHODS get_additional_indent
RETURNING VALUE(rv_indent) TYPE i
RAISING zcx_app_exception.
METHODS refresh_buffer.
METHODS is_line_breaking_token
RETURNING VALUE(rv_result) TYPE abap_bool.
methods is_lb_token_resp_delimiter
RETURNING VALUE(rv_result) TYPE abap_bool.
METHODS get_token_up
RETURNING VALUE(rv_result) TYPE zapp_d_token.
METHODS is_comment
RETURNING VALUE(rv_result) TYPE abap_bool.
METHODS finalize_init
RAISING zcx_app_exception.
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
1324,
62,
25135,
198,
220,
44731,
764,
628,
220,
337,
36252,
50,
651,
62,
3605,
62,
22866,
62,
25135,
198,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
21062,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
198,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
13,
628,
220,
337,
36252,
50,
651,
62,
3605,
62,
18519,
62,
22866,
62,
25135,
198,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
21062,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
198,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
13,
628,
198,
220,
337,
36252,
50,
651,
62,
22866,
62,
25135,
198,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
21062,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
198,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
13,
628,
220,
337,
36252,
50,
651,
62,
18519,
62,
22866,
62,
25135,
198,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
21062,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
198,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
13,
628,
220,
337,
36252,
50,
651,
62,
47050,
62,
25135,
198,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
21062,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
13,
628,
198,
220,
337,
36252,
50,
651,
62,
19545,
62,
25135,
198,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
21062,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
13,
628,
220,
337,
36252,
50,
2315,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4173,
62,
30001,
62,
2302,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
1324,
62,
82,
62,
301,
3369,
87,
62,
2302,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4173,
62,
83,
62,
10459,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
11348,
66,
316,
540,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4173,
62,
83,
62,
26090,
220,
220,
220,
220,
41876,
4526,
37,
5390,
264,
301,
76,
429,
62,
8658,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4173,
62,
83,
62,
301,
5620,
220,
220,
220,
220,
41876,
4526,
37,
5390,
264,
19554,
66,
62,
8658,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4173,
62,
25135,
62,
7890,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
1324,
62,
82,
62,
25135,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4173,
62,
33692,
220,
220,
220,
220,
220,
220,
220,
2099,
1006,
284,
1976,
361,
62,
1324,
62,
33692,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4173,
62,
22866,
62,
25135,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4173,
62,
18519,
62,
22866,
62,
25135,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4173,
62,
47050,
62,
25135,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
39852,
2849,
1847,
198,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
13,
628,
220,
337,
36252,
50,
318,
62,
3605,
62,
1370,
62,
42180,
198,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
20274,
8,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
13,
628,
220,
337,
36252,
50,
651,
62,
22019,
62,
808,
198,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
20274,
8,
41876,
1312,
198,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
13,
628,
220,
337,
36252,
50,
900,
62,
22019,
62,
808,
198,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
22019,
62,
808,
41876,
1312,
198,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
13,
628,
220,
337,
36252,
50,
651,
62,
437,
62,
808,
198,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
20274,
8,
41876,
1312,
198,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
13,
628,
220,
337,
36252,
50,
651,
62,
22019,
62,
28968,
62,
9688,
198,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
20274,
8,
41876,
1312,
198,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
13,
628,
220,
337,
36252,
50,
900,
62,
22019,
62,
28968,
62,
9688,
198,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
22019,
62,
28968,
62,
9688,
41876,
1312,
198,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
13,
628,
220,
337,
36252,
50,
651,
62,
22019,
62,
28968,
62,
437,
198,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
20274,
8,
41876,
1312,
198,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
13,
628,
220,
337,
36252,
50,
651,
62,
5239,
198,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
20274,
8,
41876,
11348,
66,
316,
540,
198,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
13,
628,
220,
337,
36252,
50,
651,
62,
3605,
62,
1370,
62,
521
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class lcl_mustache_page definition final.
public section.
interfaces zif_abapgit_gui_renderable.
class-methods create
importing
io_data type ref to zcl_mustache_data
iv_template_url type string optional
io_mustache type ref to zcl_mustache optional
returning
value(ro_component) type ref to lcl_mustache_page
raising zcx_mustache_error zcx_abapgit_exception.
private section.
data mo_data type ref to zcl_mustache_data.
data mo_mustache type ref to zcl_mustache.
endclass.
class lcl_mustache_page implementation.
method zif_abapgit_gui_renderable~render.
data lv_out type string.
try.
lv_out = mo_mustache->render( mo_data->get( ) ).
zcl_w3mime_fs=>write_file_x(
iv_filename = 'mustache.txt'
iv_data = cl_bcs_convert=>string_to_xstring( iv_string = lv_out ) ).
catch zcx_mustache_error.
zcx_abapgit_exception=>raise( 'Error rendering table component' ).
endtry.
create object ro_html type zcl_abapgit_html.
ro_html->add( lv_out ).
endmethod.
method create.
create object ro_component.
ro_component->mo_data = io_data.
if iv_template_url is not initial.
data lo_asset_man type ref to zif_abapgit_gui_asset_manager.
data lv_template type string.
lo_asset_man ?= lcl_gui_factory=>get_asset_man( ).
lv_template = lo_asset_man->get_text_asset( iv_template_url ).
ro_component->mo_mustache = zcl_mustache=>create( lv_template ).
elseif io_mustache is bound.
ro_component->mo_mustache = io_mustache.
else.
zcx_abapgit_exception=>raise( 'Cannot create mustache page - no template' ).
endif.
endmethod.
endclass.
| [
4871,
300,
565,
62,
27238,
4891,
62,
7700,
6770,
2457,
13,
198,
220,
1171,
2665,
13,
198,
220,
220,
220,
20314,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
13287,
540,
13,
198,
220,
220,
220,
1398,
12,
24396,
82,
2251,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
7890,
2099,
1006,
284,
1976,
565,
62,
27238,
4891,
62,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
28243,
62,
6371,
2099,
4731,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
27238,
4891,
2099,
1006,
284,
1976,
565,
62,
27238,
4891,
11902,
198,
220,
220,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
7,
305,
62,
42895,
8,
2099,
1006,
284,
300,
565,
62,
27238,
4891,
62,
7700,
198,
220,
220,
220,
220,
220,
8620,
1976,
66,
87,
62,
27238,
4891,
62,
18224,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
220,
2839,
2665,
13,
198,
220,
220,
220,
1366,
6941,
62,
7890,
2099,
1006,
284,
1976,
565,
62,
27238,
4891,
62,
7890,
13,
198,
220,
220,
220,
1366,
6941,
62,
27238,
4891,
2099,
1006,
284,
1976,
565,
62,
27238,
4891,
13,
198,
198,
437,
4871,
13,
198,
198,
4871,
300,
565,
62,
27238,
4891,
62,
7700,
7822,
13,
628,
220,
2446,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
13287,
540,
93,
13287,
13,
628,
220,
220,
220,
1366,
300,
85,
62,
448,
220,
220,
220,
220,
2099,
4731,
13,
198,
220,
220,
220,
1949,
13,
198,
220,
220,
220,
220,
220,
300,
85,
62,
448,
796,
6941,
62,
27238,
4891,
3784,
13287,
7,
6941,
62,
7890,
3784,
1136,
7,
1267,
6739,
628,
220,
220,
220,
220,
220,
1976,
565,
62,
86,
18,
76,
524,
62,
9501,
14804,
13564,
62,
7753,
62,
87,
7,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
34345,
796,
705,
27238,
4891,
13,
14116,
6,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
7890,
796,
537,
62,
65,
6359,
62,
1102,
1851,
14804,
8841,
62,
1462,
62,
87,
8841,
7,
21628,
62,
8841,
796,
300,
85,
62,
448,
1267,
6739,
628,
220,
220,
220,
4929,
1976,
66,
87,
62,
27238,
4891,
62,
18224,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
12331,
14837,
3084,
7515,
6,
6739,
198,
220,
220,
220,
886,
28311,
13,
628,
220,
220,
220,
2251,
2134,
686,
62,
6494,
2099,
1976,
565,
62,
397,
499,
18300,
62,
6494,
13,
198,
220,
220,
220,
686,
62,
6494,
3784,
2860,
7,
300,
85,
62,
448,
6739,
628,
220,
886,
24396,
13,
628,
220,
2446,
2251,
13,
628,
220,
220,
220,
2251,
2134,
686,
62,
42895,
13,
198,
220,
220,
220,
686,
62,
42895,
3784,
5908,
62,
7890,
220,
220,
220,
220,
796,
33245,
62,
7890,
13,
628,
220,
220,
220,
611,
21628,
62,
28243,
62,
6371,
318,
407,
4238,
13,
198,
220,
220,
220,
220,
220,
1366,
2376,
62,
562,
316,
62,
805,
2099,
1006,
284,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
562,
316,
62,
37153,
13,
198,
220,
220,
220,
220,
220,
1366,
300,
85,
62,
28243,
2099,
4731,
13,
198,
220,
220,
220,
220,
220,
2376,
62,
562,
316,
62,
805,
5633,
28,
300,
565,
62,
48317,
62,
69,
9548,
14804,
1136,
62,
562,
316,
62,
805,
7,
6739,
198,
220,
220,
220,
220,
220,
300,
85,
62,
28243,
220,
220,
796,
2376,
62,
562,
316,
62,
805,
3784,
1136,
62,
5239,
62,
562,
316,
7,
21628,
62,
28243,
62,
6371,
6739,
198,
220,
220,
220,
220,
220,
686,
62,
42895,
3784,
5908,
62,
27238,
4891,
796,
1976,
565,
62,
27238,
4891,
14804,
17953,
7,
300,
85,
62,
28243,
6739,
198,
220,
220,
220,
2073,
361,
33245,
62,
27238,
4891,
318,
5421,
13,
198,
220,
220,
220,
220,
220,
686,
62,
42895,
3784,
5908,
62,
27238,
4891,
796,
33245,
62,
27238,
4891,
13,
198,
220,
220,
220,
2073,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
34,
34574,
2251,
49303,
2443,
532,
645,
11055,
6,
6739,
198,
220,
220,
220,
45762,
13,
628,
220,
886,
24396,
13,
198,
198,
437,
4871,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*&---------------------------------------------------------------------*
*& Report zdop_adt02
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zdop_adt02.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
1976,
67,
404,
62,
324,
83,
2999,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
198,
9,
5,
10097,
30934,
9,
198,
2200,
15490,
1976,
67,
404,
62,
324,
83,
2999,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_rap_node_m_uuid_root DEFINITION
PUBLIC
INHERITING FROM zcl_rap_node
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor
IMPORTING
VALUE(iv_entity_name) TYPE sxco_ddef_alias_name
RAISING zcx_rap_generator.
METHODS add_to_all_childnodes
IMPORTING
VALUE(io_child_node) TYPE REF TO zcl_rap_node.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_rap_node_m_uuid_root IMPLEMENTATION.
METHOD constructor.
super->constructor(
EXPORTING
iv_entity_name = iv_entity_name
).
entityname = iv_entity_name .
implementationtype = implementation_type-managed_uuid.
set_root( me ).
set_parent( me ).
is_root_node = abap_true.
TEST-SEAM test_run_base_class.
is_test_run = abap_false.
end-test-SEAM.
ENDMETHOD.
METHOD add_to_all_childnodes.
APPEND io_child_node TO all_childnodes.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
2416,
62,
17440,
62,
76,
62,
12303,
312,
62,
15763,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
2416,
62,
17440,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
452,
62,
26858,
62,
3672,
8,
41876,
264,
87,
1073,
62,
1860,
891,
62,
26011,
62,
3672,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
2416,
62,
8612,
1352,
13,
628,
198,
220,
220,
220,
337,
36252,
50,
751,
62,
1462,
62,
439,
62,
9410,
77,
4147,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
952,
62,
9410,
62,
17440,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
2416,
62,
17440,
13,
628,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
2416,
62,
17440,
62,
76,
62,
12303,
312,
62,
15763,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
2208,
3784,
41571,
273,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
26858,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
26858,
62,
3672,
198,
220,
220,
220,
6739,
628,
220,
220,
220,
9312,
3672,
796,
21628,
62,
26858,
62,
3672,
764,
198,
220,
220,
220,
7822,
4906,
796,
7822,
62,
4906,
12,
39935,
62,
12303,
312,
13,
198,
220,
220,
220,
900,
62,
15763,
7,
502,
6739,
198,
220,
220,
220,
900,
62,
8000,
7,
502,
6739,
198,
220,
220,
220,
318,
62,
15763,
62,
17440,
796,
450,
499,
62,
7942,
13,
628,
220,
220,
220,
43001,
12,
5188,
2390,
1332,
62,
5143,
62,
8692,
62,
4871,
13,
198,
220,
220,
220,
220,
220,
318,
62,
9288,
62,
5143,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
886,
12,
9288,
12,
5188,
2390,
13,
628,
220,
23578,
49273,
13,
628,
628,
220,
337,
36252,
751,
62,
1462,
62,
439,
62,
9410,
77,
4147,
13,
198,
220,
220,
220,
43504,
10619,
33245,
62,
9410,
62,
17440,
5390,
477,
62,
9410,
77,
4147,
13,
198,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
"! Analyses an mse file
"! See https://hal.inria.fr/hal-00646884/fr/ 2.2.1 for the specification of the grammar. This class follows the names given there.
CLASS ltcl_main DEFINITION DEFERRED.
CLASS z2mse_mse_harmonize DEFINITION LOCAL FRIENDS ltcl_main.
CLASS ltcl_main DEFINITION FINAL FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS:
equalize_harmonized FOR TESTING RAISING cx_static_check,
mse_2_harmonized FOR TESTING RAISING cx_static_check,
mse_2_harmonized_package FOR TESTING RAISING cx_static_check,
mse_2_harmonized_interface FOR TESTING RAISING cx_static_check,
_make_list_of_element_nodes FOR TESTING RAISING cx_static_check,
_add_element_node FOR TESTING RAISING cx_static_check,
_extract_element_node FOR TESTING RAISING cx_static_check,
_ext_serial_attribute_nodes FOR TESTING RAISING cx_static_check,
_ext_serial_attribute_nodes2 FOR TESTING RAISING cx_static_check,
_ext_valuenodes FOR TESTING RAISING cx_static_check,
_remove_apostroph FOR TESTING RAISING cx_static_check,
_handlefileanchor for testing RAISING cx_static_check,
mse_2_harmonized_empty_package FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_main IMPLEMENTATION.
METHOD _add_element_node.
DATA: element_node TYPE string,
element_nodes_act TYPE z2mse_mse_harmonize=>string_table,
element_nodes_exp TYPE z2mse_mse_harmonize=>string_table.
element_node = | |.
z2mse_mse_harmonize=>_add_element_node( CHANGING element_node = element_node
element_nodes = element_nodes_act ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = element_nodes_act
exp = element_nodes_exp
msg = 'Do not add a single blank' ).
ENDMETHOD.
METHOD _make_list_of_element_nodes.
DATA msestr TYPE string.
DATA element_nodes_act TYPE z2mse_mse_harmonize=>string_table.
DATA element_nodes_exp TYPE z2mse_mse_harmonize=>string_table.
msestr = |( (e1) (e2 2) (e3 a ( ) ) )|.
element_nodes_exp = VALUE #( ( |(e1)| )
( |(e2 2)| )
( |(e3 a ( ) )| ) ).
element_nodes_act = z2mse_mse_harmonize=>_make_list_of_element_nodes( i_msestr = msestr ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = element_nodes_act
exp = element_nodes_exp
msg = 'Expect correct list of element nodes' ).
ENDMETHOD.
METHOD _extract_element_node.
DATA element_node TYPE string.
DATA: elementname_act TYPE string,
elementname_exp TYPE string.
DATA: serial_attribute_nodes_act TYPE z2mse_mse_harmonize=>string_table,
serial_attribute_nodes_exp TYPE z2mse_mse_harmonize=>string_table.
CLEAR serial_attribute_nodes_act.
element_node = |( ELEMENT (Serial) (AttributeNode) )|.
z2mse_mse_harmonize=>_extract_element_node( EXPORTING element_node = element_node
IMPORTING elementname = elementname_act
serial_attribute_nodes = serial_attribute_nodes_act ).
elementname_exp = |ELEMENT|.
serial_attribute_nodes_exp = VALUE #( ( |(Serial)| )
( |(AttributeNode)| ) ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = elementname_act
exp = elementname_exp
msg = 'Expect correct elementname' ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = serial_attribute_nodes_act
exp = serial_attribute_nodes_exp
msg = 'Expect correct list of serial and attribute nodes' ).
ENDMETHOD.
METHOD _ext_serial_attribute_nodes.
DATA serial_attribute_node TYPE string.
DATA is_serial_act TYPE abap_bool.
DATA is_serial_exp TYPE abap_bool.
DATA serial_id_act TYPE i.
DATA serial_id_exp TYPE i.
DATA simplename_act TYPE string.
DATA simplename_exp TYPE string.
DATA valuenodes_act TYPE z2mse_mse_harmonize=>string_table.
DATA valuenodes_exp TYPE z2mse_mse_harmonize=>string_table.
serial_attribute_node = |( id: 123 )|.
is_serial_exp = abap_true.
serial_id_exp = 123.
simplename_exp = VALUE #( ).
valuenodes_exp = VALUE #( ).
z2mse_mse_harmonize=>_ext_serial_attribute_nodes( EXPORTING serial_attribute_node = serial_attribute_node
IMPORTING is_serial = is_serial_act
serial_id = serial_id_act
attributename = simplename_act
valuenodes = valuenodes_act ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = is_serial_act
exp = is_serial_exp
msg = 'Expect correct is_serial' ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = serial_id_act
exp = serial_id_exp
msg = 'Expect correct serial_id' ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = simplename_act
exp = simplename_exp
msg = 'Expect correct simplename' ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = valuenodes_act
exp = valuenodes_exp
msg = 'Expect correct valuenodes' ).
ENDMETHOD.
METHOD _ext_serial_attribute_nodes2.
DATA serial_attribute_node TYPE string.
DATA is_serial_act TYPE abap_bool.
DATA is_serial_exp TYPE abap_bool.
DATA serial_id_act TYPE i.
DATA serial_id_exp TYPE i.
DATA simplename_act TYPE string.
DATA simplename_exp TYPE string.
DATA valuenodes_act TYPE z2mse_mse_harmonize=>string_table.
DATA valuenodes_exp TYPE z2mse_mse_harmonize=>string_table.
serial_attribute_node = |( SimpleName ( ValueNode 1 ) ( ValueNode 2 ) )|.
is_serial_exp = abap_false.
serial_id_exp = VALUE #( ).
simplename_exp = 'SimpleName'.
valuenodes_exp = VALUE #( ( |( ValueNode 1 )| )
( |( ValueNode 2 )| ) ).
z2mse_mse_harmonize=>_ext_serial_attribute_nodes( EXPORTING serial_attribute_node = serial_attribute_node
IMPORTING is_serial = is_serial_act
serial_id = serial_id_act
attributename = simplename_act
valuenodes = valuenodes_act ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = is_serial_act
exp = is_serial_exp
msg = 'Expect correct is_serial' ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = serial_id_act
exp = serial_id_exp
msg = 'Expect correct serial_id' ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = simplename_act
exp = simplename_exp
msg = 'Expect correct simplename' ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = valuenodes_act
exp = valuenodes_exp
msg = 'Expect correct valuenodes' ).
ENDMETHOD.
METHOD _ext_valuenodes.
DATA valuenode TYPE string.
DATA is_primitive_act TYPE abap_bool.
DATA primitive_act TYPE string.
DATA is_integer_reference_act TYPE abap_bool.
DATA integer_act TYPE i.
DATA is_name_reference_act TYPE abap_bool.
DATA ref_elementname_act TYPE string.
DATA is_elementnode_act TYPE abap_bool.
DATA is_primitive_exp TYPE abap_bool.
DATA primitive_exp TYPE string.
DATA is_integer_reference_exp TYPE abap_bool.
DATA integer_exp TYPE i.
DATA is_name_reference_exp TYPE abap_bool.
DATA ref_elementname_exp TYPE string.
DATA is_elementnode_exp TYPE abap_bool.
DATA count TYPE i.
DATA(repeat) = abap_true.
WHILE repeat EQ abap_true.
is_primitive_exp = VALUE #( ).
primitive_exp = VALUE #( ).
is_integer_reference_exp = VALUE #( ).
integer_exp = VALUE #( ).
is_name_reference_exp = VALUE #( ).
ref_elementname_exp = VALUE #( ).
is_elementnode_exp = VALUE #( ).
ADD 1 TO count.
CASE count.
WHEN 1.
valuenode = |123|.
is_primitive_exp = abap_true.
primitive_exp = |123|.
WHEN 2.
valuenode = |'ab'|.
is_primitive_exp = abap_true.
primitive_exp = |'ab'|.
WHEN 3.
valuenode = |true|.
is_primitive_exp = abap_true.
primitive_exp = |true|.
WHEN 4.
valuenode = |(ref: 123)|.
is_integer_reference_exp = abap_true.
integer_exp = 123.
WHEN 5.
valuenode = |(ref: ElementName)|.
is_name_reference_exp = abap_true.
ref_elementname_exp = |ElementName|.
WHEN 6.
valuenode = |(ElementNode)|.
is_elementnode_exp = abap_true.
WHEN OTHERS.
repeat = abap_true.
EXIT.
ENDCASE.
z2mse_mse_harmonize=>_ext_valuenodes( EXPORTING valuenode = valuenode
IMPORTING is_primitive = is_primitive_act
primitive = primitive_act
is_integer_reference = is_integer_reference_act
integer_reference = integer_act
is_name_reference = is_name_reference_act
ref_elementname = ref_elementname_act
is_elementnode = is_elementnode_act ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = is_primitive_act
exp = is_primitive_exp
msg = |Expect correct is_primitive : | && |{ valuenode }| ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = primitive_act
exp = primitive_exp
msg = |Expect correct primitive : | && |{ valuenode }| ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = is_integer_reference_act
exp = is_integer_reference_exp
msg = |Expect correct is_integer_reference : | && |{ valuenode }| ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = integer_act
exp = integer_exp
msg = |Expect correct is_integer_reference : | && |{ valuenode }| ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = is_name_reference_act
exp = is_name_reference_exp
msg = |Expect correct is_name_reference : | && |{ valuenode }| ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = ref_elementname_act
exp = ref_elementname_exp
msg = |Expect correct is_name_reference : | && |{ valuenode }| ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = is_elementnode_act
exp = is_elementnode_exp
msg = |Expect correct is_elementnode : | && |{ valuenode }| ).
ENDWHILE.
ENDMETHOD.
METHOD mse_2_harmonized.
DATA: mse TYPE z2mse_mse_harmonize=>string_table,
equalized_harmonized_mse_act TYPE z2mse_mse_harmonize=>harmonized_mse,
equalized_harmonized_mse_exp TYPE z2mse_mse_harmonize=>harmonized_mse.
mse = VALUE #( ( |( ( FAMIX.CustomSourceLanguage (id: 1)| )
( | (name 'SAP'))| )
( |(FAMIX.Package (id: 2 )| )
( | (name 'Z2MSE_TEST_INITIAL_SELECTION'))| )
( |(FAMIX.Class (id: 3 )| )
( | (name 'Z2MSE_TEST_CL_A')| )
( | (modifiers 'ABAPGlobalClass')| )
( | (parentPackage (ref: 2)))| )
( |(FAMIX.FileAnchor (id: 8)| )
( | (element (ref: 3))| )
( | (fileName 'adt://NPL/sap/bc/adt/oo/classes/z2mse_extr3_access/source/main'))| )
( |(FAMIX.Attribute (id: 5 )| )
( | (name 'Z2MSE_TEST_IF_A~ATTRIBUTE_A')| )
( | (parentType (ref: 3)))| )
( |(FAMIX.Method (id: 6 )| )
( | (name 'Z2MSE_TEST_IF_A~METHOD_A')| )
( | (signature 'Z2MSE_TEST_IF_A~METHOD_A')| )
( | (parentType (ref: 3)))| )
( |(FAMIX.FileAnchor (id: 9)| )
( | (element (ref: 6))| )
( | (fileName 'adt://NPL/sap/bc/adt/oo/classes/z2mse_extr3_access/source/main#start=27,5'))| )
( |(FAMIX.Method (id: 7 )| )
( | (name 'METHOD_B')| )
( | (signature 'METHOD_B')| )
( | (parentType (ref: 3)))| )
( |(FAMIX.Access| )
( | (accessor (ref: 6))| )
( | (variable (ref: 5)))| )
( |(FAMIX.Invocation| )
( | (sender (ref: 7))| )
( | (candidates (ref: 6))| )
( | (signature 'DUMMY')))| ) ).
* equalized_harmonized_mse_exp = VALUE #( ( |FAMIX.Package Z2MSE_TEST_INITIAL_SELECTION| )
* ( |FAMIX.Class Z2MSE_TEST_CL_A modifiers 'ABAPGlobalClass'| )
* ( |FAMIX.Class Z2MSE_TEST_CL_A parentPackage Z2MSE_TEST_INITIAL_SELECTION| ) ).
equalized_harmonized_mse_exp = VALUE #( ( |FAMIX.CustomSourceLanguage SAP| )
( |FAMIX.Attribute Z2MSE_TEST_CL_A>>Z2MSE_TEST_IF_A~ATTRIBUTE_A| )
( |FAMIX.Access accessor Z2MSE_TEST_CL_A>>Z2MSE_TEST_IF_A~METHOD_A variable Z2MSE_TEST_CL_A>>Z2MSE_TEST_IF_A~ATTRIBUTE_A | )
( |FAMIX.Class Z2MSE_TEST_CL_A modifiers ABAPGlobalClass| )
( |FAMIX.FileAnchor Z2MSE_TEST_CL_A fileName adt://NPL/sap/bc/adt/oo/classes/z2mse_extr3_access/source/main| )
( |FAMIX.FileAnchor Z2MSE_TEST_IF_A~METHOD_A fileName adt://NPL/sap/bc/adt/oo/classes/z2mse_extr3_access/source/main#start=27,5| )
( |FAMIX.Invocation sender Z2MSE_TEST_CL_A>>METHOD_B candidates Z2MSE_TEST_CL_A>>Z2MSE_TEST_IF_A~METHOD_A signature DUMMY| )
( |FAMIX.Method Z2MSE_TEST_CL_A>>METHOD_B signature METHOD_B| )
( |FAMIX.Method Z2MSE_TEST_CL_A>>Z2MSE_TEST_IF_A~METHOD_A signature Z2MSE_TEST_IF_A~METHOD_A| )
( |FAMIX.Package Z2MSE_TEST_INITIAL_SELECTION| )
( |FAMIX.Class Z2MSE_TEST_CL_A parentPackage Z2MSE_TEST_INITIAL_SELECTION| )
).
equalized_harmonized_mse_act = z2mse_mse_harmonize=>mse_2_harmonized( string_table = mse ).
z2mse_mse_harmonize=>equalize_harmonized( CHANGING harmonized_mse = equalized_harmonized_mse_exp ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = equalized_harmonized_mse_act
exp = equalized_harmonized_mse_exp
msg = 'Harmonize simple Package specification correctly' ).
ENDMETHOD.
METHOD mse_2_harmonized_package.
DATA: mse TYPE z2mse_model=>lines_type,
equalized_harmonized_mse_act TYPE z2mse_mse_harmonize=>harmonized_mse,
equalized_harmonized_mse_exp TYPE z2mse_mse_harmonize=>harmonized_mse.
mse = VALUE #( ( line = |( (FAMIX.Package (id: 1 )| )
( line = | (name 'A'))| )
( line = |(FAMIX.Package (id: 2 )| )
( line = | (name 'A_A_A')| )
( line = | (parentPackage (ref: 3)))| )
( line = |(FAMIX.Package (id: 3 )| )
( line = | (name 'A_A')))| )
).
* equalized_harmonized_mse_exp = VALUE #( ( |FAMIX.Package Z2MSE_TEST_INITIAL_SELECTION| )
* ( |FAMIX.Class Z2MSE_TEST_CL_A modifiers 'ABAPGlobalClass'| )
* ( |FAMIX.Class Z2MSE_TEST_CL_A parentPackage Z2MSE_TEST_INITIAL_SELECTION| ) ).
equalized_harmonized_mse_exp = VALUE #(
( |FAMIX.Package A| )
( |FAMIX.Package A_A| )
( |FAMIX.Package A_A_A parentPackage A_A| )
).
equalized_harmonized_mse_act = z2mse_mse_harmonize=>mse_2_harmonized( mse = mse ).
z2mse_mse_harmonize=>equalize_harmonized( CHANGING harmonized_mse = equalized_harmonized_mse_exp ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = equalized_harmonized_mse_act
exp = equalized_harmonized_mse_exp
msg = 'Harmonize complex Package specification correctly' ).
ENDMETHOD.
METHOD mse_2_harmonized_interface.
DATA: mse TYPE z2mse_model=>lines_type,
equalized_harmonized_mse_act TYPE z2mse_mse_harmonize=>harmonized_mse,
equalized_harmonized_mse_exp TYPE z2mse_mse_harmonize=>harmonized_mse.
mse = VALUE #( ( line = |( (FAMIX.Package (id: 1 )| )
( line = | (name 'A'))| )
( line = |(FAMIX.Class (id: 5 )| )
( line = | (name 'INTERFACE_A')| )
( line = | (modifiers 'ABAPGlobalInterface')| )
( line = | (parentPackage (ref: 1))| )
( line = | (isInterface true)))| )
).
* equalized_harmonized_mse_exp = VALUE #( ( |FAMIX.Package Z2MSE_TEST_INITIAL_SELECTION| )
* ( |FAMIX.Class Z2MSE_TEST_CL_A modifiers 'ABAPGlobalClass'| )
* ( |FAMIX.Class Z2MSE_TEST_CL_A parentPackage Z2MSE_TEST_INITIAL_SELECTION| ) ).
equalized_harmonized_mse_exp = VALUE #(
( |FAMIX.Package A| )
( |FAMIX.Class INTERFACE_A isInterface true| )
( |FAMIX.Class INTERFACE_A modifiers ABAPGlobalInterface| )
( |FAMIX.Class INTERFACE_A parentPackage A| )
).
equalized_harmonized_mse_act = z2mse_mse_harmonize=>mse_2_harmonized( mse = mse ).
z2mse_mse_harmonize=>equalize_harmonized( CHANGING harmonized_mse = equalized_harmonized_mse_exp ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = equalized_harmonized_mse_act
exp = equalized_harmonized_mse_exp
msg = 'Harmonize complex Package specification correctly' ).
ENDMETHOD.
METHOD mse_2_harmonized_empty_package.
DATA: mse TYPE z2mse_mse_harmonize=>string_table,
equalized_harmonized_mse_act TYPE z2mse_mse_harmonize=>harmonized_mse,
equalized_harmonized_mse_exp TYPE z2mse_mse_harmonize=>harmonized_mse.
mse = VALUE #( ( |( (FAMIX.Package (id: 1 )| )
( | (name ''))| )
( |(FAMIX.Class (id: 2 )| )
( | (name 'Z2MSE_TEST_CL_A')| )
( | (parentPackage (ref: 1))))| ) ).
* equalized_harmonized_mse_exp = VALUE #( ( |FAMIX.Package Z2MSE_TEST_INITIAL_SELECTION| )
* ( |FAMIX.Class Z2MSE_TEST_CL_A modifiers 'ABAPGlobalClass'| )
* ( |FAMIX.Class Z2MSE_TEST_CL_A parentPackage Z2MSE_TEST_INITIAL_SELECTION| ) ).
equalized_harmonized_mse_exp = VALUE #( ( |FAMIX.Package | )
( |FAMIX.Class Z2MSE_TEST_CL_A parentPackage | )
).
equalized_harmonized_mse_act = z2mse_mse_harmonize=>mse_2_harmonized( string_table = mse ).
z2mse_mse_harmonize=>equalize_harmonized( CHANGING harmonized_mse = equalized_harmonized_mse_exp ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = equalized_harmonized_mse_act
exp = equalized_harmonized_mse_exp
msg = 'Harmonize simple Package specification correctly' ).
ENDMETHOD.
METHOD equalize_harmonized.
DATA: harmonized_mse TYPE z2mse_mse_harmonize=>harmonized_mse,
equalized_harmonized_mse_act TYPE z2mse_mse_harmonize=>harmonized_mse,
equalized_harmonized_mse_exp TYPE z2mse_mse_harmonize=>harmonized_mse.
harmonized_mse = VALUE #( ( |B B| ) "Many blanks between both B
( |A| )
( ) ).
equalized_harmonized_mse_exp = VALUE #( ( |A| )
( |B B| ) ). "Only a single blank between both B
equalized_harmonized_mse_act = harmonized_mse.
z2mse_mse_harmonize=>equalize_harmonized( CHANGING harmonized_mse = equalized_harmonized_mse_act ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = equalized_harmonized_mse_act
exp = equalized_harmonized_mse_exp
msg = 'Harmonized mse has to be strictly sorted alphabetically by method equalize_harmonized. Multiple blanks are removed' ).
ENDMETHOD.
METHOD _remove_apostroph.
DATA: value_act TYPE string,
value_exp TYPE string.
value_act = |'AString'|.
value_exp = |AString|.
z2mse_mse_harmonize=>_remove_apostroph( CHANGING string = value_act ).
cl_abap_unit_assert=>assert_equals( EXPORTING act = value_act
exp = value_exp
msg = 'Apostrophs are to be removed' ).
ENDMETHOD.
METHOD _handlefileanchor.
data: elements_act TYPE z2mse_mse_harmonize=>ty_elements_1,
elements_exp TYPE z2mse_mse_harmonize=>ty_elements_1.
elements_act = value #( ( elementname = |FAMIX.Class| element_id = 2 )
( elementname = |FAMIX.FileAnchor| element_id = 7 attribute = |element| integer_reference = 2 )
( elementname = |FAMIX.FileAnchor| element_id = 7 attribute = |fileName| value = |String| ) ).
elements_exp = value #( ( elementname = |FAMIX.Class| element_id = 2 )
( elementname = |FAMIX.FileAnchor| element_id = 2 attribute = |fileName| value = |String| ) ).
z2mse_mse_harmonize=>_handlefileanchor( CHANGING elements = elements_act ).
cl_abap_unit_assert=>assert_equals( msg = 'Replace element_id for FAMIX.FileAnchor with the reference of element and delete line with element.' exp = elements_exp act = elements_act ).
ENDMETHOD.
ENDCLASS.
| [
40484,
1052,
43710,
281,
285,
325,
2393,
198,
40484,
4091,
3740,
1378,
14201,
13,
259,
7496,
13,
8310,
14,
14201,
12,
405,
2414,
3104,
5705,
14,
8310,
14,
362,
13,
17,
13,
16,
329,
262,
20855,
286,
262,
23491,
13,
770,
1398,
5679,
262,
3891,
1813,
612,
13,
198,
31631,
300,
83,
565,
62,
12417,
5550,
20032,
17941,
23449,
1137,
22083,
13,
198,
31631,
1976,
17,
76,
325,
62,
76,
325,
62,
29155,
261,
1096,
5550,
20032,
17941,
37347,
1847,
48167,
1677,
5258,
300,
83,
565,
62,
12417,
13,
198,
31631,
300,
83,
565,
62,
12417,
5550,
20032,
17941,
25261,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
4961,
1096,
62,
29155,
261,
1143,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
285,
325,
62,
17,
62,
29155,
261,
1143,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
285,
325,
62,
17,
62,
29155,
261,
1143,
62,
26495,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
285,
325,
62,
17,
62,
29155,
261,
1143,
62,
39994,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
4808,
15883,
62,
4868,
62,
1659,
62,
30854,
62,
77,
4147,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
4808,
2860,
62,
30854,
62,
17440,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
4808,
2302,
974,
62,
30854,
62,
17440,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
4808,
2302,
62,
46911,
62,
42348,
62,
77,
4147,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
4808,
2302,
62,
46911,
62,
42348,
62,
77,
4147,
17,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
4808,
2302,
62,
2100,
84,
268,
4147,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
4808,
28956,
62,
499,
455,
10051,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
4808,
28144,
7753,
3702,
273,
329,
4856,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
285,
325,
62,
17,
62,
29155,
261,
1143,
62,
28920,
62,
26495,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
10619,
31631,
13,
628,
198,
31631,
300,
83,
565,
62,
12417,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
4808,
2860,
62,
30854,
62,
17440,
13,
628,
220,
220,
220,
42865,
25,
5002,
62,
17440,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5002,
62,
77,
4147,
62,
529,
41876,
1976,
17,
76,
325,
62,
76,
325,
62,
29155,
261,
1096,
14804,
8841,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5002,
62,
77,
4147,
62,
11201,
41876,
1976,
17,
76,
325,
62,
76,
325,
62,
29155,
261,
1096,
14804,
8841,
62,
11487,
13,
628,
220,
220,
220,
5002,
62,
17440,
796,
930,
930,
13,
628,
220,
220,
220,
1976,
17,
76,
325,
62,
76,
325,
62,
29155,
261,
1096,
14804,
62,
2860,
62,
30854,
62,
17440,
7,
5870,
15567,
2751,
5002,
62,
17440,
220,
796,
5002,
62,
17440,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5002,
62,
77,
4147,
796,
5002,
62,
77,
4147,
62,
529,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
7788,
15490,
2751,
719,
796,
5002,
62,
77,
4147,
62,
529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
5002,
62,
77,
4147,
62,
11201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
796,
705,
5211,
407,
751,
257,
2060,
9178,
6,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
4808,
15883,
62,
4868,
62,
1659,
62,
30854,
62,
77,
4147,
13,
628,
220,
220,
220,
42865,
13845,
395,
81,
41876,
4731,
13,
198,
220,
220,
220,
42865,
5002,
62,
77,
4147,
62,
529,
41876,
1976,
17,
76,
325,
62,
76,
325,
62,
29155,
261,
1096,
14804,
8841,
62,
11487,
13,
198,
220,
220,
220,
42865,
5002,
62,
77,
4147,
62,
11201,
41876,
1976,
17,
76,
325,
62,
76,
325,
62,
29155,
261,
1096,
14804,
8841,
62,
11487,
13,
628,
220,
220,
220,
13845,
395,
81,
796,
930,
7,
357,
68,
16,
8,
357,
68,
17,
362,
8,
357,
68,
18,
257,
357,
1267,
1267,
1267,
91,
13,
198,
220,
220,
220,
5002,
62,
77,
4147,
62,
11201,
796,
26173,
8924,
1303,
7,
357,
930,
7,
68,
16,
14726,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
930,
7,
68,
17,
362,
14726,
1267,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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user type sy-uname.
INTERFACES if_oo_adt_classrun.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS Z_CL_I338058 IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
out->write('Hello ABAP in Cloud!').
ENDMETHOD.
Method get_user .
ev_user = sy-uname.
endmethod.
ENDCLASS.
| [
31631,
1976,
62,
565,
62,
72,
2091,
1795,
3365,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
25458,
651,
62,
7220,
39133,
819,
62,
7220,
2099,
827,
12,
403,
480,
13,
198,
220,
23255,
37,
2246,
1546,
611,
62,
2238,
62,
324,
83,
62,
4871,
5143,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
62,
5097,
62,
40,
2091,
1795,
3365,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
611,
62,
2238,
62,
324,
83,
62,
4871,
5143,
93,
12417,
13,
198,
220,
220,
220,
503,
3784,
13564,
10786,
15496,
9564,
2969,
287,
10130,
13679,
737,
198,
220,
23578,
49273,
13,
628,
220,
11789,
651,
62,
7220,
764,
198,
220,
220,
819,
62,
7220,
796,
827,
12,
403,
480,
13,
198,
220,
886,
24396,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
"! <p class="shorttext synchronized" lang="en">Flight Data as Instance Methods</p>
CLASS ZCL_OO_TUTORIAL_3 DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
"! <p class="shorttext synchronized" lang="en">Flight</p>
DATA FLIGHT TYPE /DMO/FLIGHT.
"! <p class="shorttext synchronized" lang="en">CONSTRUCTOR</p>
METHODS CONSTRUCTOR
IMPORTING
!CARRIER_ID TYPE /DMO/CARRIER_ID
!CONNECTION_ID TYPE /DMO/CONNECTION_ID
!FLIGHT_DATE TYPE /DMO/FLIGHT_DATE.
"! <p class="shorttext synchronized" lang="en">Get Booking Details</p>
METHODS GET_FLIGHT_DETAILS
RETURNING VALUE(FLIGHT) TYPE /DMO/FLIGHT .
"! <p class="shorttext synchronized" lang="en">Calculate Flight Price</p>
METHODS CALCULATE_FLIGHT_PRICE
EXPORTING
!PRICE TYPE /DMO/FLIGHT_PRICE
!CURRENCY_CODE TYPE /DMO/CURRENCY_CODE.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_OO_TUTORIAL_3 IMPLEMENTATION.
METHOD CALCULATE_FLIGHT_PRICE.
PRICE = ME->FLIGHT-PRICE.
CURRENCY_CODE = ME->FLIGHT-CURRENCY_CODE.
CASE ME->FLIGHT-PLANE_TYPE_ID.
WHEN '747-400'.
PRICE = PRICE + 40.
WHEN 'A310-300'.
PRICE = PRICE + 25.
WHEN OTHERS.
PRICE = PRICE + 10.
ENDCASE.
ENDMETHOD.
METHOD CONSTRUCTOR.
SELECT SINGLE * FROM /DMO/FLIGHT
WHERE CARRIER_ID = @CARRIER_ID
AND CONNECTION_ID = @CONNECTION_ID
AND FLIGHT_DATE = @FLIGHT_DATE
INTO @FLIGHT.
ENDMETHOD.
METHOD GET_FLIGHT_DETAILS.
FLIGHT = ME->FLIGHT.
ENDMETHOD.
ENDCLASS.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
43069,
6060,
355,
2262,
590,
25458,
3556,
79,
29,
198,
31631,
1168,
5097,
62,
6684,
62,
51,
3843,
1581,
12576,
62,
18,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
43069,
3556,
79,
29,
198,
220,
220,
220,
42865,
9977,
9947,
41876,
1220,
35,
11770,
14,
3697,
9947,
13,
628,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
10943,
46126,
1581,
3556,
79,
29,
198,
220,
220,
220,
337,
36252,
50,
7102,
46126,
1581,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
20034,
7112,
1137,
62,
2389,
220,
220,
220,
41876,
1220,
35,
11770,
14,
20034,
7112,
1137,
62,
2389,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
10943,
45,
24565,
62,
2389,
41876,
1220,
35,
11770,
14,
10943,
45,
24565,
62,
2389,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
3697,
9947,
62,
35,
6158,
220,
220,
41876,
1220,
35,
11770,
14,
3697,
9947,
62,
35,
6158,
13,
628,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
3855,
4897,
278,
14890,
3556,
79,
29,
198,
220,
220,
220,
337,
36252,
50,
17151,
62,
3697,
9947,
62,
35,
20892,
45484,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
3697,
9947,
8,
41876,
1220,
35,
11770,
14,
3697,
9947,
764,
628,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
9771,
3129,
378,
13365,
7886,
3556,
79,
29,
198,
220,
220,
220,
337,
36252,
50,
33290,
34,
6239,
6158,
62,
3697,
9947,
62,
4805,
8476,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4805,
8476,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
35,
11770,
14,
3697,
9947,
62,
4805,
8476,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
34,
31302,
45155,
62,
34,
16820,
41876,
1220,
35,
11770,
14,
34,
31302,
45155,
62,
34,
16820,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6684,
62,
51,
3843,
1581,
12576,
62,
18,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
33290,
34,
6239,
6158,
62,
3697,
9947,
62,
4805,
8476,
13,
628,
220,
220,
220,
4810,
8476,
796,
11948,
3784,
3697,
9947,
12,
4805,
8476,
13,
198,
220,
220,
220,
327,
31302,
45155,
62,
34,
16820,
796,
11948,
3784,
3697,
9947,
12,
34,
31302,
45155,
62,
34,
16820,
13,
628,
220,
220,
220,
42001,
11948,
3784,
3697,
9947,
12,
6489,
30525,
62,
25216,
62,
2389,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
48882,
12,
7029,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
4810,
8476,
796,
4810,
8476,
1343,
2319,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
32,
26717,
12,
6200,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
4810,
8476,
796,
4810,
8476,
1343,
1679,
13,
198,
220,
220,
220,
220,
220,
42099,
440,
4221,
4877,
13,
198,
220,
220,
220,
220,
220,
220,
220,
4810,
8476,
796,
4810,
8476,
1343,
838,
13,
198,
220,
220,
220,
23578,
34,
11159,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
7102,
46126,
1581,
13,
198,
220,
220,
220,
33493,
311,
2751,
2538,
1635,
16034,
1220,
35,
11770,
14,
3697,
9947,
198,
220,
220,
220,
220,
220,
33411,
17368,
7112,
1137,
62,
2389,
796,
2488,
20034,
7112,
1137,
62,
2389,
198,
220,
220,
220,
220,
220,
220,
220,
5357,
7102,
45,
24565,
62,
2389,
796,
2488,
10943,
45,
24565,
62,
2389,
198,
220,
220,
220,
220,
220,
220,
220,
5357,
9977,
9947,
62,
35,
6158,
796,
2488,
3697,
9947,
62,
35,
6158,
198,
220,
220,
220,
220,
220,
220,
39319,
2488,
3697,
9947,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
17151,
62,
3697,
9947,
62,
35,
20892,
45484,
13,
198,
220,
220,
220,
9977,
9947,
796,
11948,
3784,
3697,
9947,
13,
198,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*&---------------------------------------------------------------------*
*& Include ZSST_GTT_AE_IMP
*&---------------------------------------------------------------------*
CLASS lcl_actual_event IMPLEMENTATION.
METHOD get_tor_actual_event_class.
FIELD-SYMBOLS <ls_tor_root> TYPE /scmtms/s_em_bo_tor_root.
ASSIGN i_event-maintabref->* TO <ls_tor_root>.
IF sy-subrc = 0.
CASE <ls_tor_root>-tor_cat.
WHEN /scmtms/if_tor_const=>sc_tor_category-active.
ro_actual_event = NEW lcl_fo_actual_event( ).
WHEN /scmtms/if_tor_const=>sc_tor_category-booking.
ro_actual_event = NEW lcl_fb_actual_event( ).
WHEN /scmtms/if_tor_const=>sc_tor_category-freight_unit.
ro_actual_event = NEW lcl_fu_actual_event( ).
WHEN OTHERS.
MESSAGE i009(zsst_gtt) WITH <ls_tor_root>-tor_cat INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDCASE.
ENDIF.
ENDMETHOD.
METHOD lif_actual_event~check_tor_type_specific_events.
ENDMETHOD.
METHOD lif_actual_event~check_trxservername.
FIELD-SYMBOLS <ls_tor_root> TYPE /scmtms/s_em_bo_tor_root.
CLEAR e_result.
ASSIGN i_event-maintabref->* TO <ls_tor_root>.
SELECT SINGLE /saptrx/aotypes~trxservername
FROM /scmtms/c_torty
JOIN /saptrx/aotypes ON /scmtms/c_torty~aotype = /saptrx/aotypes~aotype
INTO @DATA(lv_trxservername)
WHERE /scmtms/c_torty~type = @<ls_tor_root>-tor_type AND
/saptrx/aotypes~trk_obj_type = @lif_actual_event~cv_tor_trk_obj_typ.
IF i_event-trxservername <> lv_trxservername.
e_result = lif_ef_constants=>cs_condition-false.
ENDIF.
ENDMETHOD.
METHOD lif_actual_event~check_event_relevance.
IF lif_actual_event~check_tor_type_specific_events( iv_event_code ) = lif_ef_constants=>cs_condition-false.
RETURN.
ENDIF.
lif_actual_event~check_application_event_source(
EXPORTING
i_all_appl_tables = i_all_appl_tables
iv_event_code = iv_event_code
i_event = i_event
IMPORTING
e_result = e_result ).
IF e_result = lif_ef_constants=>cs_condition-false.
RETURN.
ENDIF.
lif_actual_event~check_trxservername(
EXPORTING
i_event = i_event
IMPORTING
e_result = e_result ).
ENDMETHOD.
METHOD lif_actual_event~check_application_event_source.
FIELD-SYMBOLS <ls_tor_root> TYPE /scmtms/s_em_bo_tor_root.
CLEAR e_result.
get_execution(
EXPORTING
i_all_appl_tables = i_all_appl_tables
IMPORTING
et_execution = DATA(lt_tor_execinfo) ).
get_execution(
EXPORTING
i_all_appl_tables = i_all_appl_tables
iv_old = abap_true
IMPORTING
et_execution = DATA(lt_tor_execinfo_old) ).
ASSIGN i_event-maintabref->* TO <ls_tor_root>.
LOOP AT lt_tor_execinfo ASSIGNING FIELD-SYMBOL(<ls_tor_execinfo>) WHERE parent_node_id = <ls_tor_root>-node_id.
ASSIGN lt_tor_execinfo_old[ KEY node_id COMPONENTS node_id = <ls_tor_execinfo>-node_id ]
TO FIELD-SYMBOL(<ls_tor_execinfo_old>).
IF ( sy-subrc = 0 AND <ls_tor_execinfo_old> <> <ls_tor_execinfo> ) OR sy-subrc <> 0.
CHECK <ls_tor_execinfo>-event_code = iv_event_code.
CHECK NOT ( <ls_tor_execinfo>-execinfo_source = /scmtms/if_tor_const=>sc_tor_event_source-application OR
<ls_tor_execinfo>-execinfo_source = /scmtms/if_tor_const=>sc_tor_event_source-prop_predecessor OR
<ls_tor_execinfo>-execinfo_source = /scmtms/if_tor_const=>sc_tor_event_source-prop_successor ).
e_result = lif_ef_constants=>cs_condition-false.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD lif_actual_event~adjust_ae_location_data.
FIELD-SYMBOLS <ls_root> TYPE /scmtms/s_em_bo_tor_root.
DATA ls_trackparameters TYPE /saptrx/bapi_evm_parameters.
DATA(lt_stop) = get_stop( i_all_appl_tables ).
ASSIGN i_event-maintabref->* TO <ls_root>.
IF sy-subrc <> 0.
RETURN.
ENDIF.
ASSIGN ct_trackingheader[ trxid = <ls_root>-tor_id ] TO FIELD-SYMBOL(<ls_trackingheader>).
IF sy-subrc = 0.
<ls_trackingheader>-trxcod = lif_actual_event~cs_trxcode-shipment_order.
<ls_trackingheader>-evtid = get_model_event_id( <ls_trackingheader>-evtid ).
ENDIF.
lcl_tools=>get_stop_points(
EXPORTING
iv_root_id = <ls_root>-tor_id
it_stop = VALUE #( FOR <ls_stop> IN lt_stop USING KEY parent_seqnum
WHERE ( parent_node_id = <ls_root>-node_id ) ( <ls_stop> ) )
IMPORTING
et_stop_points = DATA(lt_stop_points) ).
ASSIGN ct_tracklocation[ evtcnt = <ls_trackingheader>-evtcnt ] TO FIELD-SYMBOL(<ls_tracklocation>).
IF sy-subrc = 0.
<ls_tracklocation>-loccod = lif_actual_event~cs_location_type-logistic.
ASSIGN lt_stop_points[ log_locid = <ls_tracklocation>-locid1 ]-stop_id TO FIELD-SYMBOL(<lv_stop_id>).
IF sy-subrc = 0.
SHIFT <lv_stop_id> LEFT DELETING LEADING '0'.
<ls_tracklocation>-locid2 = <lv_stop_id>.
ENDIF.
ENDIF.
CLEAR ls_trackparameters.
ls_trackparameters-evtcnt = <ls_trackingheader>-evtcnt.
ls_trackparameters-param_name = lif_ef_constants=>cs_system_fields-actual_technical_timezone.
ls_trackparameters-param_value = lcl_tools=>get_system_time_zone( ).
APPEND ls_trackparameters TO ct_trackparameters.
CLEAR ls_trackparameters.
ls_trackparameters-evtcnt = <ls_trackingheader>-evtcnt.
ls_trackparameters-param_name = lif_ef_constants=>cs_system_fields-actual_technical_datetime.
ls_trackparameters-param_value = lcl_tools=>get_system_date_time( ).
APPEND ls_trackparameters TO ct_trackparameters.
ENDMETHOD.
METHOD get_stop.
FIELD-SYMBOLS <lt_stop> TYPE /scmtms/t_em_bo_tor_stop.
ASSIGN i_all_appl_tables[ tabledef = lif_actual_event~cs_tabledef-tor_stop ]-tableref TO FIELD-SYMBOL(<lr_tabref>).
IF sy-subrc = 0.
ASSIGN <lr_tabref>->* TO <lt_stop>.
IF sy-subrc = 0.
rt_stop = <lt_stop>.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD get_root.
FIELD-SYMBOLS <lt_root> TYPE /scmtms/t_em_bo_tor_root.
ASSIGN i_all_appl_tables[ tabledef = lif_actual_event~cs_tabledef-tor_root ]-tableref TO FIELD-SYMBOL(<lr_tabref>).
IF sy-subrc = 0.
ASSIGN <lr_tabref>->* TO <lt_root>.
IF sy-subrc = 0.
rt_root = <lt_root>.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD get_capa_stop.
FIELD-SYMBOLS <lt_capa_stop> TYPE /scmtms/t_em_bo_tor_stop.
ASSIGN i_all_appl_tables[ tabledef = /scmtms/cl_scem_int_c=>sc_table_definition-bo_tor-capa_stop ]-tableref
TO FIELD-SYMBOL(<lr_tabref>).
IF sy-subrc = 0.
ASSIGN <lr_tabref>->* TO <lt_capa_stop>.
IF sy-subrc = 0.
rt_stop = <lt_capa_stop>.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD get_capa_root.
FIELD-SYMBOLS <lt_capa_root> TYPE /scmtms/t_em_bo_tor_root.
ASSIGN i_all_appl_tables[ tabledef = /scmtms/cl_scem_int_c=>sc_table_definition-bo_tor-capa_root ]-tableref
TO FIELD-SYMBOL(<lr_tabref>).
IF sy-subrc = 0.
ASSIGN <lr_tabref>->* TO <lt_capa_root>.
IF sy-subrc = 0.
rt_root = <lt_capa_root>.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD get_locid2.
DATA(lv_tor_id) = i_tor_id.
SHIFT lv_tor_id LEFT DELETING LEADING '0'.
DATA(lv_stop_id) = i_seq_num+1(4).
rv_locid2 = lv_tor_id && lv_stop_id.
ENDMETHOD.
METHOD get_execution.
FIELD-SYMBOLS <lt_execution> TYPE /scmtms/t_em_bo_tor_execinfo.
CLEAR et_execution.
ASSIGN i_all_appl_tables[ tabledef = SWITCH #( iv_old WHEN abap_false
THEN lif_actual_event~cs_tabledef-tor_execution_info
ELSE lif_actual_event~cs_tabledef-tor_execution_info_before )
]-tableref TO FIELD-SYMBOL(<lr_tabref>).
IF sy-subrc = 0.
ASSIGN <lr_tabref>->* TO <lt_execution>.
IF sy-subrc = 0.
et_execution = <lt_execution>.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD get_model_event_id.
CASE iv_standard_event_id.
WHEN lif_actual_event~cs_event_id-standard-arrival.
rv_model_event_id = lif_actual_event~cs_event_id-model-shp_arrival.
WHEN lif_actual_event~cs_event_id-standard-departure.
rv_model_event_id = lif_actual_event~cs_event_id-model-shp_departure.
WHEN lif_actual_event~cs_event_id-standard-pod.
rv_model_event_id = lif_actual_event~cs_event_id-model-shp_pod.
WHEN lif_actual_event~cs_event_id-standard-popu.
rv_model_event_id = lif_actual_event~cs_event_id-model-popu.
WHEN lif_actual_event~cs_event_id-standard-load_begin.
rv_model_event_id = lif_actual_event~cs_event_id-model-load_start.
WHEN lif_actual_event~cs_event_id-standard-load_end.
rv_model_event_id = lif_actual_event~cs_event_id-model-load_end.
WHEN lif_actual_event~cs_event_id-standard-coupling.
rv_model_event_id = lif_actual_event~cs_event_id-model-coupling.
WHEN lif_actual_event~cs_event_id-standard-decoupling.
rv_model_event_id = lif_actual_event~cs_event_id-model-decoupling.
WHEN lif_actual_event~cs_event_id-standard-unload_begin.
rv_model_event_id = lif_actual_event~cs_event_id-model-unload_begin.
WHEN lif_actual_event~cs_event_id-standard-unload_end.
rv_model_event_id = lif_actual_event~cs_event_id-model-unload_end.
WHEN lif_actual_event~cs_event_id-standard-delay.
rv_model_event_id = lif_actual_event~cs_event_id-model-delay.
WHEN OTHERS.
RETURN.
ENDCASE.
ENDMETHOD.
ENDCLASS.
CLASS lcl_fo_actual_event IMPLEMENTATION.
METHOD lif_actual_event~check_tor_type_specific_events.
IF iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-departure AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-arriv_dest AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-popu AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-pod AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-load_begin AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-load_end AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-unload_begin AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-unload_end AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-coupling AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-decoupling AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-delay.
e_result = lif_ef_constants=>cs_condition-false.
ENDIF.
ENDMETHOD.
ENDCLASS.
CLASS lcl_fb_actual_event IMPLEMENTATION.
METHOD lif_actual_event~check_tor_type_specific_events.
IF iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-departure AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-arriv_dest AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-popu AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-pod AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-load_begin AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-load_end AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-unload_begin AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-unload_end AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-delay.
e_result = lif_ef_constants=>cs_condition-false.
ENDIF.
ENDMETHOD.
ENDCLASS.
CLASS lcl_fu_actual_event IMPLEMENTATION.
METHOD lif_actual_event~check_tor_type_specific_events.
IF iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-departure AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-arriv_dest AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-popu AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-pod AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-load_begin AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-load_end AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-unload_begin AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-unload_end AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-coupling AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-decoupling AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-delay AND
iv_event_code <> /scmtms/if_tor_const=>sc_tor_event-delay_fu.
e_result = lif_ef_constants=>cs_condition-false.
ENDIF.
ENDMETHOD.
METHOD lif_actual_event~adjust_ae_location_data.
FIELD-SYMBOLS <ls_root> TYPE /scmtms/s_em_bo_tor_root.
DATA: lv_stop_category TYPE /scmtms/tor_category,
ls_trackparameters TYPE /saptrx/bapi_evm_parameters.
DATA(lt_stop) = get_stop( i_all_appl_tables ).
DATA(lt_capa_stop) = get_capa_stop( i_all_appl_tables ).
DATA(lt_capa_root) = get_capa_root( i_all_appl_tables ).
ASSIGN i_event-maintabref->* TO <ls_root>.
IF sy-subrc <> 0.
RETURN.
ENDIF.
ASSIGN ct_trackingheader[ trxid = <ls_root>-tor_id ] TO FIELD-SYMBOL(<ls_trackingheader>).
IF sy-subrc = 0.
<ls_trackingheader>-trxcod = lif_actual_event~cs_trxcode-freight_unit.
<ls_trackingheader>-evtid = get_model_event_id( <ls_trackingheader>-evtid ).
ENDIF.
CLEAR ls_trackparameters.
ls_trackparameters-evtcnt = <ls_trackingheader>-evtcnt.
ls_trackparameters-param_name = lif_ef_constants=>cs_system_fields-actual_technical_timezone.
ls_trackparameters-param_value = lcl_tools=>get_system_time_zone( ).
APPEND ls_trackparameters TO ct_trackparameters.
CLEAR ls_trackparameters.
ls_trackparameters-evtcnt = <ls_trackingheader>-evtcnt.
ls_trackparameters-param_name = lif_ef_constants=>cs_system_fields-actual_technical_datetime.
ls_trackparameters-param_value = lcl_tools=>get_system_date_time( ).
APPEND ls_trackparameters TO ct_trackparameters.
ASSIGN ct_tracklocation[ evtcnt = <ls_trackingheader>-evtcnt ] TO FIELD-SYMBOL(<ls_tracklocation>).
IF sy-subrc = 0.
<ls_tracklocation>-loccod = lif_actual_event~cs_location_type-logistic.
LOOP AT lt_stop ASSIGNING FIELD-SYMBOL(<ls_stop>) USING KEY parent_seqnum WHERE parent_node_id = <ls_root>-node_id.
IF sy-tabix = 1.
DATA(lv_first_location) = <ls_stop>-log_locid.
ENDIF.
DATA(lv_last_location) = <ls_stop>-log_locid.
ENDLOOP.
IF <ls_tracklocation>-locid1 = lv_first_location OR <ls_tracklocation>-locid1 = lv_last_location.
ASSIGN lt_stop[ parent_node_id = <ls_root>-node_id
log_locid = <ls_tracklocation>-locid1 ] TO <ls_stop>.
ELSE.
IF iv_event_code = /scmtms/if_tor_const=>sc_tor_event-departure OR
iv_event_code = /scmtms/if_tor_const=>sc_tor_event-popu OR
iv_event_code = /scmtms/if_tor_const=>sc_tor_event-load_begin OR
iv_event_code = /scmtms/if_tor_const=>sc_tor_event-load_end OR
iv_event_code = /scmtms/if_tor_const=>sc_tor_event-coupling OR
iv_event_code = /scmtms/if_tor_const=>sc_tor_event-delay.
lv_stop_category = /scmtms/if_tor_const=>sc_tor_stop_cat-outbound.
ELSEIF iv_event_code = /scmtms/if_tor_const=>sc_tor_event-arriv_dest OR
iv_event_code = /scmtms/if_tor_const=>sc_tor_event-pod OR
iv_event_code = /scmtms/if_tor_const=>sc_tor_event-unload_begin OR
iv_event_code = /scmtms/if_tor_const=>sc_tor_event-unload_end OR
iv_event_code = /scmtms/if_tor_const=>sc_tor_event-decoupling.
lv_stop_category = /scmtms/if_tor_const=>sc_tor_stop_cat-inbound.
ENDIF.
ASSIGN lt_stop[ parent_node_id = <ls_root>-node_id
log_locid = <ls_tracklocation>-locid1
stop_cat = lv_stop_category ] TO <ls_stop>.
ENDIF.
IF sy-subrc <> 0.
RETURN.
ENDIF.
IF iv_event_code = /scmtms/if_tor_const=>sc_tor_event-delay.
ASSIGN ct_trackparameters[
param_name = lif_ef_constants=>cs_parameter-ref_planned_event_milestone
evtcnt = <ls_trackingheader>-evtcnt ] TO FIELD-SYMBOL(<ls_track_param>).
IF sy-subrc = 0.
DATA(lv_reference_event) = <ls_track_param>-param_value.
ENDIF.
ENDIF.
IF iv_event_code = /scmtms/if_tor_const=>sc_tor_event-pod OR
lv_reference_event = /scmtms/if_tor_const=>sc_tor_event-pod.
<ls_tracklocation>-locid2 = <ls_root>-tor_id.
ELSE.
<ls_tracklocation>-locid2 = lcl_tools=>get_capa_match_key(
iv_assgn_stop_key = <ls_stop>-assgn_stop_key
it_capa_stop = lt_capa_stop
it_capa_root = lt_capa_root ).
ENDIF.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
40348,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1168,
50,
2257,
62,
38,
15751,
62,
14242,
62,
3955,
47,
198,
9,
5,
10097,
30934,
9,
198,
31631,
300,
565,
62,
50039,
62,
15596,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
651,
62,
13165,
62,
50039,
62,
15596,
62,
4871,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
1279,
7278,
62,
13165,
62,
15763,
29,
41876,
1220,
1416,
16762,
907,
14,
82,
62,
368,
62,
2127,
62,
13165,
62,
15763,
13,
198,
220,
220,
220,
24994,
16284,
1312,
62,
15596,
12,
76,
2913,
397,
5420,
3784,
9,
5390,
1279,
7278,
62,
13165,
62,
15763,
28401,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
42001,
1279,
7278,
62,
13165,
62,
15763,
29,
12,
13165,
62,
9246,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42099,
1220,
1416,
16762,
907,
14,
361,
62,
13165,
62,
9979,
14804,
1416,
62,
13165,
62,
22872,
12,
5275,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
686,
62,
50039,
62,
15596,
796,
12682,
300,
565,
62,
6513,
62,
50039,
62,
15596,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
42099,
1220,
1416,
16762,
907,
14,
361,
62,
13165,
62,
9979,
14804,
1416,
62,
13165,
62,
22872,
12,
2070,
278,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
686,
62,
50039,
62,
15596,
796,
12682,
300,
565,
62,
21855,
62,
50039,
62,
15596,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
42099,
1220,
1416,
16762,
907,
14,
361,
62,
13165,
62,
9979,
14804,
1416,
62,
13165,
62,
22872,
12,
19503,
432,
62,
20850,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
686,
62,
50039,
62,
15596,
796,
12682,
300,
565,
62,
20942,
62,
50039,
62,
15596,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
42099,
440,
4221,
4877,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
337,
1546,
4090,
8264,
1312,
28694,
7,
89,
82,
301,
62,
70,
926,
8,
13315,
1279,
7278,
62,
13165,
62,
15763,
29,
12,
13165,
62,
9246,
39319,
42865,
7,
6780,
62,
67,
13513,
737,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
565,
62,
31391,
14804,
16939,
62,
1069,
4516,
7,
6739,
198,
220,
220,
220,
220,
220,
23578,
34,
11159,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
3868,
62,
50039,
62,
15596,
93,
9122,
62,
13165,
62,
4906,
62,
11423,
62,
31534,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
3868,
62,
50039,
62,
15596,
93,
9122,
62,
2213,
87,
2655,
933,
480,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
1279,
7278,
62,
13165,
62,
15763,
29,
41876,
1220,
1416,
16762,
907,
14,
82,
62,
368,
62,
2127,
62,
13165,
62,
15763,
13,
628,
220,
220,
220,
30301,
1503,
304,
62,
20274,
13,
628,
220,
220,
220,
24994,
16284,
1312,
62,
15596,
12,
76,
2913,
397,
5420,
3784,
9,
5390,
1279,
7278,
62,
13165,
62,
15763,
28401,
628,
220,
220,
220,
33493,
311,
2751,
2538,
1220,
82,
2373,
40914,
14,
64,
13567,
93,
2213,
87,
2655,
933,
480,
198,
220,
220,
220,
220,
220,
16034,
1220,
1416,
16762,
907,
14,
66,
62,
83,
419,
88,
198,
220,
220,
220,
220,
220,
32357,
1268,
1220,
82,
2373,
40914,
14,
64,
13567,
6177,
1220,
1416,
16762,
907,
14,
66,
62,
83,
419,
88,
93,
64,
8690,
796,
1220,
82,
2373,
40914,
14,
64,
13567,
93,
64,
8690,
198,
220,
220,
220,
220,
220,
39319,
2488,
26947,
7,
6780,
62,
2213,
87,
2655,
933,
480,
8,
198,
220,
220,
220,
220,
220,
33411,
1220,
1416,
16762,
907,
14,
66,
62,
83,
419,
88,
93,
4906,
220,
220,
220,
220,
220,
220,
220,
220,
796,
2488,
27,
7278,
62,
13165,
62,
15763,
29,
12,
13165,
62,
4906,
5357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1220,
82,
2373,
40914,
14,
64,
13567,
93,
2213,
74,
62,
26801,
62,
4906,
796,
2488,
36195,
62,
50039,
62,
15596,
93,
33967,
62,
13165,
62,
2213,
74,
62,
26801,
62,
28004,
13,
628,
220,
220,
220,
16876,
1312,
62,
15596,
12,
2213,
87,
2655,
933,
480,
1279,
29,
300,
85,
62,
2213,
87,
2655,
933,
480,
13,
198,
220,
220,
220,
220,
220,
304,
62,
20274,
796,
3868,
62,
891,
62,
9979,
1187,
14804,
6359,
62,
31448,
12,
9562,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
3868,
62,
50039,
62,
15596,
93,
9122,
62,
15596,
62,
260,
2768,
590,
13,
628,
220,
220,
220,
16876,
3868,
62,
50039,
62,
15596,
93,
9122,
62,
13165,
62,
4906,
62,
11423,
62,
31534,
7,
21628,
62,
15596,
62,
8189,
1267,
796,
3868,
62,
891,
62,
9979,
1187,
14804,
6359,
62,
31448,
12,
9562,
13,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
3868,
62,
50039,
62,
15596,
93,
9122,
62,
31438,
62,
15596,
62,
10459,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
439,
62,
1324,
75,
62,
83,
2977,
796,
1312,
62,
439,
62,
1324,
75,
62,
83,
2977,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
15596,
62,
8189,
220,
220,
220,
220,
796,
21628,
62,
15596,
62,
8189,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
15596,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
1312,
62,
15596,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
304,
62,
20274,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
304,
62,
20274,
6739,
198,
220,
220,
220,
16876,
304,
62,
20274,
796,
3868,
62,
891,
62,
9979,
1187,
14804,
6359,
62,
31448,
12,
9562,
13,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ZCL_TESTLOSC definition
public
final
create public .
public section.
types: begin of ty_data,
key type string,
value type string,
end of ty_data.
class-methods execute
returning value(data) type ty_data. | [
4871,
1168,
5097,
62,
51,
6465,
45376,
34,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
198,
3858,
25,
2221,
286,
1259,
62,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1994,
2099,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
2099,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
886,
286,
1259,
62,
7890,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1398,
12,
24396,
82,
12260,
198,
220,
220,
220,
220,
220,
220,
220,
8024,
1988,
7,
7890,
8,
2099,
1259,
62,
7890,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
INTERFACE zif_timem_object
PUBLIC .
TYPES:
ty_t_part_ref TYPE STANDARD TABLE OF REF TO zcl_timem_part WITH KEY table_line .
"! Returns a list of references to part instances
METHODS get_part_list
RETURNING
VALUE(result) TYPE ztimem_part_t
RAISING
zcx_timem .
"! Returns the object name
METHODS get_name
RETURNING
VALUE(result) TYPE string .
"! Checks if the object exists in the system
METHODS check_exists
RETURNING
VALUE(result) TYPE boolean .
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
16514,
368,
62,
15252,
198,
220,
44731,
764,
628,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
83,
62,
3911,
62,
5420,
41876,
49053,
9795,
43679,
3963,
4526,
37,
5390,
1976,
565,
62,
16514,
368,
62,
3911,
13315,
35374,
3084,
62,
1370,
764,
628,
220,
366,
0,
16409,
257,
1351,
286,
10288,
284,
636,
10245,
198,
220,
337,
36252,
50,
651,
62,
3911,
62,
4868,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
1976,
16514,
368,
62,
3911,
62,
83,
198,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
16514,
368,
764,
628,
220,
366,
0,
16409,
262,
2134,
1438,
198,
220,
337,
36252,
50,
651,
62,
3672,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
4731,
764,
628,
220,
366,
0,
47719,
611,
262,
2134,
7160,
287,
262,
1080,
198,
220,
337,
36252,
50,
2198,
62,
1069,
1023,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
25131,
764,
198,
10619,
41358,
49836,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_fm_test_data_serialize DEFINITION
PUBLIC
FINAL
CREATE PUBLIC
GLOBAL FRIENDS ZCL_fm_test_data.
PUBLIC SECTION.
TYPES: BEGIN OF ty_parameter,
name TYPE string,
kind LIKE abap_func_importing,
dynamically_defined_value TYPE xsdany,
END OF ty_parameter,
BEGIN OF ty_parameter_type,
name TYPE string,
dynamically_defined_value TYPE xsdany, " srtti_type TYPE REF TO zcl_srtti_typedescr
END OF ty_parameter_type,
ty_parameter_types TYPE STANDARD TABLE OF ty_parameter_type WITH EMPTY KEY,
BEGIN OF ty_test_data,
BEGIN OF header,
fm_name TYPE tfdir-funcname,
fugr_name TYPE tlibg-area,
id TYPE eufunc-nummer,
title TYPE zcl_fm_test_data=>ty_datadir_entry-title,
author TYPE syuname,
date TYPE d,
time TYPE t,
lower_case TYPE abap_bool,
duration TYPE i,
rc TYPE i,
exception_name TYPE c LENGTH 30,
stepid TYPE zcl_fm_test_data=>ty_datadir_entry-stepid,
version TYPE c LENGTH 4,
END OF header,
values_before_call TYPE STANDARD TABLE OF ty_parameter WITH EMPTY KEY,
values_after_call TYPE STANDARD TABLE OF ty_parameter WITH EMPTY KEY,
BEGIN OF parameter_types,
input TYPE ty_parameter_types,
result TYPE ty_parameter_types,
END OF parameter_types,
error TYPE string,
END OF ty_test_data.
"! <p class="shorttext synchronized" lang="en"></p>
"!
"! @parameter test_data | <p class="shorttext synchronized" lang="en"></p>
"! @parameter test_data_xml | <p class="shorttext synchronized" lang="en"></p>
"! @raising zcx_fm_test_data | <p class="shorttext synchronized" lang="en"></p>
CLASS-METHODS serialize
IMPORTING
test_data TYPE REF TO zcl_fm_test_data
* parameter_types TYPE abap_bool DEFAULT abap_true
RETURNING
VALUE(test_data_xml) TYPE string
RAISING
zcx_fm_test_data .
"! <p class="shorttext synchronized" lang="en"></p>
"!
"! @parameter test_data_xml | <p class="shorttext synchronized" lang="en"></p>
"! @parameter result | <p class="shorttext synchronized" lang="en"></p>
"! @raising zcx_fm_test_data | <p class="shorttext synchronized" lang="en"></p>
CLASS-METHODS deserialize
IMPORTING
test_data_xml TYPE string
RETURNING
VALUE(result) TYPE REF TO zcl_fm_test_data
RAISING
zcx_fm_test_data.
CLASS-METHODS deserialize_into_structure
IMPORTING
test_data_xml TYPE string
RETURNING
VALUE(result) TYPE ty_test_data
RAISING
zcx_fm_test_data.
PROTECTED SECTION.
PRIVATE SECTION.
CLASS-METHODS get_parameter
IMPORTING
parameter TYPE abap_func_parmbind
RETURNING
VALUE(result) TYPE ty_parameter
RAISING
zcx_fm_test_data.
CLASS-METHODS get_parameter_type
IMPORTING
parameter TYPE abap_func_parmbind
RETURNING
VALUE(result) TYPE ty_parameter_type
RAISING
zcx_fm_test_data.
CLASS-METHODS serialize_parameter_types
IMPORTING
parameters TYPE abap_func_parmbind_tab
RETURNING
VALUE(xml) TYPE string.
CLASS-METHODS deserialize_parameter
IMPORTING
parameter TYPE ty_parameter
parameter_types TYPE ty_parameter_types
RETURNING
VALUE(result) TYPE abap_func_parmbind
RAISING
zcx_fm_test_data.
ENDCLASS.
CLASS zcl_fm_test_data_serialize IMPLEMENTATION.
METHOD serialize.
DATA(serializable_test_data) = VALUE ty_test_data(
header = VALUE #(
fm_name = test_data->fm_name
fugr_name = test_data->fugr_name
id = test_data->id
title = test_data->title
author = test_data->author
date = test_data->date
time = test_data->time
lower_case = test_data->lower_case
duration = test_data->duration
rc = test_data->rc
exception_name = test_data->exception_name
stepid = test_data->stepid
version = test_data->version )
values_before_call = VALUE #(
FOR <parameter> IN test_data->input_parameters
( get_parameter( <parameter> ) ) )
values_after_call = VALUE #(
FOR <parameter> IN test_data->result_parameters
( get_parameter( <parameter> ) ) )
parameter_types = VALUE #(
input = VALUE #(
FOR <type> IN test_data->input_parameters
( get_parameter_type( <type> ) ) )
result = VALUE #(
FOR <type> IN test_data->result_parameters
( get_parameter_type( <type> ) ) ) ) ).
TRY.
CALL TRANSFORMATION z_fm_test_data
SOURCE root = serializable_test_data
RESULT XML test_data_xml
OPTIONS xml_header = 'no'.
CATCH cx_root INTO DATA(error).
serializable_test_data-error = error->get_text( ).
ENDTRY.
ENDMETHOD.
METHOD deserialize.
DATA: parameter TYPE REF TO ty_parameter.
DATA(test_data_temp) = deserialize_into_structure( test_data_xml ).
IF test_data_temp-error IS NOT INITIAL.
RAISE EXCEPTION TYPE zcx_fm_test_data EXPORTING text = test_data_temp-error.
ENDIF.
DATA(test_data) = zcl_fm_test_data=>create( fm_name = test_data_temp-header-fm_name
title = test_data_temp-header-title ).
* test_data->fugr_name = test_data_temp-header-fugr_name.
* test_data->id = test_data_temp-header-id.
* test_data->author = test_data_temp-header-author.
* test_data->date = test_data_temp-header-date.
* test_data->time = test_data_temp-header-time.
test_data->set_lower_case( test_data_temp-header-lower_case ).
* test_data->duration = test_data_temp-header-duration.
* test_data->rc = test_data_temp-header-rc.
* test_data->exception_name = test_data_temp-header-exception_name.
* test_data->stepid = test_data_temp-header-stepid.
* test_data->version = test_data_temp-header-version.
test_data->set_input_parameters(
parameters = VALUE #(
FOR <parameter> IN test_data_temp-values_before_call
( deserialize_parameter( parameter = <parameter>
parameter_types = test_data_temp-parameter_types-input ) ) ) ).
result = test_data.
ENDMETHOD.
METHOD deserialize_into_structure.
DATA: error TYPE REF TO cx_root.
TRY.
CALL TRANSFORMATION z_fm_test_data
SOURCE XML test_data_xml
RESULT root = result.
CATCH cx_root INTO error.
RAISE EXCEPTION TYPE zcx_fm_test_data EXPORTING previous = error.
ENDTRY.
ENDMETHOD.
METHOD deserialize_parameter.
DATA: "test_data_temp TYPE ty_xx,
srtti_type TYPE REF TO zcl_srtti_typedescr,
error TYPE REF TO cx_root,
dref TYPE REF TO data.
DATA(parameter_type) = REF #( parameter_types[ name = parameter-name ] OPTIONAL ).
IF parameter_type IS NOT BOUND.
RAISE EXCEPTION TYPE zcx_fm_test_data EXPORTING text = |Internal error - Parameter type was not serialized|.
ENDIF.
TRY.
CALL TRANSFORMATION id
SOURCE XML parameter_type->dynamically_defined_value
RESULT data = srtti_type.
CATCH cx_root INTO error.
RAISE EXCEPTION TYPE zcx_fm_test_data EXPORTING previous = error.
ENDTRY.
DATA(rtti) = CAST cl_abap_datadescr( srtti_type->get_rtti( ) ).
CREATE DATA dref TYPE HANDLE rtti.
ASSIGN dref->* TO FIELD-SYMBOL(<parameter_value>).
" store the value
TRY.
CALL TRANSFORMATION id
SOURCE XML parameter-dynamically_defined_value
RESULT data = <parameter_value>.
CATCH cx_root INTO error.
RAISE EXCEPTION TYPE zcx_fm_test_data EXPORTING previous = error.
ENDTRY.
result = VALUE #(
name = parameter-name
kind = parameter-kind
value = dref ).
ENDMETHOD.
METHOD serialize_parameter_types.
DATA: parameter TYPE REF TO abap_func_parmbind,
srtti_type TYPE REF TO zcl_srtti_typedescr.
FIELD-SYMBOLS <parameter_value> TYPE any.
LOOP AT parameters REFERENCE INTO parameter.
ASSIGN parameter->value->* TO <parameter_value>.
srtti_type = zcl_srtti_typedescr=>create_by_data_object( <parameter_value> ).
TRY.
" to omit the BOM, get RESULT into type XSTRING, but drawback is that it's UTF-8 to be later converted to string.
CALL TRANSFORMATION id
SOURCE data = srtti_type
RESULT XML DATA(serialized_srtti_type)
OPTIONS initial_components = 'suppress' "data_refs = 'heap-or-create'
xml_header = 'no'.
CATCH cx_root INTO DATA(error).
ENDTRY.
xml = xml && |<element name="{ parameter->name }">{ cl_abap_codepage=>convert_from( serialized_srtti_type ) }</element>|.
ENDLOOP.
ENDMETHOD.
METHOD get_parameter.
FIELD-SYMBOLS <parameter_value> TYPE any.
result-name = parameter-name.
result-kind = parameter-kind.
ASSIGN parameter-value->* TO <parameter_value>.
TRY.
" to omit the BOM, get RESULT into type XSTRING, but drawback is that it's UTF-8 to be later converted to string.
CALL TRANSFORMATION id
SOURCE data = <parameter_value>
RESULT XML result-dynamically_defined_value
OPTIONS initial_components = 'suppress' "data_refs = 'heap-or-create'
xml_header = 'no'.
CATCH cx_root INTO DATA(error).
RAISE EXCEPTION TYPE zcx_fm_test_data EXPORTING previous = error.
ENDTRY.
ENDMETHOD.
METHOD get_parameter_type.
FIELD-SYMBOLS <parameter_value> TYPE any.
result-name = parameter-name.
ASSIGN parameter-value->* TO <parameter_value>.
DATA(srtti_type) = zcl_srtti_typedescr=>create_by_data_object( <parameter_value> ).
TRY.
" to omit the BOM, get RESULT into type XSTRING, but drawback is that it's UTF-8 to be later converted to string.
CALL TRANSFORMATION id
SOURCE data = srtti_type
RESULT XML result-dynamically_defined_value
OPTIONS initial_components = 'suppress' "data_refs = 'heap-or-create'
xml_header = 'no'.
CATCH cx_root INTO DATA(error).
RAISE EXCEPTION TYPE zcx_fm_test_data EXPORTING previous = error.
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
38353,
62,
9288,
62,
7890,
62,
46911,
1096,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
198,
220,
10188,
9864,
1847,
48167,
1677,
5258,
1168,
5097,
62,
38353,
62,
9288,
62,
7890,
13,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
17143,
2357,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1611,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34178,
450,
499,
62,
20786,
62,
11748,
278,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32366,
62,
23211,
62,
8367,
41876,
2124,
21282,
1092,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
17143,
2357,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
17143,
2357,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32366,
62,
23211,
62,
8367,
41876,
2124,
21282,
1092,
11,
366,
19677,
35671,
62,
4906,
41876,
4526,
37,
5390,
1976,
565,
62,
27891,
35671,
62,
774,
9124,
3798,
81,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
17143,
2357,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1259,
62,
17143,
2357,
62,
19199,
41876,
49053,
9795,
43679,
3963,
1259,
62,
17143,
2357,
62,
4906,
13315,
38144,
9936,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
9288,
62,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
43312,
3963,
13639,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
76,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
41876,
48700,
15908,
12,
20786,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31497,
81,
62,
3672,
220,
220,
220,
220,
220,
41876,
256,
8019,
70,
12,
20337,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
304,
3046,
19524,
12,
22510,
647,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3670,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
565,
62,
38353,
62,
9288,
62,
7890,
14804,
774,
62,
19608,
324,
343,
62,
13000,
12,
7839,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1772,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
827,
403,
480,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3128,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
288,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
640,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
256,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2793,
62,
7442,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9478,
220,
220,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
48321,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6631,
62,
3672,
41876,
269,
406,
49494,
1542,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2239,
312,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
565,
62,
38353,
62,
9288,
62,
7890,
14804,
774,
62,
19608,
324,
343,
62,
13000,
12,
9662,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2196,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
406,
49494,
604,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
13639,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3815,
62,
19052,
62,
13345,
41876,
49053,
9795,
43679,
3963,
1259,
62,
17143,
2357,
13315,
38144,
9936,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3815,
62,
8499,
62,
13345,
220,
41876,
49053,
9795,
43679,
3963,
1259,
62,
17143,
2357,
13315,
38144,
9936,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
43312,
3963,
11507,
62,
19199,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
220,
41876,
1259,
62,
17143,
2357,
62,
19199,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
41876,
1259,
62,
17143,
2357,
62,
19199,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
11507,
62,
19199,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4049,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
9288,
62,
7890,
13,
628,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ltc_executors definition final for testing
duration short
risk level harmless
inheriting from zcl_assert.
public section.
interfaces zif_thread_callback.
private section.
data:
o_cut type ref to ZCL_EXECUTORS,
v_collected type i.
methods:
setup,
it_returns_single_thread for testing,
it_returns_fixed_pool for testing,
it_pass_callback_and_factory for testing.
endclass.
class ltc_executors implementation.
method setup.
clear v_collected.
endmethod.
method it_returns_single_thread.
assert_bound( zcl_executors=>new_single_thread_executor( ) ).
endmethod.
method it_returns_fixed_pool.
assert_bound( zcl_executors=>new_fixed_thread_pool( 2 ) ).
endmethod.
method it_pass_callback_and_factory.
data(lo_deactivated) = new zcl_deactivated_thread_factory( ).
lo_deactivated->set_thread_call_result(
iv_thread_num = 1
io_result = new zcl_dummy_runnable_result( )
).
lo_deactivated->set_thread_call_result(
iv_thread_num = 2
io_result = new zcl_dummy_runnable_result( )
).
data(lo_executor) = zcl_executors=>new_fixed_thread_pool(
iv_threads = 2
io_callback = me
io_thread_factory = lo_deactivated ).
lo_executor->submit( new zcl_runnable_dummy( 1 ) ).
lo_executor->submit( new zcl_runnable_dummy( 1 ) ).
lo_executor->await_termination( ).
assert_equals(
exp = 2
act = lines( lo_deactivated->get_created_threads( ) )
msg = 'Should have passed factory'
).
assert_equals(
exp = 2
act = v_collected
msg = 'Should have passed call back'
).
endmethod.
method zif_thread_callback~on_error.
v_collected = v_collected + 1.
endmethod.
method zif_thread_callback~on_result.
v_collected = v_collected + 1.
endmethod.
endclass.
| [
4871,
300,
23047,
62,
18558,
315,
669,
6770,
2457,
329,
4856,
198,
220,
9478,
1790,
198,
220,
2526,
1241,
23585,
198,
220,
10639,
1780,
422,
1976,
565,
62,
30493,
13,
628,
220,
1171,
2665,
13,
198,
220,
220,
220,
20314,
1976,
361,
62,
16663,
62,
47423,
13,
198,
220,
2839,
2665,
13,
198,
220,
220,
220,
1366,
25,
198,
220,
220,
220,
220,
220,
220,
220,
267,
62,
8968,
2099,
1006,
284,
1168,
5097,
62,
6369,
2943,
3843,
20673,
11,
198,
220,
220,
220,
220,
220,
220,
220,
410,
62,
4033,
12609,
2099,
1312,
13,
198,
220,
220,
220,
5050,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
340,
62,
7783,
82,
62,
29762,
62,
16663,
329,
4856,
11,
198,
220,
220,
220,
220,
220,
340,
62,
7783,
82,
62,
34021,
62,
7742,
329,
4856,
11,
198,
220,
220,
220,
220,
220,
340,
62,
6603,
62,
47423,
62,
392,
62,
69,
9548,
329,
4856,
13,
198,
437,
4871,
13,
628,
198,
4871,
300,
23047,
62,
18558,
315,
669,
7822,
13,
628,
198,
220,
2446,
9058,
13,
198,
220,
220,
220,
1598,
410,
62,
4033,
12609,
13,
198,
220,
886,
24396,
13,
628,
220,
2446,
340,
62,
7783,
82,
62,
29762,
62,
16663,
13,
628,
220,
220,
220,
6818,
62,
7784,
7,
1976,
565,
62,
18558,
315,
669,
14804,
3605,
62,
29762,
62,
16663,
62,
18558,
38409,
7,
220,
1267,
6739,
628,
220,
886,
24396,
13,
628,
220,
2446,
340,
62,
7783,
82,
62,
34021,
62,
7742,
13,
628,
220,
220,
220,
6818,
62,
7784,
7,
1976,
565,
62,
18558,
315,
669,
14804,
3605,
62,
34021,
62,
16663,
62,
7742,
7,
362,
1267,
6739,
628,
220,
886,
24396,
13,
628,
220,
2446,
340,
62,
6603,
62,
47423,
62,
392,
62,
69,
9548,
13,
628,
220,
220,
220,
1366,
7,
5439,
62,
2934,
33106,
8,
796,
649,
1976,
565,
62,
2934,
33106,
62,
16663,
62,
69,
9548,
7,
220,
6739,
198,
220,
220,
220,
2376,
62,
2934,
33106,
3784,
2617,
62,
16663,
62,
13345,
62,
20274,
7,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16663,
62,
22510,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
20274,
220,
220,
220,
220,
796,
649,
1976,
565,
62,
67,
13513,
62,
5143,
77,
540,
62,
20274,
7,
1267,
198,
220,
220,
220,
6739,
198,
220,
220,
220,
2376,
62,
2934,
33106,
3784,
2617,
62,
16663,
62,
13345,
62,
20274,
7,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16663,
62,
22510,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
20274,
220,
220,
220,
220,
796,
649,
1976,
565,
62,
67,
13513,
62,
5143,
77,
540,
62,
20274,
7,
220,
1267,
198,
220,
220,
220,
6739,
628,
220,
220,
220,
1366,
7,
5439,
62,
18558,
38409,
8,
796,
1976,
565,
62,
18558,
315,
669,
14804,
3605,
62,
34021,
62,
16663,
62,
7742,
7,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16663,
82,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
47423,
796,
502,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
16663,
62,
69,
9548,
220,
796,
2376,
62,
2934,
33106,
6739,
628,
198,
220,
220,
220,
2376,
62,
18558,
38409,
3784,
46002,
7,
649,
1976,
565,
62,
5143,
77,
540,
62,
67,
13513,
7,
352,
1267,
6739,
198,
220,
220,
220,
2376,
62,
18558,
38409,
3784,
46002,
7,
649,
1976,
565,
62,
5143,
77,
540,
62,
67,
13513,
7,
352,
1267,
6739,
198,
220,
220,
220,
2376,
62,
18558,
38409,
3784,
707,
4548,
62,
41382,
7,
220,
6739,
628,
220,
220,
220,
6818,
62,
4853,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
719,
796,
3951,
7,
2376,
62,
2934,
33106,
3784,
1136,
62,
25598,
62,
16663,
82,
7,
220,
1267,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
31456,
796,
705,
19926,
423,
3804,
8860,
6,
198,
220,
220,
220,
6739,
628,
220,
220,
220,
6818,
62,
4853,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
719,
796,
410,
62,
4033,
12609,
198,
220,
220,
220,
220,
220,
220,
220,
31456,
796,
705,
19926,
423,
3804,
869,
736,
6,
198,
220,
220,
220,
6739,
628,
628,
220,
886,
24396,
13,
628,
198,
220,
2446,
1976,
361,
62,
16663,
62,
47423,
93,
261,
62,
18224,
13,
198,
220,
220,
220,
410,
62,
4033,
12609,
796,
410,
62,
4033,
12609,
1343,
352,
13,
198,
220,
886,
24396,
13,
628,
220,
2446,
1976,
361,
62,
16663,
62,
47423,
93,
261,
62,
20274,
13,
198,
220,
220,
220,
410,
62,
4033,
12609,
796,
410,
62,
4033,
12609,
1343,
352,
13,
198,
220,
886,
24396,
13,
198,
198,
437,
4871,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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... This was easy :-)
" JSONC... With comments
BEGIN OF c_css,
keyword TYPE string VALUE 'selectors', "#EC NOTEXT
text TYPE string VALUE 'text', "#EC NOTEXT
values TYPE string VALUE 'properties', "#EC NOTEXT
comment TYPE string VALUE 'comment', "#EC NOTEXT
END OF c_css.
CONSTANTS:
BEGIN OF c_token,
keyword TYPE c VALUE 'K', "#EC NOTEXT
text TYPE c VALUE 'T', "#EC NOTEXT
values TYPE c VALUE 'V', "#EC NOTEXT
comment TYPE c VALUE 'C', "#EC NOTEXT
END OF c_token.
CONSTANTS:
BEGIN OF c_regex,
" comments /* ... */ or //
comment TYPE string VALUE '\/\*.*\*\/|\/\*|\*\/|\/\/', "#EC NOTEXT
" not much here
keyword TYPE string VALUE 'true|false|null', "#EC NOTEXT
" double quoted strings
text TYPE string VALUE '"', "#EC NOTEXT
END OF c_regex.
METHODS constructor.
PROTECTED SECTION.
METHODS order_matches REDEFINITION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_abapgit_syntax_json IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
" Initialize instances of regular expression
add_rule( iv_regex = c_regex-keyword
iv_token = c_token-keyword
iv_style = c_css-keyword ).
" Style for keys
add_rule( iv_regex = c_regex-text
iv_token = c_token-text
iv_style = c_css-text ).
" Style for values
add_rule( iv_regex = ''
iv_token = c_token-values
iv_style = c_css-values ).
" JSONC comments
add_rule( iv_regex = c_regex-comment
iv_token = c_token-comment
iv_style = c_css-comment ).
ENDMETHOD.
METHOD order_matches.
DATA:
lv_match TYPE string,
lv_count TYPE i,
lv_line_len TYPE i,
lv_prev_token TYPE c.
FIELD-SYMBOLS:
<ls_prev> TYPE ty_match,
<ls_match> TYPE ty_match.
" Longest matches
SORT ct_matches BY offset length DESCENDING.
lv_line_len = strlen( iv_line ).
LOOP AT ct_matches ASSIGNING <ls_match>.
" Delete matches after open text match
IF lv_prev_token = c_token-text AND <ls_match>-token <> c_token-text.
CLEAR <ls_match>-token.
CONTINUE.
ENDIF.
lv_match = substring( val = iv_line
off = <ls_match>-offset
len = <ls_match>-length ).
IF <ls_match>-token = c_token-text.
<ls_match>-text_tag = lv_match.
IF lv_prev_token = c_token-text.
IF <ls_match>-text_tag = <ls_prev>-text_tag.
<ls_prev>-length = <ls_match>-offset + <ls_match>-length - <ls_prev>-offset.
CLEAR lv_prev_token.
ENDIF.
CLEAR <ls_match>-token.
CONTINUE.
ENDIF.
ENDIF.
lv_prev_token = <ls_match>-token.
ASSIGN <ls_match> TO <ls_prev>.
ENDLOOP.
DELETE ct_matches WHERE token IS INITIAL.
" Switch style of second text match to values
LOOP AT ct_matches ASSIGNING <ls_match> WHERE token = c_token-text.
lv_count = lv_count + 1.
IF lv_count >= 2.
<ls_match>-token = c_token-values.
ENDIF.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
1837,
41641,
62,
17752,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
1837,
41641,
62,
8929,
75,
4799,
198,
220,
29244,
6158,
44731,
13,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
366,
19449,
986,
770,
373,
2562,
47226,
198,
220,
220,
220,
220,
220,
366,
19449,
34,
986,
2080,
3651,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
25471,
11,
198,
220,
220,
220,
220,
220,
220,
220,
21179,
41876,
4731,
26173,
8924,
705,
19738,
669,
3256,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
5239,
3256,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
220,
220,
3815,
220,
41876,
4731,
26173,
8924,
705,
48310,
3256,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
220,
220,
2912,
41876,
4731,
26173,
8924,
705,
23893,
3256,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
25471,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
30001,
11,
198,
220,
220,
220,
220,
220,
220,
220,
21179,
41876,
269,
26173,
8924,
705,
42,
3256,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
220,
220,
220,
41876,
269,
26173,
8924,
705,
51,
3256,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
220,
220,
3815,
220,
41876,
269,
26173,
8924,
705,
53,
3256,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
220,
220,
2912,
41876,
269,
26173,
8924,
705,
34,
3256,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
30001,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
260,
25636,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
3651,
11900,
2644,
9466,
393,
3373,
198,
220,
220,
220,
220,
220,
220,
220,
2912,
41876,
4731,
26173,
8924,
705,
11139,
59,
9,
15885,
59,
9,
11139,
91,
11139,
59,
9,
91,
59,
9,
11139,
91,
45422,
3256,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
220,
220,
366,
407,
881,
994,
198,
220,
220,
220,
220,
220,
220,
220,
21179,
41876,
4731,
26173,
8924,
705,
7942,
91,
9562,
91,
8423,
3256,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
220,
220,
366,
4274,
10947,
13042,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
1,
3256,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
260,
25636,
13,
628,
220,
220,
220,
337,
36252,
50,
23772,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
1502,
62,
6759,
2052,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
1837,
41641,
62,
17752,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
2208,
3784,
41571,
273,
7,
6739,
628,
220,
220,
220,
366,
20768,
1096,
10245,
286,
3218,
5408,
628,
220,
220,
220,
751,
62,
25135,
7,
21628,
62,
260,
25636,
796,
269,
62,
260,
25636,
12,
2539,
4775,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
30001,
796,
269,
62,
30001,
12,
2539,
4775,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
7635,
796,
269,
62,
25471,
12,
2539,
4775,
6739,
628,
220,
220,
220,
366,
17738,
329,
8251,
198,
220,
220,
220,
751,
62,
25135,
7,
21628,
62,
260,
25636,
796,
269,
62,
260,
25636,
12,
5239,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
30001,
796,
269,
62,
30001,
12,
5239,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
7635,
796,
269,
62,
25471,
12,
5239,
6739,
628,
220,
220,
220,
366,
17738,
329,
3815,
198,
220,
220,
220,
751,
62,
25135,
7,
21628,
62,
260,
25636,
796,
10148,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
30001,
796,
269,
62,
30001,
12,
27160,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
7635,
796,
269,
62,
25471,
12,
27160,
6739,
628,
220,
220,
220,
366,
19449,
34,
3651,
198,
220,
220,
220,
751,
62,
25135,
7,
21628,
62,
260,
25636,
796,
269,
62,
260,
25636,
12,
23893,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
30001,
796,
269,
62,
30001,
12,
23893,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_html_toolbar DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
METHODS:
constructor
IMPORTING
iv_id TYPE string OPTIONAL,
add
IMPORTING
iv_txt TYPE string
io_sub TYPE REF TO zcl_abapgit_html_toolbar OPTIONAL
iv_typ TYPE c DEFAULT zif_abapgit_html=>c_action_type-sapevent
iv_act TYPE string OPTIONAL
iv_ico TYPE string OPTIONAL
iv_cur TYPE abap_bool OPTIONAL
iv_opt TYPE c OPTIONAL
iv_chk TYPE abap_bool DEFAULT abap_undefined
iv_aux TYPE string OPTIONAL
iv_id TYPE string OPTIONAL,
count
RETURNING VALUE(rv_count) TYPE i,
render
IMPORTING
iv_right TYPE abap_bool OPTIONAL
iv_sort TYPE abap_bool OPTIONAL
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html,
render_as_droplist
IMPORTING
iv_label TYPE string
iv_right TYPE abap_bool OPTIONAL
iv_sort TYPE abap_bool OPTIONAL
iv_corner TYPE abap_bool OPTIONAL
iv_action TYPE string OPTIONAL
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_item,
txt TYPE string,
act TYPE string,
ico TYPE string,
sub TYPE REF TO zcl_abapgit_html_toolbar,
opt TYPE char1,
typ TYPE char1,
cur TYPE abap_bool,
chk TYPE abap_bool,
aux TYPE string,
id TYPE string,
END OF ty_item.
TYPES tt_items TYPE STANDARD TABLE OF ty_item.
DATA: mt_items TYPE tt_items,
mv_id TYPE string.
METHODS:
render_items
IMPORTING
iv_sort TYPE abap_bool OPTIONAL
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html.
ENDCLASS.
CLASS ZCL_ABAPGIT_HTML_TOOLBAR IMPLEMENTATION.
METHOD add.
DATA ls_item TYPE ty_item.
ASSERT iv_typ = zif_abapgit_html=>c_action_type-separator " sep doesn't have action
OR iv_typ = zif_abapgit_html=>c_action_type-onclick " click may have no action (assigned in JS)
OR iv_typ = zif_abapgit_html=>c_action_type-dummy " dummy may have no action
OR iv_act IS INITIAL AND io_sub IS NOT INITIAL
OR iv_act IS NOT INITIAL AND io_sub IS INITIAL. " Only one supplied
ASSERT NOT ( iv_chk <> abap_undefined AND io_sub IS NOT INITIAL ).
ls_item-txt = iv_txt.
ls_item-act = iv_act.
ls_item-ico = iv_ico.
ls_item-sub = io_sub.
ls_item-opt = iv_opt.
ls_item-typ = iv_typ.
ls_item-cur = iv_cur.
ls_item-chk = iv_chk.
ls_item-aux = iv_aux.
ls_item-id = iv_id.
APPEND ls_item TO mt_items.
ENDMETHOD.
METHOD constructor.
mv_id = iv_id.
ENDMETHOD.
METHOD count.
rv_count = lines( mt_items ).
ENDMETHOD.
METHOD render.
DATA: lv_class TYPE string.
CREATE OBJECT ro_html.
lv_class = 'nav-container' ##NO_TEXT.
IF iv_right = abap_true.
lv_class = lv_class && ' float-right'.
ENDIF.
ro_html->add( |<div class="{ lv_class }">| ).
ro_html->add( render_items( iv_sort = iv_sort ) ).
ro_html->add( '</div>' ).
ENDMETHOD.
METHOD render_as_droplist.
DATA: lv_class TYPE string.
CREATE OBJECT ro_html.
lv_class = 'nav-container' ##NO_TEXT.
IF iv_right = abap_true.
lv_class = lv_class && ' float-right'.
ENDIF.
IF iv_corner = abap_true.
lv_class = lv_class && ' corner'.
ENDIF.
ro_html->add( |<div class="{ lv_class }">| ).
ro_html->add( '<ul><li>' ).
ro_html->add_a( iv_txt = iv_label
iv_typ = zif_abapgit_html=>c_action_type-sapevent
iv_act = iv_action ).
ro_html->add( '<div class="minizone"></div>' ).
ro_html->add( render_items( iv_sort = iv_sort ) ).
ro_html->add( '</li></ul>' ).
ro_html->add( '</div>' ).
ENDMETHOD.
METHOD render_items.
DATA: lv_class TYPE string,
lv_icon TYPE string,
lv_id TYPE string,
lv_check TYPE string,
lv_aux TYPE string,
lv_has_icons TYPE abap_bool.
FIELD-SYMBOLS <ls_item> LIKE LINE OF mt_items.
CREATE OBJECT ro_html.
IF iv_sort = abap_true.
SORT mt_items BY txt ASCENDING AS TEXT.
ENDIF.
" Check has icons or check boxes
LOOP AT mt_items ASSIGNING <ls_item> WHERE ico IS NOT INITIAL OR chk <> abap_undefined.
lv_has_icons = abap_true.
lv_class = ' class="with-icons"'.
EXIT.
ENDLOOP.
IF mv_id IS NOT INITIAL.
lv_id = | id="{ mv_id }"|.
ENDIF.
ro_html->add( |<ul{ lv_id }{ lv_class }>| ).
" Render items
LOOP AT mt_items ASSIGNING <ls_item>.
CLEAR: lv_class, lv_icon.
IF <ls_item>-typ = zif_abapgit_html=>c_action_type-separator.
ro_html->add( |<li class="separator">{ <ls_item>-txt }</li>| ).
CONTINUE.
ENDIF.
IF lv_has_icons = abap_true.
IF <ls_item>-chk = abap_true.
lv_icon = zcl_abapgit_html=>icon( 'check/blue' ).
lv_check = ' data-check="X"'.
ELSEIF <ls_item>-chk = abap_false.
lv_icon = zcl_abapgit_html=>icon( 'check/grey' ).
lv_check = ' data-check=""'.
ELSE. " abap_undefined -> not a check box
lv_icon = zcl_abapgit_html=>icon( <ls_item>-ico ).
ENDIF.
ENDIF.
IF <ls_item>-cur = abap_true.
lv_class = ' class="current-menu-item"'.
ENDIF.
IF <ls_item>-aux IS NOT INITIAL.
lv_aux = | data-aux="{ <ls_item>-aux }"|.
ENDIF.
ro_html->add( |<li{ lv_class }{ lv_check }{ lv_aux }>| ).
IF <ls_item>-sub IS INITIAL.
ro_html->add_a( iv_txt = lv_icon && <ls_item>-txt
iv_typ = <ls_item>-typ
iv_act = <ls_item>-act
iv_id = <ls_item>-id
iv_opt = <ls_item>-opt ).
ELSE.
ro_html->add_a( iv_txt = lv_icon && <ls_item>-txt
iv_typ = zif_abapgit_html=>c_action_type-dummy
iv_act = ''
iv_id = <ls_item>-id
iv_opt = <ls_item>-opt ).
ro_html->add( <ls_item>-sub->render_items( iv_sort ) ).
ENDIF.
ro_html->add( '</li>' ).
ENDLOOP.
ro_html->add( '</ul>' ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
25981,
5657,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
312,
41876,
4731,
39852,
2849,
1847,
11,
198,
220,
220,
220,
220,
220,
751,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
14116,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
7266,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
25981,
5657,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
28004,
41876,
269,
220,
220,
220,
220,
220,
220,
220,
220,
5550,
38865,
1976,
361,
62,
397,
499,
18300,
62,
6494,
14804,
66,
62,
2673,
62,
4906,
12,
82,
1758,
1151,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
529,
41876,
4731,
220,
220,
220,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3713,
41876,
4731,
220,
220,
220,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
22019,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
8738,
41876,
269,
220,
220,
220,
220,
220,
220,
220,
220,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
354,
74,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
917,
18156,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
14644,
41876,
4731,
220,
220,
220,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
312,
220,
41876,
4731,
220,
220,
220,
39852,
2849,
1847,
11,
198,
220,
220,
220,
220,
220,
954,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
9127,
8,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
8543,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3506,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
30619,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
6494,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
11,
198,
220,
220,
220,
220,
220,
8543,
62,
292,
62,
22285,
489,
396,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
18242,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3506,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
30619,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10215,
1008,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
2673,
220,
220,
220,
220,
220,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
6494,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
9186,
11,
198,
220,
220,
220,
220,
220,
220,
220,
256,
742,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
719,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
3713,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
850,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
25981,
5657,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2172,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2170,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1090,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
442,
74,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
27506,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4686,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
9186,
13,
628,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
23814,
41876,
49053,
9795,
43679,
3963,
1259,
62,
9186,
13,
628,
220,
220,
220,
42865,
25,
45079,
62,
23814,
41876,
256,
83,
62,
23814,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
85,
62,
312,
220,
220,
220,
41876,
4731,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
8543,
62,
23814,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
30619,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
6494,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
13,
198,
198,
10619,
31631,
13,
628
] | [
1,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*&---------------------------------------------------------------------*
*& Report ZAG_TEST_SERVI
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zag_test_servi.
CALL SCREEN 2000.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
1168,
4760,
62,
51,
6465,
62,
35009,
12861,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
198,
9,
5,
10097,
30934,
9,
198,
2200,
15490,
1976,
363,
62,
9288,
62,
3168,
72,
13,
198,
198,
34,
7036,
6374,
2200,
1677,
4751,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_gui_page_merge_res DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_gui_page
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES: zif_abapgit_gui_page_hotkey.
METHODS constructor
IMPORTING
io_repo TYPE REF TO zcl_abapgit_repo_online
io_merge_page TYPE REF TO zcl_abapgit_gui_page_merge
io_merge TYPE REF TO zcl_abapgit_merge
RAISING
zcx_abapgit_exception.
METHODS zif_abapgit_gui_page~on_event
REDEFINITION .
PROTECTED SECTION.
METHODS render_content REDEFINITION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_file_diff,
path TYPE string,
filename TYPE string,
lstate TYPE char1,
rstate TYPE char1,
fstate TYPE char1, " FILE state - Abstraction for shorter ifs
o_diff TYPE REF TO zcl_abapgit_diff,
changed_by TYPE xubname,
type TYPE string,
END OF ty_file_diff .
CONSTANTS:
BEGIN OF c_actions,
toggle_mode TYPE string VALUE 'toggle_mode' ##NO_TEXT,
apply_merge TYPE string VALUE 'apply_merge' ##NO_TEXT,
apply_source TYPE string VALUE 'apply_source' ##NO_TEXT,
apply_target TYPE string VALUE 'apply_target' ##NO_TEXT,
cancel TYPE string VALUE 'cancel' ##NO_TEXT,
END OF c_actions .
CONSTANTS:
BEGIN OF c_merge_mode,
selection TYPE string VALUE 'selection' ##NO_TEXT,
merge TYPE string VALUE 'merge' ##NO_TEXT,
END OF c_merge_mode .
DATA mo_merge TYPE REF TO zcl_abapgit_merge .
DATA mo_merge_page TYPE REF TO zcl_abapgit_gui_page_merge .
DATA mo_repo TYPE REF TO zcl_abapgit_repo_online .
DATA ms_diff_file TYPE ty_file_diff .
DATA mv_current_conflict_index TYPE sytabix .
DATA mv_merge_mode TYPE string .
DATA mt_conflicts TYPE zif_abapgit_definitions=>tt_merge_conflict .
METHODS apply_merged_content
IMPORTING
!it_postdata TYPE cnht_post_data_tab
RAISING
zcx_abapgit_exception .
METHODS build_menu
IMPORTING
VALUE(iv_with_conflict) TYPE boolean OPTIONAL
RETURNING
VALUE(ro_menu) TYPE REF TO zcl_abapgit_html_toolbar .
METHODS is_binary
IMPORTING
!iv_d1 TYPE xstring
!iv_d2 TYPE xstring
RETURNING
VALUE(rv_yes) TYPE abap_bool .
METHODS render_beacon
IMPORTING
!is_diff_line TYPE zif_abapgit_definitions=>ty_diff
!is_diff TYPE ty_file_diff
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS render_diff
IMPORTING
!is_diff TYPE ty_file_diff
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html
RAISING
zcx_abapgit_exception .
METHODS render_diff_head
IMPORTING
!is_diff TYPE ty_file_diff
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS render_lines
IMPORTING
!is_diff TYPE ty_file_diff
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS render_line_split
IMPORTING
!is_diff_line TYPE zif_abapgit_definitions=>ty_diff
!iv_fstate TYPE char1
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS render_table_head
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS resolve_diff
RAISING
zcx_abapgit_exception .
METHODS toggle_merge_mode .
ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_PAGE_MERGE_RES IMPLEMENTATION.
METHOD apply_merged_content.
CONSTANTS: lc_replace TYPE string VALUE '<<new>>'.
DATA: BEGIN OF ls_filedata,
merge_content TYPE string,
END OF ls_filedata.
DATA: lv_string TYPE string,
lt_fields TYPE tihttpnvp,
lv_new_file_content TYPE xstring.
FIELD-SYMBOLS: <lv_postdata_line> LIKE LINE OF it_postdata,
<ls_conflict> TYPE zif_abapgit_definitions=>ty_merge_conflict.
LOOP AT it_postdata ASSIGNING <lv_postdata_line>.
lv_string = |{ lv_string }{ <lv_postdata_line> }|.
ENDLOOP.
REPLACE ALL OCCURRENCES OF zif_abapgit_definitions=>c_crlf IN lv_string WITH lc_replace.
REPLACE ALL OCCURRENCES OF zif_abapgit_definitions=>c_newline IN lv_string WITH lc_replace.
lt_fields = zcl_abapgit_html_action_utils=>parse_fields_upper_case_name( lv_string ).
zcl_abapgit_html_action_utils=>get_field( EXPORTING iv_name = 'MERGE_CONTENT'
it_field = lt_fields
CHANGING cg_field = ls_filedata ).
ls_filedata-merge_content = cl_http_utility=>unescape_url( escaped = ls_filedata-merge_content ).
REPLACE ALL OCCURRENCES OF lc_replace IN ls_filedata-merge_content WITH zif_abapgit_definitions=>c_newline.
lv_new_file_content = zcl_abapgit_convert=>string_to_xstring_utf8( ls_filedata-merge_content ).
READ TABLE mt_conflicts ASSIGNING <ls_conflict> INDEX mv_current_conflict_index.
<ls_conflict>-result_sha1 = zcl_abapgit_hash=>sha1( iv_type = zif_abapgit_definitions=>c_type-blob
iv_data = lv_new_file_content ).
<ls_conflict>-result_data = lv_new_file_content.
mo_merge->resolve_conflict( <ls_conflict> ).
ENDMETHOD.
METHOD build_menu.
CREATE OBJECT ro_menu.
ro_menu->add( iv_txt = 'Toggle merge mode' iv_act = c_actions-toggle_mode ) ##NO_TEXT.
ro_menu->add( iv_txt = 'Cancel' iv_act = c_actions-cancel ) ##NO_TEXT.
ENDMETHOD.
METHOD constructor.
super->constructor( ).
mo_repo = io_repo.
ms_control-page_title = 'Resolve Conflicts'.
ms_control-page_menu = build_menu( ).
mo_merge_page = io_merge_page.
mo_merge = io_merge.
mv_merge_mode = c_merge_mode-selection.
mv_current_conflict_index = 1.
mt_conflicts = io_merge->get_conflicts( ).
ENDMETHOD.
METHOD is_binary.
DATA: lv_len TYPE i,
lv_idx TYPE i,
lv_x TYPE x.
FIELD-SYMBOLS <lv_data> LIKE iv_d1.
IF iv_d1 IS NOT INITIAL. " One of them might be new and so empty
ASSIGN iv_d1 TO <lv_data>.
ELSE.
ASSIGN iv_d2 TO <lv_data>.
ENDIF.
lv_len = xstrlen( <lv_data> ).
IF lv_len = 0.
RETURN.
ENDIF.
IF lv_len > 100.
lv_len = 100.
ENDIF.
" Simple char range test
" stackoverflow.com/questions/277521/how-to-identify-the-file-content-as-ascii-or-binary
DO lv_len TIMES. " I'm sure there is more efficient way ...
lv_idx = sy-index - 1.
lv_x = <lv_data>+lv_idx(1).
IF NOT ( lv_x BETWEEN 9 AND 13 OR lv_x BETWEEN 32 AND 126 ).
rv_yes = abap_true.
EXIT.
ENDIF.
ENDDO.
ENDMETHOD.
METHOD render_beacon.
DATA: lv_beacon TYPE string.
CREATE OBJECT ro_html.
IF is_diff_line-beacon > 0.
READ TABLE is_diff-o_diff->mt_beacons INTO lv_beacon INDEX is_diff_line-beacon.
ELSE.
lv_beacon = '---'.
ENDIF.
ro_html->add( '<thead class="nav_line">' ).
ro_html->add( '<tr>' ).
ro_html->add( '<th class="num"></th>' ).
ro_html->add( |<th colspan="3">@@ { is_diff_line-new_num } @@ { lv_beacon }</th>| ).
ro_html->add( '</tr>' ).
ro_html->add( '</thead>' ).
ENDMETHOD.
METHOD render_content.
resolve_diff( ).
IF ms_diff_file IS INITIAL.
zcx_abapgit_exception=>raise( 'no conflict found' ).
ENDIF.
CREATE OBJECT ro_html.
ro_html->add( |<div id="diff-list" data-repo-key="{ mo_repo->get_key( ) }">| ).
ro_html->add( render_diff( ms_diff_file ) ).
ro_html->add( '</div>' ).
ENDMETHOD.
METHOD render_diff.
DATA: lv_target_content TYPE string.
FIELD-SYMBOLS: <ls_conflict> TYPE zif_abapgit_definitions=>ty_merge_conflict.
CREATE OBJECT ro_html.
ro_html->add( |<div class="diff" data-type="{ is_diff-type
}" data-changed-by="{ is_diff-changed_by
}" data-file="{ is_diff-path && is_diff-filename }">| ). "#EC NOTEXT
ro_html->add( render_diff_head( is_diff ) ).
" Content
IF is_diff-type <> 'binary'.
IF mv_merge_mode EQ c_merge_mode-selection.
ro_html->add( '<div class="diff_content">' ). "#EC NOTEXT
ro_html->add( '<table class="diff_tab syntax-hl">' ). "#EC NOTEXT
ro_html->add( render_table_head( ) ).
ro_html->add( render_lines( is_diff ) ).
ro_html->add( '</table>' ). "#EC NOTEXT
ro_html->add( '</div>' ). "#EC NOTEXT
ELSE.
"Table for Div-Table and textarea
ro_html->add( '<div class="diff_content">' ). "#EC NOTEXT
ro_html->add( '<table class="w100">' ). "#EC NOTEXT
ro_html->add( '<thead class="header">' ). "#EC NOTEXT
ro_html->add( '<tr>' ). "#EC NOTEXT
ro_html->add( '<th>Code</th>' ). "#EC NOTEXT
ro_html->add( '<th>Merge - ' ). "#EC NOTEXT
ro_html->add_a( iv_act = 'submitFormById(''merge_form'');' "#EC NOTEXT
iv_txt = 'Apply'
iv_typ = zif_abapgit_definitions=>c_action_type-onclick
iv_opt = zif_abapgit_definitions=>c_html_opt-strong ).
ro_html->add( '</th> ' ). "#EC NOTEXT
ro_html->add( '</tr>' ). "#EC NOTEXT
ro_html->add( '</thead>' ). "#EC NOTEXT
ro_html->add( '<td>' ).
"Diff-Table of source and target file
ro_html->add( '<table class="diff_tab syntax-hl">' ). "#EC NOTEXT
ro_html->add( render_table_head( ) ).
ro_html->add( render_lines( is_diff ) ).
ro_html->add( '</table>' ). "#EC NOTEXT
READ TABLE mt_conflicts ASSIGNING <ls_conflict> INDEX mv_current_conflict_index.
IF sy-subrc EQ 0.
lv_target_content = zcl_abapgit_convert=>xstring_to_string_utf8( <ls_conflict>-target_data ).
lv_target_content = escape( val = lv_target_content format = cl_abap_format=>e_html_text ).
ENDIF.
ro_html->add( '</td>' ). "#EC NOTEXT
ro_html->add( '<td>' ). "#EC NOTEXT
ro_html->add( '<div class="form-container">' ).
ro_html->add( |<form id="merge_form" class="aligned-form w100" accept-charset="UTF-8"| ).
ro_html->add( |method="post" action="sapevent:apply_merge">| ).
ro_html->add( |<textarea id="merge_content" name="merge_content" class="w100" | ).
ro_html->add( |rows="{ lines( is_diff-o_diff->get( ) ) }">{ lv_target_content }</textarea>| ).
ro_html->add( '<input type="submit" class="hidden-submit">' ).
ro_html->add( '</form>' ). "#EC NOTEXT
ro_html->add( '</div>' ). "#EC NOTEXT
ro_html->add( '</td>' ). "#EC NOTEXT
ro_html->add( '</table>' ). "#EC NOTEXT
ro_html->add( '</div>' ). "#EC NOTEXT
ENDIF.
ELSE.
ro_html->add( '<div class="diff_content paddings center grey">' ). "#EC NOTEXT
ro_html->add( 'The content seems to be binary.' ). "#EC NOTEXT
ro_html->add( 'Cannot display as diff.' ). "#EC NOTEXT
ro_html->add( '</div>' ). "#EC NOTEXT
ENDIF.
ro_html->add( '</div>' ). "#EC NOTEXT
ENDMETHOD.
METHOD render_diff_head.
DATA: ls_stats TYPE zif_abapgit_definitions=>ty_count.
CREATE OBJECT ro_html.
ro_html->add( '<div class="diff_head">' ). "#EC NOTEXT
IF is_diff-type <> 'binary' AND is_diff-o_diff IS NOT INITIAL.
ls_stats = is_diff-o_diff->stats( ).
ro_html->add( |<span class="diff_banner diff_ins">+ { ls_stats-insert }</span>| ).
ro_html->add( |<span class="diff_banner diff_del">- { ls_stats-delete }</span>| ).
ro_html->add( |<span class="diff_banner diff_upd">~ { ls_stats-update }</span>| ).
ENDIF.
ro_html->add( |<span class="diff_name">{ is_diff-filename }</span>| ). "#EC NOTEXT
ro_html->add( '</div>' ). "#EC NOTEXT
ENDMETHOD.
METHOD render_lines.
DATA: lo_highlighter TYPE REF TO zcl_abapgit_syntax_highlighter,
lt_diffs TYPE zif_abapgit_definitions=>ty_diffs_tt,
lv_insert_nav TYPE abap_bool.
FIELD-SYMBOLS <ls_diff> LIKE LINE OF lt_diffs.
lo_highlighter = zcl_abapgit_syntax_highlighter=>create( is_diff-filename ).
CREATE OBJECT ro_html.
lt_diffs = is_diff-o_diff->get( ).
LOOP AT lt_diffs ASSIGNING <ls_diff>.
IF <ls_diff>-short = abap_false.
lv_insert_nav = abap_true.
CONTINUE.
ENDIF.
IF lv_insert_nav = abap_true. " Insert separator line with navigation
ro_html->add( render_beacon( is_diff_line = <ls_diff> is_diff = is_diff ) ).
lv_insert_nav = abap_false.
ENDIF.
IF lo_highlighter IS BOUND.
<ls_diff>-new = lo_highlighter->process_line( <ls_diff>-new ).
<ls_diff>-old = lo_highlighter->process_line( <ls_diff>-old ).
ELSE.
<ls_diff>-new = escape( val = <ls_diff>-new format = cl_abap_format=>e_html_attr ).
<ls_diff>-old = escape( val = <ls_diff>-old format = cl_abap_format=>e_html_attr ).
ENDIF.
CONDENSE <ls_diff>-new_num. "get rid of leading spaces
CONDENSE <ls_diff>-old_num.
ro_html->add( render_line_split( is_diff_line = <ls_diff>
iv_fstate = is_diff-fstate ) ).
ENDLOOP.
ENDMETHOD.
METHOD render_line_split.
DATA: lv_new TYPE string,
lv_old TYPE string,
lv_mark TYPE string,
lv_bg TYPE string.
CREATE OBJECT ro_html.
" New line
lv_mark = ` `.
IF is_diff_line-result = zif_abapgit_definitions=>c_diff-update.
lv_bg = ' diff_upd'.
lv_mark = `~`.
ELSEIF is_diff_line-result = zif_abapgit_definitions=>c_diff-insert.
lv_bg = ' diff_ins'.
lv_mark = `+`.
ENDIF.
lv_new = |<td class="num" line-num="{ is_diff_line-new_num }"></td>|
&& |<td class="code{ lv_bg }">{ lv_mark }{ is_diff_line-new }</td>|.
" Old line
CLEAR lv_bg.
lv_mark = ` `.
IF is_diff_line-result = zif_abapgit_definitions=>c_diff-update.
lv_bg = ' diff_upd'.
lv_mark = `~`.
ELSEIF is_diff_line-result = zif_abapgit_definitions=>c_diff-delete.
lv_bg = ' diff_del'.
lv_mark = `-`.
ENDIF.
lv_old = |<td class="num" line-num="{ is_diff_line-old_num }"></td>|
&& |<td class="code{ lv_bg }">{ lv_mark }{ is_diff_line-old }</td>|.
" render line, inverse sides if remote is newer
ro_html->add( '<tr>' ). "#EC NOTEXT
ro_html->add( lv_old ). " Target
ro_html->add( lv_new ). " Source
ro_html->add( '</tr>' ). "#EC NOTEXT
ENDMETHOD.
METHOD render_table_head.
CREATE OBJECT ro_html.
IF mv_merge_mode EQ c_merge_mode-selection.
ro_html->add( '<thead class="header">' ). "#EC NOTEXT
ro_html->add( '<tr>' ). "#EC NOTEXT
ro_html->add( '<th class="num"></th>' ). "#EC NOTEXT
ro_html->add( '<form id="target_form" method="post" action="sapevent:apply_target">' ). "#EC NOTEXT
ro_html->add( '<th>Target - ' && mo_repo->get_branch_name( ) && ' - ' ). "#EC NOTEXT
ro_html->add_a( iv_act = 'submitFormById(''target_form'');' "#EC NOTEXT
iv_txt = 'Apply'
iv_typ = zif_abapgit_definitions=>c_action_type-onclick
iv_opt = zif_abapgit_definitions=>c_html_opt-strong ).
ro_html->add( '</th> ' ). "#EC NOTEXT
ro_html->add( '</form>' ). "#EC NOTEXT
ro_html->add( '<th class="num"></th>' ). "#EC NOTEXT
ro_html->add( '<form id="source_form" method="post" action="sapevent:apply_source">' ). "#EC NOTEXT
ro_html->add( '<th>Source - ' && mo_merge->get_source_branch( ) && ' - ' ). "#EC NOTEXT
ro_html->add_a( iv_act = 'submitFormById(''source_form'');' "#EC NOTEXT
iv_txt = 'Apply'
iv_typ = zif_abapgit_definitions=>c_action_type-onclick
iv_opt = zif_abapgit_definitions=>c_html_opt-strong ).
ro_html->add( '</th> ' ). "#EC NOTEXT
ro_html->add( '</form>' ). "#EC NOTEXT
ro_html->add( '</tr>' ). "#EC NOTEXT
ro_html->add( '</thead>' ). "#EC NOTEXT
ELSE.
ro_html->add( '<thead class="header">' ). "#EC NOTEXT
ro_html->add( '<tr>' ). "#EC NOTEXT
ro_html->add( '<th class="num"></th>' ). "#EC NOTEXT
ro_html->add( '<th>Target - ' && mo_repo->get_branch_name( ) && '</th> ' ). "#EC NOTEXT
ro_html->add( '<th class="num"></th>' ). "#EC NOTEXT
ro_html->add( '<th>Source - ' && mo_merge->get_source_branch( ) && '</th> ' ). "#EC NOTEXT
ro_html->add( '</tr>' ). "#EC NOTEXT
ro_html->add( '</thead>' ). "#EC NOTEXT
ENDIF.
ENDMETHOD.
METHOD resolve_diff.
DATA: lv_offs TYPE i.
FIELD-SYMBOLS: <ls_conflict> TYPE zif_abapgit_definitions=>ty_merge_conflict.
CLEAR ms_diff_file.
READ TABLE mt_conflicts ASSIGNING <ls_conflict> INDEX mv_current_conflict_index.
IF sy-subrc NE 0.
RETURN.
ENDIF.
ms_diff_file-path = <ls_conflict>-path.
ms_diff_file-filename = <ls_conflict>-filename.
ms_diff_file-type = reverse( <ls_conflict>-filename ).
FIND FIRST OCCURRENCE OF '.' IN ms_diff_file-type MATCH OFFSET lv_offs.
ms_diff_file-type = reverse( substring( val = ms_diff_file-type len = lv_offs ) ).
IF ms_diff_file-type <> 'xml' AND ms_diff_file-type <> 'abap'.
ms_diff_file-type = 'other'.
ENDIF.
IF ms_diff_file-type = 'other'
AND is_binary( iv_d1 = <ls_conflict>-source_data iv_d2 = <ls_conflict>-target_data ) = abap_true.
ms_diff_file-type = 'binary'.
ENDIF.
IF ms_diff_file-type <> 'binary'.
CREATE OBJECT ms_diff_file-o_diff
EXPORTING
iv_new = <ls_conflict>-source_data
iv_old = <ls_conflict>-target_data.
ENDIF.
ENDMETHOD.
METHOD toggle_merge_mode.
IF mv_merge_mode EQ c_merge_mode-selection.
mv_merge_mode = c_merge_mode-merge.
ELSE.
mv_merge_mode = c_merge_mode-selection.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_gui_page_hotkey~get_hotkey_actions.
ENDMETHOD.
METHOD zif_abapgit_gui_page~on_event.
FIELD-SYMBOLS: <ls_conflict> TYPE zif_abapgit_definitions=>ty_merge_conflict.
CASE iv_action.
WHEN c_actions-apply_merge
OR c_actions-apply_source
OR c_actions-apply_target
OR c_actions-cancel.
CASE iv_action.
WHEN c_actions-apply_merge.
apply_merged_content( it_postdata ).
WHEN c_actions-apply_source.
READ TABLE mt_conflicts ASSIGNING <ls_conflict> INDEX mv_current_conflict_index.
<ls_conflict>-result_sha1 = <ls_conflict>-source_sha1.
<ls_conflict>-result_data = <ls_conflict>-source_data.
mo_merge->resolve_conflict( <ls_conflict> ).
WHEN c_actions-apply_target.
READ TABLE mt_conflicts ASSIGNING <ls_conflict> INDEX mv_current_conflict_index.
<ls_conflict>-result_sha1 = <ls_conflict>-target_sha1.
<ls_conflict>-result_data = <ls_conflict>-target_data.
mo_merge->resolve_conflict( <ls_conflict> ).
ENDCASE.
mv_current_conflict_index = mv_current_conflict_index + 1.
IF mv_current_conflict_index > lines( mt_conflicts ).
CLEAR mv_current_conflict_index.
ENDIF.
IF mv_current_conflict_index IS NOT INITIAL.
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
ELSE.
ei_page = mo_merge_page.
ev_state = zif_abapgit_definitions=>c_event_state-go_back.
ENDIF.
WHEN c_actions-toggle_mode.
toggle_merge_mode( ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
ENDCASE.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
647,
469,
62,
411,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
8940,
2539,
13,
628,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
260,
7501,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
647,
469,
62,
7700,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
647,
469,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
647,
469,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
647,
469,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
337,
36252,
50,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
7700,
93,
261,
62,
15596,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
8543,
62,
11299,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
7753,
62,
26069,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3108,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
29472,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
5219,
220,
220,
220,
220,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
374,
5219,
220,
220,
220,
220,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
277,
5219,
220,
220,
220,
220,
41876,
1149,
16,
11,
366,
45811,
1181,
532,
2275,
301,
7861,
329,
12238,
611,
82,
198,
220,
220,
220,
220,
220,
220,
220,
267,
62,
26069,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26069,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3421,
62,
1525,
41876,
2124,
549,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
7753,
62,
26069,
764,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
4658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
19846,
62,
14171,
220,
41876,
4731,
26173,
8924,
705,
44256,
62,
14171,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4174,
62,
647,
469,
220,
41876,
4731,
26173,
8924,
705,
39014,
62,
647,
469,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4174,
62,
10459,
41876,
4731,
26173,
8924,
705,
39014,
62,
10459,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4174,
62,
16793,
41876,
4731,
26173,
8924,
705,
39014,
62,
16793,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
14241,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
66,
21130,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
4658,
764,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
647,
469,
62,
14171,
11,
198,
220,
220,
220,
220,
220,
220,
220,
6356,
41876,
4731,
26173,
8924,
705,
49283,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20121,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
647,
469,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
647,
469,
62,
14171,
764,
198,
220,
220,
220,
42865,
6941,
62,
647,
469,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
647,
469,
764,
198,
220,
220,
220,
42865,
6941,
62,
647,
469,
62,
7700,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
647,
469,
764,
198,
220,
220,
220,
42865,
6941,
62,
260,
7501,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
764,
198,
220,
220,
220,
42865,
13845,
62,
26069,
62,
7753,
41876,
1259,
62,
7753,
62,
26069,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
14421,
62,
10414,
13758,
62,
9630,
41876,
827,
8658,
844,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
647,
469,
62,
14171,
41876,
4731,
764,
198,
220,
220,
220,
42865,
45079,
62,
10414,
42267,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
926,
62,
647,
469,
62,
10414,
13758,
764,
628,
220,
220,
220,
337,
36252,
50,
4174,
62,
647,
2004,
62,
11299,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
7353,
7890,
41876,
269,
77,
4352,
62,
7353,
62,
7890,
62,
8658,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
1382,
62,
26272,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
452,
62,
4480,
62,
10414,
13758,
8,
41876,
25131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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ltcl_test DEFINITION FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS FINAL.
PRIVATE SECTION.
METHODS: test FOR TESTING.
ENDCLASS.
CLASS ltcl_test IMPLEMENTATION.
METHOD test.
DATA: lo_stream TYPE REF TO zcl_abapgit_zlib_stream,
lv_remaining TYPE i,
lv_int TYPE i,
lv_bits TYPE string.
CREATE OBJECT lo_stream
EXPORTING
iv_data = '112233445566'.
lv_bits = lo_stream->take_bits( 8 ).
cl_abap_unit_assert=>assert_equals(
act = lv_bits
exp = '00010001' ).
lv_remaining = lo_stream->remaining( ).
cl_abap_unit_assert=>assert_equals(
act = lv_remaining
exp = 6 ).
lv_int = lo_stream->take_int( 8 ).
cl_abap_unit_assert=>assert_equals(
act = lv_int
exp = 34 ).
ENDMETHOD.
ENDCLASS.
| [
198,
31631,
300,
83,
565,
62,
9288,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
25261,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
1332,
7473,
43001,
2751,
13,
198,
198,
10619,
31631,
13,
628,
198,
31631,
300,
83,
565,
62,
9288,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
1332,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
5532,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
89,
8019,
62,
5532,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
2787,
1397,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
600,
220,
220,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
9895,
220,
220,
220,
220,
220,
41876,
4731,
13,
628,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
2376,
62,
5532,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
7890,
796,
705,
14686,
1954,
2682,
30505,
2791,
4458,
628,
220,
220,
220,
300,
85,
62,
9895,
796,
2376,
62,
5532,
3784,
20657,
62,
9895,
7,
807,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
198,
220,
220,
220,
220,
220,
719,
796,
300,
85,
62,
9895,
198,
220,
220,
220,
220,
220,
1033,
796,
705,
18005,
18005,
6,
6739,
628,
220,
220,
220,
300,
85,
62,
2787,
1397,
796,
2376,
62,
5532,
3784,
2787,
1397,
7,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
198,
220,
220,
220,
220,
220,
719,
796,
300,
85,
62,
2787,
1397,
198,
220,
220,
220,
220,
220,
1033,
796,
718,
6739,
628,
220,
220,
220,
300,
85,
62,
600,
796,
2376,
62,
5532,
3784,
20657,
62,
600,
7,
807,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
198,
220,
220,
220,
220,
220,
719,
796,
300,
85,
62,
600,
198,
220,
220,
220,
220,
220,
1033,
796,
4974,
6739,
628,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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_comment TYPE zif_abapgit_definitions=>ty_comment
!io_stage TYPE REF TO zcl_abapgit_stage
RAISING
zcx_abapgit_exception .
METHODS create_branch
IMPORTING
!iv_name TYPE string
!iv_from TYPE zif_abapgit_definitions=>ty_sha1 OPTIONAL
RAISING
zcx_abapgit_exception .
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
397,
499,
18300,
62,
18300,
62,
3575,
602,
198,
220,
44731,
764,
628,
220,
337,
36252,
50,
4574,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
271,
62,
23893,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
23893,
198,
220,
220,
220,
220,
220,
5145,
952,
62,
14247,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
14247,
198,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
628,
220,
337,
36252,
50,
2251,
62,
1671,
3702,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
41876,
4731,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
6738,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
26270,
16,
39852,
2849,
1847,
198,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
198,
10619,
41358,
49836,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_objects_program DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super.
PUBLIC SECTION.
TYPES: BEGIN OF ty_progdir,
name TYPE progdir-name,
state TYPE progdir-state,
sqlx TYPE progdir-sqlx,
edtx TYPE progdir-edtx,
varcl TYPE progdir-varcl,
dbapl TYPE progdir-dbapl,
dbna TYPE progdir-dbna,
clas TYPE progdir-clas,
type TYPE progdir-type,
occurs TYPE progdir-occurs,
subc TYPE progdir-subc,
appl TYPE progdir-appl,
secu TYPE progdir-secu,
cnam TYPE progdir-cnam,
cdat TYPE progdir-cdat,
unam TYPE progdir-unam,
udat TYPE progdir-udat,
vern TYPE progdir-vern,
levl TYPE progdir-levl,
rstat TYPE progdir-rstat,
rmand TYPE progdir-rmand,
rload TYPE progdir-rload,
fixpt TYPE progdir-fixpt,
sset TYPE progdir-sset,
sdate TYPE progdir-sdate,
stime TYPE progdir-stime,
idate TYPE progdir-idate,
itime TYPE progdir-itime,
ldbname TYPE progdir-ldbname,
uccheck TYPE progdir-uccheck,
END OF ty_progdir.
METHODS serialize_program
IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_output OPTIONAL
is_item TYPE zif_abapgit_definitions=>ty_item
io_files TYPE REF TO zcl_abapgit_objects_files
iv_program TYPE programm OPTIONAL
iv_extra TYPE clike OPTIONAL
RAISING zcx_abapgit_exception.
METHODS read_progdir
IMPORTING iv_program TYPE programm
RETURNING VALUE(rs_progdir) TYPE ty_progdir.
METHODS deserialize_program
IMPORTING is_progdir TYPE ty_progdir
it_source TYPE abaptxt255_tab
it_tpool TYPE textpool_table
iv_package TYPE devclass
RAISING zcx_abapgit_exception.
PROTECTED SECTION.
TYPES:
ty_spaces_tt TYPE STANDARD TABLE OF i WITH DEFAULT KEY .
TYPES:
BEGIN OF ty_dynpro,
header TYPE rpy_dyhead,
containers TYPE dycatt_tab,
fields TYPE dyfatc_tab,
flow_logic TYPE swydyflow,
spaces TYPE ty_spaces_tt,
END OF ty_dynpro .
TYPES:
ty_dynpro_tt TYPE STANDARD TABLE OF ty_dynpro WITH DEFAULT KEY .
TYPES:
BEGIN OF ty_cua,
adm TYPE rsmpe_adm,
sta TYPE STANDARD TABLE OF rsmpe_stat WITH DEFAULT KEY,
fun TYPE STANDARD TABLE OF rsmpe_funt WITH DEFAULT KEY,
men TYPE STANDARD TABLE OF rsmpe_men WITH DEFAULT KEY,
mtx TYPE STANDARD TABLE OF rsmpe_mnlt WITH DEFAULT KEY,
act TYPE STANDARD TABLE OF rsmpe_act WITH DEFAULT KEY,
but TYPE STANDARD TABLE OF rsmpe_but WITH DEFAULT KEY,
pfk TYPE STANDARD TABLE OF rsmpe_pfk WITH DEFAULT KEY,
set TYPE STANDARD TABLE OF rsmpe_staf WITH DEFAULT KEY,
doc TYPE STANDARD TABLE OF rsmpe_atrt WITH DEFAULT KEY,
tit TYPE STANDARD TABLE OF rsmpe_titt WITH DEFAULT KEY,
biv TYPE STANDARD TABLE OF rsmpe_buts WITH DEFAULT KEY,
END OF ty_cua .
METHODS serialize_dynpros
IMPORTING
!iv_program_name TYPE programm
RETURNING
VALUE(rt_dynpro) TYPE ty_dynpro_tt
RAISING
zcx_abapgit_exception .
METHODS serialize_cua
IMPORTING
!iv_program_name TYPE programm
RETURNING
VALUE(rs_cua) TYPE ty_cua
RAISING
zcx_abapgit_exception .
METHODS deserialize_dynpros
IMPORTING
!it_dynpros TYPE ty_dynpro_tt
RAISING
zcx_abapgit_exception .
METHODS deserialize_textpool
IMPORTING
!iv_program TYPE programm
!it_tpool TYPE textpool_table
!iv_language TYPE langu OPTIONAL
!iv_is_include TYPE abap_bool DEFAULT abap_false
RAISING
zcx_abapgit_exception .
METHODS deserialize_cua
IMPORTING
!iv_program_name TYPE programm
!is_cua TYPE ty_cua
RAISING
zcx_abapgit_exception .
METHODS is_any_dynpro_locked
IMPORTING
!iv_program TYPE programm
RETURNING
VALUE(rv_is_any_dynpro_locked) TYPE abap_bool
RAISING
zcx_abapgit_exception .
METHODS is_cua_locked
IMPORTING
!iv_program TYPE programm
RETURNING
VALUE(rv_is_cua_locked) TYPE abap_bool
RAISING
zcx_abapgit_exception .
METHODS is_text_locked
IMPORTING
!iv_program TYPE programm
RETURNING
VALUE(rv_is_text_locked) TYPE abap_bool
RAISING
zcx_abapgit_exception .
CLASS-METHODS add_tpool
IMPORTING
!it_tpool TYPE textpool_table
RETURNING
VALUE(rt_tpool) TYPE zif_abapgit_definitions=>ty_tpool_tt .
CLASS-METHODS read_tpool
IMPORTING
!it_tpool TYPE zif_abapgit_definitions=>ty_tpool_tt
RETURNING
VALUE(rt_tpool) TYPE zif_abapgit_definitions=>ty_tpool_tt .
PRIVATE SECTION.
METHODS:
condense_flow
EXPORTING et_spaces TYPE ty_spaces_tt
CHANGING ct_flow TYPE swydyflow,
uncondense_flow
IMPORTING it_flow TYPE swydyflow
it_spaces TYPE ty_spaces_tt
RETURNING VALUE(rt_flow) TYPE swydyflow.
CLASS-METHODS auto_correct_cua_adm
IMPORTING
is_cua TYPE zcl_abapgit_objects_program=>ty_cua
CHANGING
cs_adm TYPE rsmpe_adm.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECTS_PROGRAM IMPLEMENTATION.
METHOD add_tpool.
FIELD-SYMBOLS: <ls_tpool_in> LIKE LINE OF it_tpool,
<ls_tpool_out> LIKE LINE OF rt_tpool.
LOOP AT it_tpool ASSIGNING <ls_tpool_in>.
APPEND INITIAL LINE TO rt_tpool ASSIGNING <ls_tpool_out>.
MOVE-CORRESPONDING <ls_tpool_in> TO <ls_tpool_out>.
IF <ls_tpool_out>-id = 'S'.
<ls_tpool_out>-split = <ls_tpool_out>-entry.
<ls_tpool_out>-entry = <ls_tpool_out>-entry+8.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD auto_correct_cua_adm.
" issue #1807 automatic correction of CUA interfaces saved incorrectly in the past (ADM was not saved in the XML)
CONSTANTS:
lc_num_n_space TYPE string VALUE ' 0123456789',
lc_num_only TYPE string VALUE '0123456789'.
FIELD-SYMBOLS:
<ls_pfk> TYPE rsmpe_pfk,
<ls_act> TYPE rsmpe_act,
<ls_men> TYPE rsmpe_men.
IF cs_adm IS NOT INITIAL
AND ( cs_adm-actcode CO lc_num_n_space
AND cs_adm-mencode CO lc_num_n_space
AND cs_adm-pfkcode CO lc_num_n_space ). "Check performed in form check_adm of include LSMPIF03
RETURN.
ENDIF.
LOOP AT is_cua-act ASSIGNING <ls_act>.
IF <ls_act>-code+6(14) IS INITIAL AND <ls_act>-code(6) CO lc_num_only.
cs_adm-actcode = <ls_act>-code.
ENDIF.
ENDLOOP.
LOOP AT is_cua-men ASSIGNING <ls_men>.
IF <ls_men>-code+6(14) IS INITIAL AND <ls_men>-code(6) CO lc_num_only.
cs_adm-mencode = <ls_men>-code.
ENDIF.
ENDLOOP.
LOOP AT is_cua-pfk ASSIGNING <ls_pfk>.
IF <ls_pfk>-code+6(14) IS INITIAL AND <ls_pfk>-code(6) CO lc_num_only.
cs_adm-pfkcode = <ls_pfk>-code.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD condense_flow.
DATA: lv_spaces LIKE LINE OF et_spaces.
FIELD-SYMBOLS: <ls_flow> LIKE LINE OF ct_flow.
CLEAR et_spaces.
LOOP AT ct_flow ASSIGNING <ls_flow>.
lv_spaces = 0.
WHILE NOT <ls_flow>-line IS INITIAL AND <ls_flow>-line(1) = space.
lv_spaces = lv_spaces + 1.
<ls_flow>-line = <ls_flow>-line+1.
ENDWHILE.
APPEND lv_spaces TO et_spaces.
ENDLOOP.
ENDMETHOD.
METHOD deserialize_cua.
DATA: ls_tr_key TYPE trkey,
ls_adm TYPE rsmpe_adm.
IF lines( is_cua-sta ) = 0
AND lines( is_cua-fun ) = 0
AND lines( is_cua-men ) = 0
AND lines( is_cua-mtx ) = 0
AND lines( is_cua-act ) = 0
AND lines( is_cua-but ) = 0
AND lines( is_cua-pfk ) = 0
AND lines( is_cua-set ) = 0
AND lines( is_cua-doc ) = 0
AND lines( is_cua-tit ) = 0
AND lines( is_cua-biv ) = 0.
RETURN.
ENDIF.
SELECT SINGLE devclass INTO ls_tr_key-devclass
FROM tadir
WHERE pgmid = 'R3TR'
AND object = ms_item-obj_type
AND obj_name = ms_item-obj_name. "#EC CI_GENBUFF
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'not found in tadir' ).
ENDIF.
ls_tr_key-obj_type = ms_item-obj_type.
ls_tr_key-obj_name = ms_item-obj_name.
ls_tr_key-sub_type = 'CUAD'.
ls_tr_key-sub_name = iv_program_name.
ls_adm = is_cua-adm.
auto_correct_cua_adm( EXPORTING is_cua = is_cua CHANGING cs_adm = ls_adm ).
sy-tcode = 'SE41' ##write_ok. " evil hack, workaround to handle fixes in note 2159455
CALL FUNCTION 'RS_CUA_INTERNAL_WRITE'
EXPORTING
program = iv_program_name
language = mv_language
tr_key = ls_tr_key
adm = ls_adm
state = 'I'
TABLES
sta = is_cua-sta
fun = is_cua-fun
men = is_cua-men
mtx = is_cua-mtx
act = is_cua-act
but = is_cua-but
pfk = is_cua-pfk
set = is_cua-set
doc = is_cua-doc
tit = is_cua-tit
biv = is_cua-biv
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
* if moving code from SAPlink, see https://github.com/larshp/abapGit/issues/562
zcx_abapgit_exception=>raise( |Error from RS_CUA_INTERNAL_WRITE. Subrc = { sy-subrc }| ).
ENDIF.
zcl_abapgit_objects_activation=>add(
iv_type = 'CUAD'
iv_name = iv_program_name ).
ENDMETHOD.
METHOD deserialize_dynpros.
CONSTANTS lc_rpyty_force_off TYPE char01 VALUE '/' ##NO_TEXT.
DATA: lv_name TYPE dwinactiv-obj_name,
ls_dynpro LIKE LINE OF it_dynpros.
FIELD-SYMBOLS: <ls_field> TYPE rpy_dyfatc.
* ls_dynpro is changed by the function module, a field-symbol will cause
* the program to dump since it_dynpros cannot be changed
LOOP AT it_dynpros INTO ls_dynpro.
ls_dynpro-flow_logic = uncondense_flow(
it_flow = ls_dynpro-flow_logic
it_spaces = ls_dynpro-spaces ).
LOOP AT ls_dynpro-fields ASSIGNING <ls_field>.
* if the DDIC element has a PARAMETER_ID and the flag "from_dict" is active
* the import will enable the SET-/GET_PARAM flag. In this case: "force off"
IF <ls_field>-param_id IS NOT INITIAL
AND <ls_field>-from_dict = abap_true.
IF <ls_field>-set_param IS INITIAL.
<ls_field>-set_param = lc_rpyty_force_off.
ENDIF.
IF <ls_field>-get_param IS INITIAL.
<ls_field>-get_param = lc_rpyty_force_off.
ENDIF.
ENDIF.
* If the previous conditions are met the value 'F' will be taken over
* during de-serialization potentially overlapping other fields in the screen,
* we set the tag to the correct value 'X'
IF <ls_field>-type = 'CHECK'
AND <ls_field>-from_dict = abap_true
AND <ls_field>-text IS INITIAL
AND <ls_field>-modific IS INITIAL.
<ls_field>-modific = 'X'.
ENDIF.
"fix for issue #2747:
IF <ls_field>-foreignkey IS INITIAL.
<ls_field>-foreignkey = lc_rpyty_force_off.
ENDIF.
ENDLOOP.
CALL FUNCTION 'RPY_DYNPRO_INSERT'
EXPORTING
header = ls_dynpro-header
suppress_exist_checks = abap_true
TABLES
containers = ls_dynpro-containers
fields_to_containers = ls_dynpro-fields
flow_logic = ls_dynpro-flow_logic
EXCEPTIONS
cancelled = 1
already_exists = 2
program_not_exists = 3
not_executed = 4
missing_required_field = 5
illegal_field_value = 6
field_not_allowed = 7
not_generated = 8
illegal_field_position = 9
OTHERS = 10.
IF sy-subrc <> 2 AND sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
* todo, RPY_DYNPRO_UPDATE?
CONCATENATE ls_dynpro-header-program ls_dynpro-header-screen
INTO lv_name RESPECTING BLANKS.
ASSERT NOT lv_name IS INITIAL.
zcl_abapgit_objects_activation=>add(
iv_type = 'DYNP'
iv_name = lv_name ).
ENDLOOP.
ENDMETHOD.
METHOD deserialize_program.
DATA: lv_exists TYPE abap_bool,
lv_progname TYPE reposrc-progname,
ls_tpool LIKE LINE OF it_tpool,
lv_title TYPE rglif-title,
ls_progdir_new TYPE progdir.
FIELD-SYMBOLS: <lg_any> TYPE any.
CALL FUNCTION 'RS_CORR_INSERT'
EXPORTING
object = is_progdir-name
object_class = 'ABAP'
devclass = iv_package
master_language = mv_language
mode = 'I'
suppress_dialog = abap_true
EXCEPTIONS
cancelled = 1
permission_failure = 2
unknown_objectclass = 3
OTHERS = 4.
IF sy-subrc = 1.
zcx_abapgit_exception=>raise( |Error from RS_CORR_INSERT, Cancelled, { sy-msgid }, { sy-msgno }| ).
ELSEIF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from RS_CORR_INSERT, { sy-msgid }, { sy-msgno }| ).
ENDIF.
READ TABLE it_tpool INTO ls_tpool WITH KEY id = 'R'.
IF sy-subrc = 0.
* there is a bug in RPY_PROGRAM_UPDATE, the header line of TTAB is not
* cleared, so the title length might be inherited from a different program.
ASSIGN ('(SAPLSIFP)TTAB') TO <lg_any>.
IF sy-subrc = 0.
CLEAR <lg_any>.
ENDIF.
lv_title = ls_tpool-entry.
ENDIF.
SELECT SINGLE progname FROM reposrc INTO lv_progname
WHERE progname = is_progdir-name
AND r3state = 'A'.
IF sy-subrc = 0.
lv_exists = abap_true.
ELSE.
lv_exists = abap_false.
ENDIF.
IF lv_exists = abap_true.
zcl_abapgit_language=>set_current_language( mv_language ).
CALL FUNCTION 'RPY_PROGRAM_UPDATE'
EXPORTING
program_name = is_progdir-name
title_string = lv_title
save_inactive = 'I'
TABLES
source_extended = it_source
EXCEPTIONS
cancelled = 1
permission_error = 2
not_found = 3
OTHERS = 4.
IF sy-subrc <> 0.
zcl_abapgit_language=>restore_login_language( ).
IF sy-msgid = 'EU' AND sy-msgno = '510'.
zcx_abapgit_exception=>raise( 'User is currently editing program' ).
ELSE.
zcx_abapgit_exception=>raise( |PROG { is_progdir-name }, updating error: { sy-msgid } { sy-msgno }| ).
ENDIF.
ENDIF.
zcl_abapgit_language=>restore_login_language( ).
ELSEIF strlen( is_progdir-name ) > 30.
* function module RPY_PROGRAM_INSERT cannot handle function group includes
" special treatment for extensions
" if the program name exceeds 30 characters it is not a usual
" ABAP program but might be some extension, which requires the internal
" addition EXTENSION TYPE, see
" http://help.sap.com/abapdocu_751/en/abapinsert_report_internal.htm#!ABAP_ADDITION_1@1@
" This e.g. occurs in case of transportable Code Inspector variants (ending with ===VC)
INSERT REPORT is_progdir-name
FROM it_source
STATE 'I'
EXTENSION TYPE is_progdir-name+30.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from INSERT REPORT .. EXTENSION TYPE' ).
ENDIF.
ELSE.
INSERT REPORT is_progdir-name
FROM it_source
STATE 'I'
PROGRAM TYPE is_progdir-subc.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from INSERT REPORT' ).
ENDIF.
ENDIF.
IF NOT it_tpool[] IS INITIAL.
INSERT TEXTPOOL is_progdir-name
FROM it_tpool
LANGUAGE mv_language
STATE 'I'.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from INSERT TEXTPOOL' ).
ENDIF.
ENDIF.
CALL FUNCTION 'READ_PROGDIR'
EXPORTING
i_progname = is_progdir-name
i_state = 'I'
IMPORTING
e_progdir = ls_progdir_new
EXCEPTIONS
not_exists = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |not found in PROGDIR. Subrc = { sy-subrc }| ).
ENDIF.
* todo, package?
ls_progdir_new-ldbname = is_progdir-ldbname.
ls_progdir_new-dbna = is_progdir-dbna.
ls_progdir_new-dbapl = is_progdir-dbapl.
ls_progdir_new-rload = is_progdir-rload.
ls_progdir_new-fixpt = is_progdir-fixpt.
ls_progdir_new-varcl = is_progdir-varcl.
ls_progdir_new-appl = is_progdir-appl.
ls_progdir_new-rstat = is_progdir-rstat.
CALL FUNCTION 'UPDATE_PROGDIR'
EXPORTING
i_progdir = ls_progdir_new
i_progname = ls_progdir_new-name
i_state = ls_progdir_new-state
EXCEPTIONS
not_executed = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |PROG, error inserting. Subrc = { sy-subrc }| ).
ENDIF.
SELECT SINGLE * FROM progdir INTO ls_progdir_new
WHERE name = ls_progdir_new-name
AND state = ls_progdir_new-state.
IF sy-subrc = 0 AND is_progdir-varcl = space AND ls_progdir_new-varcl = abap_true.
* function module UPDATE_PROGDIR does not update VARCL
UPDATE progdir SET varcl = is_progdir-varcl
WHERE name = ls_progdir_new-name
AND state = ls_progdir_new-state. "#EC CI_SUBRC
ENDIF.
zcl_abapgit_objects_activation=>add(
iv_type = 'REPS'
iv_name = is_progdir-name ).
ENDMETHOD.
METHOD deserialize_textpool.
DATA lv_language TYPE langu.
DATA lv_state TYPE c.
DATA lv_delete TYPE abap_bool.
IF iv_language IS INITIAL.
lv_language = mv_language.
ELSE.
lv_language = iv_language.
ENDIF.
IF lv_language = mv_language.
lv_state = 'I'. "Textpool in master language needs to be activated
ELSE.
lv_state = 'A'. "Translations are always active
ENDIF.
IF it_tpool IS INITIAL.
IF iv_is_include = abap_false OR lv_state = 'A'.
DELETE TEXTPOOL iv_program "Remove initial description from textpool if
LANGUAGE iv_program "original program does not have a textpool
STATE lv_state.
lv_delete = abap_true.
ELSE.
INSERT TEXTPOOL iv_program "In case of includes: Deletion of textpool in
FROM it_tpool "master language cannot be activated because
LANGUAGE lv_language "this woul activate the deletion of the textpool
STATE lv_state. "of the mail program -> insert empty textpool
ENDIF.
ELSE.
IF lines( it_tpool ) = 1 AND lv_language = mv_language.
READ TABLE it_tpool WITH KEY id = 'R' TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
RETURN. "No action because description in master language is already there
ENDIF.
ENDIF.
INSERT TEXTPOOL iv_program
FROM it_tpool
LANGUAGE lv_language
STATE lv_state.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from INSERT TEXTPOOL' ).
ENDIF.
ENDIF.
IF lv_state = 'I'. "Textpool in master language needs to be activated
zcl_abapgit_objects_activation=>add(
iv_type = 'REPT'
iv_name = iv_program
iv_delete = lv_delete ).
ENDIF.
ENDMETHOD.
METHOD is_any_dynpro_locked.
DATA: lt_dynpros TYPE zcl_abapgit_objects_program=>ty_dynpro_tt,
lv_object TYPE seqg3-garg.
FIELD-SYMBOLS: <ls_dynpro> TYPE zcl_abapgit_objects_program=>ty_dynpro.
lt_dynpros = serialize_dynpros( iv_program ).
LOOP AT lt_dynpros ASSIGNING <ls_dynpro>.
lv_object = |{ <ls_dynpro>-header-screen }{ <ls_dynpro>-header-program }|.
IF exists_a_lock_entry_for( iv_lock_object = 'ESCRP'
iv_argument = lv_object ) = abap_true.
rv_is_any_dynpro_locked = abap_true.
EXIT.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD is_cua_locked.
DATA: lv_object TYPE eqegraarg.
lv_object = |CU{ iv_program }|.
OVERLAY lv_object WITH ' '.
lv_object = lv_object && '*'.
rv_is_cua_locked = exists_a_lock_entry_for( iv_lock_object = 'ESCUAPAINT'
iv_argument = lv_object ).
ENDMETHOD.
METHOD is_text_locked.
DATA: lv_object TYPE eqegraarg.
lv_object = |*{ iv_program }|.
rv_is_text_locked = exists_a_lock_entry_for( iv_lock_object = 'EABAPTEXTE'
iv_argument = lv_object ).
ENDMETHOD.
METHOD read_progdir.
DATA: ls_sapdir TYPE progdir.
CALL FUNCTION 'READ_PROGDIR'
EXPORTING
i_progname = iv_program
i_state = 'A'
IMPORTING
e_progdir = ls_sapdir.
MOVE-CORRESPONDING ls_sapdir TO rs_progdir.
CLEAR: rs_progdir-edtx,
rs_progdir-cnam,
rs_progdir-cdat,
rs_progdir-unam,
rs_progdir-udat,
rs_progdir-levl,
rs_progdir-vern,
rs_progdir-rmand,
rs_progdir-sdate,
rs_progdir-stime,
rs_progdir-idate,
rs_progdir-itime,
rs_progdir-varcl,
rs_progdir-state.
ENDMETHOD.
METHOD read_tpool.
FIELD-SYMBOLS: <ls_tpool_in> LIKE LINE OF it_tpool,
<ls_tpool_out> LIKE LINE OF rt_tpool.
LOOP AT it_tpool ASSIGNING <ls_tpool_in>.
APPEND INITIAL LINE TO rt_tpool ASSIGNING <ls_tpool_out>.
MOVE-CORRESPONDING <ls_tpool_in> TO <ls_tpool_out>.
IF <ls_tpool_out>-id = 'S'.
CONCATENATE <ls_tpool_in>-split <ls_tpool_in>-entry
INTO <ls_tpool_out>-entry
RESPECTING BLANKS.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD serialize_cua.
CALL FUNCTION 'RS_CUA_INTERNAL_FETCH'
EXPORTING
program = iv_program_name
language = mv_language
state = 'A'
IMPORTING
adm = rs_cua-adm
TABLES
sta = rs_cua-sta
fun = rs_cua-fun
men = rs_cua-men
mtx = rs_cua-mtx
act = rs_cua-act
but = rs_cua-but
pfk = rs_cua-pfk
set = rs_cua-set
doc = rs_cua-doc
tit = rs_cua-tit
biv = rs_cua-biv
EXCEPTIONS
not_found = 1
unknown_version = 2
OTHERS = 3.
IF sy-subrc > 1.
zcx_abapgit_exception=>raise( |error from RS_CUA_INTERNAL_FETCH, subrc: {
sy-subrc }, program: { iv_program_name }, language: { mv_language }| ).
ENDIF.
ENDMETHOD.
METHOD serialize_dynpros.
DATA: ls_header TYPE rpy_dyhead,
lt_containers TYPE dycatt_tab,
lt_fields_to_containers TYPE dyfatc_tab,
lt_flow_logic TYPE swydyflow,
lt_d020s TYPE TABLE OF d020s,
lt_fieldlist_int TYPE TABLE OF d021s. "internal format
FIELD-SYMBOLS: <ls_d020s> LIKE LINE OF lt_d020s,
<lv_outputstyle> TYPE scrpostyle,
<ls_container> LIKE LINE OF lt_containers,
<ls_field> LIKE LINE OF lt_fields_to_containers,
<ls_dynpro> LIKE LINE OF rt_dynpro,
<ls_field_int> LIKE LINE OF lt_fieldlist_int.
"#2746: relevant flag values (taken from include MSEUSBIT)
CONSTANTS: lc_flg1ddf TYPE x VALUE '20',
lc_flg3fku TYPE x VALUE '08',
lc_flg3for TYPE x VALUE '04',
lc_flg3fdu TYPE x VALUE '02'.
CALL FUNCTION 'RS_SCREEN_LIST'
EXPORTING
dynnr = ''
progname = iv_program_name
TABLES
dynpros = lt_d020s
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 2.
zcx_abapgit_exception=>raise( |Error from RS_SCREEN_LIST. Subrc = { sy-subrc }| ).
ENDIF.
SORT lt_d020s BY dnum ASCENDING.
* loop dynpros and skip generated selection screens
LOOP AT lt_d020s ASSIGNING <ls_d020s>
WHERE type <> 'S' AND type <> 'W' AND type <> 'J'
AND NOT dnum IS INITIAL.
CALL FUNCTION 'RPY_DYNPRO_READ'
EXPORTING
progname = iv_program_name
dynnr = <ls_d020s>-dnum
IMPORTING
header = ls_header
TABLES
containers = lt_containers
fields_to_containers = lt_fields_to_containers
flow_logic = lt_flow_logic
EXCEPTIONS
cancelled = 1
not_found = 2
permission_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error while reading dynpro: { sy-subrc }| ).
ENDIF.
"#2746: we need the dynpro fields in internal format:
FREE lt_fieldlist_int.
CALL FUNCTION 'RPY_DYNPRO_READ_NATIVE'
EXPORTING
progname = iv_program_name
dynnr = <ls_d020s>-dnum
TABLES
fieldlist = lt_fieldlist_int.
LOOP AT lt_fields_to_containers ASSIGNING <ls_field>.
* output style is a NUMC field, the XML conversion will fail if it contains invalid value
* field does not exist in all versions
ASSIGN COMPONENT 'OUTPUTSTYLE' OF STRUCTURE <ls_field> TO <lv_outputstyle>.
IF sy-subrc = 0 AND <lv_outputstyle> = ' '.
CLEAR <lv_outputstyle>.
ENDIF.
"2746: we apply the same logic as in SAPLWBSCREEN
"for setting or unsetting the foreignkey field:
UNASSIGN <ls_field_int>.
READ TABLE lt_fieldlist_int ASSIGNING <ls_field_int> WITH KEY fnam = <ls_field>-name.
IF <ls_field_int> IS ASSIGNED.
IF <ls_field_int>-flg1 O lc_flg1ddf AND
<ls_field_int>-flg3 O lc_flg3for AND
<ls_field_int>-flg3 Z lc_flg3fdu AND
<ls_field_int>-flg3 Z lc_flg3fku.
<ls_field>-foreignkey = 'X'.
ELSE.
CLEAR <ls_field>-foreignkey.
ENDIF.
ENDIF.
ENDLOOP.
LOOP AT lt_containers ASSIGNING <ls_container>.
IF <ls_container>-c_resize_v = abap_false.
CLEAR <ls_container>-c_line_min.
ENDIF.
IF <ls_container>-c_resize_h = abap_false.
CLEAR <ls_container>-c_coln_min.
ENDIF.
ENDLOOP.
APPEND INITIAL LINE TO rt_dynpro ASSIGNING <ls_dynpro>.
<ls_dynpro>-header = ls_header.
<ls_dynpro>-containers = lt_containers.
<ls_dynpro>-fields = lt_fields_to_containers.
condense_flow( IMPORTING et_spaces = <ls_dynpro>-spaces
CHANGING ct_flow = lt_flow_logic ).
<ls_dynpro>-flow_logic = lt_flow_logic.
ENDLOOP.
ENDMETHOD.
METHOD serialize_program.
DATA: ls_progdir TYPE ty_progdir,
lv_program_name TYPE programm,
lt_dynpros TYPE ty_dynpro_tt,
ls_cua TYPE ty_cua,
lt_source TYPE TABLE OF abaptxt255,
lt_tpool TYPE textpool_table,
ls_tpool LIKE LINE OF lt_tpool,
lo_xml TYPE REF TO zcl_abapgit_xml_output.
IF iv_program IS INITIAL.
lv_program_name = is_item-obj_name.
ELSE.
lv_program_name = iv_program.
ENDIF.
zcl_abapgit_language=>set_current_language( mv_language ).
CALL FUNCTION 'RPY_PROGRAM_READ'
EXPORTING
program_name = lv_program_name
with_lowercase = abap_true
TABLES
source_extended = lt_source
textelements = lt_tpool
EXCEPTIONS
cancelled = 1
not_found = 2
permission_error = 3
OTHERS = 4.
IF sy-subrc = 2.
zcl_abapgit_language=>restore_login_language( ).
RETURN.
ELSEIF sy-subrc <> 0.
zcl_abapgit_language=>restore_login_language( ).
zcx_abapgit_exception=>raise( |Error reading program with RPY_PROGRAM_READ. Subrc = { sy-subrc }| ).
ENDIF.
zcl_abapgit_language=>restore_login_language( ).
ls_progdir = read_progdir( lv_program_name ).
IF io_xml IS BOUND.
lo_xml = io_xml.
ELSE.
CREATE OBJECT lo_xml.
ENDIF.
lo_xml->add( iv_name = 'PROGDIR'
ig_data = ls_progdir ).
IF ls_progdir-subc = '1' OR ls_progdir-subc = 'M'.
lt_dynpros = serialize_dynpros( lv_program_name ).
lo_xml->add( iv_name = 'DYNPROS'
ig_data = lt_dynpros ).
ls_cua = serialize_cua( lv_program_name ).
IF NOT ls_cua IS INITIAL.
lo_xml->add( iv_name = 'CUA'
ig_data = ls_cua ).
ENDIF.
ENDIF.
READ TABLE lt_tpool WITH KEY id = 'R' INTO ls_tpool.
IF sy-subrc = 0 AND ls_tpool-key = '' AND ls_tpool-length = 0.
DELETE lt_tpool INDEX sy-tabix.
ENDIF.
lo_xml->add( iv_name = 'TPOOL'
ig_data = add_tpool( lt_tpool ) ).
IF NOT io_xml IS BOUND.
io_files->add_xml( iv_extra = iv_extra
io_xml = lo_xml ).
ENDIF.
io_files->add_abap( iv_extra = iv_extra
it_abap = lt_source ).
ENDMETHOD.
METHOD uncondense_flow.
DATA: lv_spaces LIKE LINE OF it_spaces.
FIELD-SYMBOLS: <ls_flow> LIKE LINE OF it_flow,
<ls_output> LIKE LINE OF rt_flow.
LOOP AT it_flow ASSIGNING <ls_flow>.
APPEND INITIAL LINE TO rt_flow ASSIGNING <ls_output>.
<ls_output>-line = <ls_flow>-line.
READ TABLE it_spaces INDEX sy-tabix INTO lv_spaces.
IF sy-subrc = 0.
SHIFT <ls_output>-line RIGHT BY lv_spaces PLACES IN CHARACTER MODE.
ENDIF.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
23065,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
1676,
70,
15908,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
41876,
1172,
15908,
12,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1181,
220,
220,
41876,
1172,
15908,
12,
5219,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44161,
87,
220,
220,
220,
41876,
1172,
15908,
12,
25410,
87,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1225,
17602,
220,
220,
220,
41876,
1172,
15908,
12,
276,
17602,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1401,
565,
220,
220,
41876,
1172,
15908,
12,
7785,
565,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
288,
7012,
489,
220,
220,
41876,
1172,
15908,
12,
67,
7012,
489,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20613,
2616,
220,
220,
220,
41876,
1172,
15908,
12,
9945,
2616,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
537,
292,
220,
220,
220,
41876,
1172,
15908,
12,
565,
292,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
41876,
1172,
15908,
12,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8833,
220,
41876,
1172,
15908,
12,
13966,
1834,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
850,
66,
220,
220,
220,
41876,
1172,
15908,
12,
7266,
66,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3680,
220,
220,
220,
41876,
1172,
15908,
12,
1324,
75,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
792,
84,
220,
220,
220,
41876,
1172,
15908,
12,
2363,
84,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
7402,
220,
220,
220,
41876,
1172,
15908,
12,
66,
7402,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
19608,
220,
220,
220,
41876,
1172,
15908,
12,
10210,
265,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
555,
321,
220,
220,
220,
41876,
1172,
15908,
12,
403,
321,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
19608,
220,
220,
220,
41876,
1172,
15908,
12,
463,
265,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
933,
220,
220,
220,
41876,
1172,
15908,
12,
933,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
443,
19279,
220,
220,
220,
41876,
1172,
15908,
12,
2768,
75,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
14269,
220,
220,
41876,
1172,
15908,
12,
81,
14269,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
22249,
220,
220,
41876,
1172,
15908,
12,
81,
22249,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
2220,
220,
220,
41876,
1172,
15908,
12,
81,
2220,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4259,
457,
220,
220,
41876,
1172,
15908,
12,
13049,
457,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
2617,
220,
220,
220,
41876,
1172,
15908,
12,
824,
316,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
4475,
220,
220,
41876,
1172,
15908,
12,
82,
4475,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
336,
524,
220,
220,
41876,
1172,
15908,
12,
301,
524,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
378,
220,
220,
41876,
1172,
15908,
12,
20540,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
524,
220,
220,
41876,
1172,
15908,
12,
22552,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
9945,
3672,
41876,
1172,
15908,
12,
335,
65,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
535,
258,
694,
41876,
1172,
15908,
12,
18863,
258,
694,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
1676,
70,
15908,
13,
628,
220,
220,
220,
337,
36252,
50,
11389,
1096,
62,
23065,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
33245,
62,
19875,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
19875,
62,
22915,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
9186,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
16624,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16624,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
23065,
41876,
1430,
76,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
26086,
220,
220,
41876,
537,
522,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
337,
36252,
50,
1100,
62,
1676,
70,
15908,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
23065,
220,
220,
220,
220,
220,
220,
220,
41876,
1430,
76,
198,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*******************************************************************
* System-defined Include-files. *
*******************************************************************
INCLUDE LZADELE_EXP_DEVTOP. " Global Declarations
INCLUDE LZADELE_EXP_DEVUXX. " Function Modules
*******************************************************************
* User-defined Include-files (if necessary). *
*******************************************************************
* INCLUDE LZADELE_EXP_DEVF... " Subroutines
* INCLUDE LZADELE_EXP_DEVO... " PBO-Modules
* INCLUDE LZADELE_EXP_DEVI... " PAI-Modules
* INCLUDE LZADELE_EXP_DEVE... " Events
* INCLUDE LZADELE_EXP_DEVP... " Local class implement.
* INCLUDE LZADELE_EXP_DEVT99. " ABAP Unit tests
| [
17174,
17174,
8162,
198,
9,
220,
220,
4482,
12,
23211,
40348,
12,
16624,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
17174,
17174,
8162,
198,
220,
3268,
5097,
52,
7206,
406,
57,
19266,
2538,
62,
49864,
62,
39345,
35222,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8060,
16691,
24355,
198,
220,
3268,
5097,
52,
7206,
406,
57,
19266,
2538,
62,
49864,
62,
39345,
52,
8051,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
15553,
3401,
5028,
198,
198,
17174,
17174,
8162,
198,
9,
220,
220,
11787,
12,
23211,
40348,
12,
16624,
357,
361,
3306,
737,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
17174,
17174,
8162,
198,
9,
3268,
5097,
52,
7206,
406,
57,
19266,
2538,
62,
49864,
62,
39345,
37,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3834,
81,
448,
1127,
198,
9,
3268,
5097,
52,
7206,
406,
57,
19266,
2538,
62,
49864,
62,
7206,
29516,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
350,
8202,
12,
5841,
5028,
198,
9,
3268,
5097,
52,
7206,
406,
57,
19266,
2538,
62,
49864,
62,
7206,
12861,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8147,
40,
12,
5841,
5028,
198,
9,
3268,
5097,
52,
7206,
406,
57,
19266,
2538,
62,
49864,
62,
7206,
6089,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
18715,
198,
9,
3268,
5097,
52,
7206,
406,
57,
19266,
2538,
62,
49864,
62,
7206,
8859,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
10714,
1398,
3494,
13,
198,
9,
3268,
5097,
52,
7206,
406,
57,
19266,
2538,
62,
49864,
62,
7206,
36392,
2079,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9564,
2969,
11801,
5254,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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REATE PUBLIC .
PUBLIC SECTION.
TYPES:
ty_types_tt TYPE STANDARD TABLE OF tadir-object WITH DEFAULT KEY .
TYPES:
BEGIN OF ty_deserialization,
obj TYPE REF TO zif_abapgit_object,
xml TYPE REF TO zcl_abapgit_xml_input,
package TYPE devclass,
item TYPE zif_abapgit_definitions=>ty_item,
END OF ty_deserialization .
TYPES:
ty_deserialization_tt TYPE STANDARD TABLE OF ty_deserialization WITH DEFAULT KEY .
TYPES:
BEGIN OF ty_serialization,
files TYPE zif_abapgit_definitions=>ty_files_tt,
item TYPE zif_abapgit_definitions=>ty_item,
END OF ty_serialization .
CLASS-METHODS serialize
IMPORTING
!is_item TYPE zif_abapgit_definitions=>ty_item
!iv_language TYPE spras
RETURNING
VALUE(rs_files_and_item) TYPE zcl_abapgit_objects=>ty_serialization
RAISING
zcx_abapgit_exception .
CLASS-METHODS deserialize
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo
!is_checks TYPE zif_abapgit_definitions=>ty_deserialize_checks
RETURNING
VALUE(rt_accessed_files) TYPE zif_abapgit_definitions=>ty_file_signatures_tt
RAISING
zcx_abapgit_exception .
CLASS-METHODS deserialize_checks
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo
RETURNING
VALUE(rs_checks) TYPE zif_abapgit_definitions=>ty_deserialize_checks
RAISING
zcx_abapgit_exception .
CLASS-METHODS delete
IMPORTING
!it_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
!is_checks TYPE zif_abapgit_definitions=>ty_delete_checks OPTIONAL
RAISING
zcx_abapgit_exception .
CLASS-METHODS jump
IMPORTING
!is_item TYPE zif_abapgit_definitions=>ty_item
!iv_line_number TYPE i OPTIONAL
RAISING
zcx_abapgit_exception .
CLASS-METHODS changed_by
IMPORTING
!is_item TYPE zif_abapgit_definitions=>ty_item
RETURNING
VALUE(rv_user) TYPE xubname
RAISING
zcx_abapgit_exception .
CLASS-METHODS has_changed_since
IMPORTING
!is_item TYPE zif_abapgit_definitions=>ty_item
!iv_timestamp TYPE timestamp
RETURNING
VALUE(rv_changed) TYPE abap_bool
RAISING
zcx_abapgit_exception .
CLASS-METHODS is_supported
IMPORTING
!is_item TYPE zif_abapgit_definitions=>ty_item
!iv_native_only TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(rv_bool) TYPE abap_bool .
CLASS-METHODS exists
IMPORTING
!is_item TYPE zif_abapgit_definitions=>ty_item
RETURNING
VALUE(rv_bool) TYPE abap_bool .
CLASS-METHODS supported_list
RETURNING
VALUE(rt_types) TYPE ty_types_tt .
CLASS-METHODS is_active
IMPORTING
!is_item TYPE zif_abapgit_definitions=>ty_item
RETURNING
VALUE(rv_active) TYPE abap_bool
RAISING
zcx_abapgit_exception .
PROTECTED SECTION.
PRIVATE SECTION.
TYPES: BEGIN OF ty_obj_serializer_map,
item TYPE zif_abapgit_definitions=>ty_item,
metadata TYPE zif_abapgit_definitions=>ty_metadata,
END OF ty_obj_serializer_map,
tty_obj_serializer_map
TYPE SORTED TABLE OF ty_obj_serializer_map WITH UNIQUE KEY item.
CLASS-DATA gt_obj_serializer_map TYPE tty_obj_serializer_map.
CLASS-METHODS files_to_deserialize
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo
RETURNING
VALUE(rt_results) TYPE zif_abapgit_definitions=>ty_results_tt
RAISING
zcx_abapgit_exception .
CLASS-METHODS check_duplicates
IMPORTING
!it_files TYPE zif_abapgit_definitions=>ty_files_tt
RAISING
zcx_abapgit_exception .
CLASS-METHODS prioritize_deser
IMPORTING
!it_results TYPE zif_abapgit_definitions=>ty_results_tt
RETURNING
VALUE(rt_results) TYPE zif_abapgit_definitions=>ty_results_tt .
CLASS-METHODS class_name
IMPORTING
!is_item TYPE zif_abapgit_definitions=>ty_item
RETURNING
VALUE(rv_class_name) TYPE string .
CLASS-METHODS warning_overwrite_adjust
IMPORTING
!it_overwrite TYPE zif_abapgit_definitions=>ty_overwrite_tt
CHANGING
!ct_results TYPE zif_abapgit_definitions=>ty_results_tt
RAISING
zcx_abapgit_exception .
CLASS-METHODS checks_adjust
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo
!is_checks TYPE zif_abapgit_definitions=>ty_deserialize_checks
CHANGING
!ct_results TYPE zif_abapgit_definitions=>ty_results_tt
RAISING
zcx_abapgit_exception .
CLASS-METHODS warning_overwrite_find
IMPORTING
!it_results TYPE zif_abapgit_definitions=>ty_results_tt
RETURNING
VALUE(rt_overwrite) TYPE zif_abapgit_definitions=>ty_overwrite_tt
RAISING
zcx_abapgit_exception .
CLASS-METHODS warning_package_adjust
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo
!it_overwrite TYPE zif_abapgit_definitions=>ty_overwrite_tt
CHANGING
!ct_results TYPE zif_abapgit_definitions=>ty_results_tt
RAISING
zcx_abapgit_exception .
CLASS-METHODS warning_package_find
IMPORTING
!it_results TYPE zif_abapgit_definitions=>ty_results_tt
!io_repo TYPE REF TO zcl_abapgit_repo
RETURNING
VALUE(rt_overwrite) TYPE zif_abapgit_definitions=>ty_overwrite_tt
RAISING
zcx_abapgit_exception .
CLASS-METHODS update_package_tree
IMPORTING
!iv_package TYPE devclass .
CLASS-METHODS delete_obj
IMPORTING
!is_item TYPE zif_abapgit_definitions=>ty_item
RAISING
zcx_abapgit_exception .
CLASS-METHODS compare_remote_to_local
IMPORTING
!ii_object TYPE REF TO zif_abapgit_object
!it_remote TYPE zif_abapgit_definitions=>ty_files_tt
!is_result TYPE zif_abapgit_definitions=>ty_result
RAISING
zcx_abapgit_exception .
CLASS-METHODS deserialize_objects
IMPORTING
it_objects TYPE ty_deserialization_tt
iv_ddic TYPE abap_bool DEFAULT abap_false
iv_descr TYPE string
CHANGING
ct_files TYPE zif_abapgit_definitions=>ty_file_signatures_tt
RAISING
zcx_abapgit_exception .
CLASS-METHODS check_objects_locked
IMPORTING
iv_language TYPE spras
it_items TYPE zif_abapgit_definitions=>ty_items_tt
RAISING
zcx_abapgit_exception.
CLASS-METHODS create_object
IMPORTING
is_item TYPE zif_abapgit_definitions=>ty_item
iv_language TYPE spras
is_metadata TYPE zif_abapgit_definitions=>ty_metadata OPTIONAL
iv_native_only TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(ri_obj) TYPE REF TO zif_abapgit_object
RAISING
zcx_abapgit_exception .
CLASS-METHODS map_tadir_to_items
IMPORTING
it_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
RETURNING
VALUE(rt_items) TYPE zif_abapgit_definitions=>ty_items_tt.
CLASS-METHODS map_results_to_items
IMPORTING
it_results TYPE zif_abapgit_definitions=>ty_results_tt
RETURNING
VALUE(rt_items) TYPE zif_abapgit_definitions=>ty_items_tt.
CLASS-METHODS filter_files_to_deserialize
IMPORTING
it_results TYPE zif_abapgit_definitions=>ty_results_tt
RETURNING
VALUE(rt_results) TYPE zif_abapgit_definitions=>ty_results_tt.
CLASS-METHODS adjust_namespaces
IMPORTING
it_results TYPE zif_abapgit_definitions=>ty_results_tt
RETURNING
VALUE(rt_results) TYPE zif_abapgit_definitions=>ty_results_tt.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECTS IMPLEMENTATION.
METHOD adjust_namespaces.
FIELD-SYMBOLS: <ls_result> LIKE LINE OF rt_results.
rt_results = it_results.
LOOP AT rt_results ASSIGNING <ls_result>.
REPLACE ALL OCCURRENCES OF '#' IN <ls_result>-obj_name WITH '/'.
ENDLOOP.
ENDMETHOD.
METHOD changed_by.
DATA: li_obj TYPE REF TO zif_abapgit_object.
IF is_item IS NOT INITIAL.
li_obj = create_object( is_item = is_item
iv_language = zif_abapgit_definitions=>c_english ).
rv_user = li_obj->changed_by( ).
ENDIF.
IF rv_user IS INITIAL.
* eg. ".abapgit.xml" file
rv_user = zcl_abapgit_objects_super=>c_user_unknown.
ENDIF.
* todo, fallback to looking at transports if rv_user = 'UNKNOWN'?
ENDMETHOD.
METHOD checks_adjust.
warning_overwrite_adjust(
EXPORTING it_overwrite = is_checks-overwrite
CHANGING ct_results = ct_results ).
warning_package_adjust(
EXPORTING
io_repo = io_repo
it_overwrite = is_checks-warning_package
CHANGING
ct_results = ct_results ).
ENDMETHOD.
METHOD check_duplicates.
DATA: lt_files TYPE zif_abapgit_definitions=>ty_files_tt.
lt_files = it_files.
SORT lt_files BY path ASCENDING filename ASCENDING.
DELETE ADJACENT DUPLICATES FROM lt_files COMPARING path filename.
IF lines( lt_files ) <> lines( it_files ).
zcx_abapgit_exception=>raise( 'Duplicates' ).
ENDIF.
ENDMETHOD.
METHOD check_objects_locked.
DATA: li_obj TYPE REF TO zif_abapgit_object.
FIELD-SYMBOLS: <ls_item> LIKE LINE OF it_items.
LOOP AT it_items ASSIGNING <ls_item>.
li_obj = create_object( is_item = <ls_item>
iv_language = iv_language ).
IF li_obj->is_locked( ) = abap_true.
zcx_abapgit_exception=>raise( |Object { <ls_item>-obj_type } { <ls_item>-obj_name } |
&& |is locked. Action not possible.| ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD class_name.
CONCATENATE 'ZCL_ABAPGIT_OBJECT_' is_item-obj_type INTO rv_class_name. "#EC NOTEXT
ENDMETHOD.
METHOD compare_remote_to_local.
* this method is used for comparing local with remote objects
* before pull, this is useful eg. when overwriting a TABL object.
* only the main XML file is used for comparison
DATA: ls_remote_file TYPE zif_abapgit_definitions=>ty_file,
lo_remote_version TYPE REF TO zcl_abapgit_xml_input,
lv_count TYPE i,
li_comparison_result TYPE REF TO zif_abapgit_comparison_result.
FIND ALL OCCURRENCES OF '.' IN is_result-filename MATCH COUNT lv_count.
IF is_result-filename CS '.XML' AND lv_count = 2.
IF ii_object->exists( ) = abap_false.
RETURN.
ENDIF.
READ TABLE it_remote WITH KEY filename = is_result-filename INTO ls_remote_file.
"if file does not exist in remote, we don't need to validate
IF sy-subrc = 0.
CREATE OBJECT lo_remote_version
EXPORTING
iv_xml = zcl_abapgit_convert=>xstring_to_string_utf8( ls_remote_file-data ).
li_comparison_result = ii_object->compare_to_remote_version( lo_remote_version ).
li_comparison_result->show_confirmation_dialog( ).
IF li_comparison_result->is_result_complete_halt( ) = abap_true.
zcx_abapgit_exception=>raise( 'Deserialization aborted by user' ).
ENDIF.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD create_object.
DATA: lv_message TYPE string,
lv_class_name TYPE string,
ls_obj_serializer_map LIKE LINE OF gt_obj_serializer_map.
READ TABLE gt_obj_serializer_map
INTO ls_obj_serializer_map WITH KEY item = is_item.
IF sy-subrc = 0.
lv_class_name = ls_obj_serializer_map-metadata-class.
ELSEIF is_metadata IS NOT INITIAL.
* Metadata is provided only on serialization
* Once this has been triggered, the same serializer shall be used
* for subsequent processes.
* Thus, buffer the metadata afterwards
ls_obj_serializer_map-item = is_item.
ls_obj_serializer_map-metadata = is_metadata.
INSERT ls_obj_serializer_map INTO TABLE gt_obj_serializer_map.
lv_class_name = is_metadata-class.
ELSE.
lv_class_name = class_name( is_item ).
ENDIF.
REPLACE FIRST OCCURRENCE OF 'LCL' IN lv_class_name WITH 'ZCL_ABAPGIT'.
TRY.
CREATE OBJECT ri_obj TYPE (lv_class_name)
EXPORTING
is_item = is_item
iv_language = iv_language.
CATCH cx_sy_create_object_error.
lv_message = |Object type { is_item-obj_type } not supported, serialize|. "#EC NOTEXT
IF iv_native_only = abap_false.
TRY. " 2nd step, try looking for plugins
CREATE OBJECT ri_obj TYPE zcl_abapgit_objects_bridge
EXPORTING
is_item = is_item.
CATCH cx_sy_create_object_error.
zcx_abapgit_exception=>raise( lv_message ).
ENDTRY.
ELSE. " No native support? -> fail
zcx_abapgit_exception=>raise( lv_message ).
ENDIF.
ENDTRY.
ENDMETHOD.
METHOD delete.
DATA: ls_item TYPE zif_abapgit_definitions=>ty_item,
lo_progress TYPE REF TO zcl_abapgit_progress,
lt_tadir LIKE it_tadir,
lt_items TYPE zif_abapgit_definitions=>ty_items_tt,
lx_error TYPE REF TO zcx_abapgit_exception,
lv_text TYPE string.
FIELD-SYMBOLS: <ls_tadir> LIKE LINE OF it_tadir.
lt_tadir = it_tadir.
IF is_checks-transport-required = abap_true.
zcl_abapgit_default_transport=>get_instance( )->set( is_checks-transport-transport ).
ENDIF.
TRY.
zcl_abapgit_dependencies=>resolve( CHANGING ct_tadir = lt_tadir ).
CREATE OBJECT lo_progress
EXPORTING
iv_total = lines( lt_tadir ).
lt_items = map_tadir_to_items( lt_tadir ).
check_objects_locked( iv_language = zif_abapgit_definitions=>c_english
it_items = lt_items ).
LOOP AT lt_tadir ASSIGNING <ls_tadir>.
lo_progress->show( iv_current = sy-tabix
iv_text = |Delete { <ls_tadir>-obj_name }| ) ##NO_TEXT.
CLEAR ls_item.
ls_item-obj_type = <ls_tadir>-object.
ls_item-obj_name = <ls_tadir>-obj_name.
delete_obj( ls_item ).
* make sure to save object deletions
COMMIT WORK.
ENDLOOP.
CATCH zcx_abapgit_exception INTO lx_error.
zcl_abapgit_default_transport=>get_instance( )->reset( ).
lv_text = lx_error->get_text( ).
zcx_abapgit_exception=>raise( lv_text ).
ENDTRY.
zcl_abapgit_default_transport=>get_instance( )->reset( ).
ENDMETHOD.
METHOD delete_obj.
DATA: li_obj TYPE REF TO zif_abapgit_object.
IF is_supported( is_item ) = abap_true.
li_obj = create_object( is_item = is_item
iv_language = zif_abapgit_definitions=>c_english ).
li_obj->delete( ).
IF li_obj->get_metadata( )-delete_tadir = abap_true.
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_delete_tadir_entry = abap_true
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = is_item-obj_type
wi_tadir_obj_name = is_item-obj_name
wi_test_modus = abap_false.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD deserialize.
DATA: ls_item TYPE zif_abapgit_definitions=>ty_item,
li_obj TYPE REF TO zif_abapgit_object,
lt_remote TYPE zif_abapgit_definitions=>ty_files_tt,
lv_package TYPE devclass,
lo_files TYPE REF TO zcl_abapgit_objects_files,
lo_xml TYPE REF TO zcl_abapgit_xml_input,
lt_results TYPE zif_abapgit_definitions=>ty_results_tt,
lt_ddic TYPE TABLE OF ty_deserialization,
lt_rest TYPE TABLE OF ty_deserialization,
lt_late TYPE TABLE OF ty_deserialization,
lo_progress TYPE REF TO zcl_abapgit_progress,
lv_path TYPE string,
lt_items TYPE zif_abapgit_definitions=>ty_items_tt.
DATA: lo_folder_logic TYPE REF TO zcl_abapgit_folder_logic.
FIELD-SYMBOLS: <ls_result> TYPE zif_abapgit_definitions=>ty_result,
<ls_deser> LIKE LINE OF lt_late.
lv_package = io_repo->get_package( ).
IF is_checks-transport-required = abap_true.
zcl_abapgit_default_transport=>get_instance( )->set( is_checks-transport-transport ).
ENDIF.
zcl_abapgit_objects_activation=>clear( ).
lt_remote = io_repo->get_files_remote( ).
lt_results = files_to_deserialize( io_repo ).
checks_adjust(
EXPORTING
io_repo = io_repo
is_checks = is_checks
CHANGING
ct_results = lt_results ).
CREATE OBJECT lo_progress
EXPORTING
iv_total = lines( lt_results ).
lt_items = map_results_to_items( lt_results ).
check_objects_locked( iv_language = io_repo->get_dot_abapgit( )->get_master_language( )
it_items = lt_items ).
lo_folder_logic = zcl_abapgit_folder_logic=>get_instance( ).
LOOP AT lt_results ASSIGNING <ls_result>.
lo_progress->show( iv_current = sy-tabix
iv_text = |Deserialize { <ls_result>-obj_name }| ) ##NO_TEXT.
CLEAR ls_item.
ls_item-obj_type = <ls_result>-obj_type.
ls_item-obj_name = <ls_result>-obj_name.
lv_package = lo_folder_logic->path_to_package(
iv_top = io_repo->get_package( )
io_dot = io_repo->get_dot_abapgit( )
iv_path = <ls_result>-path ).
IF ls_item-obj_type = 'DEVC'.
" Packages have the same filename across different folders. The path needs to be supplied
" to find the correct file.
lv_path = <ls_result>-path.
ENDIF.
CREATE OBJECT lo_files
EXPORTING
is_item = ls_item
iv_path = lv_path.
lo_files->set_files( lt_remote ).
* Analyze XML in order to instantiate the proper serializer
lo_xml = lo_files->read_xml( ).
li_obj = create_object( is_item = ls_item
iv_language = io_repo->get_dot_abapgit( )->get_master_language( )
is_metadata = lo_xml->get_metadata( ) ).
compare_remote_to_local(
ii_object = li_obj
it_remote = lt_remote
is_result = <ls_result> ).
li_obj->mo_files = lo_files.
IF li_obj->get_metadata( )-late_deser = abap_true.
APPEND INITIAL LINE TO lt_late ASSIGNING <ls_deser>.
ELSEIF li_obj->get_metadata( )-ddic = abap_true.
APPEND INITIAL LINE TO lt_ddic ASSIGNING <ls_deser>.
ELSE.
APPEND INITIAL LINE TO lt_rest ASSIGNING <ls_deser>.
ENDIF.
<ls_deser>-item = ls_item.
<ls_deser>-obj = li_obj.
<ls_deser>-xml = lo_xml.
<ls_deser>-package = lv_package.
CLEAR: lv_path, lv_package.
ENDLOOP.
deserialize_objects( EXPORTING it_objects = lt_ddic
iv_ddic = abap_true
iv_descr = 'DDIC'
CHANGING ct_files = rt_accessed_files ).
deserialize_objects( EXPORTING it_objects = lt_rest
iv_descr = 'Objects'
CHANGING ct_files = rt_accessed_files ).
deserialize_objects( EXPORTING it_objects = lt_late
iv_descr = 'Late'
CHANGING ct_files = rt_accessed_files ).
update_package_tree( io_repo->get_package( ) ).
SORT rt_accessed_files BY path ASCENDING filename ASCENDING.
DELETE ADJACENT DUPLICATES FROM rt_accessed_files. " Just in case
zcl_abapgit_default_transport=>get_instance( )->reset( ).
ENDMETHOD.
METHOD deserialize_checks.
DATA: lt_results TYPE zif_abapgit_definitions=>ty_results_tt,
li_package TYPE REF TO zif_abapgit_sap_package.
lt_results = files_to_deserialize( io_repo ).
rs_checks-overwrite = warning_overwrite_find( lt_results ).
rs_checks-warning_package = warning_package_find(
io_repo = io_repo
it_results = lt_results ).
IF lines( lt_results ) > 0.
li_package = zcl_abapgit_factory=>get_sap_package( io_repo->get_package( ) ).
rs_checks-transport-required = li_package->are_changes_recorded_in_tr_req( ).
IF NOT rs_checks-transport-required IS INITIAL.
rs_checks-transport-type = li_package->get_transport_type( ).
ENDIF.
ENDIF.
ENDMETHOD.
METHOD deserialize_objects.
DATA: lo_progress TYPE REF TO zcl_abapgit_progress.
FIELD-SYMBOLS: <ls_obj> LIKE LINE OF it_objects.
zcl_abapgit_objects_activation=>clear( ).
CREATE OBJECT lo_progress
EXPORTING
iv_total = lines( it_objects ).
LOOP AT it_objects ASSIGNING <ls_obj>.
lo_progress->show(
iv_current = sy-tabix
iv_text = |Deserialize { iv_descr } - { <ls_obj>-item-obj_name }| ) ##NO_TEXT.
<ls_obj>-obj->deserialize( iv_package = <ls_obj>-package
io_xml = <ls_obj>-xml ).
APPEND LINES OF <ls_obj>-obj->mo_files->get_accessed_files( ) TO ct_files.
ENDLOOP.
zcl_abapgit_objects_activation=>activate( iv_ddic ).
ENDMETHOD.
METHOD exists.
DATA: li_obj TYPE REF TO zif_abapgit_object.
TRY.
li_obj = create_object( is_item = is_item
iv_language = zif_abapgit_definitions=>c_english ).
rv_bool = li_obj->exists( ).
CATCH zcx_abapgit_exception.
* ignore all errors and assume the object exists
rv_bool = abap_true.
ENDTRY.
ENDMETHOD.
METHOD files_to_deserialize.
rt_results = adjust_namespaces(
prioritize_deser(
filter_files_to_deserialize(
zcl_abapgit_file_status=>status( io_repo ) ) ) ).
ENDMETHOD.
METHOD filter_files_to_deserialize.
rt_results = it_results.
DELETE rt_results WHERE match = abap_true. " Full match
SORT rt_results
BY obj_type ASCENDING
obj_name ASCENDING
rstate DESCENDING. " ensures that non-empty rstate is kept
DELETE ADJACENT DUPLICATES FROM rt_results COMPARING obj_type obj_name.
DELETE rt_results WHERE obj_type IS INITIAL.
DELETE rt_results WHERE lstate = zif_abapgit_definitions=>c_state-added AND rstate IS INITIAL.
ENDMETHOD.
METHOD has_changed_since.
rv_changed = abap_true. " Assume changed
IF is_supported( is_item ) = abap_false.
RETURN. " Will requre serialize which will log the error
ENDIF.
rv_changed = create_object(
is_item = is_item
iv_language = zif_abapgit_definitions=>c_english )->has_changed_since( iv_timestamp ).
ENDMETHOD.
METHOD is_active.
DATA: li_object TYPE REF TO zif_abapgit_object.
TRY.
li_object = create_object( is_item = is_item
iv_language = sy-langu ).
rv_active = li_object->is_active( ).
CATCH cx_sy_dyn_call_illegal_method
cx_sy_ref_is_initial
zcx_abapgit_exception.
rv_active = abap_true.
ENDTRY.
ENDMETHOD.
METHOD is_supported.
TRY.
create_object( is_item = is_item
iv_language = zif_abapgit_definitions=>c_english
iv_native_only = iv_native_only ).
rv_bool = abap_true.
CATCH zcx_abapgit_exception.
rv_bool = abap_false.
ENDTRY.
ENDMETHOD.
METHOD jump.
DATA: li_obj TYPE REF TO zif_abapgit_object,
lv_adt_jump_enabled TYPE abap_bool.
li_obj = create_object( is_item = is_item
iv_language = zif_abapgit_definitions=>c_english ).
IF li_obj->exists( ) = abap_false.
zcx_abapgit_exception=>raise( |Object { is_item-obj_type } { is_item-obj_name } doesn't exist| ).
ENDIF.
lv_adt_jump_enabled = zcl_abapgit_persist_settings=>get_instance( )->read( )->get_adt_jump_enabled( ).
IF lv_adt_jump_enabled = abap_true.
TRY.
zcl_abapgit_objects_super=>jump_adt(
iv_obj_name = is_item-obj_name
iv_obj_type = is_item-obj_type
iv_line_number = iv_line_number ).
CATCH zcx_abapgit_exception.
li_obj->jump( ).
ENDTRY.
ELSE.
li_obj->jump( ).
ENDIF.
ENDMETHOD.
METHOD map_results_to_items.
DATA: ls_item LIKE LINE OF rt_items.
FIELD-SYMBOLS: <ls_result> TYPE zif_abapgit_definitions=>ty_result.
LOOP AT it_results ASSIGNING <ls_result>.
ls_item-devclass = <ls_result>-package.
ls_item-obj_type = <ls_result>-obj_type.
ls_item-obj_name = <ls_result>-obj_name.
INSERT ls_item INTO TABLE rt_items.
ENDLOOP.
ENDMETHOD.
METHOD map_tadir_to_items.
DATA: ls_item LIKE LINE OF rt_items.
FIELD-SYMBOLS: <ls_tadir> TYPE zif_abapgit_definitions=>ty_tadir.
LOOP AT it_tadir ASSIGNING <ls_tadir>.
ls_item-devclass = <ls_tadir>-devclass.
ls_item-obj_type = <ls_tadir>-object.
ls_item-obj_name = <ls_tadir>-obj_name.
INSERT ls_item INTO TABLE rt_items.
ENDLOOP.
ENDMETHOD.
METHOD prioritize_deser.
FIELD-SYMBOLS: <ls_result> LIKE LINE OF it_results.
* XSLT has to be handled before CLAS/PROG
LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'XSLT'.
APPEND <ls_result> TO rt_results.
ENDLOOP.
* PROG before internet services, as the services might use the screens
LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'PROG'.
APPEND <ls_result> TO rt_results.
ENDLOOP.
* ISAP has to be handled before ISRP
LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'IASP'.
APPEND <ls_result> TO rt_results.
ENDLOOP.
* PINF has to be handled before DEVC for package interface usage
LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'PINF'.
APPEND <ls_result> TO rt_results.
ENDLOOP.
* ENHS has to be handled before ENHO
LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'ENHS'.
APPEND <ls_result> TO rt_results.
ENDLOOP.
* DDLS has to be handled before DCLS
LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'DDLS'.
APPEND <ls_result> TO rt_results.
ENDLOOP.
LOOP AT it_results ASSIGNING <ls_result>
WHERE obj_type <> 'IASP'
AND obj_type <> 'PROG'
AND obj_type <> 'XSLT'
AND obj_type <> 'PINF'
AND obj_type <> 'ENHS'
AND obj_type <> 'DDLS'.
APPEND <ls_result> TO rt_results.
ENDLOOP.
ENDMETHOD.
METHOD serialize.
DATA: li_obj TYPE REF TO zif_abapgit_object,
lo_xml TYPE REF TO zcl_abapgit_xml_output,
lo_files TYPE REF TO zcl_abapgit_objects_files.
FIELD-SYMBOLS: <ls_file> LIKE LINE OF rs_files_and_item-files.
rs_files_and_item-item = is_item.
IF is_supported( rs_files_and_item-item ) = abap_false.
zcx_abapgit_exception=>raise( |Object type ignored, not supported: {
rs_files_and_item-item-obj_type }-{
rs_files_and_item-item-obj_name }| ).
ENDIF.
CREATE OBJECT lo_files
EXPORTING
is_item = rs_files_and_item-item.
li_obj = create_object( is_item = rs_files_and_item-item
iv_language = iv_language ).
li_obj->mo_files = lo_files.
CREATE OBJECT lo_xml.
li_obj->serialize( lo_xml ).
lo_files->add_xml( io_xml = lo_xml
is_metadata = li_obj->get_metadata( ) ).
rs_files_and_item-files = lo_files->get_files( ).
check_duplicates( rs_files_and_item-files ).
rs_files_and_item-item-inactive = boolc( li_obj->is_active( ) = abap_false ).
LOOP AT rs_files_and_item-files ASSIGNING <ls_file>.
<ls_file>-sha1 = zcl_abapgit_hash=>sha1(
iv_type = zif_abapgit_definitions=>c_type-blob
iv_data = <ls_file>-data ).
ENDLOOP.
ENDMETHOD.
METHOD supported_list.
DATA: lt_objects TYPE STANDARD TABLE OF ko100,
lv_supported TYPE abap_bool,
ls_item TYPE zif_abapgit_definitions=>ty_item.
FIELD-SYMBOLS <ls_object> LIKE LINE OF lt_objects.
CALL FUNCTION 'TR_OBJECT_TABLE'
TABLES
wt_object_text = lt_objects
EXCEPTIONS
OTHERS = 1 ##FM_SUBRC_OK.
LOOP AT lt_objects ASSIGNING <ls_object> WHERE pgmid = 'R3TR'.
ls_item-obj_type = <ls_object>-object.
lv_supported = zcl_abapgit_objects=>is_supported(
is_item = ls_item
iv_native_only = abap_true ).
IF lv_supported = abap_true.
APPEND <ls_object>-object TO rt_types.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD update_package_tree.
DATA: lt_packages TYPE zif_abapgit_sap_package=>ty_devclass_tt,
lv_package LIKE LINE OF lt_packages,
lv_tree TYPE dirtree-tname.
lt_packages = zcl_abapgit_factory=>get_sap_package( iv_package )->list_subpackages( ).
APPEND iv_package TO lt_packages.
LOOP AT lt_packages INTO lv_package.
* update package tree for SE80
lv_tree = 'EU_' && lv_package.
CALL FUNCTION 'WB_TREE_ACTUALIZE'
EXPORTING
tree_name = lv_tree
without_crossreference = abap_true
with_tcode_index = abap_true.
ENDLOOP.
ENDMETHOD.
METHOD warning_overwrite_adjust.
DATA: lt_overwrite LIKE it_overwrite,
ls_overwrite LIKE LINE OF lt_overwrite.
FIELD-SYMBOLS: <ls_overwrite> LIKE LINE OF lt_overwrite.
* make sure to get the current status, as something might have changed in the meanwhile
lt_overwrite = warning_overwrite_find( ct_results ).
LOOP AT lt_overwrite ASSIGNING <ls_overwrite>.
READ TABLE it_overwrite INTO ls_overwrite WITH KEY
obj_type = <ls_overwrite>-obj_type
obj_name = <ls_overwrite>-obj_name.
IF sy-subrc <> 0 OR ls_overwrite-decision IS INITIAL.
zcx_abapgit_exception=>raise( |Overwrite { <ls_overwrite>-obj_type } {
<ls_overwrite>-obj_name } undecided| ).
ENDIF.
IF ls_overwrite-decision = 'N'.
DELETE ct_results WHERE
obj_type = <ls_overwrite>-obj_type AND
obj_name = <ls_overwrite>-obj_name.
ASSERT sy-subrc = 0.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD warning_overwrite_find.
DATA: ls_overwrite LIKE LINE OF rt_overwrite.
FIELD-SYMBOLS: <ls_result> LIKE LINE OF it_results.
LOOP AT it_results ASSIGNING <ls_result>
WHERE NOT obj_type IS INITIAL.
IF <ls_result>-lstate IS NOT INITIAL
AND <ls_result>-lstate <> zif_abapgit_definitions=>c_state-deleted
AND NOT ( <ls_result>-lstate = zif_abapgit_definitions=>c_state-added
AND <ls_result>-rstate IS INITIAL ).
* current object has been modified locally, add to table
CLEAR ls_overwrite.
MOVE-CORRESPONDING <ls_result> TO ls_overwrite.
APPEND ls_overwrite TO rt_overwrite.
ENDIF.
ENDLOOP.
SORT rt_overwrite.
DELETE ADJACENT DUPLICATES FROM rt_overwrite.
ENDMETHOD.
METHOD warning_package_adjust.
DATA: lt_overwrite LIKE it_overwrite,
ls_overwrite LIKE LINE OF lt_overwrite.
FIELD-SYMBOLS: <ls_overwrite> LIKE LINE OF lt_overwrite.
* make sure to get the current status, as something might have changed in the meanwhile
lt_overwrite = warning_package_find(
it_results = ct_results
io_repo = io_repo ).
LOOP AT lt_overwrite ASSIGNING <ls_overwrite>.
READ TABLE it_overwrite INTO ls_overwrite WITH KEY
obj_type = <ls_overwrite>-obj_type
obj_name = <ls_overwrite>-obj_name.
IF sy-subrc <> 0 OR ls_overwrite-decision IS INITIAL.
zcx_abapgit_exception=>raise( |Overwrite odd package { <ls_overwrite>-obj_type } {
<ls_overwrite>-obj_name } undecided| ).
ENDIF.
IF ls_overwrite-decision = 'N'.
DELETE ct_results WHERE
obj_type = <ls_overwrite>-obj_type AND
obj_name = <ls_overwrite>-obj_name.
ASSERT sy-subrc = 0.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD warning_package_find.
DATA: lv_package TYPE devclass,
lt_overwrite_uniqe TYPE HASHED TABLE OF zif_abapgit_definitions=>ty_overwrite
WITH UNIQUE KEY obj_type obj_name devclass,
ls_overwrite LIKE LINE OF rt_overwrite,
ls_tadir TYPE zif_abapgit_definitions=>ty_tadir.
DATA: lo_folder_logic TYPE REF TO zcl_abapgit_folder_logic.
FIELD-SYMBOLS: <ls_result> LIKE LINE OF it_results.
lo_folder_logic = zcl_abapgit_folder_logic=>get_instance( ).
LOOP AT it_results ASSIGNING <ls_result>.
lv_package = lo_folder_logic->path_to_package(
iv_top = io_repo->get_package( )
io_dot = io_repo->get_dot_abapgit( )
iv_path = <ls_result>-path ).
ls_tadir = zcl_abapgit_factory=>get_tadir( )->read_single(
iv_object = <ls_result>-obj_type
iv_obj_name = <ls_result>-obj_name ).
IF NOT ls_tadir IS INITIAL AND ls_tadir-devclass <> lv_package.
* overwriting object from different package than expected
CLEAR ls_overwrite.
ls_overwrite-obj_type = <ls_result>-obj_type.
ls_overwrite-obj_name = <ls_result>-obj_name.
ls_overwrite-devclass = ls_tadir-devclass.
INSERT ls_overwrite INTO TABLE lt_overwrite_uniqe.
ENDIF.
ENDLOOP.
rt_overwrite = lt_overwrite_uniqe.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48205,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
19199,
62,
926,
41876,
49053,
9795,
43679,
3963,
36264,
343,
12,
15252,
13315,
5550,
38865,
35374,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
8906,
48499,
1634,
11,
198,
220,
220,
220,
220,
220,
220,
220,
26181,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
15252,
11,
198,
220,
220,
220,
220,
220,
220,
220,
35555,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
19875,
62,
15414,
11,
198,
220,
220,
220,
220,
220,
220,
220,
5301,
41876,
1614,
4871,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2378,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
8906,
48499,
1634,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
8906,
48499,
1634,
62,
926,
41876,
49053,
9795,
43679,
3963,
1259,
62,
8906,
48499,
1634,
13315,
5550,
38865,
35374,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
46911,
1634,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3696,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
62,
926,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2378,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
46911,
1634,
764,
628,
220,
220,
220,
42715,
12,
49273,
50,
11389,
1096,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
9186,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
16129,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
7500,
292,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
16624,
62,
392,
62,
9186,
8,
41876,
1976,
565,
62,
397,
499,
18300,
62,
48205,
14804,
774,
62,
46911,
1634,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
748,
48499,
1096,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
260,
7501,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
42116,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
8906,
48499,
1096,
62,
42116,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
15526,
276,
62,
16624,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
7753,
62,
12683,
6691,
62,
926,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
748,
48499,
1096,
62,
42116,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
260,
7501,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
42116,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
8906,
48499,
1096,
62,
42116,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
12233,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
83,
324,
343,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
83,
324,
343,
62,
926,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
42116,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
33678,
62,
42116,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
4391,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
9186,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
1370,
62,
17618,
41876,
1312,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
3421,
62,
1525,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
9186,
220,
220,
220,
220,
220,
220,
41876,
1976
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ZCL_ZGWSO_DPC_EXT definition
public
inheriting from ZCL_ZGWSO_DPC
create public .
public section. | [
4871,
1168,
5097,
62,
57,
33191,
15821,
62,
35,
5662,
62,
13918,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
1168,
5097,
62,
57,
33191,
15821,
62,
35,
5662,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_mqtt_packet_pubrel DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_mqtt_packet .
METHODS constructor
IMPORTING
!iv_packet_identifier TYPE zif_mqtt_packet=>ty_packet_identifier OPTIONAL .
METHODS get_packet_identifier
RETURNING
VALUE(rv_packet_identifier) TYPE zif_mqtt_packet=>ty_packet_identifier .
METHODS set_packet_identifier
IMPORTING
!iv_packet_identifier TYPE zif_mqtt_packet=>ty_packet_identifier .
PROTECTED SECTION.
DATA mv_packet_identifier TYPE zif_mqtt_packet=>ty_packet_identifier .
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_MQTT_PACKET_PUBREL IMPLEMENTATION.
METHOD constructor.
mv_packet_identifier = iv_packet_identifier.
ENDMETHOD.
METHOD get_packet_identifier.
rv_packet_identifier = mv_packet_identifier.
ENDMETHOD.
METHOD set_packet_identifier.
mv_packet_identifier = iv_packet_identifier.
ENDMETHOD.
METHOD zif_mqtt_packet~decode.
ASSERT io_stream->eat_hex( 1 ) = '62'.
io_stream->eat_length( ).
mv_packet_identifier = io_stream->eat_hex( 2 ).
ENDMETHOD.
METHOD zif_mqtt_packet~encode.
DATA(lo_payload) = NEW zcl_mqtt_stream( ).
ASSERT NOT mv_packet_identifier IS INITIAL.
lo_payload->add_hex( mv_packet_identifier ).
ro_stream = NEW #( ).
ro_stream->add_packet(
ii_packet = me
iv_flags = 2
io_payload = lo_payload ).
ENDMETHOD.
METHOD zif_mqtt_packet~get_type.
rv_value = zif_mqtt_constants=>gc_packets-pubrel.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
76,
80,
926,
62,
8002,
316,
62,
12984,
2411,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
76,
80,
926,
62,
8002,
316,
764,
628,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8002,
316,
62,
738,
7483,
41876,
1976,
361,
62,
76,
80,
926,
62,
8002,
316,
14804,
774,
62,
8002,
316,
62,
738,
7483,
39852,
2849,
1847,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
8002,
316,
62,
738,
7483,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8002,
316,
62,
738,
7483,
8,
41876,
1976,
361,
62,
76,
80,
926,
62,
8002,
316,
14804,
774,
62,
8002,
316,
62,
738,
7483,
764,
198,
220,
220,
220,
337,
36252,
50,
900,
62,
8002,
316,
62,
738,
7483,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8002,
316,
62,
738,
7483,
41876,
1976,
361,
62,
76,
80,
926,
62,
8002,
316,
14804,
774,
62,
8002,
316,
62,
738,
7483,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
42865,
285,
85,
62,
8002,
316,
62,
738,
7483,
41876,
1976,
361,
62,
76,
80,
926,
62,
8002,
316,
14804,
774,
62,
8002,
316,
62,
738,
7483,
764,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
49215,
15751,
62,
47,
8120,
2767,
62,
5105,
33,
16448,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
285,
85,
62,
8002,
316,
62,
738,
7483,
796,
21628,
62,
8002,
316,
62,
738,
7483,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
8002,
316,
62,
738,
7483,
13,
628,
220,
220,
220,
374,
85,
62,
8002,
316,
62,
738,
7483,
796,
285,
85,
62,
8002,
316,
62,
738,
7483,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
900,
62,
8002,
316,
62,
738,
7483,
13,
628,
220,
220,
220,
285,
85,
62,
8002,
316,
62,
738,
7483,
796,
21628,
62,
8002,
316,
62,
738,
7483,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
76,
80,
926,
62,
8002,
316,
93,
12501,
1098,
13,
628,
220,
220,
220,
24994,
17395,
33245,
62,
5532,
3784,
4098,
62,
33095,
7,
352,
1267,
796,
705,
5237,
4458,
628,
220,
220,
220,
33245,
62,
5532,
3784,
4098,
62,
13664,
7,
6739,
628,
220,
220,
220,
285,
85,
62,
8002,
316,
62,
738,
7483,
796,
33245,
62,
5532,
3784,
4098,
62,
33095,
7,
362,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
76,
80,
926,
62,
8002,
316,
93,
268,
8189,
13,
628,
220,
220,
220,
42865,
7,
5439,
62,
15577,
2220,
8,
796,
12682,
1976,
565,
62,
76,
80,
926,
62,
5532,
7,
6739,
628,
220,
220,
220,
24994,
17395,
5626,
285,
85,
62,
8002,
316,
62,
738,
7483,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
2376,
62,
15577,
2220,
3784,
2860,
62,
33095,
7,
285,
85,
62,
8002,
316,
62,
738,
7483,
6739,
628,
220,
220,
220,
686,
62,
5532,
796,
12682,
1303,
7,
6739,
628,
220,
220,
220,
686,
62,
5532,
3784,
2860,
62,
8002,
316,
7,
198,
220,
220,
220,
220,
220,
21065,
62,
8002,
316,
220,
796,
502,
198,
220,
220,
220,
220,
220,
21628,
62,
33152,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
33245,
62,
15577,
2220,
796,
2376,
62,
15577,
2220,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
76,
80,
926,
62,
8002,
316,
93,
1136,
62,
4906,
13,
628,
220,
220,
220,
374,
85,
62,
8367,
796,
1976,
361,
62,
76,
80,
926,
62,
9979,
1187,
14804,
36484,
62,
8002,
1039,
12,
12984,
2411,
13,
628,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*"* use this source file for your ABAP unit test classes
CLASS ltcl_calculate_patch DEFINITION FINAL FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS:
single_insert FOR TESTING RAISING cx_static_check,
multiple_adjacent_insert FOR TESTING RAISING cx_static_check,
multiple_non_adjacent_insert FOR TESTING RAISING cx_static_check,
multiple_partial_insert FOR TESTING RAISING cx_static_check,
single_delete FOR TESTING RAISING cx_static_check,
multiple_adjacend_delete FOR TESTING RAISING cx_static_check,
multiple_non_adjacent_delete FOR TESTING RAISING cx_static_check,
multiple_partial_delete FOR TESTING RAISING cx_static_check,
single_update FOR TESTING RAISING cx_static_check,
multiple_adjacend_update FOR TESTING RAISING cx_static_check,
multiple_non_adjacent_update FOR TESTING RAISING cx_static_check,
multiple_partial_update FOR TESTING RAISING cx_static_check,
mixed FOR TESTING RAISING cx_static_check,
unknown_result_type FOR TESTING RAISING cx_static_check.
METHODS:
given_diff
IMPORTING
iv_patch_flag TYPE zif_abapgit_definitions=>ty_diff-patch_flag
iv_new_num TYPE zif_abapgit_definitions=>ty_diff-new_num
iv_new TYPE zif_abapgit_definitions=>ty_diff-new
iv_result TYPE zif_abapgit_definitions=>ty_diff-result
iv_old_num TYPE zif_abapgit_definitions=>ty_diff-old_num
iv_old TYPE zif_abapgit_definitions=>ty_diff-old
iv_short TYPE zif_abapgit_definitions=>ty_diff-short DEFAULT 'X'
iv_beacon TYPE zif_abapgit_definitions=>ty_diff-beacon DEFAULT 1,
when_patch_is_calculated,
then_patch_should_be
IMPORTING
iv_exp_patch TYPE string,
then_exception_is_raised.
DATA:
mt_diff TYPE zif_abapgit_definitions=>ty_diffs_tt,
mt_patch TYPE string_table,
mx_error TYPE REF TO zcx_abapgit_exception.
ENDCLASS.
CLASS ltcl_calculate_patch IMPLEMENTATION.
METHOD single_insert.
given_diff( iv_patch_flag = ' '
iv_new_num = ' 1'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 1'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' 2'
iv_new = 'write: `Test`.'
iv_result = 'I'
iv_old_num = ' '
iv_old = ' ' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 3'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 2'
iv_old = ' ' ).
when_patch_is_calculated( ).
then_patch_should_be(
|\n| &&
|write: `Test`.\n| &&
|\n| ).
ENDMETHOD.
METHOD multiple_adjacent_insert.
given_diff( iv_patch_flag = ' '
iv_new_num = ' 1'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 1'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' 2'
iv_new = 'write: `Test`.'
iv_result = 'I'
iv_old_num = ' '
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' 3'
iv_new = 'write: `Hello world`.'
iv_result = 'I'
iv_old_num = ' '
iv_old = ' ' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 4'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 2'
iv_old = ' ' ).
when_patch_is_calculated( ).
then_patch_should_be(
|\n| &&
|write: `Test`.\n| &&
|write: `Hello world`.\n| &&
|\n| ).
ENDMETHOD.
METHOD multiple_non_adjacent_insert.
given_diff( iv_patch_flag = ' '
iv_new_num = ' 1'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 1'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' 2'
iv_new = 'write: `Test`.'
iv_result = 'I'
iv_old_num = ' '
iv_old = ' ' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 3'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 2'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' 4'
iv_new = 'write: `Hello world`.'
iv_result = 'I'
iv_old_num = ' '
iv_old = ' ' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 5'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 3'
iv_old = ' ' ).
when_patch_is_calculated( ).
then_patch_should_be(
|\n| &&
|write: `Test`.\n| &&
|\n| &&
|write: `Hello world`.\n| &&
|\n| ).
ENDMETHOD.
METHOD multiple_partial_insert.
given_diff( iv_patch_flag = ' '
iv_new_num = ' 1'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 1'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' 2'
iv_new = 'write: `Test`.'
iv_result = 'I'
iv_old_num = ' '
iv_old = ' ' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 3'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 2'
iv_old = ' ' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 4'
iv_new = 'write: `Hello world`.'
iv_result = 'I'
iv_old_num = ' '
iv_old = ' ' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 5'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 3'
iv_old = ' ' ).
when_patch_is_calculated( ).
then_patch_should_be(
|\n| &&
|write: `Test`.\n| &&
|\n| &&
|\n| ).
ENDMETHOD.
METHOD single_delete.
given_diff( iv_patch_flag = ' '
iv_new_num = ' 1'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 1'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' '
iv_new = ' '
iv_result = 'D'
iv_old_num = ' 2'
iv_old = 'write: `Test`.' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 2'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 3'
iv_old = ' ' ).
when_patch_is_calculated( ).
then_patch_should_be( |\n\n| ).
ENDMETHOD.
METHOD multiple_adjacend_delete.
given_diff( iv_patch_flag = ' '
iv_new_num = ' 1'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 1'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' '
iv_new = ' '
iv_result = 'D'
iv_old_num = ' 2'
iv_old = 'write: `Test`.' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' '
iv_new = ' '
iv_result = 'D'
iv_old_num = ' 3'
iv_old = 'write: `Hello world`.' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 2'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 4'
iv_old = ' ' ).
when_patch_is_calculated( ).
then_patch_should_be( |\n\n| ).
ENDMETHOD.
METHOD multiple_non_adjacent_delete.
given_diff( iv_patch_flag = ' '
iv_new_num = ' 1'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 1'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' '
iv_new = ' '
iv_result = 'D'
iv_old_num = ' 2'
iv_old = 'write: `Test`.' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' '
iv_new = ' '
iv_result = 'D'
iv_old_num = ' 3'
iv_old = 'write: `Hello world`.' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' '
iv_new = ' '
iv_result = 'D'
iv_old_num = ' 4'
iv_old = 'write: `Hello 123`.' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 2'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 5'
iv_old = ' ' ).
when_patch_is_calculated( ).
then_patch_should_be(
|\n| &&
|write: `Hello world`.| &&
|\n| ).
ENDMETHOD.
METHOD multiple_partial_delete.
given_diff( iv_patch_flag = ' '
iv_new_num = ' 1'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 1'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' '
iv_new = ' '
iv_result = 'D'
iv_old_num = ' 2'
iv_old = 'write: `Test`.' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' '
iv_new = ' '
iv_result = 'D'
iv_old_num = ' 3'
iv_old = 'write: `Hello world`.' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' '
iv_new = ' '
iv_result = 'D'
iv_old_num = ' 4'
iv_old = 'write: `Hello 123`.' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' '
iv_new = ' '
iv_result = 'D'
iv_old_num = ' 5'
iv_old = 'write: `Hello test`.' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 2'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 6'
iv_old = ' ' ).
when_patch_is_calculated( ).
then_patch_should_be(
|\n| &&
|write: `Hello world`.\n| &&
|write: `Hello 123`.\n| &&
|\n| ).
ENDMETHOD.
METHOD single_update.
given_diff( iv_patch_flag = ' '
iv_new_num = ' 1'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 1'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' 2'
iv_new = 'write: `Hello world`.'
iv_result = 'U'
iv_old_num = ' 2'
iv_old = 'write: `Test`.' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 3'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 3'
iv_old = ' ' ).
when_patch_is_calculated( ).
then_patch_should_be(
|\n| &&
|write: `Hello world`.\n| &&
|\n| ).
ENDMETHOD.
METHOD multiple_adjacend_update.
given_diff( iv_patch_flag = ' '
iv_new_num = ' 1'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 1'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' 2'
iv_new = 'write: `Hello world`.'
iv_result = 'U'
iv_old_num = ' 2'
iv_old = 'write: `Test`.' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' 3'
iv_new = 'write: `Test`.'
iv_result = 'U'
iv_old_num = ' 3'
iv_old = 'write: `Hello world`.' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 4'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 4'
iv_old = ' ' ).
when_patch_is_calculated( ).
then_patch_should_be(
|\n| &&
|write: `Hello world`.\n| &&
|write: `Test`.\n| &&
|\n| ).
ENDMETHOD.
METHOD multiple_non_adjacent_update.
given_diff( iv_patch_flag = ' '
iv_new_num = ' 1'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 1'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' 2'
iv_new = 'write: `Hello world`.'
iv_result = 'U'
iv_old_num = ' 2'
iv_old = 'write: `Test`.' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 3'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 3'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' 4'
iv_new = 'write: `Test`.'
iv_result = 'U'
iv_old_num = ' 4'
iv_old = 'write: `Hello world`.' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 5'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 5'
iv_old = ' ' ).
when_patch_is_calculated( ).
then_patch_should_be(
|\n| &&
|write: `Hello world`.\n| &&
|\n| &&
|write: `Test`.\n| &&
|\n| ).
ENDMETHOD.
METHOD multiple_partial_update.
given_diff( iv_patch_flag = ' '
iv_new_num = ' 1'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 1'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' 2'
iv_new = 'write: `Hello world`.'
iv_result = 'U'
iv_old_num = ' 2'
iv_old = 'write: `Test`.' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 3'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 3'
iv_old = ' ' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 4'
iv_new = 'write: `Test`.'
iv_result = 'U'
iv_old_num = ' 4'
iv_old = 'write: `Hello world`.' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 5'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 5'
iv_old = ' ' ).
when_patch_is_calculated( ).
then_patch_should_be(
|\n| &&
|write: `Hello world`.\n| &&
|\n| &&
|write: `Hello world`.\n| &&
|\n| ).
ENDMETHOD.
METHOD mixed.
given_diff( iv_patch_flag = ' '
iv_new_num = ' 1'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 1'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' 2'
iv_new = 'write: `Hello world`.'
iv_result = 'U'
iv_old_num = ' 2'
iv_old = 'write: `Test`.' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 3'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 3'
iv_old = ' ' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 4'
iv_new = 'write: `Test`.'
iv_result = 'U'
iv_old_num = ' 4'
iv_old = 'write: `Hello world`.' ).
given_diff( iv_patch_flag = ' '
iv_new_num = ' 5'
iv_new = ' '
iv_result = ' '
iv_old_num = ' 5'
iv_old = ' ' ).
given_diff( iv_patch_flag = 'X'
iv_new_num = ' 6'
iv_new = 'write: `newline`.'
iv_result = 'I'
iv_old_num = ' '
iv_old = ' ' ).
when_patch_is_calculated( ).
then_patch_should_be(
|\n| &&
|write: `Hello world`.\n| &&
|\n| &&
|write: `Hello world`.\n| &&
|\n| &&
|write: `newline`.\n| ).
ENDMETHOD.
METHOD unknown_result_type.
given_diff( iv_patch_flag = ' '
iv_new_num = ' 1'
iv_new = ' '
iv_result = 'X'
iv_old_num = ' 1'
iv_old = ' ' ).
when_patch_is_calculated( ).
then_exception_is_raised( ).
ENDMETHOD.
METHOD given_diff.
DATA: ls_diff LIKE LINE OF mt_diff.
ls_diff-patch_flag = iv_patch_flag.
ls_diff-new_num = iv_new_num.
ls_diff-new = iv_new.
ls_diff-result = iv_result.
ls_diff-old_num = iv_old_num.
ls_diff-old = iv_old.
ls_diff-short = iv_short.
ls_diff-beacon = iv_beacon.
INSERT ls_diff INTO TABLE mt_diff.
ENDMETHOD.
METHOD when_patch_is_calculated.
DATA: lo_git_add_patch TYPE REF TO zcl_abapgit_git_add_patch.
CREATE OBJECT lo_git_add_patch
EXPORTING
it_diff = mt_diff.
TRY.
mt_patch = lo_git_add_patch->get_patch( ).
CATCH zcx_abapgit_exception INTO mx_error ##NO_HANDLER.
ENDTRY.
ENDMETHOD.
METHOD then_patch_should_be.
DATA: lt_patch TYPE STANDARD TABLE OF string WITH DEFAULT KEY,
lv_patch LIKE LINE OF lt_patch.
FIELD-SYMBOLS: <lv_patch> LIKE LINE OF mt_patch.
SPLIT iv_exp_patch AT |\n| INTO TABLE lt_patch IN CHARACTER MODE.
LOOP AT lt_patch INTO lv_patch.
READ TABLE mt_patch INDEX sy-tabix ASSIGNING <lv_patch>.
cl_abap_unit_assert=>assert_subrc( ).
cl_abap_unit_assert=>assert_equals(
exp = lv_patch
act = <lv_patch> ).
ENDLOOP.
ENDMETHOD.
METHOD then_exception_is_raised.
cl_abap_unit_assert=>assert_equals(
exp = |Unknown result|
act = mx_error->get_text( ) ).
ENDMETHOD.
ENDCLASS.
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
534,
9564,
2969,
4326,
1332,
6097,
198,
198,
31631,
300,
83,
565,
62,
9948,
3129,
378,
62,
17147,
5550,
20032,
17941,
25261,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
2060,
62,
28463,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
3294,
62,
41255,
12643,
62,
28463,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
3294,
62,
13159,
62,
41255,
12643,
62,
28463,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
3294,
62,
47172,
62,
28463,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
628,
220,
220,
220,
220,
220,
2060,
62,
33678,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
3294,
62,
324,
30482,
437,
62,
33678,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
3294,
62,
13159,
62,
41255,
12643,
62,
33678,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
3294,
62,
47172,
62,
33678,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
628,
220,
220,
220,
220,
220,
2060,
62,
19119,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
3294,
62,
324,
30482,
437,
62,
19119,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
3294,
62,
13159,
62,
41255,
12643,
62,
19119,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
3294,
62,
47172,
62,
19119,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
628,
220,
220,
220,
220,
220,
7668,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
628,
220,
220,
220,
220,
220,
6439,
62,
20274,
62,
4906,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
1813,
62,
26069,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
17147,
62,
32109,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
26069,
12,
17147,
62,
32109,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3605,
62,
22510,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
26069,
12,
3605,
62,
22510,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3605,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
26069,
12,
3605,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
20274,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
26069,
12,
20274,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
727,
62,
22510,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
26069,
12,
727,
62,
22510,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
727,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
26069,
12,
727,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
19509,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
26069,
12,
19509,
5550,
38865,
705,
55,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
1350,
7807,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
26069,
12,
1350,
7807,
5550,
38865,
352,
11,
628,
220,
220,
220,
220,
220,
618,
62,
17147,
62,
271,
62,
9948,
49262,
11,
628,
220,
220,
220,
220,
220,
788,
62,
17147,
62,
21754,
62,
1350,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
11201,
62,
17147,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
788,
62,
1069,
4516,
62,
271,
62,
49309,
13,
628,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
45079,
62,
26069,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
67,
10203,
62,
926,
11,
198,
220,
220,
220,
220,
220,
45079,
62,
17147,
41876,
4731,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
285,
87,
62,
18224,
41876,
4526,
37,
5390,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
198,
10619,
31631,
13,
628,
198,
31631,
300,
83,
565,
62,
9948,
3129,
378,
62,
17147,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
2060,
62,
28463,
13,
628,
220,
220,
220,
1813,
62,
26069,
7,
21628,
62,
17147,
62,
32109,
796,
705,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3605,
62,
22510,
220,
220,
220,
796,
705,
220,
220,
220,
352,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3605,
220,
220,
220,
220,
220,
220,
220,
796,
705,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
20274,
220,
220,
220,
220,
796,
705,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
727,
62,
22510,
220,
220,
220,
796,
705,
220,
220,
220,
352,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_excel_writer_2007 DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
*"* public components of class ZCL_EXCEL_WRITER_2007
*"* do not include other source files here!!!
INTERFACES zif_excel_writer .
METHODS constructor.
PROTECTED SECTION.
*"* protected components of class ZCL_EXCEL_WRITER_2007
*"* do not include other source files here!!!
TYPES: BEGIN OF mty_column_formula_used,
id TYPE zexcel_s_cell_data-column_formula_id,
si TYPE string,
"! type: shared, etc.
t TYPE string,
END OF mty_column_formula_used,
mty_column_formulas_used TYPE HASHED TABLE OF mty_column_formula_used WITH UNIQUE KEY id.
CONSTANTS c_content_types TYPE string VALUE '[Content_Types].xml'. "#EC NOTEXT
CONSTANTS c_docprops_app TYPE string VALUE 'docProps/app.xml'. "#EC NOTEXT
CONSTANTS c_docprops_core TYPE string VALUE 'docProps/core.xml'. "#EC NOTEXT
CONSTANTS c_relationships TYPE string VALUE '_rels/.rels'. "#EC NOTEXT
CONSTANTS c_xl_calcchain TYPE string VALUE 'xl/calcChain.xml'. "#EC NOTEXT
CONSTANTS c_xl_drawings TYPE string VALUE 'xl/drawings/drawing#.xml'. "#EC NOTEXT
CONSTANTS c_xl_drawings_rels TYPE string VALUE 'xl/drawings/_rels/drawing#.xml.rels'. "#EC NOTEXT
CONSTANTS c_xl_relationships TYPE string VALUE 'xl/_rels/workbook.xml.rels'. "#EC NOTEXT
CONSTANTS c_xl_sharedstrings TYPE string VALUE 'xl/sharedStrings.xml'. "#EC NOTEXT
CONSTANTS c_xl_sheet TYPE string VALUE 'xl/worksheets/sheet#.xml'. "#EC NOTEXT
CONSTANTS c_xl_sheet_rels TYPE string VALUE 'xl/worksheets/_rels/sheet#.xml.rels'. "#EC NOTEXT
CONSTANTS c_xl_styles TYPE string VALUE 'xl/styles.xml'. "#EC NOTEXT
CONSTANTS c_xl_theme TYPE string VALUE 'xl/theme/theme1.xml'. "#EC NOTEXT
CONSTANTS c_xl_workbook TYPE string VALUE 'xl/workbook.xml'. "#EC NOTEXT
DATA excel TYPE REF TO zcl_excel .
DATA shared_strings TYPE zexcel_t_shared_string .
DATA styles_cond_mapping TYPE zexcel_t_styles_cond_mapping .
DATA styles_mapping TYPE zexcel_t_styles_mapping .
CONSTANTS c_xl_comments TYPE string VALUE 'xl/comments#.xml'. "#EC NOTEXT
CONSTANTS cl_xl_drawing_for_comments TYPE string VALUE 'xl/drawings/vmlDrawing#.vml'. "#EC NOTEXT
CONSTANTS c_xl_drawings_vml_rels TYPE string VALUE 'xl/drawings/_rels/vmlDrawing#.vml.rels'. "#EC NOTEXT
DATA ixml TYPE REF TO if_ixml.
METHODS create_xl_sheet_sheet_data
IMPORTING
!io_document TYPE REF TO if_ixml_document
!io_worksheet TYPE REF TO zcl_excel_worksheet
RETURNING
VALUE(rv_ixml_sheet_data_root) TYPE REF TO if_ixml_element
RAISING
zcx_excel .
METHODS add_further_data_to_zip
IMPORTING
!io_zip TYPE REF TO cl_abap_zip .
METHODS create
RETURNING
VALUE(ep_excel) TYPE xstring
RAISING
zcx_excel .
METHODS create_content_types
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS create_docprops_app
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS create_docprops_core
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS create_dxf_style
IMPORTING
!iv_cell_style TYPE zexcel_cell_style
!io_dxf_element TYPE REF TO if_ixml_element
!io_ixml_document TYPE REF TO if_ixml_document
!it_cellxfs TYPE zexcel_t_cellxfs
!it_fonts TYPE zexcel_t_style_font
!it_fills TYPE zexcel_t_style_fill
CHANGING
!cv_dfx_count TYPE i .
METHODS create_relationships
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS create_xl_charts
IMPORTING
!io_drawing TYPE REF TO zcl_excel_drawing
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS create_xl_comments
IMPORTING
!io_worksheet TYPE REF TO zcl_excel_worksheet
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS create_xl_drawings
IMPORTING
!io_worksheet TYPE REF TO zcl_excel_worksheet
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS create_xl_drawings_rels
IMPORTING
!io_worksheet TYPE REF TO zcl_excel_worksheet
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS create_xl_drawing_anchor
IMPORTING
!io_drawing TYPE REF TO zcl_excel_drawing
!io_document TYPE REF TO if_ixml_document
!ip_index TYPE i
RETURNING
VALUE(ep_anchor) TYPE REF TO if_ixml_element .
METHODS create_xl_drawing_for_comments
IMPORTING
!io_worksheet TYPE REF TO zcl_excel_worksheet
RETURNING
VALUE(ep_content) TYPE xstring
RAISING
zcx_excel .
METHODS create_xl_relationships
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS create_xl_sharedstrings
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS create_xl_sheet
IMPORTING
!io_worksheet TYPE REF TO zcl_excel_worksheet
!iv_active TYPE flag DEFAULT ''
RETURNING
VALUE(ep_content) TYPE xstring
RAISING
zcx_excel .
METHODS create_xl_sheet_ignored_errors
IMPORTING
io_worksheet TYPE REF TO zcl_excel_worksheet
io_document TYPE REF TO if_ixml_document
io_element_root TYPE REF TO if_ixml_element.
METHODS create_xl_sheet_pagebreaks
IMPORTING
!io_document TYPE REF TO if_ixml_document
!io_parent TYPE REF TO if_ixml_element
!io_worksheet TYPE REF TO zcl_excel_worksheet
RAISING
zcx_excel .
METHODS create_xl_sheet_rels
IMPORTING
!io_worksheet TYPE REF TO zcl_excel_worksheet
!iv_drawing_index TYPE i
!iv_comment_index TYPE i
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS create_xl_styles
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS create_xl_styles_color_node
IMPORTING
!io_document TYPE REF TO if_ixml_document
!io_parent TYPE REF TO if_ixml_element
!iv_color_elem_name TYPE string DEFAULT 'color'
!is_color TYPE zexcel_s_style_color .
METHODS create_xl_styles_font_node
IMPORTING
!io_document TYPE REF TO if_ixml_document
!io_parent TYPE REF TO if_ixml_element
!is_font TYPE zexcel_s_style_font
!iv_use_rtf TYPE abap_bool DEFAULT abap_false .
METHODS create_xl_table
IMPORTING
!io_table TYPE REF TO zcl_excel_table
RETURNING
VALUE(ep_content) TYPE xstring
RAISING
zcx_excel .
METHODS create_xl_theme
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS create_xl_workbook
RETURNING
VALUE(ep_content) TYPE xstring
RAISING
zcx_excel .
METHODS get_shared_string_index
IMPORTING
!ip_cell_value TYPE zexcel_cell_value
!it_rtf TYPE zexcel_t_rtf OPTIONAL
RETURNING
VALUE(ep_index) TYPE int4 .
METHODS create_xl_drawings_vml
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS set_vml_string
RETURNING
VALUE(ep_content) TYPE string .
METHODS create_xl_drawings_vml_rels
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS set_vml_shape_footer
IMPORTING
!is_footer TYPE zexcel_s_worksheet_head_foot
RETURNING
VALUE(ep_content) TYPE string .
METHODS set_vml_shape_header
IMPORTING
!is_header TYPE zexcel_s_worksheet_head_foot
RETURNING
VALUE(ep_content) TYPE string .
METHODS create_xl_drawing_for_hdft_im
IMPORTING
!io_worksheet TYPE REF TO zcl_excel_worksheet
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS create_xl_drawings_hdft_rels
IMPORTING
!io_worksheet TYPE REF TO zcl_excel_worksheet
RETURNING
VALUE(ep_content) TYPE xstring .
METHODS create_xml_document
RETURNING
VALUE(ro_document) TYPE REF TO if_ixml_document.
METHODS render_xml_document
IMPORTING
io_document TYPE REF TO if_ixml_document
RETURNING
VALUE(ep_content) TYPE xstring.
METHODS create_xl_sheet_column_formula
IMPORTING
io_document TYPE REF TO if_ixml_document
it_column_formulas TYPE zcl_excel_worksheet=>mty_th_column_formula
is_sheet_content TYPE zexcel_s_cell_data
EXPORTING
eo_element TYPE REF TO if_ixml_element
CHANGING
ct_column_formulas_used TYPE mty_column_formulas_used
cv_si TYPE i
RAISING
zcx_excel.
METHODS is_formula_shareable
IMPORTING
ip_formula TYPE string
RETURNING
VALUE(ep_shareable) TYPE abap_bool
RAISING
zcx_excel.
PRIVATE SECTION.
*"* private components of class ZCL_EXCEL_WRITER_2007
*"* do not include other source files here!!!
CONSTANTS c_off TYPE string VALUE '0'. "#EC NOTEXT
CONSTANTS c_on TYPE string VALUE '1'. "#EC NOTEXT
CONSTANTS c_xl_printersettings TYPE string VALUE 'xl/printerSettings/printerSettings#.bin'. "#EC NOTEXT
TYPES: tv_charbool TYPE c LENGTH 5.
METHODS add_1_val_child_node
IMPORTING
io_document TYPE REF TO if_ixml_document
io_parent TYPE REF TO if_ixml_element
iv_elem_name TYPE string
iv_attr_name TYPE string
iv_attr_value TYPE string.
METHODS flag2bool
IMPORTING
!ip_flag TYPE flag
RETURNING
VALUE(ep_boolean) TYPE tv_charbool .
ENDCLASS.
CLASS zcl_excel_writer_2007 IMPLEMENTATION.
METHOD constructor.
me->ixml = cl_ixml=>create( ).
ENDMETHOD.
METHOD add_1_val_child_node.
DATA: lo_child TYPE REF TO if_ixml_element.
lo_child = io_document->create_simple_element( name = iv_elem_name
parent = io_document ).
IF iv_attr_name IS NOT INITIAL.
lo_child->set_attribute_ns( name = iv_attr_name
value = iv_attr_value ).
ENDIF.
io_parent->append_child( new_child = lo_child ).
ENDMETHOD.
METHOD add_further_data_to_zip.
* Can be used by child classes like xlsm-writer to write additional data to zip archive
ENDMETHOD.
METHOD create.
* Office 2007 file format is a cab of several xml files with extension .xlsx
DATA: lo_zip TYPE REF TO cl_abap_zip,
lo_worksheet TYPE REF TO zcl_excel_worksheet,
lo_active_worksheet TYPE REF TO zcl_excel_worksheet,
lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_nested_iterator TYPE REF TO cl_object_collection_iterator,
lo_table TYPE REF TO zcl_excel_table,
lo_drawing TYPE REF TO zcl_excel_drawing,
lo_drawings TYPE REF TO zcl_excel_drawings,
lo_comment TYPE REF TO zcl_excel_comment, " (+) Issue #180
lo_comments TYPE REF TO zcl_excel_comments. " (+) Issue #180
DATA: lv_content TYPE xstring,
lv_active TYPE flag,
lv_xl_sheet TYPE string,
lv_xl_sheet_rels TYPE string,
lv_xl_drawing_for_comment TYPE string, " (+) Issue #180
lv_xl_comment TYPE string, " (+) Issue #180
lv_xl_drawing TYPE string,
lv_xl_drawing_rels TYPE string,
lv_index_str TYPE string,
lv_value TYPE string,
lv_sheet_index TYPE i,
lv_drawing_index TYPE i,
lv_comment_index TYPE i. " (+) Issue #180
**********************************************************************
**********************************************************************
* Start of insertion # issue 139 - Dateretention of cellstyles
me->excel->add_static_styles( ).
* End of insertion # issue 139 - Dateretention of cellstyles
**********************************************************************
* STEP 1: Create archive object file (ZIP)
CREATE OBJECT lo_zip.
**********************************************************************
* STEP 2: Add [Content_Types].xml to zip
lv_content = me->create_content_types( ).
lo_zip->add( name = me->c_content_types
content = lv_content ).
**********************************************************************
* STEP 3: Add _rels/.rels to zip
lv_content = me->create_relationships( ).
lo_zip->add( name = me->c_relationships
content = lv_content ).
**********************************************************************
* STEP 4: Add docProps/app.xml to zip
lv_content = me->create_docprops_app( ).
lo_zip->add( name = me->c_docprops_app
content = lv_content ).
**********************************************************************
* STEP 5: Add docProps/core.xml to zip
lv_content = me->create_docprops_core( ).
lo_zip->add( name = me->c_docprops_core
content = lv_content ).
**********************************************************************
* STEP 6: Add xl/_rels/workbook.xml.rels to zip
lv_content = me->create_xl_relationships( ).
lo_zip->add( name = me->c_xl_relationships
content = lv_content ).
**********************************************************************
* STEP 6: Add xl/_rels/workbook.xml.rels to zip
lv_content = me->create_xl_theme( ).
lo_zip->add( name = me->c_xl_theme
content = lv_content ).
**********************************************************************
* STEP 7: Add xl/workbook.xml to zip
lv_content = me->create_xl_workbook( ).
lo_zip->add( name = me->c_xl_workbook
content = lv_content ).
**********************************************************************
* STEP 8: Add xl/workbook.xml to zip
* lv_content = me->create_xl_styles_static( ).
lv_content = me->create_xl_styles( ).
lo_zip->add( name = me->c_xl_styles
content = lv_content ).
**********************************************************************
* STEP 9: Add sharedStrings.xml to zip
lv_content = me->create_xl_sharedstrings( ).
lo_zip->add( name = me->c_xl_sharedstrings
content = lv_content ).
**********************************************************************
* STEP 10: Add sheet#.xml and drawing#.xml to zip
lo_iterator = me->excel->get_worksheets_iterator( ).
lo_active_worksheet = me->excel->get_active_worksheet( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lv_sheet_index = sy-index.
lo_worksheet ?= lo_iterator->get_next( ).
IF lo_active_worksheet->get_guid( ) EQ lo_worksheet->get_guid( ).
lv_active = abap_true.
ELSE.
lv_active = abap_false.
ENDIF.
lv_content = me->create_xl_sheet( io_worksheet = lo_worksheet
iv_active = lv_active ).
lv_xl_sheet = me->c_xl_sheet.
lv_index_str = lv_sheet_index.
CONDENSE lv_index_str NO-GAPS.
REPLACE ALL OCCURRENCES OF '#' IN lv_xl_sheet WITH lv_index_str.
lo_zip->add( name = lv_xl_sheet
content = lv_content ).
* Begin - Add - Issue #180
* Add comments **********************************
lo_comments = lo_worksheet->get_comments( ).
IF lo_comments->is_empty( ) = abap_false.
lv_comment_index = lv_comment_index + 1.
" Create comment itself
lv_content = me->create_xl_comments( lo_worksheet ).
lv_xl_comment = me->c_xl_comments.
lv_index_str = lv_comment_index.
CONDENSE lv_index_str NO-GAPS.
REPLACE ALL OCCURRENCES OF '#' IN lv_xl_comment WITH lv_index_str.
lo_zip->add( name = lv_xl_comment
content = lv_content ).
" Create vmlDrawing that will host the comment
lv_content = me->create_xl_drawing_for_comments( lo_worksheet ).
lv_xl_drawing_for_comment = me->cl_xl_drawing_for_comments.
REPLACE ALL OCCURRENCES OF '#' IN lv_xl_drawing_for_comment WITH lv_index_str.
lo_zip->add( name = lv_xl_drawing_for_comment
content = lv_content ).
ENDIF.
* End - Add - Issue #180
* Add drawings **********************************
lo_drawings = lo_worksheet->get_drawings( ).
IF lo_drawings->is_empty( ) = abap_false.
lv_drawing_index = lv_drawing_index + 1.
lv_content = me->create_xl_drawings( lo_worksheet ).
lv_xl_drawing = me->c_xl_drawings.
lv_index_str = lv_drawing_index.
CONDENSE lv_index_str NO-GAPS.
REPLACE ALL OCCURRENCES OF '#' IN lv_xl_drawing WITH lv_index_str.
lo_zip->add( name = lv_xl_drawing
content = lv_content ).
lv_content = me->create_xl_drawings_rels( lo_worksheet ).
lv_xl_drawing_rels = me->c_xl_drawings_rels.
REPLACE ALL OCCURRENCES OF '#' IN lv_xl_drawing_rels WITH lv_index_str.
lo_zip->add( name = lv_xl_drawing_rels
content = lv_content ).
ENDIF.
* Add Header/Footer image
DATA: lt_drawings TYPE zexcel_t_drawings.
lt_drawings = lo_worksheet->get_header_footer_drawings( ).
IF lines( lt_drawings ) > 0. "Header or footer image exist
lv_comment_index = lv_comment_index + 1.
lv_index_str = lv_comment_index.
CONDENSE lv_index_str NO-GAPS.
" Create vmlDrawing that will host the image
lv_content = me->create_xl_drawing_for_hdft_im( lo_worksheet ).
lv_xl_drawing_for_comment = me->cl_xl_drawing_for_comments.
REPLACE ALL OCCURRENCES OF '#' IN lv_xl_drawing_for_comment WITH lv_index_str.
lo_zip->add( name = lv_xl_drawing_for_comment
content = lv_content ).
" Create vmlDrawing REL that will host the image
lv_content = me->create_xl_drawings_hdft_rels( lo_worksheet ).
lv_xl_drawing_rels = me->c_xl_drawings_vml_rels.
REPLACE ALL OCCURRENCES OF '#' IN lv_xl_drawing_rels WITH lv_index_str.
lo_zip->add( name = lv_xl_drawing_rels
content = lv_content ).
ENDIF.
lv_xl_sheet_rels = me->c_xl_sheet_rels.
lv_content = me->create_xl_sheet_rels( io_worksheet = lo_worksheet
iv_drawing_index = lv_drawing_index
iv_comment_index = lv_comment_index ). " (+) Issue #180
lv_index_str = lv_sheet_index.
CONDENSE lv_index_str NO-GAPS.
REPLACE ALL OCCURRENCES OF '#' IN lv_xl_sheet_rels WITH lv_index_str.
lo_zip->add( name = lv_xl_sheet_rels
content = lv_content ).
lo_nested_iterator = lo_worksheet->get_tables_iterator( ).
WHILE lo_nested_iterator->has_next( ) EQ abap_true.
lo_table ?= lo_nested_iterator->get_next( ).
lv_content = me->create_xl_table( lo_table ).
lv_value = lo_table->get_name( ).
CONCATENATE 'xl/tables/' lv_value '.xml' INTO lv_value.
lo_zip->add( name = lv_value
content = lv_content ).
ENDWHILE.
ENDWHILE.
**********************************************************************
* STEP 11: Add media
lo_iterator = me->excel->get_drawings_iterator( zcl_excel_drawing=>type_image ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_drawing ?= lo_iterator->get_next( ).
* IF lo_drawing->get_type( ) NE zcl_excel_drawing=>type_image_header_footer.
lv_content = lo_drawing->get_media( ).
lv_value = lo_drawing->get_media_name( ).
CONCATENATE 'xl/media/' lv_value INTO lv_value.
lo_zip->add( name = lv_value
content = lv_content ).
* ENDIF.
ENDWHILE.
**********************************************************************
* STEP 12: Add charts
lo_iterator = me->excel->get_drawings_iterator( zcl_excel_drawing=>type_chart ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_drawing ?= lo_iterator->get_next( ).
lv_content = lo_drawing->get_media( ).
"-------------Added by Alessandro Iannacci - Only if template exist
IF lv_content IS NOT INITIAL AND me->excel->use_template EQ abap_true.
lv_value = lo_drawing->get_media_name( ).
CONCATENATE 'xl/charts/' lv_value INTO lv_value.
lo_zip->add( name = lv_value
content = lv_content ).
ELSE. "ADD CUSTOM CHART!!!!
lv_content = me->create_xl_charts( lo_drawing ).
lv_value = lo_drawing->get_media_name( ).
CONCATENATE 'xl/charts/' lv_value INTO lv_value.
lo_zip->add( name = lv_value
content = lv_content ).
ENDIF.
"-------------------------------------------------
ENDWHILE.
* Second to last step: Allow further information put into the zip archive by child classes
me->add_further_data_to_zip( lo_zip ).
**********************************************************************
* Last step: Create the final zip
ep_excel = lo_zip->save( ).
ENDMETHOD.
METHOD create_content_types.
** Constant node name
DATA: lc_xml_node_types TYPE string VALUE 'Types',
lc_xml_node_override TYPE string VALUE 'Override',
lc_xml_node_default TYPE string VALUE 'Default',
" Node attributes
lc_xml_attr_partname TYPE string VALUE 'PartName',
lc_xml_attr_extension TYPE string VALUE 'Extension',
lc_xml_attr_contenttype TYPE string VALUE 'ContentType',
" Node namespace
lc_xml_node_types_ns TYPE string VALUE 'http://schemas.openxmlformats.org/package/2006/content-types',
" Node extension
lc_xml_node_rels_ext TYPE string VALUE 'rels',
lc_xml_node_xml_ext TYPE string VALUE 'xml',
lc_xml_node_xml_vml TYPE string VALUE 'vml', " (+) GGAR
" Node partnumber
lc_xml_node_theme_pn TYPE string VALUE '/xl/theme/theme1.xml',
lc_xml_node_styles_pn TYPE string VALUE '/xl/styles.xml',
lc_xml_node_workb_pn TYPE string VALUE '/xl/workbook.xml',
lc_xml_node_props_pn TYPE string VALUE '/docProps/app.xml',
lc_xml_node_worksheet_pn TYPE string VALUE '/xl/worksheets/sheet#.xml',
lc_xml_node_strings_pn TYPE string VALUE '/xl/sharedStrings.xml',
lc_xml_node_core_pn TYPE string VALUE '/docProps/core.xml',
lc_xml_node_chart_pn TYPE string VALUE '/xl/charts/chart#.xml',
" Node contentType
lc_xml_node_theme_ct TYPE string VALUE 'application/vnd.openxmlformats-officedocument.theme+xml',
lc_xml_node_styles_ct TYPE string VALUE 'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml',
lc_xml_node_workb_ct TYPE string VALUE 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml',
lc_xml_node_rels_ct TYPE string VALUE 'application/vnd.openxmlformats-package.relationships+xml',
lc_xml_node_vml_ct TYPE string VALUE 'application/vnd.openxmlformats-officedocument.vmlDrawing',
lc_xml_node_xml_ct TYPE string VALUE 'application/xml',
lc_xml_node_props_ct TYPE string VALUE 'application/vnd.openxmlformats-officedocument.extended-properties+xml',
lc_xml_node_worksheet_ct TYPE string VALUE 'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml',
lc_xml_node_strings_ct TYPE string VALUE 'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml',
lc_xml_node_core_ct TYPE string VALUE 'application/vnd.openxmlformats-package.core-properties+xml',
lc_xml_node_table_ct TYPE string VALUE 'application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml',
lc_xml_node_comments_ct TYPE string VALUE 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml', " (+) GGAR
lc_xml_node_drawings_ct TYPE string VALUE 'application/vnd.openxmlformats-officedocument.drawing+xml',
lc_xml_node_chart_ct TYPE string VALUE 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element TYPE REF TO if_ixml_element,
lo_worksheet TYPE REF TO zcl_excel_worksheet,
lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_nested_iterator TYPE REF TO cl_object_collection_iterator,
lo_table TYPE REF TO zcl_excel_table.
DATA: lv_worksheets_num TYPE i,
lv_worksheets_numc TYPE n LENGTH 3,
lv_xml_node_worksheet_pn TYPE string,
lv_value TYPE string,
lv_comment_index TYPE i VALUE 1, " (+) GGAR
lv_drawing_index TYPE i VALUE 1,
lv_index_str TYPE string.
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
**********************************************************************
* STEP 3: Create main node types
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_types
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns'
value = lc_xml_node_types_ns ).
**********************************************************************
* STEP 4: Create subnodes
" rels node
lo_element = lo_document->create_simple_element( name = lc_xml_node_default
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_extension
value = lc_xml_node_rels_ext ).
lo_element->set_attribute_ns( name = lc_xml_attr_contenttype
value = lc_xml_node_rels_ct ).
lo_element_root->append_child( new_child = lo_element ).
" extension node
lo_element = lo_document->create_simple_element( name = lc_xml_node_default
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_extension
value = lc_xml_node_xml_ext ).
lo_element->set_attribute_ns( name = lc_xml_attr_contenttype
value = lc_xml_node_xml_ct ).
lo_element_root->append_child( new_child = lo_element ).
* Begin - Add - GGAR
" VML node (for comments)
lo_element = lo_document->create_simple_element( name = lc_xml_node_default
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_extension
value = lc_xml_node_xml_vml ).
lo_element->set_attribute_ns( name = lc_xml_attr_contenttype
value = lc_xml_node_vml_ct ).
lo_element_root->append_child( new_child = lo_element ).
* End - Add - GGAR
" Theme node
lo_element = lo_document->create_simple_element( name = lc_xml_node_override
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_partname
value = lc_xml_node_theme_pn ).
lo_element->set_attribute_ns( name = lc_xml_attr_contenttype
value = lc_xml_node_theme_ct ).
lo_element_root->append_child( new_child = lo_element ).
" Styles node
lo_element = lo_document->create_simple_element( name = lc_xml_node_override
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_partname
value = lc_xml_node_styles_pn ).
lo_element->set_attribute_ns( name = lc_xml_attr_contenttype
value = lc_xml_node_styles_ct ).
lo_element_root->append_child( new_child = lo_element ).
" Workbook node
lo_element = lo_document->create_simple_element( name = lc_xml_node_override
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_partname
value = lc_xml_node_workb_pn ).
lo_element->set_attribute_ns( name = lc_xml_attr_contenttype
value = lc_xml_node_workb_ct ).
lo_element_root->append_child( new_child = lo_element ).
" Properties node
lo_element = lo_document->create_simple_element( name = lc_xml_node_override
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_partname
value = lc_xml_node_props_pn ).
lo_element->set_attribute_ns( name = lc_xml_attr_contenttype
value = lc_xml_node_props_ct ).
lo_element_root->append_child( new_child = lo_element ).
" Worksheet node
lv_worksheets_num = excel->get_worksheets_size( ).
DO lv_worksheets_num TIMES.
lo_element = lo_document->create_simple_element( name = lc_xml_node_override
parent = lo_document ).
MOVE sy-index TO lv_worksheets_numc.
SHIFT lv_worksheets_numc LEFT DELETING LEADING '0'.
lv_xml_node_worksheet_pn = lc_xml_node_worksheet_pn.
REPLACE ALL OCCURRENCES OF '#' IN lv_xml_node_worksheet_pn WITH lv_worksheets_numc.
lo_element->set_attribute_ns( name = lc_xml_attr_partname
value = lv_xml_node_worksheet_pn ).
lo_element->set_attribute_ns( name = lc_xml_attr_contenttype
value = lc_xml_node_worksheet_ct ).
lo_element_root->append_child( new_child = lo_element ).
ENDDO.
lo_iterator = me->excel->get_worksheets_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_worksheet ?= lo_iterator->get_next( ).
lo_nested_iterator = lo_worksheet->get_tables_iterator( ).
WHILE lo_nested_iterator->has_next( ) EQ abap_true.
lo_table ?= lo_nested_iterator->get_next( ).
lv_value = lo_table->get_name( ).
CONCATENATE '/xl/tables/' lv_value '.xml' INTO lv_value.
lo_element = lo_document->create_simple_element( name = lc_xml_node_override
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_partname
value = lv_value ).
lo_element->set_attribute_ns( name = lc_xml_attr_contenttype
value = lc_xml_node_table_ct ).
lo_element_root->append_child( new_child = lo_element ).
ENDWHILE.
* Begin - Add - GGAR
" Comments
DATA: lo_comments TYPE REF TO zcl_excel_comments.
lo_comments = lo_worksheet->get_comments( ).
IF lo_comments->is_empty( ) = abap_false.
lv_index_str = lv_comment_index.
CONDENSE lv_index_str NO-GAPS.
CONCATENATE '/' me->c_xl_comments INTO lv_value.
REPLACE '#' WITH lv_index_str INTO lv_value.
lo_element = lo_document->create_simple_element( name = lc_xml_node_override
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_partname
value = lv_value ).
lo_element->set_attribute_ns( name = lc_xml_attr_contenttype
value = lc_xml_node_comments_ct ).
lo_element_root->append_child( new_child = lo_element ).
ADD 1 TO lv_comment_index.
ENDIF.
* End - Add - GGAR
" Drawings
DATA: lo_drawings TYPE REF TO zcl_excel_drawings.
lo_drawings = lo_worksheet->get_drawings( ).
IF lo_drawings->is_empty( ) = abap_false.
lv_index_str = lv_drawing_index.
CONDENSE lv_index_str NO-GAPS.
CONCATENATE '/' me->c_xl_drawings INTO lv_value.
REPLACE '#' WITH lv_index_str INTO lv_value.
lo_element = lo_document->create_simple_element( name = lc_xml_node_override
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_partname
value = lv_value ).
lo_element->set_attribute_ns( name = lc_xml_attr_contenttype
value = lc_xml_node_drawings_ct ).
lo_element_root->append_child( new_child = lo_element ).
ADD 1 TO lv_drawing_index.
ENDIF.
ENDWHILE.
" media mimes
DATA: lo_drawing TYPE REF TO zcl_excel_drawing,
lt_media_type TYPE TABLE OF mimetypes-extension,
lv_media_type TYPE mimetypes-extension,
lv_mime_type TYPE mimetypes-type.
lo_iterator = me->excel->get_drawings_iterator( zcl_excel_drawing=>type_image ).
WHILE lo_iterator->has_next( ) = abap_true.
lo_drawing ?= lo_iterator->get_next( ).
lv_media_type = lo_drawing->get_media_type( ).
COLLECT lv_media_type INTO lt_media_type.
ENDWHILE.
LOOP AT lt_media_type INTO lv_media_type.
CALL FUNCTION 'SDOK_MIMETYPE_GET'
EXPORTING
extension = lv_media_type
IMPORTING
mimetype = lv_mime_type.
lo_element = lo_document->create_simple_element( name = lc_xml_node_default
parent = lo_document ).
lv_value = lv_media_type.
lo_element->set_attribute_ns( name = lc_xml_attr_extension
value = lv_value ).
lv_value = lv_mime_type.
lo_element->set_attribute_ns( name = lc_xml_attr_contenttype
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
ENDLOOP.
" Charts
lo_iterator = me->excel->get_drawings_iterator( zcl_excel_drawing=>type_chart ).
WHILE lo_iterator->has_next( ) = abap_true.
lo_drawing ?= lo_iterator->get_next( ).
lo_element = lo_document->create_simple_element( name = lc_xml_node_override
parent = lo_document ).
lv_index_str = lo_drawing->get_index( ).
CONDENSE lv_index_str.
lv_value = lc_xml_node_chart_pn.
REPLACE ALL OCCURRENCES OF '#' IN lv_value WITH lv_index_str.
lo_element->set_attribute_ns( name = lc_xml_attr_partname
value = lv_value ).
lo_element->set_attribute_ns( name = lc_xml_attr_contenttype
value = lc_xml_node_chart_ct ).
lo_element_root->append_child( new_child = lo_element ).
ENDWHILE.
" Strings node
lo_element = lo_document->create_simple_element( name = lc_xml_node_override
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_partname
value = lc_xml_node_strings_pn ).
lo_element->set_attribute_ns( name = lc_xml_attr_contenttype
value = lc_xml_node_strings_ct ).
lo_element_root->append_child( new_child = lo_element ).
" Strings node
lo_element = lo_document->create_simple_element( name = lc_xml_node_override
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_partname
value = lc_xml_node_core_pn ).
lo_element->set_attribute_ns( name = lc_xml_attr_contenttype
value = lc_xml_node_core_ct ).
lo_element_root->append_child( new_child = lo_element ).
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_docprops_app.
** Constant node name
DATA: lc_xml_node_properties TYPE string VALUE 'Properties',
lc_xml_node_application TYPE string VALUE 'Application',
lc_xml_node_docsecurity TYPE string VALUE 'DocSecurity',
lc_xml_node_scalecrop TYPE string VALUE 'ScaleCrop',
lc_xml_node_headingpairs TYPE string VALUE 'HeadingPairs',
lc_xml_node_vector TYPE string VALUE 'vector',
lc_xml_node_variant TYPE string VALUE 'variant',
lc_xml_node_lpstr TYPE string VALUE 'lpstr',
lc_xml_node_i4 TYPE string VALUE 'i4',
lc_xml_node_titlesofparts TYPE string VALUE 'TitlesOfParts',
lc_xml_node_company TYPE string VALUE 'Company',
lc_xml_node_linksuptodate TYPE string VALUE 'LinksUpToDate',
lc_xml_node_shareddoc TYPE string VALUE 'SharedDoc',
lc_xml_node_hyperlinkschanged TYPE string VALUE 'HyperlinksChanged',
lc_xml_node_appversion TYPE string VALUE 'AppVersion',
" Namespace prefix
lc_vt_ns TYPE string VALUE 'vt',
lc_xml_node_props_ns TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties',
lc_xml_node_props_vt_ns TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes',
" Node attributes
lc_xml_attr_size TYPE string VALUE 'size',
lc_xml_attr_basetype TYPE string VALUE 'baseType'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element TYPE REF TO if_ixml_element,
lo_sub_element_vector TYPE REF TO if_ixml_element,
lo_sub_element_variant TYPE REF TO if_ixml_element,
lo_sub_element_lpstr TYPE REF TO if_ixml_element,
lo_sub_element_i4 TYPE REF TO if_ixml_element,
lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_worksheet TYPE REF TO zcl_excel_worksheet.
DATA: lv_value TYPE string.
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
**********************************************************************
* STEP 3: Create main node properties
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_properties
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns'
value = lc_xml_node_props_ns ).
lo_element_root->set_attribute_ns( name = 'xmlns:vt'
value = lc_xml_node_props_vt_ns ).
**********************************************************************
* STEP 4: Create subnodes
" Application
lo_element = lo_document->create_simple_element( name = lc_xml_node_application
parent = lo_document ).
lv_value = excel->zif_excel_book_properties~application.
lo_element->set_value( value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
" DocSecurity
lo_element = lo_document->create_simple_element( name = lc_xml_node_docsecurity
parent = lo_document ).
lv_value = excel->zif_excel_book_properties~docsecurity.
lo_element->set_value( value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
" ScaleCrop
lo_element = lo_document->create_simple_element( name = lc_xml_node_scalecrop
parent = lo_document ).
lv_value = me->flag2bool( excel->zif_excel_book_properties~scalecrop ).
lo_element->set_value( value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
" HeadingPairs
lo_element = lo_document->create_simple_element( name = lc_xml_node_headingpairs
parent = lo_document ).
" * vector node
lo_sub_element_vector = lo_document->create_simple_element_ns( name = lc_xml_node_vector
prefix = lc_vt_ns
parent = lo_document ).
lo_sub_element_vector->set_attribute_ns( name = lc_xml_attr_size
value = '2' ).
lo_sub_element_vector->set_attribute_ns( name = lc_xml_attr_basetype
value = lc_xml_node_variant ).
" ** variant node
lo_sub_element_variant = lo_document->create_simple_element_ns( name = lc_xml_node_variant
prefix = lc_vt_ns
parent = lo_document ).
" *** lpstr node
lo_sub_element_lpstr = lo_document->create_simple_element_ns( name = lc_xml_node_lpstr
prefix = lc_vt_ns
parent = lo_document ).
lv_value = excel->get_worksheets_name( ).
lo_sub_element_lpstr->set_value( value = lv_value ).
lo_sub_element_variant->append_child( new_child = lo_sub_element_lpstr ). " lpstr node
lo_sub_element_vector->append_child( new_child = lo_sub_element_variant ). " variant node
" ** variant node
lo_sub_element_variant = lo_document->create_simple_element_ns( name = lc_xml_node_variant
prefix = lc_vt_ns
parent = lo_document ).
" *** i4 node
lo_sub_element_i4 = lo_document->create_simple_element_ns( name = lc_xml_node_i4
prefix = lc_vt_ns
parent = lo_document ).
lv_value = excel->get_worksheets_size( ).
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_sub_element_i4->set_value( value = lv_value ).
lo_sub_element_variant->append_child( new_child = lo_sub_element_i4 ). " lpstr node
lo_sub_element_vector->append_child( new_child = lo_sub_element_variant ). " variant node
lo_element->append_child( new_child = lo_sub_element_vector ). " vector node
lo_element_root->append_child( new_child = lo_element ). " HeadingPairs
" TitlesOfParts
lo_element = lo_document->create_simple_element( name = lc_xml_node_titlesofparts
parent = lo_document ).
" * vector node
lo_sub_element_vector = lo_document->create_simple_element_ns( name = lc_xml_node_vector
prefix = lc_vt_ns
parent = lo_document ).
lv_value = excel->get_worksheets_size( ).
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_sub_element_vector->set_attribute_ns( name = lc_xml_attr_size
value = lv_value ).
lo_sub_element_vector->set_attribute_ns( name = lc_xml_attr_basetype
value = lc_xml_node_lpstr ).
lo_iterator = excel->get_worksheets_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
" ** lpstr node
lo_sub_element_lpstr = lo_document->create_simple_element_ns( name = lc_xml_node_lpstr
prefix = lc_vt_ns
parent = lo_document ).
lo_worksheet ?= lo_iterator->get_next( ).
lv_value = lo_worksheet->get_title( ).
lo_sub_element_lpstr->set_value( value = lv_value ).
lo_sub_element_vector->append_child( new_child = lo_sub_element_lpstr ). " lpstr node
ENDWHILE.
lo_element->append_child( new_child = lo_sub_element_vector ). " vector node
lo_element_root->append_child( new_child = lo_element ). " TitlesOfParts
" Company
IF excel->zif_excel_book_properties~company IS NOT INITIAL.
lo_element = lo_document->create_simple_element( name = lc_xml_node_company
parent = lo_document ).
lv_value = excel->zif_excel_book_properties~company.
lo_element->set_value( value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
ENDIF.
" LinksUpToDate
lo_element = lo_document->create_simple_element( name = lc_xml_node_linksuptodate
parent = lo_document ).
lv_value = me->flag2bool( excel->zif_excel_book_properties~linksuptodate ).
lo_element->set_value( value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
" SharedDoc
lo_element = lo_document->create_simple_element( name = lc_xml_node_shareddoc
parent = lo_document ).
lv_value = me->flag2bool( excel->zif_excel_book_properties~shareddoc ).
lo_element->set_value( value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
" HyperlinksChanged
lo_element = lo_document->create_simple_element( name = lc_xml_node_hyperlinkschanged
parent = lo_document ).
lv_value = me->flag2bool( excel->zif_excel_book_properties~hyperlinkschanged ).
lo_element->set_value( value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
" AppVersion
lo_element = lo_document->create_simple_element( name = lc_xml_node_appversion
parent = lo_document ).
lv_value = excel->zif_excel_book_properties~appversion.
lo_element->set_value( value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_docprops_core.
** Constant node name
DATA: lc_xml_node_coreproperties TYPE string VALUE 'coreProperties',
lc_xml_node_creator TYPE string VALUE 'creator',
lc_xml_node_description TYPE string VALUE 'description',
lc_xml_node_lastmodifiedby TYPE string VALUE 'lastModifiedBy',
lc_xml_node_created TYPE string VALUE 'created',
lc_xml_node_modified TYPE string VALUE 'modified',
" Node attributes
lc_xml_attr_type TYPE string VALUE 'type',
lc_xml_attr_target TYPE string VALUE 'dcterms:W3CDTF',
" Node namespace
lc_cp_ns TYPE string VALUE 'cp',
lc_dc_ns TYPE string VALUE 'dc',
lc_dcterms_ns TYPE string VALUE 'dcterms',
* lc_dcmitype_ns TYPE string VALUE 'dcmitype',
lc_xsi_ns TYPE string VALUE 'xsi',
lc_xml_node_cp_ns TYPE string VALUE 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties',
lc_xml_node_dc_ns TYPE string VALUE 'http://purl.org/dc/elements/1.1/',
lc_xml_node_dcterms_ns TYPE string VALUE 'http://purl.org/dc/terms/',
lc_xml_node_dcmitype_ns TYPE string VALUE 'http://purl.org/dc/dcmitype/',
lc_xml_node_xsi_ns TYPE string VALUE 'http://www.w3.org/2001/XMLSchema-instance'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element TYPE REF TO if_ixml_element.
DATA: lv_value TYPE string,
lv_date TYPE d,
lv_time TYPE t.
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
**********************************************************************
* STEP 3: Create main node coreProperties
lo_element_root = lo_document->create_simple_element_ns( name = lc_xml_node_coreproperties
prefix = lc_cp_ns
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns:cp'
value = lc_xml_node_cp_ns ).
lo_element_root->set_attribute_ns( name = 'xmlns:dc'
value = lc_xml_node_dc_ns ).
lo_element_root->set_attribute_ns( name = 'xmlns:dcterms'
value = lc_xml_node_dcterms_ns ).
lo_element_root->set_attribute_ns( name = 'xmlns:dcmitype'
value = lc_xml_node_dcmitype_ns ).
lo_element_root->set_attribute_ns( name = 'xmlns:xsi'
value = lc_xml_node_xsi_ns ).
**********************************************************************
* STEP 4: Create subnodes
" Creator node
lo_element = lo_document->create_simple_element_ns( name = lc_xml_node_creator
prefix = lc_dc_ns
parent = lo_document ).
lv_value = excel->zif_excel_book_properties~creator.
lo_element->set_value( value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
" Description node
lo_element = lo_document->create_simple_element_ns( name = lc_xml_node_description
prefix = lc_dc_ns
parent = lo_document ).
lv_value = excel->zif_excel_book_properties~description.
lo_element->set_value( value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
" lastModifiedBy node
lo_element = lo_document->create_simple_element_ns( name = lc_xml_node_lastmodifiedby
prefix = lc_cp_ns
parent = lo_document ).
lv_value = excel->zif_excel_book_properties~lastmodifiedby.
lo_element->set_value( value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
" Created node
lo_element = lo_document->create_simple_element_ns( name = lc_xml_node_created
prefix = lc_dcterms_ns
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
prefix = lc_xsi_ns
value = lc_xml_attr_target ).
CONVERT TIME STAMP excel->zif_excel_book_properties~created TIME ZONE sy-zonlo INTO DATE lv_date TIME lv_time.
CONCATENATE lv_date lv_time INTO lv_value RESPECTING BLANKS.
REPLACE ALL OCCURRENCES OF REGEX '([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})' IN lv_value WITH '$1-$2-$3T$4:$5:$6Z'.
* lv_value = excel->zif_excel_book_properties~created.
* lv_value = '2010-07-04T14:58:53Z'.
lo_element->set_value( value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
" Modified node
lo_element = lo_document->create_simple_element_ns( name = lc_xml_node_modified
prefix = lc_dcterms_ns
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
prefix = lc_xsi_ns
value = lc_xml_attr_target ).
CONVERT TIME STAMP excel->zif_excel_book_properties~modified TIME ZONE sy-zonlo INTO DATE lv_date TIME lv_time.
CONCATENATE lv_date lv_time INTO lv_value RESPECTING BLANKS.
REPLACE ALL OCCURRENCES OF REGEX '([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})' IN lv_value WITH '$1-$2-$3T$4:$5:$6Z'.
* lv_value = excel->zif_excel_book_properties~modified.
* lv_value = '2010-07-04T14:58:53Z'.
lo_element->set_value( value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_dxf_style.
CONSTANTS: lc_xml_node_dxf TYPE string VALUE 'dxf',
lc_xml_node_font TYPE string VALUE 'font',
lc_xml_node_b TYPE string VALUE 'b', "bold
lc_xml_node_i TYPE string VALUE 'i', "italic
lc_xml_node_u TYPE string VALUE 'u', "underline
lc_xml_node_strike TYPE string VALUE 'strike', "strikethrough
lc_xml_attr_val TYPE string VALUE 'val',
lc_xml_node_fill TYPE string VALUE 'fill',
lc_xml_node_patternfill TYPE string VALUE 'patternFill',
lc_xml_attr_patterntype TYPE string VALUE 'patternType',
lc_xml_node_fgcolor TYPE string VALUE 'fgColor',
lc_xml_node_bgcolor TYPE string VALUE 'bgColor'.
DATA: ls_styles_mapping TYPE zexcel_s_styles_mapping,
ls_cellxfs TYPE zexcel_s_cellxfs,
ls_style_cond_mapping TYPE zexcel_s_styles_cond_mapping,
lo_sub_element TYPE REF TO if_ixml_element,
lo_sub_element_2 TYPE REF TO if_ixml_element,
lv_index TYPE i,
ls_font TYPE zexcel_s_style_font,
lo_element_font TYPE REF TO if_ixml_element,
lv_value TYPE string,
ls_fill TYPE zexcel_s_style_fill,
lo_element_fill TYPE REF TO if_ixml_element.
CHECK iv_cell_style IS NOT INITIAL.
READ TABLE me->styles_mapping INTO ls_styles_mapping WITH KEY guid = iv_cell_style.
ADD 1 TO ls_styles_mapping-style. " the numbering starts from 0
READ TABLE it_cellxfs INTO ls_cellxfs INDEX ls_styles_mapping-style.
ADD 1 TO ls_cellxfs-fillid. " the numbering starts from 0
READ TABLE me->styles_cond_mapping INTO ls_style_cond_mapping WITH KEY style = ls_styles_mapping-style.
IF sy-subrc EQ 0.
ls_style_cond_mapping-guid = iv_cell_style.
APPEND ls_style_cond_mapping TO me->styles_cond_mapping.
ELSE.
ls_style_cond_mapping-guid = iv_cell_style.
ls_style_cond_mapping-style = ls_styles_mapping-style.
ls_style_cond_mapping-dxf = cv_dfx_count.
APPEND ls_style_cond_mapping TO me->styles_cond_mapping.
ADD 1 TO cv_dfx_count.
" dxf node
lo_sub_element = io_ixml_document->create_simple_element( name = lc_xml_node_dxf
parent = io_ixml_document ).
"Conditional formatting font style correction by Alessandro Iannacci START
lv_index = ls_cellxfs-fontid + 1.
READ TABLE it_fonts INTO ls_font INDEX lv_index.
IF ls_font IS NOT INITIAL.
lo_element_font = io_ixml_document->create_simple_element( name = lc_xml_node_font
parent = io_ixml_document ).
IF ls_font-bold EQ abap_true.
lo_sub_element_2 = io_ixml_document->create_simple_element( name = lc_xml_node_b
parent = io_ixml_document ).
lo_element_font->append_child( new_child = lo_sub_element_2 ).
ENDIF.
IF ls_font-italic EQ abap_true.
lo_sub_element_2 = io_ixml_document->create_simple_element( name = lc_xml_node_i
parent = io_ixml_document ).
lo_element_font->append_child( new_child = lo_sub_element_2 ).
ENDIF.
IF ls_font-underline EQ abap_true.
lo_sub_element_2 = io_ixml_document->create_simple_element( name = lc_xml_node_u
parent = io_ixml_document ).
lv_value = ls_font-underline_mode.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_val
value = lv_value ).
lo_element_font->append_child( new_child = lo_sub_element_2 ).
ENDIF.
IF ls_font-strikethrough EQ abap_true.
lo_sub_element_2 = io_ixml_document->create_simple_element( name = lc_xml_node_strike
parent = io_ixml_document ).
lo_element_font->append_child( new_child = lo_sub_element_2 ).
ENDIF.
"color
create_xl_styles_color_node(
io_document = io_ixml_document
io_parent = lo_element_font
is_color = ls_font-color ).
lo_sub_element->append_child( new_child = lo_element_font ).
ENDIF.
"---Conditional formatting font style correction by Alessandro Iannacci END
READ TABLE it_fills INTO ls_fill INDEX ls_cellxfs-fillid.
IF ls_fill IS NOT INITIAL.
" fill properties
lo_element_fill = io_ixml_document->create_simple_element( name = lc_xml_node_fill
parent = io_ixml_document ).
"pattern
lo_sub_element_2 = io_ixml_document->create_simple_element( name = lc_xml_node_patternfill
parent = io_ixml_document ).
lv_value = ls_fill-filltype.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_patterntype
value = lv_value ).
" fgcolor
create_xl_styles_color_node(
io_document = io_ixml_document
io_parent = lo_sub_element_2
is_color = ls_fill-fgcolor
iv_color_elem_name = lc_xml_node_fgcolor ).
IF ls_fill-fgcolor-rgb IS INITIAL AND
ls_fill-fgcolor-indexed EQ zcl_excel_style_color=>c_indexed_not_set AND
ls_fill-fgcolor-theme EQ zcl_excel_style_color=>c_theme_not_set AND
ls_fill-fgcolor-tint IS INITIAL AND ls_fill-bgcolor-indexed EQ zcl_excel_style_color=>c_indexed_sys_foreground.
" bgcolor
create_xl_styles_color_node(
io_document = io_ixml_document
io_parent = lo_sub_element_2
is_color = ls_fill-bgcolor
iv_color_elem_name = lc_xml_node_bgcolor ).
ENDIF.
lo_element_fill->append_child( new_child = lo_sub_element_2 ). "pattern
lo_sub_element->append_child( new_child = lo_element_fill ).
ENDIF.
ENDIF.
io_dxf_element->append_child( new_child = lo_sub_element ).
ENDMETHOD.
METHOD create_relationships.
** Constant node name
DATA: lc_xml_node_relationships TYPE string VALUE 'Relationships',
lc_xml_node_relationship TYPE string VALUE 'Relationship',
" Node attributes
lc_xml_attr_id TYPE string VALUE 'Id',
lc_xml_attr_type TYPE string VALUE 'Type',
lc_xml_attr_target TYPE string VALUE 'Target',
" Node namespace
lc_xml_node_rels_ns TYPE string VALUE 'http://schemas.openxmlformats.org/package/2006/relationships',
" Node id
lc_xml_node_rid1_id TYPE string VALUE 'rId1',
lc_xml_node_rid2_id TYPE string VALUE 'rId2',
lc_xml_node_rid3_id TYPE string VALUE 'rId3',
" Node type
lc_xml_node_rid1_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument',
lc_xml_node_rid2_tp TYPE string VALUE 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties',
lc_xml_node_rid3_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties',
" Node target
lc_xml_node_rid1_tg TYPE string VALUE 'xl/workbook.xml',
lc_xml_node_rid2_tg TYPE string VALUE 'docProps/core.xml',
lc_xml_node_rid3_tg TYPE string VALUE 'docProps/app.xml'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element TYPE REF TO if_ixml_element.
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
**********************************************************************
* STEP 3: Create main node relationships
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_relationships
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns'
value = lc_xml_node_rels_ns ).
**********************************************************************
* STEP 4: Create subnodes
" Theme node
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_id
value = lc_xml_node_rid3_id ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid3_tp ).
lo_element->set_attribute_ns( name = lc_xml_attr_target
value = lc_xml_node_rid3_tg ).
lo_element_root->append_child( new_child = lo_element ).
" Styles node
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_id
value = lc_xml_node_rid2_id ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid2_tp ).
lo_element->set_attribute_ns( name = lc_xml_attr_target
value = lc_xml_node_rid2_tg ).
lo_element_root->append_child( new_child = lo_element ).
" rels node
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_id
value = lc_xml_node_rid1_id ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid1_tp ).
lo_element->set_attribute_ns( name = lc_xml_attr_target
value = lc_xml_node_rid1_tg ).
lo_element_root->append_child( new_child = lo_element ).
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_xl_charts.
** Constant node name
CONSTANTS: lc_xml_node_chartspace TYPE string VALUE 'c:chartSpace',
lc_xml_node_ns_c TYPE string VALUE 'http://schemas.openxmlformats.org/drawingml/2006/chart',
lc_xml_node_ns_a TYPE string VALUE 'http://schemas.openxmlformats.org/drawingml/2006/main',
lc_xml_node_ns_r TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
lc_xml_node_date1904 TYPE string VALUE 'c:date1904',
lc_xml_node_lang TYPE string VALUE 'c:lang',
lc_xml_node_roundedcorners TYPE string VALUE 'c:roundedCorners',
lc_xml_node_altcont TYPE string VALUE 'mc:AlternateContent',
lc_xml_node_altcont_ns_mc TYPE string VALUE 'http://schemas.openxmlformats.org/markup-compatibility/2006',
lc_xml_node_choice TYPE string VALUE 'mc:Choice',
lc_xml_node_choice_ns_requires TYPE string VALUE 'c14',
lc_xml_node_choice_ns_c14 TYPE string VALUE 'http://schemas.microsoft.com/office/drawing/2007/8/2/chart',
lc_xml_node_style TYPE string VALUE 'c14:style',
lc_xml_node_fallback TYPE string VALUE 'mc:Fallback',
lc_xml_node_style2 TYPE string VALUE 'c:style',
"---------------------------CHART
lc_xml_node_chart TYPE string VALUE 'c:chart',
lc_xml_node_autotitledeleted TYPE string VALUE 'c:autoTitleDeleted',
"plotArea
lc_xml_node_plotarea TYPE string VALUE 'c:plotArea',
lc_xml_node_layout TYPE string VALUE 'c:layout',
lc_xml_node_varycolors TYPE string VALUE 'c:varyColors',
lc_xml_node_ser TYPE string VALUE 'c:ser',
lc_xml_node_idx TYPE string VALUE 'c:idx',
lc_xml_node_order TYPE string VALUE 'c:order',
lc_xml_node_tx TYPE string VALUE 'c:tx',
lc_xml_node_v TYPE string VALUE 'c:v',
lc_xml_node_val TYPE string VALUE 'c:val',
lc_xml_node_cat TYPE string VALUE 'c:cat',
lc_xml_node_numref TYPE string VALUE 'c:numRef',
lc_xml_node_strref TYPE string VALUE 'c:strRef',
lc_xml_node_f TYPE string VALUE 'c:f', "this is the range
lc_xml_node_overlap TYPE string VALUE 'c:overlap',
"note: numcache avoided
lc_xml_node_dlbls TYPE string VALUE 'c:dLbls',
lc_xml_node_showlegendkey TYPE string VALUE 'c:showLegendKey',
lc_xml_node_showval TYPE string VALUE 'c:showVal',
lc_xml_node_showcatname TYPE string VALUE 'c:showCatName',
lc_xml_node_showsername TYPE string VALUE 'c:showSerName',
lc_xml_node_showpercent TYPE string VALUE 'c:showPercent',
lc_xml_node_showbubblesize TYPE string VALUE 'c:showBubbleSize',
"plotArea->pie
lc_xml_node_piechart TYPE string VALUE 'c:pieChart',
lc_xml_node_showleaderlines TYPE string VALUE 'c:showLeaderLines',
lc_xml_node_firstsliceang TYPE string VALUE 'c:firstSliceAng',
"plotArea->line
lc_xml_node_linechart TYPE string VALUE 'c:lineChart',
lc_xml_node_symbol TYPE string VALUE 'c:symbol',
lc_xml_node_marker TYPE string VALUE 'c:marker',
lc_xml_node_smooth TYPE string VALUE 'c:smooth',
"plotArea->bar
lc_xml_node_invertifnegative TYPE string VALUE 'c:invertIfNegative',
lc_xml_node_barchart TYPE string VALUE 'c:barChart',
lc_xml_node_bardir TYPE string VALUE 'c:barDir',
lc_xml_node_gapwidth TYPE string VALUE 'c:gapWidth',
"plotArea->line + plotArea->bar
lc_xml_node_grouping TYPE string VALUE 'c:grouping',
lc_xml_node_axid TYPE string VALUE 'c:axId',
lc_xml_node_catax TYPE string VALUE 'c:catAx',
lc_xml_node_valax TYPE string VALUE 'c:valAx',
lc_xml_node_scaling TYPE string VALUE 'c:scaling',
lc_xml_node_orientation TYPE string VALUE 'c:orientation',
lc_xml_node_delete TYPE string VALUE 'c:delete',
lc_xml_node_axpos TYPE string VALUE 'c:axPos',
lc_xml_node_numfmt TYPE string VALUE 'c:numFmt',
lc_xml_node_majorgridlines TYPE string VALUE 'c:majorGridlines',
lc_xml_node_majortickmark TYPE string VALUE 'c:majorTickMark',
lc_xml_node_minortickmark TYPE string VALUE 'c:minorTickMark',
lc_xml_node_ticklblpos TYPE string VALUE 'c:tickLblPos',
lc_xml_node_crossax TYPE string VALUE 'c:crossAx',
lc_xml_node_crosses TYPE string VALUE 'c:crosses',
lc_xml_node_auto TYPE string VALUE 'c:auto',
lc_xml_node_lblalgn TYPE string VALUE 'c:lblAlgn',
lc_xml_node_lbloffset TYPE string VALUE 'c:lblOffset',
lc_xml_node_nomultilvllbl TYPE string VALUE 'c:noMultiLvlLbl',
lc_xml_node_crossbetween TYPE string VALUE 'c:crossBetween',
"legend
lc_xml_node_legend TYPE string VALUE 'c:legend',
"legend->pie
lc_xml_node_legendpos TYPE string VALUE 'c:legendPos',
* lc_xml_node_layout TYPE string VALUE 'c:layout', "already exist
lc_xml_node_overlay TYPE string VALUE 'c:overlay',
lc_xml_node_txpr TYPE string VALUE 'c:txPr',
lc_xml_node_bodypr TYPE string VALUE 'a:bodyPr',
lc_xml_node_lststyle TYPE string VALUE 'a:lstStyle',
lc_xml_node_p TYPE string VALUE 'a:p',
lc_xml_node_ppr TYPE string VALUE 'a:pPr',
lc_xml_node_defrpr TYPE string VALUE 'a:defRPr',
lc_xml_node_endpararpr TYPE string VALUE 'a:endParaRPr',
"legend->bar + legend->line
lc_xml_node_plotvisonly TYPE string VALUE 'c:plotVisOnly',
lc_xml_node_dispblanksas TYPE string VALUE 'c:dispBlanksAs',
lc_xml_node_showdlblsovermax TYPE string VALUE 'c:showDLblsOverMax',
"---------------------------END OF CHART
lc_xml_node_printsettings TYPE string VALUE 'c:printSettings',
lc_xml_node_headerfooter TYPE string VALUE 'c:headerFooter',
lc_xml_node_pagemargins TYPE string VALUE 'c:pageMargins',
lc_xml_node_pagesetup TYPE string VALUE 'c:pageSetup'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element.
DATA lo_element TYPE REF TO if_ixml_element.
DATA lo_element2 TYPE REF TO if_ixml_element.
DATA lo_element3 TYPE REF TO if_ixml_element.
DATA lo_el_rootchart TYPE REF TO if_ixml_element.
DATA lo_element4 TYPE REF TO if_ixml_element.
DATA lo_element5 TYPE REF TO if_ixml_element.
DATA lo_element6 TYPE REF TO if_ixml_element.
DATA lo_element7 TYPE REF TO if_ixml_element.
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
***********************************************************************
* STEP 3: Create main node relationships
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_chartspace
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns:c'
value = lc_xml_node_ns_c ).
lo_element_root->set_attribute_ns( name = 'xmlns:a'
value = lc_xml_node_ns_a ).
lo_element_root->set_attribute_ns( name = 'xmlns:r'
value = lc_xml_node_ns_r ).
**********************************************************************
* STEP 4: Create chart
DATA lo_chartb TYPE REF TO zcl_excel_graph_bars.
DATA lo_chartp TYPE REF TO zcl_excel_graph_pie.
DATA lo_chartl TYPE REF TO zcl_excel_graph_line.
DATA lo_chart TYPE REF TO zcl_excel_graph.
DATA ls_serie TYPE zcl_excel_graph=>s_series.
DATA ls_ax TYPE zcl_excel_graph_bars=>s_ax.
DATA lv_str TYPE string.
"Identify chart type
CASE io_drawing->graph_type.
WHEN zcl_excel_drawing=>c_graph_bars.
lo_chartb ?= io_drawing->graph.
WHEN zcl_excel_drawing=>c_graph_pie.
lo_chartp ?= io_drawing->graph.
WHEN zcl_excel_drawing=>c_graph_line.
lo_chartl ?= io_drawing->graph.
WHEN OTHERS.
ENDCASE.
lo_chart = io_drawing->graph.
lo_element = lo_document->create_simple_element( name = lc_xml_node_date1904
parent = lo_element_root ).
lo_element->set_attribute_ns( name = 'val'
value = lo_chart->ns_1904val ).
lo_element = lo_document->create_simple_element( name = lc_xml_node_lang
parent = lo_element_root ).
lo_element->set_attribute_ns( name = 'val'
value = lo_chart->ns_langval ).
lo_element = lo_document->create_simple_element( name = lc_xml_node_roundedcorners
parent = lo_element_root ).
lo_element->set_attribute_ns( name = 'val'
value = lo_chart->ns_roundedcornersval ).
lo_element = lo_document->create_simple_element( name = lc_xml_node_altcont
parent = lo_element_root ).
lo_element->set_attribute_ns( name = 'xmlns:mc'
value = lc_xml_node_altcont_ns_mc ).
"Choice
lo_element2 = lo_document->create_simple_element( name = lc_xml_node_choice
parent = lo_element ).
lo_element2->set_attribute_ns( name = 'Requires'
value = lc_xml_node_choice_ns_requires ).
lo_element2->set_attribute_ns( name = 'xmlns:c14'
value = lc_xml_node_choice_ns_c14 ).
"C14:style
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_style
parent = lo_element2 ).
lo_element3->set_attribute_ns( name = 'val'
value = lo_chart->ns_c14styleval ).
"Fallback
lo_element2 = lo_document->create_simple_element( name = lc_xml_node_fallback
parent = lo_element ).
"C:style
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_style2
parent = lo_element2 ).
lo_element3->set_attribute_ns( name = 'val'
value = lo_chart->ns_styleval ).
"---------------------------CHART
lo_element = lo_document->create_simple_element( name = lc_xml_node_chart
parent = lo_element_root ).
"Added
IF lo_chart->title IS NOT INITIAL.
lo_element2 = lo_document->create_simple_element( name = 'c:title'
parent = lo_element ).
lo_element3 = lo_document->create_simple_element( name = 'c:tx'
parent = lo_element2 ).
lo_element4 = lo_document->create_simple_element( name = 'c:rich'
parent = lo_element3 ).
lo_element5 = lo_document->create_simple_element( name = 'a:bodyPr'
parent = lo_element4 ).
lo_element5 = lo_document->create_simple_element( name = 'a:lstStyle'
parent = lo_element4 ).
lo_element5 = lo_document->create_simple_element( name = 'a:p'
parent = lo_element4 ).
lo_element6 = lo_document->create_simple_element( name = 'a:pPr'
parent = lo_element5 ).
lo_element7 = lo_document->create_simple_element( name = 'a:defRPr'
parent = lo_element6 ).
lo_element6 = lo_document->create_simple_element( name = 'a:r'
parent = lo_element5 ).
lo_element7 = lo_document->create_simple_element( name = 'a:rPr'
parent = lo_element6 ).
lo_element7->set_attribute_ns( name = 'lang'
value = 'en-US' ).
lo_element7 = lo_document->create_simple_element( name = 'a:t'
parent = lo_element6 ).
lo_element7->set_value( value = lo_chart->title ).
ENDIF.
"End
lo_element2 = lo_document->create_simple_element( name = lc_xml_node_autotitledeleted
parent = lo_element ).
lo_element2->set_attribute_ns( name = 'val'
value = lo_chart->ns_autotitledeletedval ).
"plotArea
lo_element2 = lo_document->create_simple_element( name = lc_xml_node_plotarea
parent = lo_element ).
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_layout
parent = lo_element2 ).
CASE io_drawing->graph_type.
WHEN zcl_excel_drawing=>c_graph_bars.
"----bar
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_barchart
parent = lo_element2 ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_bardir
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = lo_chartb->ns_bardirval ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_grouping
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = lo_chartb->ns_groupingval ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_varycolors
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = lo_chartb->ns_varycolorsval ).
"series
LOOP AT lo_chartb->series INTO ls_serie.
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_ser
parent = lo_element3 ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_idx
parent = lo_element4 ).
IF ls_serie-idx IS NOT INITIAL.
lv_str = ls_serie-idx.
ELSE.
lv_str = sy-tabix - 1.
ENDIF.
CONDENSE lv_str.
lo_element5->set_attribute_ns( name = 'val'
value = lv_str ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_order
parent = lo_element4 ).
lv_str = ls_serie-order.
CONDENSE lv_str.
lo_element5->set_attribute_ns( name = 'val'
value = lv_str ).
IF ls_serie-sername IS NOT INITIAL.
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_tx
parent = lo_element4 ).
lo_element6 = lo_document->create_simple_element( name = lc_xml_node_v
parent = lo_element5 ).
lo_element6->set_value( value = ls_serie-sername ).
ENDIF.
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_invertifnegative
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = ls_serie-invertifnegative ).
IF ls_serie-lbl IS NOT INITIAL.
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_cat
parent = lo_element4 ).
lo_element6 = lo_document->create_simple_element( name = lc_xml_node_strref
parent = lo_element5 ).
lo_element7 = lo_document->create_simple_element( name = lc_xml_node_f
parent = lo_element6 ).
lo_element7->set_value( value = ls_serie-lbl ).
ENDIF.
IF ls_serie-ref IS NOT INITIAL.
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_val
parent = lo_element4 ).
lo_element6 = lo_document->create_simple_element( name = lc_xml_node_numref
parent = lo_element5 ).
lo_element7 = lo_document->create_simple_element( name = lc_xml_node_f
parent = lo_element6 ).
lo_element7->set_value( value = ls_serie-ref ).
ENDIF.
ENDLOOP.
"endseries
IF lo_chartb->ns_groupingval = zcl_excel_graph_bars=>c_groupingval_stacked.
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_overlap
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = '100' ).
ENDIF.
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_dlbls
parent = lo_element3 ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showlegendkey
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartb->ns_showlegendkeyval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showval
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartb->ns_showvalval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showcatname
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartb->ns_showcatnameval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showsername
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartb->ns_showsernameval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showpercent
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartb->ns_showpercentval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showbubblesize
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartb->ns_showbubblesizeval ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_gapwidth
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = lo_chartb->ns_gapwidthval ).
"axes
lo_el_rootchart = lo_element3.
LOOP AT lo_chartb->axes INTO ls_ax.
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_axid
parent = lo_el_rootchart ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-axid ).
CASE ls_ax-type.
WHEN zcl_excel_graph_bars=>c_catax.
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_catax
parent = lo_element2 ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_axid
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-axid ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_scaling
parent = lo_element3 ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_orientation
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = ls_ax-orientation ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_delete
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-delete ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_axpos
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-axpos ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_numfmt
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'formatCode'
value = ls_ax-formatcode ).
lo_element4->set_attribute_ns( name = 'sourceLinked'
value = ls_ax-sourcelinked ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_majortickmark
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-majortickmark ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_minortickmark
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-minortickmark ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_ticklblpos
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-ticklblpos ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_crossax
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-crossax ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_crosses
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-crosses ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_auto
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-auto ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_lblalgn
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-lblalgn ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_lbloffset
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-lbloffset ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_nomultilvllbl
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-nomultilvllbl ).
WHEN zcl_excel_graph_bars=>c_valax.
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_valax
parent = lo_element2 ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_axid
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-axid ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_scaling
parent = lo_element3 ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_orientation
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = ls_ax-orientation ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_delete
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-delete ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_axpos
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-axpos ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_majorgridlines
parent = lo_element3 ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_numfmt
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'formatCode'
value = ls_ax-formatcode ).
lo_element4->set_attribute_ns( name = 'sourceLinked'
value = ls_ax-sourcelinked ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_majortickmark
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-majortickmark ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_minortickmark
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-minortickmark ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_ticklblpos
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-ticklblpos ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_crossax
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-crossax ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_crosses
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-crosses ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_crossbetween
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-crossbetween ).
WHEN OTHERS.
ENDCASE.
ENDLOOP.
"endaxes
WHEN zcl_excel_drawing=>c_graph_pie.
"----pie
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_piechart
parent = lo_element2 ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_varycolors
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = lo_chartp->ns_varycolorsval ).
"series
LOOP AT lo_chartp->series INTO ls_serie.
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_ser
parent = lo_element3 ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_idx
parent = lo_element4 ).
IF ls_serie-idx IS NOT INITIAL.
lv_str = ls_serie-idx.
ELSE.
lv_str = sy-tabix - 1.
ENDIF.
CONDENSE lv_str.
lo_element5->set_attribute_ns( name = 'val'
value = lv_str ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_order
parent = lo_element4 ).
lv_str = ls_serie-order.
CONDENSE lv_str.
lo_element5->set_attribute_ns( name = 'val'
value = lv_str ).
IF ls_serie-sername IS NOT INITIAL.
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_tx
parent = lo_element4 ).
lo_element6 = lo_document->create_simple_element( name = lc_xml_node_v
parent = lo_element5 ).
lo_element6->set_value( value = ls_serie-sername ).
ENDIF.
IF ls_serie-lbl IS NOT INITIAL.
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_cat
parent = lo_element4 ).
lo_element6 = lo_document->create_simple_element( name = lc_xml_node_strref
parent = lo_element5 ).
lo_element7 = lo_document->create_simple_element( name = lc_xml_node_f
parent = lo_element6 ).
lo_element7->set_value( value = ls_serie-lbl ).
ENDIF.
IF ls_serie-ref IS NOT INITIAL.
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_val
parent = lo_element4 ).
lo_element6 = lo_document->create_simple_element( name = lc_xml_node_numref
parent = lo_element5 ).
lo_element7 = lo_document->create_simple_element( name = lc_xml_node_f
parent = lo_element6 ).
lo_element7->set_value( value = ls_serie-ref ).
ENDIF.
ENDLOOP.
"endseries
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_dlbls
parent = lo_element3 ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showlegendkey
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartp->ns_showlegendkeyval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showval
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartp->ns_showvalval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showcatname
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartp->ns_showcatnameval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showsername
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartp->ns_showsernameval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showpercent
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartp->ns_showpercentval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showbubblesize
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartp->ns_showbubblesizeval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showleaderlines
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartp->ns_showleaderlinesval ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_firstsliceang
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = lo_chartp->ns_firstsliceangval ).
WHEN zcl_excel_drawing=>c_graph_line.
"----line
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_linechart
parent = lo_element2 ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_grouping
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = lo_chartl->ns_groupingval ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_varycolors
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = lo_chartl->ns_varycolorsval ).
"series
LOOP AT lo_chartl->series INTO ls_serie.
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_ser
parent = lo_element3 ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_idx
parent = lo_element4 ).
IF ls_serie-idx IS NOT INITIAL.
lv_str = ls_serie-idx.
ELSE.
lv_str = sy-tabix - 1.
ENDIF.
CONDENSE lv_str.
lo_element5->set_attribute_ns( name = 'val'
value = lv_str ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_order
parent = lo_element4 ).
lv_str = ls_serie-order.
CONDENSE lv_str.
lo_element5->set_attribute_ns( name = 'val'
value = lv_str ).
IF ls_serie-sername IS NOT INITIAL.
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_tx
parent = lo_element4 ).
lo_element6 = lo_document->create_simple_element( name = lc_xml_node_v
parent = lo_element5 ).
lo_element6->set_value( value = ls_serie-sername ).
ENDIF.
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_marker
parent = lo_element4 ).
lo_element6 = lo_document->create_simple_element( name = lc_xml_node_symbol
parent = lo_element5 ).
lo_element6->set_attribute_ns( name = 'val'
value = ls_serie-symbol ).
IF ls_serie-lbl IS NOT INITIAL.
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_cat
parent = lo_element4 ).
lo_element6 = lo_document->create_simple_element( name = lc_xml_node_strref
parent = lo_element5 ).
lo_element7 = lo_document->create_simple_element( name = lc_xml_node_f
parent = lo_element6 ).
lo_element7->set_value( value = ls_serie-lbl ).
ENDIF.
IF ls_serie-ref IS NOT INITIAL.
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_val
parent = lo_element4 ).
lo_element6 = lo_document->create_simple_element( name = lc_xml_node_numref
parent = lo_element5 ).
lo_element7 = lo_document->create_simple_element( name = lc_xml_node_f
parent = lo_element6 ).
lo_element7->set_value( value = ls_serie-ref ).
ENDIF.
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_smooth
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = ls_serie-smooth ).
ENDLOOP.
"endseries
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_dlbls
parent = lo_element3 ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showlegendkey
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartl->ns_showlegendkeyval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showval
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartl->ns_showvalval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showcatname
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartl->ns_showcatnameval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showsername
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartl->ns_showsernameval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showpercent
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartl->ns_showpercentval ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_showbubblesize
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = lo_chartl->ns_showbubblesizeval ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_marker
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = lo_chartl->ns_markerval ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_smooth
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = lo_chartl->ns_smoothval ).
"axes
lo_el_rootchart = lo_element3.
LOOP AT lo_chartl->axes INTO ls_ax.
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_axid
parent = lo_el_rootchart ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-axid ).
CASE ls_ax-type.
WHEN zcl_excel_graph_line=>c_catax.
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_catax
parent = lo_element2 ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_axid
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-axid ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_scaling
parent = lo_element3 ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_orientation
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = ls_ax-orientation ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_delete
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-delete ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_axpos
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-axpos ).
* lo_element4 = lo_document->create_simple_element( name = lc_xml_node_numfmt
* parent = lo_element3 ).
* lo_element4->set_attribute_ns( name = 'formatCode'
* value = ls_ax-formatcode ).
* lo_element4->set_attribute_ns( name = 'sourceLinked'
* value = ls_ax-sourcelinked ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_majortickmark
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-majortickmark ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_minortickmark
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-minortickmark ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_ticklblpos
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-ticklblpos ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_crossax
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-crossax ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_crosses
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-crosses ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_auto
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-auto ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_lblalgn
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-lblalgn ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_lbloffset
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-lbloffset ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_nomultilvllbl
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-nomultilvllbl ).
WHEN zcl_excel_graph_line=>c_valax.
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_valax
parent = lo_element2 ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_axid
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-axid ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_scaling
parent = lo_element3 ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_orientation
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'val'
value = ls_ax-orientation ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_delete
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-delete ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_axpos
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-axpos ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_majorgridlines
parent = lo_element3 ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_numfmt
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'formatCode'
value = ls_ax-formatcode ).
lo_element4->set_attribute_ns( name = 'sourceLinked'
value = ls_ax-sourcelinked ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_majortickmark
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-majortickmark ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_minortickmark
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-minortickmark ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_ticklblpos
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-ticklblpos ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_crossax
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-crossax ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_crosses
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-crosses ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_crossbetween
parent = lo_element3 ).
lo_element4->set_attribute_ns( name = 'val'
value = ls_ax-crossbetween ).
WHEN OTHERS.
ENDCASE.
ENDLOOP.
"endaxes
WHEN OTHERS.
ENDCASE.
"legend
IF lo_chart->print_label EQ abap_true.
lo_element2 = lo_document->create_simple_element( name = lc_xml_node_legend
parent = lo_element ).
CASE io_drawing->graph_type.
WHEN zcl_excel_drawing=>c_graph_bars.
"----bar
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_legendpos
parent = lo_element2 ).
lo_element3->set_attribute_ns( name = 'val'
value = lo_chartb->ns_legendposval ).
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_layout
parent = lo_element2 ).
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_overlay
parent = lo_element2 ).
lo_element3->set_attribute_ns( name = 'val'
value = lo_chartb->ns_overlayval ).
WHEN zcl_excel_drawing=>c_graph_line.
"----line
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_legendpos
parent = lo_element2 ).
lo_element3->set_attribute_ns( name = 'val'
value = lo_chartl->ns_legendposval ).
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_layout
parent = lo_element2 ).
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_overlay
parent = lo_element2 ).
lo_element3->set_attribute_ns( name = 'val'
value = lo_chartl->ns_overlayval ).
WHEN zcl_excel_drawing=>c_graph_pie.
"----pie
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_legendpos
parent = lo_element2 ).
lo_element3->set_attribute_ns( name = 'val'
value = lo_chartp->ns_legendposval ).
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_layout
parent = lo_element2 ).
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_overlay
parent = lo_element2 ).
lo_element3->set_attribute_ns( name = 'val'
value = lo_chartp->ns_overlayval ).
lo_element3 = lo_document->create_simple_element( name = lc_xml_node_txpr
parent = lo_element2 ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_bodypr
parent = lo_element3 ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_lststyle
parent = lo_element3 ).
lo_element4 = lo_document->create_simple_element( name = lc_xml_node_p
parent = lo_element3 ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_ppr
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'rtl'
value = lo_chartp->ns_pprrtl ).
lo_element6 = lo_document->create_simple_element( name = lc_xml_node_defrpr
parent = lo_element5 ).
lo_element5 = lo_document->create_simple_element( name = lc_xml_node_endpararpr
parent = lo_element4 ).
lo_element5->set_attribute_ns( name = 'lang'
value = lo_chartp->ns_endpararprlang ).
WHEN OTHERS.
ENDCASE.
ENDIF.
lo_element2 = lo_document->create_simple_element( name = lc_xml_node_plotvisonly
parent = lo_element ).
lo_element2->set_attribute_ns( name = 'val'
value = lo_chart->ns_plotvisonlyval ).
lo_element2 = lo_document->create_simple_element( name = lc_xml_node_dispblanksas
parent = lo_element ).
lo_element2->set_attribute_ns( name = 'val'
value = lo_chart->ns_dispblanksasval ).
lo_element2 = lo_document->create_simple_element( name = lc_xml_node_showdlblsovermax
parent = lo_element ).
lo_element2->set_attribute_ns( name = 'val'
value = lo_chart->ns_showdlblsovermaxval ).
"---------------------------END OF CHART
"printSettings
lo_element = lo_document->create_simple_element( name = lc_xml_node_printsettings
parent = lo_element_root ).
"headerFooter
lo_element2 = lo_document->create_simple_element( name = lc_xml_node_headerfooter
parent = lo_element ).
"pageMargins
lo_element2 = lo_document->create_simple_element( name = lc_xml_node_pagemargins
parent = lo_element ).
lo_element2->set_attribute_ns( name = 'b'
value = lo_chart->pagemargins-b ).
lo_element2->set_attribute_ns( name = 'l'
value = lo_chart->pagemargins-l ).
lo_element2->set_attribute_ns( name = 'r'
value = lo_chart->pagemargins-r ).
lo_element2->set_attribute_ns( name = 't'
value = lo_chart->pagemargins-t ).
lo_element2->set_attribute_ns( name = 'header'
value = lo_chart->pagemargins-header ).
lo_element2->set_attribute_ns( name = 'footer'
value = lo_chart->pagemargins-footer ).
"pageSetup
lo_element2 = lo_document->create_simple_element( name = lc_xml_node_pagesetup
parent = lo_element ).
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_xl_comments.
** Constant node name
CONSTANTS: lc_xml_node_comments TYPE string VALUE 'comments',
lc_xml_node_ns TYPE string VALUE 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',
" authors
lc_xml_node_author TYPE string VALUE 'author',
lc_xml_node_authors TYPE string VALUE 'authors',
" comments
lc_xml_node_commentlist TYPE string VALUE 'commentList',
lc_xml_node_comment TYPE string VALUE 'comment',
lc_xml_node_text TYPE string VALUE 'text',
lc_xml_node_r TYPE string VALUE 'r',
lc_xml_node_rpr TYPE string VALUE 'rPr',
lc_xml_node_b TYPE string VALUE 'b',
lc_xml_node_sz TYPE string VALUE 'sz',
lc_xml_node_color TYPE string VALUE 'color',
lc_xml_node_rfont TYPE string VALUE 'rFont',
* lc_xml_node_charset TYPE string VALUE 'charset',
lc_xml_node_family TYPE string VALUE 'family',
lc_xml_node_t TYPE string VALUE 't',
" comments attributes
lc_xml_attr_ref TYPE string VALUE 'ref',
lc_xml_attr_authorid TYPE string VALUE 'authorId',
lc_xml_attr_val TYPE string VALUE 'val',
lc_xml_attr_indexed TYPE string VALUE 'indexed',
lc_xml_attr_xmlspacing TYPE string VALUE 'xml:space'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element_authors TYPE REF TO if_ixml_element,
lo_element_author TYPE REF TO if_ixml_element,
lo_element_commentlist TYPE REF TO if_ixml_element,
lo_element_comment TYPE REF TO if_ixml_element,
lo_element_text TYPE REF TO if_ixml_element,
lo_element_r TYPE REF TO if_ixml_element,
lo_element_rpr TYPE REF TO if_ixml_element,
lo_element_b TYPE REF TO if_ixml_element,
lo_element_sz TYPE REF TO if_ixml_element,
lo_element_color TYPE REF TO if_ixml_element,
lo_element_rfont TYPE REF TO if_ixml_element,
* lo_element_charset TYPE REF TO if_ixml_element,
lo_element_family TYPE REF TO if_ixml_element,
lo_element_t TYPE REF TO if_ixml_element,
lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_comments TYPE REF TO zcl_excel_comments,
lo_comment TYPE REF TO zcl_excel_comment.
DATA: lv_rel_id TYPE i,
lv_author TYPE string.
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
***********************************************************************
* STEP 3: Create main node relationships
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_comments
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns'
value = lc_xml_node_ns ).
**********************************************************************
* STEP 4: Create authors
* TO-DO: management of several authors
lo_element_authors = lo_document->create_simple_element( name = lc_xml_node_authors
parent = lo_document ).
lo_element_author = lo_document->create_simple_element( name = lc_xml_node_author
parent = lo_document ).
lv_author = sy-uname.
lo_element_author->set_value( lv_author ).
lo_element_authors->append_child( new_child = lo_element_author ).
lo_element_root->append_child( new_child = lo_element_authors ).
**********************************************************************
* STEP 5: Create comments
lo_element_commentlist = lo_document->create_simple_element( name = lc_xml_node_commentlist
parent = lo_document ).
lo_comments = io_worksheet->get_comments( ).
lo_iterator = lo_comments->get_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_comment ?= lo_iterator->get_next( ).
lo_element_comment = lo_document->create_simple_element( name = lc_xml_node_comment
parent = lo_document ).
lo_element_comment->set_attribute_ns( name = lc_xml_attr_ref
value = lo_comment->get_ref( ) ).
lo_element_comment->set_attribute_ns( name = lc_xml_attr_authorid
value = '0' ). " TO-DO
lo_element_text = lo_document->create_simple_element( name = lc_xml_node_text
parent = lo_document ).
lo_element_r = lo_document->create_simple_element( name = lc_xml_node_r
parent = lo_document ).
lo_element_rpr = lo_document->create_simple_element( name = lc_xml_node_rpr
parent = lo_document ).
lo_element_b = lo_document->create_simple_element( name = lc_xml_node_b
parent = lo_document ).
lo_element_rpr->append_child( new_child = lo_element_b ).
add_1_val_child_node( io_document = lo_document io_parent = lo_element_rpr iv_elem_name = lc_xml_node_sz iv_attr_name = lc_xml_attr_val iv_attr_value = '9' ).
add_1_val_child_node( io_document = lo_document io_parent = lo_element_rpr iv_elem_name = lc_xml_node_color iv_attr_name = lc_xml_attr_indexed iv_attr_value = '81' ).
add_1_val_child_node( io_document = lo_document io_parent = lo_element_rpr iv_elem_name = lc_xml_node_rfont iv_attr_name = lc_xml_attr_val iv_attr_value = 'Tahoma' ).
add_1_val_child_node( io_document = lo_document io_parent = lo_element_rpr iv_elem_name = lc_xml_node_family iv_attr_name = lc_xml_attr_val iv_attr_value = '2' ).
lo_element_r->append_child( new_child = lo_element_rpr ).
lo_element_t = lo_document->create_simple_element( name = lc_xml_node_t
parent = lo_document ).
lo_element_t->set_attribute_ns( name = lc_xml_attr_xmlspacing
value = 'preserve' ).
lo_element_t->set_value( lo_comment->get_text( ) ).
lo_element_r->append_child( new_child = lo_element_t ).
lo_element_text->append_child( new_child = lo_element_r ).
lo_element_comment->append_child( new_child = lo_element_text ).
lo_element_commentlist->append_child( new_child = lo_element_comment ).
ENDWHILE.
lo_element_root->append_child( new_child = lo_element_commentlist ).
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_xl_drawings.
** Constant node name
CONSTANTS: lc_xml_node_wsdr TYPE string VALUE 'xdr:wsDr',
lc_xml_node_ns_xdr TYPE string VALUE 'http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing',
lc_xml_node_ns_a TYPE string VALUE 'http://schemas.openxmlformats.org/drawingml/2006/main'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element_cellanchor TYPE REF TO if_ixml_element,
lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_drawings TYPE REF TO zcl_excel_drawings,
lo_drawing TYPE REF TO zcl_excel_drawing.
DATA: lv_rel_id TYPE i.
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
***********************************************************************
* STEP 3: Create main node relationships
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_wsdr
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns:xdr'
value = lc_xml_node_ns_xdr ).
lo_element_root->set_attribute_ns( name = 'xmlns:a'
value = lc_xml_node_ns_a ).
**********************************************************************
* STEP 4: Create drawings
CLEAR: lv_rel_id.
lo_drawings = io_worksheet->get_drawings( ).
lo_iterator = lo_drawings->get_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_drawing ?= lo_iterator->get_next( ).
ADD 1 TO lv_rel_id.
lo_element_cellanchor = me->create_xl_drawing_anchor(
io_drawing = lo_drawing
io_document = lo_document
ip_index = lv_rel_id ).
lo_element_root->append_child( new_child = lo_element_cellanchor ).
ENDWHILE.
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_xl_drawings_hdft_rels.
** Constant node name
DATA: lc_xml_node_relationships TYPE string VALUE 'Relationships',
lc_xml_node_relationship TYPE string VALUE 'Relationship',
" Node attributes
lc_xml_attr_id TYPE string VALUE 'Id',
lc_xml_attr_type TYPE string VALUE 'Type',
lc_xml_attr_target TYPE string VALUE 'Target',
" Node namespace
lc_xml_node_rels_ns TYPE string VALUE 'http://schemas.openxmlformats.org/package/2006/relationships',
lc_xml_node_rid_image_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image',
lc_xml_node_rid_chart_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart'.
DATA: lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_drawing TYPE REF TO zcl_excel_drawing,
lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element TYPE REF TO if_ixml_element,
lv_value TYPE string,
lv_relation_id TYPE i,
lt_temp TYPE strtable,
lt_drawings TYPE zexcel_t_drawings.
FIELD-SYMBOLS: <fs_temp> TYPE sstrtable,
<fs_drawings> TYPE zexcel_s_drawings.
* BODY
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
**********************************************************************
* STEP 3: Create main node relationships
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_relationships
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns'
value = lc_xml_node_rels_ns ).
**********************************************************************
* STEP 4: Create subnodes
**********************************************************************
lt_drawings = io_worksheet->get_header_footer_drawings( ).
LOOP AT lt_drawings ASSIGNING <fs_drawings>. "Header or footer image exist
ADD 1 TO lv_relation_id.
* lv_value = lv_relation_id.
lv_value = <fs_drawings>-drawing->get_index( ).
READ TABLE lt_temp WITH KEY str = lv_value TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
APPEND INITIAL LINE TO lt_temp ASSIGNING <fs_temp>.
<fs_temp>-row_index = sy-tabix.
<fs_temp>-str = lv_value.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_id
* value = 'LOGO' ).
value = lv_value ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid_image_tp ).
lv_value = '../media/#'.
REPLACE '#' IN lv_value WITH <fs_drawings>-drawing->get_media_name( ).
lo_element->set_attribute_ns( name = lc_xml_attr_target
* value = '../media/LOGO.png' ).
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
ENDIF.
ENDLOOP.
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD. "create_xl_drawings_hdft_rels
METHOD create_xl_drawings_rels.
** Constant node name
DATA: lc_xml_node_relationships TYPE string VALUE 'Relationships',
lc_xml_node_relationship TYPE string VALUE 'Relationship',
" Node attributes
lc_xml_attr_id TYPE string VALUE 'Id',
lc_xml_attr_type TYPE string VALUE 'Type',
lc_xml_attr_target TYPE string VALUE 'Target',
" Node namespace
lc_xml_node_rels_ns TYPE string VALUE 'http://schemas.openxmlformats.org/package/2006/relationships',
lc_xml_node_rid_image_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image',
lc_xml_node_rid_chart_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element TYPE REF TO if_ixml_element,
lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_drawings TYPE REF TO zcl_excel_drawings,
lo_drawing TYPE REF TO zcl_excel_drawing.
DATA: lv_value TYPE string,
lv_counter TYPE i.
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
**********************************************************************
* STEP 3: Create main node relationships
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_relationships
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns'
value = lc_xml_node_rels_ns ).
**********************************************************************
* STEP 4: Create subnodes
" Add sheet Relationship nodes here
lv_counter = 0.
lo_drawings = io_worksheet->get_drawings( ).
lo_iterator = lo_drawings->get_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_drawing ?= lo_iterator->get_next( ).
ADD 1 TO lv_counter.
lv_value = lv_counter.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_id
value = lv_value ).
lv_value = lo_drawing->get_media_name( ).
CASE lo_drawing->get_type( ).
WHEN zcl_excel_drawing=>type_image.
CONCATENATE '../media/' lv_value INTO lv_value.
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid_image_tp ).
WHEN zcl_excel_drawing=>type_chart.
CONCATENATE '../charts/' lv_value INTO lv_value.
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid_chart_tp ).
ENDCASE.
lo_element->set_attribute_ns( name = lc_xml_attr_target
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
ENDWHILE.
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_xl_drawings_vml.
DATA:
lo_xml_document TYPE REF TO cl_xml_document,
ld_stream TYPE string.
* INIT_RESULT
CLEAR ep_content.
* BODY
ld_stream = set_vml_string( ).
CREATE OBJECT lo_xml_document.
CALL METHOD lo_xml_document->parse_string
EXPORTING
stream = ld_stream.
* CALL FUNCTION 'CRM_IC_XML_STRING2XSTRING'
* EXPORTING
* instring = ld_stream
* IMPORTING
* outxstring = ep_content.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = ld_stream
IMPORTING
buffer = ep_content
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
CLEAR ep_content.
ENDIF.
ENDMETHOD.
METHOD create_xl_drawings_vml_rels.
** Constant node name
DATA: lc_xml_node_relationships TYPE string VALUE 'Relationships',
lc_xml_node_relationship TYPE string VALUE 'Relationship',
" Node attributes
lc_xml_attr_id TYPE string VALUE 'Id',
lc_xml_attr_type TYPE string VALUE 'Type',
lc_xml_attr_target TYPE string VALUE 'Target',
" Node namespace
lc_xml_node_rels_ns TYPE string VALUE 'http://schemas.openxmlformats.org/package/2006/relationships',
lc_xml_node_rid_image_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image',
lc_xml_node_rid_chart_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart'.
DATA: lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_drawing TYPE REF TO zcl_excel_drawing,
lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element TYPE REF TO if_ixml_element,
lv_value TYPE string,
lv_relation_id TYPE i.
* BODY
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
**********************************************************************
* STEP 3: Create main node relationships
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_relationships
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns'
value = lc_xml_node_rels_ns ).
**********************************************************************
* STEP 4: Create subnodes
lv_relation_id = 0.
lo_iterator = me->excel->get_drawings_iterator( zcl_excel_drawing=>type_image ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_drawing ?= lo_iterator->get_next( ).
IF lo_drawing->get_type( ) = zcl_excel_drawing=>type_image_header_footer.
ADD 1 TO lv_relation_id.
lv_value = lv_relation_id.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_id
* value = 'LOGO' ).
value = lv_value ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid_image_tp ).
lv_value = '../media/#'.
REPLACE '#' IN lv_value WITH lo_drawing->get_media_name( ).
lo_element->set_attribute_ns( name = lc_xml_attr_target
* value = '../media/LOGO.png' ).
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
ENDIF.
ENDWHILE.
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_xl_drawing_anchor.
** Constant node name
CONSTANTS: lc_xml_node_onecellanchor TYPE string VALUE 'xdr:oneCellAnchor',
lc_xml_node_twocellanchor TYPE string VALUE 'xdr:twoCellAnchor',
lc_xml_node_from TYPE string VALUE 'xdr:from',
lc_xml_node_to TYPE string VALUE 'xdr:to',
lc_xml_node_pic TYPE string VALUE 'xdr:pic',
lc_xml_node_ext TYPE string VALUE 'xdr:ext',
lc_xml_node_clientdata TYPE string VALUE 'xdr:clientData',
lc_xml_node_col TYPE string VALUE 'xdr:col',
lc_xml_node_coloff TYPE string VALUE 'xdr:colOff',
lc_xml_node_row TYPE string VALUE 'xdr:row',
lc_xml_node_rowoff TYPE string VALUE 'xdr:rowOff',
lc_xml_node_nvpicpr TYPE string VALUE 'xdr:nvPicPr',
lc_xml_node_cnvpr TYPE string VALUE 'xdr:cNvPr',
lc_xml_node_cnvpicpr TYPE string VALUE 'xdr:cNvPicPr',
lc_xml_node_piclocks TYPE string VALUE 'a:picLocks',
lc_xml_node_sppr TYPE string VALUE 'xdr:spPr',
lc_xml_node_apgeom TYPE string VALUE 'a:prstGeom',
lc_xml_node_aavlst TYPE string VALUE 'a:avLst',
lc_xml_node_graphicframe TYPE string VALUE 'xdr:graphicFrame',
lc_xml_node_nvgraphicframepr TYPE string VALUE 'xdr:nvGraphicFramePr',
lc_xml_node_cnvgraphicframepr TYPE string VALUE 'xdr:cNvGraphicFramePr',
lc_xml_node_graphicframelocks TYPE string VALUE 'a:graphicFrameLocks',
lc_xml_node_xfrm TYPE string VALUE 'xdr:xfrm',
lc_xml_node_aoff TYPE string VALUE 'a:off',
lc_xml_node_aext TYPE string VALUE 'a:ext',
lc_xml_node_agraphic TYPE string VALUE 'a:graphic',
lc_xml_node_agraphicdata TYPE string VALUE 'a:graphicData',
lc_xml_node_ns_c TYPE string VALUE 'http://schemas.openxmlformats.org/drawingml/2006/chart',
lc_xml_node_cchart TYPE string VALUE 'c:chart',
lc_xml_node_blipfill TYPE string VALUE 'xdr:blipFill',
lc_xml_node_ablip TYPE string VALUE 'a:blip',
lc_xml_node_astretch TYPE string VALUE 'a:stretch',
lc_xml_node_ns_r TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'.
DATA: lo_element_graphicframe TYPE REF TO if_ixml_element,
lo_element TYPE REF TO if_ixml_element,
lo_element2 TYPE REF TO if_ixml_element,
lo_element3 TYPE REF TO if_ixml_element,
lo_element_from TYPE REF TO if_ixml_element,
lo_element_to TYPE REF TO if_ixml_element,
lo_element_ext TYPE REF TO if_ixml_element,
lo_element_pic TYPE REF TO if_ixml_element,
lo_element_clientdata TYPE REF TO if_ixml_element,
ls_position TYPE zexcel_drawing_position,
lv_col TYPE string, " zexcel_cell_column,
lv_row TYPE string, " zexcel_cell_row.
lv_col_offset TYPE string,
lv_row_offset TYPE string,
lv_value TYPE string.
ls_position = io_drawing->get_position( ).
IF ls_position-anchor = 'ONE'.
ep_anchor = io_document->create_simple_element( name = lc_xml_node_onecellanchor
parent = io_document ).
ELSE.
ep_anchor = io_document->create_simple_element( name = lc_xml_node_twocellanchor
parent = io_document ).
ENDIF.
* from cell ******************************
lo_element_from = io_document->create_simple_element( name = lc_xml_node_from
parent = io_document ).
lv_col = ls_position-from-col.
lv_row = ls_position-from-row.
lv_col_offset = ls_position-from-col_offset.
lv_row_offset = ls_position-from-row_offset.
CONDENSE lv_col NO-GAPS.
CONDENSE lv_row NO-GAPS.
CONDENSE lv_col_offset NO-GAPS.
CONDENSE lv_row_offset NO-GAPS.
lo_element = io_document->create_simple_element( name = lc_xml_node_col
parent = io_document ).
lo_element->set_value( value = lv_col ).
lo_element_from->append_child( new_child = lo_element ).
lo_element = io_document->create_simple_element( name = lc_xml_node_coloff
parent = io_document ).
lo_element->set_value( value = lv_col_offset ).
lo_element_from->append_child( new_child = lo_element ).
lo_element = io_document->create_simple_element( name = lc_xml_node_row
parent = io_document ).
lo_element->set_value( value = lv_row ).
lo_element_from->append_child( new_child = lo_element ).
lo_element = io_document->create_simple_element( name = lc_xml_node_rowoff
parent = io_document ).
lo_element->set_value( value = lv_row_offset ).
lo_element_from->append_child( new_child = lo_element ).
ep_anchor->append_child( new_child = lo_element_from ).
IF ls_position-anchor = 'ONE'.
* ext ******************************
lo_element_ext = io_document->create_simple_element( name = lc_xml_node_ext
parent = io_document ).
lv_value = io_drawing->get_width_emu_str( ).
lo_element_ext->set_attribute_ns( name = 'cx'
value = lv_value ).
lv_value = io_drawing->get_height_emu_str( ).
lo_element_ext->set_attribute_ns( name = 'cy'
value = lv_value ).
ep_anchor->append_child( new_child = lo_element_ext ).
ELSEIF ls_position-anchor = 'TWO'.
* to cell ******************************
lo_element_to = io_document->create_simple_element( name = lc_xml_node_to
parent = io_document ).
lv_col = ls_position-to-col.
lv_row = ls_position-to-row.
lv_col_offset = ls_position-to-col_offset.
lv_row_offset = ls_position-to-row_offset.
CONDENSE lv_col NO-GAPS.
CONDENSE lv_row NO-GAPS.
CONDENSE lv_col_offset NO-GAPS.
CONDENSE lv_row_offset NO-GAPS.
lo_element = io_document->create_simple_element( name = lc_xml_node_col
parent = io_document ).
lo_element->set_value( value = lv_col ).
lo_element_to->append_child( new_child = lo_element ).
lo_element = io_document->create_simple_element( name = lc_xml_node_coloff
parent = io_document ).
lo_element->set_value( value = lv_col_offset ).
lo_element_to->append_child( new_child = lo_element ).
lo_element = io_document->create_simple_element( name = lc_xml_node_row
parent = io_document ).
lo_element->set_value( value = lv_row ).
lo_element_to->append_child( new_child = lo_element ).
lo_element = io_document->create_simple_element( name = lc_xml_node_rowoff
parent = io_document ).
lo_element->set_value( value = lv_row_offset ).
lo_element_to->append_child( new_child = lo_element ).
ep_anchor->append_child( new_child = lo_element_to ).
ENDIF.
CASE io_drawing->get_type( ).
WHEN zcl_excel_drawing=>type_image.
* pic **********************************
lo_element_pic = io_document->create_simple_element( name = lc_xml_node_pic
parent = io_document ).
* nvPicPr
lo_element = io_document->create_simple_element( name = lc_xml_node_nvpicpr
parent = io_document ).
* cNvPr
lo_element2 = io_document->create_simple_element( name = lc_xml_node_cnvpr
parent = io_document ).
lv_value = sy-index.
CONDENSE lv_value.
lo_element2->set_attribute_ns( name = 'id'
value = lv_value ).
lo_element2->set_attribute_ns( name = 'name'
value = io_drawing->title ).
lo_element->append_child( new_child = lo_element2 ).
* cNvPicPr
lo_element2 = io_document->create_simple_element( name = lc_xml_node_cnvpicpr
parent = io_document ).
* picLocks
lo_element3 = io_document->create_simple_element( name = lc_xml_node_piclocks
parent = io_document ).
lo_element3->set_attribute_ns( name = 'noChangeAspect'
value = '1' ).
lo_element2->append_child( new_child = lo_element3 ).
lo_element->append_child( new_child = lo_element2 ).
lo_element_pic->append_child( new_child = lo_element ).
* blipFill
lv_value = ip_index.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element = io_document->create_simple_element( name = lc_xml_node_blipfill
parent = io_document ).
lo_element2 = io_document->create_simple_element( name = lc_xml_node_ablip
parent = io_document ).
lo_element2->set_attribute_ns( name = 'xmlns:r'
value = lc_xml_node_ns_r ).
lo_element2->set_attribute_ns( name = 'r:embed'
value = lv_value ).
lo_element->append_child( new_child = lo_element2 ).
lo_element2 = io_document->create_simple_element( name = lc_xml_node_astretch
parent = io_document ).
lo_element->append_child( new_child = lo_element2 ).
lo_element_pic->append_child( new_child = lo_element ).
* spPr
lo_element = io_document->create_simple_element( name = lc_xml_node_sppr
parent = io_document ).
lo_element2 = io_document->create_simple_element( name = lc_xml_node_apgeom
parent = io_document ).
lo_element2->set_attribute_ns( name = 'prst'
value = 'rect' ).
lo_element3 = io_document->create_simple_element( name = lc_xml_node_aavlst
parent = io_document ).
lo_element2->append_child( new_child = lo_element3 ).
lo_element->append_child( new_child = lo_element2 ).
lo_element_pic->append_child( new_child = lo_element ).
ep_anchor->append_child( new_child = lo_element_pic ).
WHEN zcl_excel_drawing=>type_chart.
* graphicFrame **********************************
lo_element_graphicframe = io_document->create_simple_element( name = lc_xml_node_graphicframe
parent = io_document ).
* nvGraphicFramePr
lo_element = io_document->create_simple_element( name = lc_xml_node_nvgraphicframepr
parent = io_document ).
* cNvPr
lo_element2 = io_document->create_simple_element( name = lc_xml_node_cnvpr
parent = io_document ).
lv_value = sy-index.
CONDENSE lv_value.
lo_element2->set_attribute_ns( name = 'id'
value = lv_value ).
lo_element2->set_attribute_ns( name = 'name'
value = io_drawing->title ).
lo_element->append_child( new_child = lo_element2 ).
* cNvGraphicFramePr
lo_element2 = io_document->create_simple_element( name = lc_xml_node_cnvgraphicframepr
parent = io_document ).
lo_element3 = io_document->create_simple_element( name = lc_xml_node_graphicframelocks
parent = io_document ).
lo_element2->append_child( new_child = lo_element3 ).
lo_element->append_child( new_child = lo_element2 ).
lo_element_graphicframe->append_child( new_child = lo_element ).
* xfrm
lo_element = io_document->create_simple_element( name = lc_xml_node_xfrm
parent = io_document ).
* off
lo_element2 = io_document->create_simple_element( name = lc_xml_node_aoff
parent = io_document ).
lo_element2->set_attribute_ns( name = 'y' value = '0' ).
lo_element2->set_attribute_ns( name = 'x' value = '0' ).
lo_element->append_child( new_child = lo_element2 ).
* ext
lo_element2 = io_document->create_simple_element( name = lc_xml_node_aext
parent = io_document ).
lo_element2->set_attribute_ns( name = 'cy' value = '0' ).
lo_element2->set_attribute_ns( name = 'cx' value = '0' ).
lo_element->append_child( new_child = lo_element2 ).
lo_element_graphicframe->append_child( new_child = lo_element ).
* graphic
lo_element = io_document->create_simple_element( name = lc_xml_node_agraphic
parent = io_document ).
* graphicData
lo_element2 = io_document->create_simple_element( name = lc_xml_node_agraphicdata
parent = io_document ).
lo_element2->set_attribute_ns( name = 'uri' value = lc_xml_node_ns_c ).
* chart
lo_element3 = io_document->create_simple_element( name = lc_xml_node_cchart
parent = io_document ).
lo_element3->set_attribute_ns( name = 'xmlns:r'
value = lc_xml_node_ns_r ).
lo_element3->set_attribute_ns( name = 'xmlns:c'
value = lc_xml_node_ns_c ).
lv_value = ip_index.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element3->set_attribute_ns( name = 'r:id'
value = lv_value ).
lo_element2->append_child( new_child = lo_element3 ).
lo_element->append_child( new_child = lo_element2 ).
lo_element_graphicframe->append_child( new_child = lo_element ).
ep_anchor->append_child( new_child = lo_element_graphicframe ).
ENDCASE.
* client data ***************************
lo_element_clientdata = io_document->create_simple_element( name = lc_xml_node_clientdata
parent = io_document ).
ep_anchor->append_child( new_child = lo_element_clientdata ).
ENDMETHOD.
METHOD create_xl_drawing_for_comments.
** Constant node name
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_o TYPE string VALUE 'urn:schemas-microsoft-com:office:office',
lc_xml_node_ns_x TYPE string VALUE 'urn:schemas-microsoft-com:office:excel',
" shapelayout
lc_xml_node_shapelayout TYPE string VALUE 'o:shapelayout',
lc_xml_node_idmap TYPE string VALUE 'o:idmap',
" shapetype
lc_xml_node_shapetype TYPE string VALUE 'v:shapetype',
lc_xml_node_stroke TYPE string VALUE 'v:stroke',
lc_xml_node_path TYPE string VALUE 'v:path',
" shape
lc_xml_node_shape TYPE string VALUE 'v:shape',
lc_xml_node_fill TYPE string VALUE 'v:fill',
lc_xml_node_shadow TYPE string VALUE 'v:shadow',
lc_xml_node_textbox TYPE string VALUE 'v:textbox',
lc_xml_node_div TYPE string VALUE 'div',
lc_xml_node_clientdata TYPE string VALUE 'x:ClientData',
lc_xml_node_movewithcells TYPE string VALUE 'x:MoveWithCells',
lc_xml_node_sizewithcells TYPE string VALUE 'x:SizeWithCells',
lc_xml_node_anchor TYPE string VALUE 'x:Anchor',
lc_xml_node_autofill TYPE string VALUE 'x:AutoFill',
lc_xml_node_row TYPE string VALUE 'x:Row',
lc_xml_node_column TYPE string VALUE 'x:Column',
" attributes,
lc_xml_attr_vext TYPE string VALUE 'v:ext',
lc_xml_attr_data TYPE string VALUE 'data',
lc_xml_attr_id TYPE string VALUE 'id',
lc_xml_attr_coordsize TYPE string VALUE 'coordsize',
lc_xml_attr_ospt TYPE string VALUE 'o:spt',
lc_xml_attr_joinstyle TYPE string VALUE 'joinstyle',
lc_xml_attr_path TYPE string VALUE 'path',
lc_xml_attr_gradientshapeok TYPE string VALUE 'gradientshapeok',
lc_xml_attr_oconnecttype TYPE string VALUE 'o:connecttype',
lc_xml_attr_type TYPE string VALUE 'type',
lc_xml_attr_style TYPE string VALUE 'style',
lc_xml_attr_fillcolor TYPE string VALUE 'fillcolor',
lc_xml_attr_oinsetmode TYPE string VALUE 'o:insetmode',
lc_xml_attr_color TYPE string VALUE 'color',
lc_xml_attr_color2 TYPE string VALUE 'color2',
lc_xml_attr_on TYPE string VALUE 'on',
lc_xml_attr_obscured TYPE string VALUE 'obscured',
lc_xml_attr_objecttype TYPE string VALUE 'ObjectType',
" attributes values
lc_xml_attr_val_edit TYPE string VALUE 'edit',
lc_xml_attr_val_rect TYPE string VALUE 'rect',
lc_xml_attr_val_t TYPE string VALUE 't',
lc_xml_attr_val_miter TYPE string VALUE 'miter',
lc_xml_attr_val_auto TYPE string VALUE 'auto',
lc_xml_attr_val_black TYPE string VALUE 'black',
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_note TYPE string VALUE 'Note'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
"shapelayout
lo_element_shapelayout TYPE REF TO if_ixml_element,
lo_element_idmap TYPE REF TO if_ixml_element,
"shapetype
lo_element_shapetype TYPE REF TO if_ixml_element,
lo_element_stroke TYPE REF TO if_ixml_element,
lo_element_path TYPE REF TO if_ixml_element,
"shape
lo_element_shape TYPE REF TO if_ixml_element,
lo_element_fill TYPE REF TO if_ixml_element,
lo_element_shadow TYPE REF TO if_ixml_element,
lo_element_textbox TYPE REF TO if_ixml_element,
lo_element_div TYPE REF TO if_ixml_element,
lo_element_clientdata TYPE REF TO if_ixml_element,
lo_element_movewithcells TYPE REF TO if_ixml_element,
lo_element_sizewithcells TYPE REF TO if_ixml_element,
lo_element_anchor TYPE REF TO if_ixml_element,
lo_element_autofill TYPE REF TO if_ixml_element,
lo_element_row TYPE REF TO if_ixml_element,
lo_element_column TYPE REF TO if_ixml_element,
lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_comments TYPE REF TO zcl_excel_comments,
lo_comment TYPE REF TO zcl_excel_comment,
lv_row TYPE zexcel_cell_row,
lv_str_column TYPE zexcel_cell_column_alpha,
lv_column TYPE zexcel_cell_column,
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.
**********************************************************************
* STEP 1: Create XML document
lo_document = me->ixml->create_document( ).
***********************************************************************
* STEP 2: Create main node relationships
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_xml
parent = lo_document ).
lo_element_root->set_attribute_ns( : name = 'xmlns:v' value = lc_xml_node_ns_v ),
name = 'xmlns:o' value = lc_xml_node_ns_o ),
name = 'xmlns:x' value = lc_xml_node_ns_x ).
**********************************************************************
* STEP 3: Create o:shapeLayout
* TO-DO: management of several authors
lo_element_shapelayout = lo_document->create_simple_element( name = lc_xml_node_shapelayout
parent = lo_document ).
lo_element_shapelayout->set_attribute_ns( name = lc_xml_attr_vext
value = lc_xml_attr_val_edit ).
lo_element_idmap = lo_document->create_simple_element( name = lc_xml_node_idmap
parent = lo_document ).
lo_element_idmap->set_attribute_ns( : name = lc_xml_attr_vext value = lc_xml_attr_val_edit ),
name = lc_xml_attr_data value = '1' ).
lo_element_shapelayout->append_child( new_child = lo_element_idmap ).
lo_element_root->append_child( new_child = lo_element_shapelayout ).
**********************************************************************
* STEP 4: Create v:shapetype
lo_element_shapetype = lo_document->create_simple_element( name = lc_xml_node_shapetype
parent = lo_document ).
lo_element_shapetype->set_attribute_ns( : name = lc_xml_attr_id value = '_x0000_t202' ),
name = lc_xml_attr_coordsize value = '21600,21600' ),
name = lc_xml_attr_ospt value = '202' ),
name = lc_xml_attr_path value = 'm,l,21600r21600,l21600,xe' ).
lo_element_stroke = lo_document->create_simple_element( name = lc_xml_node_stroke
parent = lo_document ).
lo_element_stroke->set_attribute_ns( name = lc_xml_attr_joinstyle value = lc_xml_attr_val_miter ).
lo_element_path = lo_document->create_simple_element( name = lc_xml_node_path
parent = lo_document ).
lo_element_path->set_attribute_ns( : name = lc_xml_attr_gradientshapeok value = lc_xml_attr_val_t ),
name = lc_xml_attr_oconnecttype value = lc_xml_attr_val_rect ).
lo_element_shapetype->append_child( : new_child = lo_element_stroke ),
new_child = lo_element_path ).
lo_element_root->append_child( new_child = lo_element_shapetype ).
**********************************************************************
* STEP 4: Create v:shapetype
lo_comments = io_worksheet->get_comments( ).
lo_iterator = lo_comments->get_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lv_index = sy-index.
lo_comment ?= lo_iterator->get_next( ).
zcl_excel_common=>convert_columnrow2column_a_row( EXPORTING i_columnrow = lo_comment->get_ref( )
IMPORTING e_column = lv_str_column
e_row = lv_row ).
lv_column = zcl_excel_common=>convert_column2int( lv_str_column ).
lo_element_shape = lo_document->create_simple_element( name = lc_xml_node_shape
parent = lo_document ).
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_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_oinsetmode value = lc_xml_attr_val_auto ).
" Fill
lo_element_fill = lo_document->create_simple_element( name = lc_xml_node_fill
parent = lo_document ).
lo_element_fill->set_attribute_ns( name = lc_xml_attr_color2 value = '#ffffe1' ).
lo_element_shape->append_child( new_child = lo_element_fill ).
" Shadow
lo_element_shadow = lo_document->create_simple_element( name = lc_xml_node_shadow
parent = lo_document ).
lo_element_shadow->set_attribute_ns( : name = lc_xml_attr_on value = lc_xml_attr_val_t ),
name = lc_xml_attr_color value = lc_xml_attr_val_black ),
name = lc_xml_attr_obscured value = lc_xml_attr_val_t ).
lo_element_shape->append_child( new_child = lo_element_shadow ).
" Path
lo_element_path = lo_document->create_simple_element( name = lc_xml_node_path
parent = lo_document ).
lo_element_path->set_attribute_ns( name = lc_xml_attr_oconnecttype value = lc_xml_attr_val_none ).
lo_element_shape->append_child( new_child = lo_element_path ).
" Textbox
lo_element_textbox = lo_document->create_simple_element( name = lc_xml_node_textbox
parent = lo_document ).
lo_element_textbox->set_attribute_ns( name = lc_xml_attr_style value = lc_xml_attr_val_msodir ).
lo_element_div = lo_document->create_simple_element( name = lc_xml_node_div
parent = lo_document ).
lo_element_div->set_attribute_ns( name = lc_xml_attr_style value = 'text-align:left' ).
lo_element_textbox->append_child( new_child = lo_element_div ).
lo_element_shape->append_child( new_child = lo_element_textbox ).
" ClientData
lo_element_clientdata = lo_document->create_simple_element( name = lc_xml_node_clientdata
parent = lo_document ).
lo_element_clientdata->set_attribute_ns( name = lc_xml_attr_objecttype value = lc_xml_attr_val_note ).
lo_element_movewithcells = lo_document->create_simple_element( name = lc_xml_node_movewithcells
parent = lo_document ).
lo_element_clientdata->append_child( new_child = lo_element_movewithcells ).
lo_element_sizewithcells = lo_document->create_simple_element( name = lc_xml_node_sizewithcells
parent = lo_document ).
lo_element_clientdata->append_child( new_child = lo_element_sizewithcells ).
lo_element_anchor = lo_document->create_simple_element( name = lc_xml_node_anchor
parent = lo_document ).
lo_element_anchor->set_value( '2, 15, 11, 10, 4, 31, 15, 9' ).
lo_element_clientdata->append_child( new_child = lo_element_anchor ).
lo_element_autofill = lo_document->create_simple_element( name = lc_xml_node_autofill
parent = lo_document ).
lo_element_autofill->set_value( 'False' ).
lo_element_clientdata->append_child( new_child = lo_element_autofill ).
lo_element_row = lo_document->create_simple_element( name = lc_xml_node_row
parent = lo_document ).
lv_int_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_column = lo_document->create_simple_element( name = lc_xml_node_column
parent = lo_document ).
lv_int_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_shape->append_child( new_child = lo_element_clientdata ).
lo_element_root->append_child( new_child = lo_element_shape ).
ENDWHILE.
**********************************************************************
* STEP 6: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_xl_drawing_for_hdft_im.
DATA:
ld_1 TYPE string,
ld_2 TYPE string,
ld_3 TYPE string,
ld_4 TYPE string,
ld_5 TYPE string,
ld_7 TYPE string,
ls_odd_header TYPE zexcel_s_worksheet_head_foot,
ls_odd_footer TYPE zexcel_s_worksheet_head_foot,
ls_even_header TYPE zexcel_s_worksheet_head_foot,
ls_even_footer TYPE zexcel_s_worksheet_head_foot,
lv_content TYPE string,
lo_xml_document TYPE REF TO cl_xml_document.
* INIT_RESULT
CLEAR ep_content.
* BODY
ld_1 = '<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1"/></o:shapelayout>'.
ld_2 = '<v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"/><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"/>'.
ld_3 = '<v:f eqn="sum @0 1 0"/><v:f eqn="sum 0 0 @1"/><v:f eqn="prod @2 1 2"/><v:f eqn="prod @3 21600 pixelWidth"/><v:f eqn="prod @3 21600 pixelHeight"/><v:f eqn="sum @0 0 1"/><v:f eqn="prod @6 1 2"/><v:f eqn="prod @7 21600 pixelWidth"/>'.
ld_4 = '<v:f eqn="sum @8 21600 0"/><v:f eqn="prod @7 21600 pixelHeight"/><v:f eqn="sum @10 21600 0"/></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/><o:lock v:ext="edit" aspectratio="t"/></v:shapetype>'.
CONCATENATE ld_1
ld_2
ld_3
ld_4
INTO lv_content.
io_worksheet->sheet_setup->get_header_footer( IMPORTING ep_odd_header = ls_odd_header
ep_odd_footer = ls_odd_footer
ep_even_header = ls_even_header
ep_even_footer = ls_even_footer ).
ld_5 = me->set_vml_shape_header( ls_odd_header ).
CONCATENATE lv_content
ld_5
INTO lv_content.
ld_5 = me->set_vml_shape_header( ls_even_header ).
CONCATENATE lv_content
ld_5
INTO lv_content.
ld_5 = me->set_vml_shape_footer( ls_odd_footer ).
CONCATENATE lv_content
ld_5
INTO lv_content.
ld_5 = me->set_vml_shape_footer( ls_even_footer ).
CONCATENATE lv_content
ld_5
INTO lv_content.
ld_7 = '</xml>'.
CONCATENATE lv_content
ld_7
INTO lv_content.
CREATE OBJECT lo_xml_document.
CALL METHOD lo_xml_document->parse_string
EXPORTING
stream = lv_content.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = lv_content
IMPORTING
buffer = ep_content
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
CLEAR ep_content.
ENDIF.
ENDMETHOD.
METHOD create_xl_relationships.
** Constant node name
DATA: lc_xml_node_relationships TYPE string VALUE 'Relationships',
lc_xml_node_relationship TYPE string VALUE 'Relationship',
" Node attributes
lc_xml_attr_id TYPE string VALUE 'Id',
lc_xml_attr_type TYPE string VALUE 'Type',
lc_xml_attr_target TYPE string VALUE 'Target',
" Node namespace
lc_xml_node_rels_ns TYPE string VALUE 'http://schemas.openxmlformats.org/package/2006/relationships',
" Node id
lc_xml_node_ridx_id TYPE string VALUE 'rId#',
" Node type
lc_xml_node_rid_sheet_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',
lc_xml_node_rid_theme_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',
lc_xml_node_rid_styles_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',
lc_xml_node_rid_shared_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',
" Node target
lc_xml_node_ridx_tg TYPE string VALUE 'worksheets/sheet#.xml',
lc_xml_node_rid_shared_tg TYPE string VALUE 'sharedStrings.xml',
lc_xml_node_rid_styles_tg TYPE string VALUE 'styles.xml',
lc_xml_node_rid_theme_tg TYPE string VALUE 'theme/theme1.xml'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element TYPE REF TO if_ixml_element.
DATA: lv_xml_node_ridx_tg TYPE string,
lv_xml_node_ridx_id TYPE string,
lv_size TYPE i,
lv_syindex TYPE string.
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
**********************************************************************
* STEP 3: Create main node relationships
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_relationships
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns'
value = lc_xml_node_rels_ns ).
**********************************************************************
* STEP 4: Create subnodes
lv_size = excel->get_worksheets_size( ).
" Relationship node
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
lv_size = lv_size + 1.
lv_syindex = lv_size.
SHIFT lv_syindex RIGHT DELETING TRAILING space.
SHIFT lv_syindex LEFT DELETING LEADING space.
lv_xml_node_ridx_id = lc_xml_node_ridx_id.
REPLACE ALL OCCURRENCES OF '#' IN lv_xml_node_ridx_id WITH lv_syindex.
lo_element->set_attribute_ns( name = lc_xml_attr_id
value = lv_xml_node_ridx_id ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid_theme_tp ).
lo_element->set_attribute_ns( name = lc_xml_attr_target
value = lc_xml_node_rid_theme_tg ).
lo_element_root->append_child( new_child = lo_element ).
" Relationship node
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
lv_size = lv_size + 1.
lv_syindex = lv_size.
SHIFT lv_syindex RIGHT DELETING TRAILING space.
SHIFT lv_syindex LEFT DELETING LEADING space.
lv_xml_node_ridx_id = lc_xml_node_ridx_id.
REPLACE ALL OCCURRENCES OF '#' IN lv_xml_node_ridx_id WITH lv_syindex.
lo_element->set_attribute_ns( name = lc_xml_attr_id
value = lv_xml_node_ridx_id ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid_styles_tp ).
lo_element->set_attribute_ns( name = lc_xml_attr_target
value = lc_xml_node_rid_styles_tg ).
lo_element_root->append_child( new_child = lo_element ).
lv_size = excel->get_worksheets_size( ).
DO lv_size TIMES.
" Relationship node
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
lv_xml_node_ridx_id = lc_xml_node_ridx_id.
lv_xml_node_ridx_tg = lc_xml_node_ridx_tg.
lv_syindex = sy-index.
SHIFT lv_syindex RIGHT DELETING TRAILING space.
SHIFT lv_syindex LEFT DELETING LEADING space.
REPLACE ALL OCCURRENCES OF '#' IN lv_xml_node_ridx_id WITH lv_syindex.
REPLACE ALL OCCURRENCES OF '#' IN lv_xml_node_ridx_tg WITH lv_syindex.
lo_element->set_attribute_ns( name = lc_xml_attr_id
value = lv_xml_node_ridx_id ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid_sheet_tp ).
lo_element->set_attribute_ns( name = lc_xml_attr_target
value = lv_xml_node_ridx_tg ).
lo_element_root->append_child( new_child = lo_element ).
ENDDO.
" Relationship node
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
ADD 3 TO lv_size.
lv_syindex = lv_size.
SHIFT lv_syindex RIGHT DELETING TRAILING space.
SHIFT lv_syindex LEFT DELETING LEADING space.
lv_xml_node_ridx_id = lc_xml_node_ridx_id.
REPLACE ALL OCCURRENCES OF '#' IN lv_xml_node_ridx_id WITH lv_syindex.
lo_element->set_attribute_ns( name = lc_xml_attr_id
value = lv_xml_node_ridx_id ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid_shared_tp ).
lo_element->set_attribute_ns( name = lc_xml_attr_target
value = lc_xml_node_rid_shared_tg ).
lo_element_root->append_child( new_child = lo_element ).
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_xl_sharedstrings.
** Constant node name
DATA: lc_xml_node_sst TYPE string VALUE 'sst',
lc_xml_node_si TYPE string VALUE 'si',
lc_xml_node_t TYPE string VALUE 't',
lc_xml_node_r TYPE string VALUE 'r',
lc_xml_node_rpr TYPE string VALUE 'rPr',
" Node attributes
lc_xml_attr_count TYPE string VALUE 'count',
lc_xml_attr_uniquecount TYPE string VALUE 'uniqueCount',
" Node namespace
lc_xml_node_ns TYPE string VALUE 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element TYPE REF TO if_ixml_element,
lo_sub_element TYPE REF TO if_ixml_element,
lo_sub2_element TYPE REF TO if_ixml_element,
lo_font_element TYPE REF TO if_ixml_element,
lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_worksheet TYPE REF TO zcl_excel_worksheet.
DATA: lt_cell_data TYPE zexcel_t_cell_data_unsorted,
lt_cell_data_rtf TYPE zexcel_t_cell_data_unsorted,
lv_value TYPE string,
ls_shared_string TYPE zexcel_s_shared_string,
lv_count_str TYPE string,
lv_uniquecount_str TYPE string,
lv_sytabix TYPE sytabix,
lv_count TYPE i,
lv_uniquecount TYPE i.
FIELD-SYMBOLS: <fs_sheet_content> TYPE zexcel_s_cell_data,
<fs_rtf> TYPE zexcel_s_rtf,
<fs_sheet_string> TYPE zexcel_s_shared_string.
**********************************************************************
* STEP 1: Collect strings from each worksheet
lo_iterator = excel->get_worksheets_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_worksheet ?= lo_iterator->get_next( ).
APPEND LINES OF lo_worksheet->sheet_content TO lt_cell_data.
ENDWHILE.
DELETE lt_cell_data WHERE cell_formula IS NOT INITIAL. " delete formula content
DESCRIBE TABLE lt_cell_data LINES lv_count.
MOVE lv_count TO lv_count_str.
" separating plain and rich text format strings
lt_cell_data_rtf = lt_cell_data.
DELETE lt_cell_data WHERE rtf_tab IS NOT INITIAL.
DELETE lt_cell_data_rtf WHERE rtf_tab IS INITIAL.
SHIFT lv_count_str RIGHT DELETING TRAILING space.
SHIFT lv_count_str LEFT DELETING LEADING space.
SORT lt_cell_data BY cell_value data_type.
DELETE ADJACENT DUPLICATES FROM lt_cell_data COMPARING cell_value data_type.
" leave unique rich text format strings
SORT lt_cell_data_rtf BY cell_value rtf_tab.
DELETE ADJACENT DUPLICATES FROM lt_cell_data_rtf COMPARING cell_value rtf_tab.
" merge into single list
APPEND LINES OF lt_cell_data_rtf TO lt_cell_data.
SORT lt_cell_data BY cell_value rtf_tab.
FREE lt_cell_data_rtf.
DESCRIBE TABLE lt_cell_data LINES lv_uniquecount.
MOVE lv_uniquecount TO lv_uniquecount_str.
SHIFT lv_uniquecount_str RIGHT DELETING TRAILING space.
SHIFT lv_uniquecount_str LEFT DELETING LEADING space.
CLEAR lv_count.
LOOP AT lt_cell_data ASSIGNING <fs_sheet_content> WHERE data_type = 's'.
* lv_sytabix = sy-tabix - 1.
lv_sytabix = lv_count.
MOVE lv_sytabix TO ls_shared_string-string_no.
MOVE <fs_sheet_content>-cell_value TO ls_shared_string-string_value.
MOVE <fs_sheet_content>-data_type TO ls_shared_string-string_type.
ls_shared_string-rtf_tab = <fs_sheet_content>-rtf_tab.
INSERT ls_shared_string INTO TABLE shared_strings.
ADD 1 TO lv_count.
ENDLOOP.
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
**********************************************************************
* STEP 3: Create main node
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_sst
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns'
value = lc_xml_node_ns ).
lo_element_root->set_attribute_ns( name = lc_xml_attr_count
value = lv_count_str ).
lo_element_root->set_attribute_ns( name = lc_xml_attr_uniquecount
value = lv_uniquecount_str ).
**********************************************************************
* STEP 4: Create subnode
LOOP AT shared_strings ASSIGNING <fs_sheet_string>.
lo_element = lo_document->create_simple_element( name = lc_xml_node_si
parent = lo_document ).
IF <fs_sheet_string>-rtf_tab IS INITIAL.
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_t
parent = lo_document ).
IF boolc( contains( val = <fs_sheet_string>-string_value start = ` ` ) ) = abap_true
OR boolc( contains( val = <fs_sheet_string>-string_value end = ` ` ) ) = abap_true.
lo_sub_element->set_attribute( name = 'space' namespace = 'xml' value = 'preserve' ).
ENDIF.
lo_sub_element->set_value( value = <fs_sheet_string>-string_value ).
ELSE.
LOOP AT <fs_sheet_string>-rtf_tab ASSIGNING <fs_rtf>.
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_r
parent = lo_element ).
TRY.
lv_value = substring( val = <fs_sheet_string>-string_value
off = <fs_rtf>-offset
len = <fs_rtf>-length ).
CATCH cx_sy_range_out_of_bounds.
EXIT.
ENDTRY.
IF <fs_rtf>-font IS NOT INITIAL.
lo_font_element = lo_document->create_simple_element( name = lc_xml_node_rpr
parent = lo_sub_element ).
create_xl_styles_font_node( io_document = lo_document
io_parent = lo_font_element
is_font = <fs_rtf>-font
iv_use_rtf = abap_true ).
ENDIF.
lo_sub2_element = lo_document->create_simple_element( name = lc_xml_node_t
parent = lo_sub_element ).
IF boolc( contains( val = lv_value start = ` ` ) ) = abap_true
OR boolc( contains( val = lv_value end = ` ` ) ) = abap_true.
lo_sub2_element->set_attribute( name = 'space' namespace = 'xml' value = 'preserve' ).
ENDIF.
lo_sub2_element->set_value( lv_value ).
ENDLOOP.
ENDIF.
lo_element->append_child( new_child = lo_sub_element ).
lo_element_root->append_child( new_child = lo_element ).
ENDLOOP.
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_xl_sheet.
*--------------------------------------------------------------------*
* issue #330 - Adding ColorScale conditional formatting
* - Ivan Femia, 2014-08-25
*--------------------------------------------------------------------*
TYPES: BEGIN OF colors,
colorrgb TYPE zexcel_color,
END OF colors.
*--------------------------------------------------------------------*
* issue #237 - Error writing column-style
* - Stefan Schmoecker, 2012-11-01
*--------------------------------------------------------------------*
TYPES: BEGIN OF cfvo,
value TYPE zexcel_conditional_value,
type TYPE zexcel_conditional_type,
END OF cfvo.
*--------------------------------------------------------------------*
* issue #220 - If cell in tables-area don't use default from row or column or sheet - Declarations 1 - start
*--------------------------------------------------------------------*
TYPES: BEGIN OF lty_table_area,
left TYPE i,
right TYPE i,
top TYPE i,
bottom TYPE i,
END OF lty_table_area.
*--------------------------------------------------------------------*
* issue #220 - If cell in tables-area don't use default from row or column or sheet - Declarations 1 - end
*--------------------------------------------------------------------*
TYPES: BEGIN OF ty_condformating_range,
dimension_range TYPE string,
condformatting_node TYPE REF TO if_ixml_element,
END OF ty_condformating_range,
ty_condformating_ranges TYPE STANDARD TABLE OF ty_condformating_range.
** Constant node name
DATA: lc_xml_node_worksheet TYPE string VALUE 'worksheet',
lc_xml_node_sheetpr TYPE string VALUE 'sheetPr',
lc_xml_node_tabcolor TYPE string VALUE 'tabColor',
lc_xml_node_outlinepr TYPE string VALUE 'outlinePr',
lc_xml_node_dimension TYPE string VALUE 'dimension',
lc_xml_node_sheetviews TYPE string VALUE 'sheetViews',
lc_xml_node_sheetview TYPE string VALUE 'sheetView',
lc_xml_node_selection TYPE string VALUE 'selection',
lc_xml_node_pane TYPE string VALUE 'pane',
lc_xml_node_sheetformatpr TYPE string VALUE 'sheetFormatPr',
lc_xml_node_cols TYPE string VALUE 'cols',
lc_xml_node_col TYPE string VALUE 'col',
lc_xml_node_sheetprotection TYPE string VALUE 'sheetProtection',
lc_xml_node_pagemargins TYPE string VALUE 'pageMargins',
lc_xml_node_pagesetup TYPE string VALUE 'pageSetup',
lc_xml_node_pagesetuppr TYPE string VALUE 'pageSetUpPr',
lc_xml_node_condformatting TYPE string VALUE 'conditionalFormatting',
lc_xml_node_cfrule TYPE string VALUE 'cfRule',
lc_xml_node_color TYPE string VALUE 'color', " Databar by Albert Lladanosa
lc_xml_node_databar TYPE string VALUE 'dataBar', " Databar by Albert Lladanosa
lc_xml_node_colorscale TYPE string VALUE 'colorScale',
lc_xml_node_iconset TYPE string VALUE 'iconSet',
lc_xml_node_cfvo TYPE string VALUE 'cfvo',
lc_xml_node_formula TYPE string VALUE 'formula',
lc_xml_node_datavalidations TYPE string VALUE 'dataValidations',
lc_xml_node_datavalidation TYPE string VALUE 'dataValidation',
lc_xml_node_formula1 TYPE string VALUE 'formula1',
lc_xml_node_formula2 TYPE string VALUE 'formula2',
lc_xml_node_mergecell TYPE string VALUE 'mergeCell',
lc_xml_node_mergecells TYPE string VALUE 'mergeCells',
lc_xml_node_drawing TYPE string VALUE 'drawing',
lc_xml_node_drawing_for_cmt TYPE string VALUE 'legacyDrawing',
**********************************************************************
lc_xml_node_drawing_for_hd_ft TYPE string VALUE 'legacyDrawingHF',
**********************************************************************
lc_xml_node_headerfooter TYPE string VALUE 'headerFooter',
lc_xml_node_oddheader TYPE string VALUE 'oddHeader',
lc_xml_node_oddfooter TYPE string VALUE 'oddFooter',
lc_xml_node_evenheader TYPE string VALUE 'evenHeader',
lc_xml_node_evenfooter TYPE string VALUE 'evenFooter',
lc_xml_node_autofilter TYPE string VALUE 'autoFilter',
lc_xml_node_filtercolumn TYPE string VALUE 'filterColumn',
lc_xml_node_filters TYPE string VALUE 'filters',
lc_xml_node_filter TYPE string VALUE 'filter',
" Node attributes
lc_xml_attr_ref TYPE string VALUE 'ref',
lc_xml_attr_summarybelow TYPE string VALUE 'summaryBelow',
lc_xml_attr_summaryright TYPE string VALUE 'summaryRight',
lc_xml_attr_tabselected TYPE string VALUE 'tabSelected',
lc_xml_attr_showzeros TYPE string VALUE 'showZeros',
lc_xml_attr_zoomscale TYPE string VALUE 'zoomScale',
lc_xml_attr_zoomscalenormal TYPE string VALUE 'zoomScaleNormal',
lc_xml_attr_zoomscalepageview TYPE string VALUE 'zoomScalePageLayoutView',
lc_xml_attr_zoomscalesheetview TYPE string VALUE 'zoomScaleSheetLayoutView',
lc_xml_attr_workbookviewid TYPE string VALUE 'workbookViewId',
lc_xml_attr_showgridlines TYPE string VALUE 'showGridLines',
lc_xml_attr_gridlines TYPE string VALUE 'gridLines',
lc_xml_attr_showrowcolheaders TYPE string VALUE 'showRowColHeaders',
lc_xml_attr_activecell TYPE string VALUE 'activeCell',
lc_xml_attr_sqref TYPE string VALUE 'sqref',
lc_xml_attr_min TYPE string VALUE 'min',
lc_xml_attr_max TYPE string VALUE 'max',
lc_xml_attr_hidden TYPE string VALUE 'hidden',
lc_xml_attr_width TYPE string VALUE 'width',
lc_xml_attr_defaultwidth TYPE string VALUE '9.10',
lc_xml_attr_style TYPE string VALUE 'style',
lc_xml_attr_true TYPE string VALUE 'true',
lc_xml_attr_bestfit TYPE string VALUE 'bestFit',
lc_xml_attr_customheight TYPE string VALUE 'customHeight',
lc_xml_attr_customwidth TYPE string VALUE 'customWidth',
lc_xml_attr_collapsed TYPE string VALUE 'collapsed',
lc_xml_attr_defaultrowheight TYPE string VALUE 'defaultRowHeight',
lc_xml_attr_defaultcolwidth TYPE string VALUE 'defaultColWidth',
lc_xml_attr_outlinelevelrow TYPE string VALUE 'x14ac:outlineLevelRow',
lc_xml_attr_outlinelevelcol TYPE string VALUE 'x14ac:outlineLevelCol',
lc_xml_attr_outlinelevel TYPE string VALUE 'outlineLevel',
lc_xml_attr_password TYPE string VALUE 'password',
lc_xml_attr_sheet TYPE string VALUE 'sheet',
lc_xml_attr_objects TYPE string VALUE 'objects',
lc_xml_attr_scenarios TYPE string VALUE 'scenarios',
lc_xml_attr_autofilter TYPE string VALUE 'autoFilter',
lc_xml_attr_deletecolumns TYPE string VALUE 'deleteColumns',
lc_xml_attr_deleterows TYPE string VALUE 'deleteRows',
lc_xml_attr_formatcells TYPE string VALUE 'formatCells',
lc_xml_attr_formatcolumns TYPE string VALUE 'formatColumns',
lc_xml_attr_formatrows TYPE string VALUE 'formatRows',
lc_xml_attr_insertcolumns TYPE string VALUE 'insertColumns',
lc_xml_attr_inserthyperlinks TYPE string VALUE 'insertHyperlinks',
lc_xml_attr_insertrows TYPE string VALUE 'insertRows',
lc_xml_attr_pivottables TYPE string VALUE 'pivotTables',
lc_xml_attr_selectlockedcells TYPE string VALUE 'selectLockedCells',
lc_xml_attr_selectunlockedcell TYPE string VALUE 'selectUnlockedCells',
lc_xml_attr_sort TYPE string VALUE 'sort',
lc_xml_attr_left TYPE string VALUE 'left',
lc_xml_attr_right TYPE string VALUE 'right',
lc_xml_attr_top TYPE string VALUE 'top',
lc_xml_attr_bottom TYPE string VALUE 'bottom',
lc_xml_attr_header TYPE string VALUE 'header',
lc_xml_attr_footer TYPE string VALUE 'footer',
lc_xml_attr_type TYPE string VALUE 'type',
lc_xml_attr_iconset TYPE string VALUE 'iconSet',
lc_xml_attr_showvalue TYPE string VALUE 'showValue',
lc_xml_attr_val TYPE string VALUE 'val',
lc_xml_attr_dxfid TYPE string VALUE 'dxfId',
lc_xml_attr_priority TYPE string VALUE 'priority',
lc_xml_attr_operator TYPE string VALUE 'operator',
lc_xml_attr_text TYPE string VALUE 'text',
lc_xml_attr_notcontainstext TYPE string VALUE 'notContainsText',
lc_xml_attr_allowblank TYPE string VALUE 'allowBlank',
lc_xml_attr_showinputmessage TYPE string VALUE 'showInputMessage',
lc_xml_attr_showerrormessage TYPE string VALUE 'showErrorMessage',
lc_xml_attr_showdropdown TYPE string VALUE 'ShowDropDown', " 'showDropDown' does not work
lc_xml_attr_errortitle TYPE string VALUE 'errorTitle',
lc_xml_attr_error TYPE string VALUE 'error',
lc_xml_attr_errorstyle TYPE string VALUE 'errorStyle',
lc_xml_attr_prompttitle TYPE string VALUE 'promptTitle',
lc_xml_attr_prompt TYPE string VALUE 'prompt',
lc_xml_attr_count TYPE string VALUE 'count',
lc_xml_attr_blackandwhite TYPE string VALUE 'blackAndWhite',
lc_xml_attr_cellcomments TYPE string VALUE 'cellComments',
lc_xml_attr_copies TYPE string VALUE 'copies',
lc_xml_attr_draft TYPE string VALUE 'draft',
lc_xml_attr_errors TYPE string VALUE 'errors',
lc_xml_attr_firstpagenumber TYPE string VALUE 'firstPageNumber',
lc_xml_attr_fittopage TYPE string VALUE 'fitToPage',
lc_xml_attr_fittoheight TYPE string VALUE 'fitToHeight',
lc_xml_attr_fittowidth TYPE string VALUE 'fitToWidth',
lc_xml_attr_horizontaldpi TYPE string VALUE 'horizontalDpi',
lc_xml_attr_orientation TYPE string VALUE 'orientation',
lc_xml_attr_pageorder TYPE string VALUE 'pageOrder',
lc_xml_attr_paperheight TYPE string VALUE 'paperHeight',
lc_xml_attr_papersize TYPE string VALUE 'paperSize',
lc_xml_attr_paperwidth TYPE string VALUE 'paperWidth',
lc_xml_attr_scale TYPE string VALUE 'scale',
lc_xml_attr_usefirstpagenumber TYPE string VALUE 'useFirstPageNumber',
lc_xml_attr_useprinterdefaults TYPE string VALUE 'usePrinterDefaults',
lc_xml_attr_verticaldpi TYPE string VALUE 'verticalDpi',
lc_xml_attr_differentoddeven TYPE string VALUE 'differentOddEven',
lc_xml_attr_colid TYPE string VALUE 'colId',
lc_xml_attr_filtermode TYPE string VALUE 'filterMode',
lc_xml_attr_tabcolor_rgb TYPE string VALUE 'rgb',
" Node namespace
lc_xml_node_ns TYPE string VALUE 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',
lc_xml_node_r_ns TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
lc_xml_node_comp_ns TYPE string VALUE 'http://schemas.openxmlformats.org/markup-compatibility/2006',
lc_xml_node_comp_pref TYPE string VALUE 'x14ac',
lc_xml_node_ig_ns TYPE string VALUE 'http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element TYPE REF TO if_ixml_element,
lo_element_2 TYPE REF TO if_ixml_element,
lo_element_3 TYPE REF TO if_ixml_element,
lo_element_4 TYPE REF TO if_ixml_element,
lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_style_cond TYPE REF TO zcl_excel_style_cond,
lo_data_validation TYPE REF TO zcl_excel_data_validation,
lo_table TYPE REF TO zcl_excel_table,
lo_column_default TYPE REF TO zcl_excel_column,
lo_row_default TYPE REF TO zcl_excel_row.
DATA: lv_value TYPE string,
lt_range_merge TYPE string_table,
lv_column TYPE zexcel_cell_column,
lv_style_guid TYPE zexcel_cell_style,
ls_databar TYPE zexcel_conditional_databar, " Databar by Albert Lladanosa
ls_colorscale TYPE zexcel_conditional_colorscale,
ls_iconset TYPE zexcel_conditional_iconset,
ls_cellis TYPE zexcel_conditional_cellis,
ls_textfunction TYPE zcl_excel_style_cond=>ts_conditional_textfunction,
lv_column_start TYPE zexcel_cell_column_alpha,
lv_row_start TYPE zexcel_cell_row,
lv_cell_coords TYPE zexcel_cell_coords,
ls_expression TYPE zexcel_conditional_expression,
ls_conditional_top10 TYPE zexcel_conditional_top10,
ls_conditional_above_avg TYPE zexcel_conditional_above_avg,
lt_cfvo TYPE TABLE OF cfvo,
ls_cfvo TYPE cfvo,
lt_colors TYPE TABLE OF colors,
ls_colors TYPE colors,
lv_cell_row_s TYPE string,
ls_style_mapping TYPE zexcel_s_styles_mapping,
lv_freeze_cell_row TYPE zexcel_cell_row,
lv_freeze_cell_column TYPE zexcel_cell_column,
lv_freeze_cell_column_alpha TYPE zexcel_cell_column_alpha,
lo_column_iterator TYPE REF TO cl_object_collection_iterator,
lo_column TYPE REF TO zcl_excel_column,
lo_row_iterator TYPE REF TO cl_object_collection_iterator,
ls_style_cond_mapping TYPE zexcel_s_styles_cond_mapping,
lv_relation_id TYPE i VALUE 0,
outline_level_col TYPE i VALUE 0,
lts_row_outlines TYPE zcl_excel_worksheet=>mty_ts_outlines_row,
merge_count TYPE int4,
lt_values TYPE zexcel_t_autofilter_values,
ls_values TYPE zexcel_s_autofilter_values,
lo_autofilters TYPE REF TO zcl_excel_autofilters,
lo_autofilter TYPE REF TO zcl_excel_autofilter,
lv_ref TYPE string,
lt_condformating_ranges TYPE ty_condformating_ranges,
ls_condformating_range TYPE ty_condformating_range,
ld_first_half TYPE string,
ld_second_half TYPE string.
FIELD-SYMBOLS: <ls_sheet_content> TYPE zexcel_s_cell_data,
<fs_range_merge> LIKE LINE OF lt_range_merge,
<ls_row_outline> LIKE LINE OF lts_row_outlines,
<ls_condformating_range> TYPE ty_condformating_range.
*--------------------------------------------------------------------*
* issue #220 - If cell in tables-area don't use default from row or column or sheet - Declarations 2 - start
*--------------------------------------------------------------------*
DATA: lt_table_areas TYPE SORTED TABLE OF lty_table_area WITH NON-UNIQUE KEY left right top bottom.
*--------------------------------------------------------------------*
* issue #220 - If cell in tables-area don't use default from row or column or sheet - Declarations 2 - end
*--------------------------------------------------------------------*
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
***********************************************************************
* STEP 3: Create main node relationships
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_worksheet
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns'
value = lc_xml_node_ns ).
lo_element_root->set_attribute_ns( name = 'xmlns:r'
value = lc_xml_node_r_ns ).
lo_element_root->set_attribute_ns( name = 'xmlns:mc'
value = lc_xml_node_comp_ns ).
lo_element_root->set_attribute_ns( name = 'mc:Ignorable'
value = lc_xml_node_comp_pref ).
lo_element_root->set_attribute_ns( name = 'xmlns:x14ac'
value = lc_xml_node_ig_ns ).
**********************************************************************
* STEP 4: Create subnodes
" sheetPr
lo_element = lo_document->create_simple_element( name = lc_xml_node_sheetpr
parent = lo_document ).
" TODO tabColor
IF io_worksheet->tabcolor IS NOT INITIAL.
lo_element_2 = lo_document->create_simple_element( name = lc_xml_node_tabcolor
parent = lo_element ).
* Theme not supported yet - start with RGB
lv_value = io_worksheet->tabcolor-rgb.
lo_element_2->set_attribute_ns( name = lc_xml_attr_tabcolor_rgb
value = lv_value ).
ENDIF.
" outlinePr
lo_element_2 = lo_document->create_simple_element( name = lc_xml_node_outlinepr
parent = lo_document ).
lv_value = io_worksheet->zif_excel_sheet_properties~summarybelow.
CONDENSE lv_value.
lo_element_2->set_attribute_ns( name = lc_xml_attr_summarybelow
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_properties~summaryright.
CONDENSE lv_value.
lo_element_2->set_attribute_ns( name = lc_xml_attr_summaryright
value = lv_value ).
lo_element->append_child( new_child = lo_element_2 ).
IF io_worksheet->sheet_setup->fit_to_page IS NOT INITIAL.
lo_element_2 = lo_document->create_simple_element( name = lc_xml_node_pagesetuppr
parent = lo_document ).
lo_element_2->set_attribute_ns( name = lc_xml_attr_fittopage
value = `1` ).
lo_element->append_child( new_child = lo_element_2 ). " pageSetupPr node
ENDIF.
lo_element_root->append_child( new_child = lo_element ).
" dimension node
lo_element = lo_document->create_simple_element( name = lc_xml_node_dimension
parent = lo_document ).
lv_value = io_worksheet->get_dimension_range( ).
lo_element->set_attribute_ns( name = lc_xml_attr_ref
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
" sheetViews node
lo_element = lo_document->create_simple_element( name = lc_xml_node_sheetviews
parent = lo_document ).
" sheetView node
lo_element_2 = lo_document->create_simple_element( name = lc_xml_node_sheetview
parent = lo_document ).
IF io_worksheet->zif_excel_sheet_properties~show_zeros EQ abap_false.
lo_element_2->set_attribute_ns( name = lc_xml_attr_showzeros
value = '0' ).
ENDIF.
IF iv_active = abap_true
OR io_worksheet->zif_excel_sheet_properties~selected EQ abap_true.
lo_element_2->set_attribute_ns( name = lc_xml_attr_tabselected
value = '1' ).
ELSE.
lo_element_2->set_attribute_ns( name = lc_xml_attr_tabselected
value = '0' ).
ENDIF.
" Zoom scale
IF io_worksheet->zif_excel_sheet_properties~zoomscale GT 400.
io_worksheet->zif_excel_sheet_properties~zoomscale = 400.
ELSEIF io_worksheet->zif_excel_sheet_properties~zoomscale LT 10.
io_worksheet->zif_excel_sheet_properties~zoomscale = 10.
ENDIF.
lv_value = io_worksheet->zif_excel_sheet_properties~zoomscale.
CONDENSE lv_value.
lo_element_2->set_attribute_ns( name = lc_xml_attr_zoomscale
value = lv_value ).
IF io_worksheet->zif_excel_sheet_properties~zoomscale_normal NE 0.
IF io_worksheet->zif_excel_sheet_properties~zoomscale_normal GT 400.
io_worksheet->zif_excel_sheet_properties~zoomscale_normal = 400.
ELSEIF io_worksheet->zif_excel_sheet_properties~zoomscale_normal LT 10.
io_worksheet->zif_excel_sheet_properties~zoomscale_normal = 10.
ENDIF.
lv_value = io_worksheet->zif_excel_sheet_properties~zoomscale_normal.
CONDENSE lv_value.
lo_element_2->set_attribute_ns( name = lc_xml_attr_zoomscalenormal
value = lv_value ).
ENDIF.
IF io_worksheet->zif_excel_sheet_properties~zoomscale_pagelayoutview NE 0.
IF io_worksheet->zif_excel_sheet_properties~zoomscale_pagelayoutview GT 400.
io_worksheet->zif_excel_sheet_properties~zoomscale_pagelayoutview = 400.
ELSEIF io_worksheet->zif_excel_sheet_properties~zoomscale_pagelayoutview LT 10.
io_worksheet->zif_excel_sheet_properties~zoomscale_pagelayoutview = 10.
ENDIF.
lv_value = io_worksheet->zif_excel_sheet_properties~zoomscale_pagelayoutview.
CONDENSE lv_value.
lo_element_2->set_attribute_ns( name = lc_xml_attr_zoomscalepageview
value = lv_value ).
ENDIF.
IF io_worksheet->zif_excel_sheet_properties~zoomscale_sheetlayoutview NE 0.
IF io_worksheet->zif_excel_sheet_properties~zoomscale_sheetlayoutview GT 400.
io_worksheet->zif_excel_sheet_properties~zoomscale_sheetlayoutview = 400.
ELSEIF io_worksheet->zif_excel_sheet_properties~zoomscale_sheetlayoutview LT 10.
io_worksheet->zif_excel_sheet_properties~zoomscale_sheetlayoutview = 10.
ENDIF.
lv_value = io_worksheet->zif_excel_sheet_properties~zoomscale_sheetlayoutview.
CONDENSE lv_value.
lo_element_2->set_attribute_ns( name = lc_xml_attr_zoomscalesheetview
value = lv_value ).
ENDIF.
lo_element_2->set_attribute_ns( name = lc_xml_attr_workbookviewid
value = '0' ).
" showGridLines attribute
IF io_worksheet->show_gridlines = abap_true.
lo_element_2->set_attribute_ns( name = lc_xml_attr_showgridlines
value = '1' ).
ELSE.
lo_element_2->set_attribute_ns( name = lc_xml_attr_showgridlines
value = '0' ).
ENDIF.
" showRowColHeaders attribute
IF io_worksheet->show_rowcolheaders = abap_true.
lo_element_2->set_attribute_ns( name = lc_xml_attr_showrowcolheaders
value = '1' ).
ELSE.
lo_element_2->set_attribute_ns( name = lc_xml_attr_showrowcolheaders
value = '0' ).
ENDIF.
" freeze panes
io_worksheet->get_freeze_cell( IMPORTING ep_row = lv_freeze_cell_row
ep_column = lv_freeze_cell_column ).
IF lv_freeze_cell_row IS NOT INITIAL AND lv_freeze_cell_column IS NOT INITIAL.
lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_pane
parent = lo_element_2 ).
IF lv_freeze_cell_row > 1.
lv_value = lv_freeze_cell_row - 1.
CONDENSE lv_value.
lo_element_3->set_attribute_ns( name = 'ySplit'
value = lv_value ).
ENDIF.
IF lv_freeze_cell_column > 1.
lv_value = lv_freeze_cell_column - 1.
CONDENSE lv_value.
lo_element_3->set_attribute_ns( name = 'xSplit'
value = lv_value ).
ENDIF.
lv_freeze_cell_column_alpha = zcl_excel_common=>convert_column2alpha( ip_column = lv_freeze_cell_column ).
lv_value = zcl_excel_common=>number_to_excel_string( ip_value = lv_freeze_cell_row ).
CONCATENATE lv_freeze_cell_column_alpha lv_value INTO lv_value.
lo_element_3->set_attribute_ns( name = 'topLeftCell'
value = lv_value ).
lo_element_3->set_attribute_ns( name = 'activePane'
value = 'bottomRight' ).
lo_element_3->set_attribute_ns( name = 'state'
value = 'frozen' ).
lo_element_2->append_child( new_child = lo_element_3 ).
ENDIF.
" selection node
lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_selection
parent = lo_document ).
lv_value = io_worksheet->get_active_cell( ).
lo_element_3->set_attribute_ns( name = lc_xml_attr_activecell
value = lv_value ).
lo_element_3->set_attribute_ns( name = lc_xml_attr_sqref
value = lv_value ).
lo_element_2->append_child( new_child = lo_element_3 ). " sheetView node
lo_element->append_child( new_child = lo_element_2 ). " sheetView node
lo_element_root->append_child( new_child = lo_element ). " sheetViews node
lo_column_iterator = io_worksheet->get_columns_iterator( ).
lo_row_iterator = io_worksheet->get_rows_iterator( ).
" Calculate col
IF NOT lo_column_iterator IS BOUND.
io_worksheet->calculate_column_widths( ).
lo_column_iterator = io_worksheet->get_columns_iterator( ).
ENDIF.
" sheetFormatPr node
lo_element = lo_document->create_simple_element( name = lc_xml_node_sheetformatpr
parent = lo_document ).
" defaultRowHeight
lo_row_default = io_worksheet->get_default_row( ).
IF lo_row_default IS BOUND.
IF lo_row_default->get_row_height( ) >= 0.
lo_element->set_attribute_ns( name = lc_xml_attr_customheight
value = lc_xml_attr_true ).
lv_value = lo_row_default->get_row_height( ).
ELSE.
lv_value = '12.75'.
ENDIF.
ELSE.
lv_value = '12.75'.
ENDIF.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element->set_attribute_ns( name = lc_xml_attr_defaultrowheight
value = lv_value ).
" defaultColWidth
lo_column_default = io_worksheet->get_default_column( ).
IF lo_column_default IS BOUND AND lo_column_default->get_width( ) >= 0.
lv_value = lo_column_default->get_width( ).
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element->set_attribute_ns( name = lc_xml_attr_defaultcolwidth
value = lv_value ).
ENDIF.
" outlineLevelCol
WHILE lo_column_iterator->has_next( ) = abap_true.
lo_column ?= lo_column_iterator->get_next( ).
IF lo_column->get_outline_level( ) > outline_level_col.
outline_level_col = lo_column->get_outline_level( ).
ENDIF.
ENDWHILE.
lv_value = outline_level_col.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element->set_attribute_ns( name = lc_xml_attr_outlinelevelcol
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ). " sheetFormatPr node
* Reset column iterator
lo_column_iterator = io_worksheet->get_columns_iterator( ).
IF io_worksheet->zif_excel_sheet_properties~get_style( ) IS NOT INITIAL OR lo_column_iterator->has_next( ) = abap_true.
" cols node
lo_element = lo_document->create_simple_element( name = lc_xml_node_cols
parent = lo_document ).
" This code have to be enhanced in order to manage also column style properties
" Now it is an out/out
IF lo_column_iterator->has_next( ) = abap_true.
WHILE lo_column_iterator->has_next( ) = abap_true.
lo_column ?= lo_column_iterator->get_next( ).
" col node
lo_element_2 = lo_document->create_simple_element( name = lc_xml_node_col
parent = lo_document ).
lv_value = lo_column->get_column_index( ).
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element_2->set_attribute_ns( name = lc_xml_attr_min
value = lv_value ).
lo_element_2->set_attribute_ns( name = lc_xml_attr_max
value = lv_value ).
" Width
IF lo_column->get_width( ) < 0.
lo_element_2->set_attribute_ns( name = lc_xml_attr_width
value = lc_xml_attr_defaultwidth ).
ELSE.
lv_value = lo_column->get_width( ).
lo_element_2->set_attribute_ns( name = lc_xml_attr_width
value = lv_value ).
ENDIF.
" Column visibility
IF lo_column->get_visible( ) = abap_false.
lo_element_2->set_attribute_ns( name = lc_xml_attr_hidden
value = lc_xml_attr_true ).
ENDIF.
" Auto size?
IF lo_column->get_auto_size( ) = abap_true.
lo_element_2->set_attribute_ns( name = lc_xml_attr_bestfit
value = lc_xml_attr_true ).
ENDIF.
" Custom width?
IF lo_column_default IS BOUND.
IF lo_column->get_width( ) <> lo_column_default->get_width( ).
lo_element_2->set_attribute_ns( name = lc_xml_attr_customwidth
value = lc_xml_attr_true ).
ENDIF.
ELSE.
lo_element_2->set_attribute_ns( name = lc_xml_attr_customwidth
value = lc_xml_attr_true ).
ENDIF.
" Collapsed
IF lo_column->get_collapsed( ) = abap_true.
lo_element_2->set_attribute_ns( name = lc_xml_attr_collapsed
value = lc_xml_attr_true ).
ENDIF.
" outlineLevel
IF lo_column->get_outline_level( ) > 0.
lv_value = lo_column->get_outline_level( ).
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element_2->set_attribute_ns( name = lc_xml_attr_outlinelevel
value = lv_value ).
ENDIF.
" Style
lv_style_guid = lo_column->get_column_style_guid( ). "ins issue #157 - set column style
CLEAR ls_style_mapping.
READ TABLE styles_mapping INTO ls_style_mapping WITH KEY guid = lv_style_guid.
IF sy-subrc = 0. "ins issue #295
lv_value = ls_style_mapping-style. "ins issue #295
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element_2->set_attribute_ns( name = lc_xml_attr_style
value = lv_value ).
ENDIF. "ins issue #237
lo_element->append_child( new_child = lo_element_2 ). " col node
ENDWHILE.
* ELSE. "del issue #157 - set sheet style ( add missing columns
* IF io_worksheet->zif_excel_sheet_properties~get_style( ) IS NOT INITIAL. "del issue #157 - set sheet style ( add missing columns
* Begin of insertion issue #157 - set sheet style ( add missing columns
ENDIF.
* Always pass through this coding
IF io_worksheet->zif_excel_sheet_properties~get_style( ) IS NOT INITIAL.
DATA: lts_sorted_columns TYPE SORTED TABLE OF zexcel_cell_column WITH UNIQUE KEY table_line.
TYPES: BEGIN OF ty_missing_columns,
first_column TYPE zexcel_cell_column,
last_column TYPE zexcel_cell_column,
END OF ty_missing_columns.
DATA: t_missing_columns TYPE STANDARD TABLE OF ty_missing_columns WITH NON-UNIQUE DEFAULT KEY,
missing_column LIKE LINE OF t_missing_columns.
* First collect columns that were already handled before. The rest has to be inserted now
lo_column_iterator = io_worksheet->get_columns_iterator( ).
WHILE lo_column_iterator->has_next( ) = abap_true.
lo_column ?= lo_column_iterator->get_next( ).
lv_column = zcl_excel_common=>convert_column2int( lo_column->get_column_index( ) ).
INSERT lv_column INTO TABLE lts_sorted_columns.
ENDWHILE.
* Now find all columns that were missing so far
missing_column-first_column = 1.
LOOP AT lts_sorted_columns INTO lv_column.
IF lv_column > missing_column-first_column.
missing_column-last_column = lv_column - 1.
APPEND missing_column TO t_missing_columns.
ENDIF.
missing_column-first_column = lv_column + 1.
ENDLOOP.
missing_column-last_column = zcl_excel_common=>c_excel_sheet_max_col.
APPEND missing_column TO t_missing_columns.
* Now apply stylesetting ( and other defaults - I copy it from above. Whoever programmed that seems to know what to do :o)
LOOP AT t_missing_columns INTO missing_column.
* End of insertion issue #157 - set column style
lo_element_2 = lo_document->create_simple_element( name = lc_xml_node_col
parent = lo_document ).
* lv_value = zcl_excel_common=>c_excel_sheet_min_col."del issue #157 - set sheet style ( add missing columns
lv_value = missing_column-first_column. "ins issue #157 - set sheet style ( add missing columns
CONDENSE lv_value.
lo_element_2->set_attribute_ns( name = lc_xml_attr_min
value = lv_value ).
* lv_value = zcl_excel_common=>c_excel_sheet_max_col."del issue #157 - set sheet style ( add missing columns
lv_value = missing_column-last_column. "ins issue #157 - set sheet style ( add missing columns
CONDENSE lv_value.
lo_element_2->set_attribute_ns( name = lc_xml_attr_max
value = lv_value ).
lo_element_2->set_attribute_ns( name = lc_xml_attr_width
value = lc_xml_attr_defaultwidth ).
lv_style_guid = io_worksheet->zif_excel_sheet_properties~get_style( ).
READ TABLE styles_mapping INTO ls_style_mapping WITH KEY guid = lv_style_guid.
lv_value = ls_style_mapping-style.
CONDENSE lv_value.
lo_element_2->set_attribute_ns( name = lc_xml_attr_style
value = lv_value ).
lo_element->append_child( new_child = lo_element_2 ). " col node
ENDLOOP. "ins issue #157 - set sheet style ( add missing columns
ENDIF.
*--------------------------------------------------------------------*
* issue #367 add feature hide columns from
*--------------------------------------------------------------------*
IF io_worksheet->zif_excel_sheet_properties~hide_columns_from IS NOT INITIAL.
lo_element_2 = lo_document->create_simple_element( name = lc_xml_node_col
parent = lo_document ).
lv_value = zcl_excel_common=>convert_column2int( io_worksheet->zif_excel_sheet_properties~hide_columns_from ).
CONDENSE lv_value NO-GAPS.
lo_element_2->set_attribute_ns( name = lc_xml_attr_min
value = lv_value ).
lo_element_2->set_attribute_ns( name = lc_xml_attr_max
value = '16384' ).
lo_element_2->set_attribute_ns( name = lc_xml_attr_hidden
value = '1' ).
lo_element->append_child( new_child = lo_element_2 ). " col node
ENDIF.
lo_element_root->append_child( new_child = lo_element ). " cols node
ENDIF.
*--------------------------------------------------------------------*
* Sheet content - use own method to create this
*--------------------------------------------------------------------*
lo_element = create_xl_sheet_sheet_data( io_worksheet = io_worksheet
io_document = lo_document ) .
lo_autofilters = excel->get_autofilters_reference( ).
lo_autofilter = lo_autofilters->get( io_worksheet = io_worksheet ) .
lo_element_root->append_child( new_child = lo_element ). " sheetData node
*< Begin of insertion Issue #572 - Protect sheet with filter caused Excel error
* Autofilter must be set AFTER sheet protection in XML
IF io_worksheet->zif_excel_sheet_protection~protected EQ abap_true.
" sheetProtection node
lo_element = lo_document->create_simple_element( name = lc_xml_node_sheetprotection
parent = lo_document ).
MOVE io_worksheet->zif_excel_sheet_protection~password TO lv_value.
IF lv_value IS NOT INITIAL.
lo_element->set_attribute_ns( name = lc_xml_attr_password
value = lv_value ).
ENDIF.
lv_value = io_worksheet->zif_excel_sheet_protection~auto_filter.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_autofilter
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_protection~delete_columns.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_deletecolumns
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_protection~delete_rows.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_deleterows
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_protection~format_cells.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_formatcells
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_protection~format_columns.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_formatcolumns
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_protection~format_rows.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_formatrows
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_protection~insert_columns.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_insertcolumns
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_protection~insert_hyperlinks.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_inserthyperlinks
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_protection~insert_rows.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_insertrows
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_protection~objects.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_objects
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_protection~pivot_tables.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_pivottables
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_protection~scenarios.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_scenarios
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_protection~select_locked_cells.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_selectlockedcells
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_protection~select_unlocked_cells.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_selectunlockedcell
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_protection~sheet.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_sheet
value = lv_value ).
lv_value = io_worksheet->zif_excel_sheet_protection~sort.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_sort
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
ENDIF.
*> End of insertion Issue #572 - Protect sheet with filter caused Excel error
IF lo_autofilter IS BOUND.
* Create node autofilter
lo_element = lo_document->create_simple_element( name = lc_xml_node_autofilter
parent = lo_document ).
lv_ref = lo_autofilter->get_filter_range( ) .
CONDENSE lv_ref NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_ref
value = lv_ref ).
lt_values = lo_autofilter->get_values( ) .
IF lt_values IS NOT INITIAL.
* If we filter we need to set the filter mode to 1.
lo_element_2 = lo_document->find_from_name( name = lc_xml_node_sheetpr ).
lo_element_2->set_attribute_ns( name = lc_xml_attr_filtermode
value = '1' ).
* Create node filtercolumn
CLEAR lv_column.
LOOP AT lt_values INTO ls_values.
IF ls_values-column <> lv_column.
IF lv_column IS NOT INITIAL.
lo_element_2->append_child( new_child = lo_element_3 ).
lo_element->append_child( new_child = lo_element_2 ).
ENDIF.
lo_element_2 = lo_document->create_simple_element( name = lc_xml_node_filtercolumn
parent = lo_element ).
lv_column = ls_values-column - lo_autofilter->filter_area-col_start.
lv_value = lv_column.
CONDENSE lv_value NO-GAPS.
lo_element_2->set_attribute_ns( name = lc_xml_attr_colid
value = lv_value ).
lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_filters
parent = lo_element_2 ).
lv_column = ls_values-column.
ENDIF.
lo_element_4 = lo_document->create_simple_element( name = lc_xml_node_filter
parent = lo_element_3 ).
lo_element_4->set_attribute_ns( name = lc_xml_attr_val
value = ls_values-value ).
lo_element_3->append_child( new_child = lo_element_4 ). " value node
ENDLOOP.
lo_element_2->append_child( new_child = lo_element_3 ).
lo_element->append_child( new_child = lo_element_2 ).
ENDIF.
lo_element_root->append_child( new_child = lo_element ).
ENDIF.
*< Comment for Issue #572 - Protect sheet with filter caused Excel error
* IF io_worksheet->zif_excel_sheet_protection~protected EQ abap_true.
* " sheetProtection node
* lo_element = lo_document->create_simple_element( name = lc_xml_node_sheetprotection
* parent = lo_document ).
* MOVE io_worksheet->zif_excel_sheet_protection~password TO lv_value.
* IF lv_value IS NOT INITIAL.
* lo_element->set_attribute_ns( name = lc_xml_attr_password
* value = lv_value ).
* ENDIF.
* lv_value = io_worksheet->zif_excel_sheet_protection~auto_filter.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_autofilter
* value = lv_value ).
* lv_value = io_worksheet->zif_excel_sheet_protection~delete_columns.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_deletecolumns
* value = lv_value ).
* lv_value = io_worksheet->zif_excel_sheet_protection~delete_rows.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_deleterows
* value = lv_value ).
* lv_value = io_worksheet->zif_excel_sheet_protection~format_cells.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_formatcells
* value = lv_value ).
* lv_value = io_worksheet->zif_excel_sheet_protection~format_columns.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_formatcolumns
* value = lv_value ).
* lv_value = io_worksheet->zif_excel_sheet_protection~format_rows.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_formatrows
* value = lv_value ).
* lv_value = io_worksheet->zif_excel_sheet_protection~insert_columns.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_insertcolumns
* value = lv_value ).
* lv_value = io_worksheet->zif_excel_sheet_protection~insert_hyperlinks.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_inserthyperlinks
* value = lv_value ).
* lv_value = io_worksheet->zif_excel_sheet_protection~insert_rows.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_insertrows
* value = lv_value ).
* lv_value = io_worksheet->zif_excel_sheet_protection~objects.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_objects
* value = lv_value ).
* lv_value = io_worksheet->zif_excel_sheet_protection~pivot_tables.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_pivottables
* value = lv_value ).
* lv_value = io_worksheet->zif_excel_sheet_protection~scenarios.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_scenarios
* value = lv_value ).
* lv_value = io_worksheet->zif_excel_sheet_protection~select_locked_cells.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_selectlockedcells
* value = lv_value ).
* lv_value = io_worksheet->zif_excel_sheet_protection~select_unlocked_cells.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_selectunlockedcell
* value = lv_value ).
* lv_value = io_worksheet->zif_excel_sheet_protection~sheet.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_sheet
* value = lv_value ).
* lv_value = io_worksheet->zif_excel_sheet_protection~sort.
* CONDENSE lv_value NO-GAPS.
* lo_element->set_attribute_ns( name = lc_xml_attr_sort
* value = lv_value ).
*
* lo_element_root->append_child( new_child = lo_element ).
* ENDIF.
*> End of Comment for Issue #572 - Protect sheet with filter caused Excel error
" Merged cells
lt_range_merge = io_worksheet->get_merge( ).
IF lt_range_merge IS NOT INITIAL.
lo_element = lo_document->create_simple_element( name = lc_xml_node_mergecells
parent = lo_document ).
DESCRIBE TABLE lt_range_merge LINES merge_count.
lv_value = merge_count.
CONDENSE lv_value.
lo_element->set_attribute_ns( name = lc_xml_attr_count
value = lv_value ).
LOOP AT lt_range_merge ASSIGNING <fs_range_merge>.
lo_element_2 = lo_document->create_simple_element( name = lc_xml_node_mergecell
parent = lo_document ).
lo_element_2->set_attribute_ns( name = lc_xml_attr_ref
value = <fs_range_merge> ).
lo_element->append_child( new_child = lo_element_2 ).
lo_element_root->append_child( new_child = lo_element ).
io_worksheet->delete_merge( ).
ENDLOOP.
ENDIF.
" Conditional formatting node
lo_iterator = io_worksheet->get_style_cond_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_style_cond ?= lo_iterator->get_next( ).
IF lo_style_cond->rule IS INITIAL.
CONTINUE.
ENDIF.
lv_value = lo_style_cond->get_dimension_range( ).
READ TABLE lt_condformating_ranges WITH KEY dimension_range = lv_value ASSIGNING <ls_condformating_range>.
IF sy-subrc = 0.
lo_element = <ls_condformating_range>-condformatting_node.
ELSE.
lo_element = lo_document->create_simple_element( name = lc_xml_node_condformatting
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_sqref
value = lv_value ).
ls_condformating_range-dimension_range = lv_value.
ls_condformating_range-condformatting_node = lo_element.
INSERT ls_condformating_range INTO TABLE lt_condformating_ranges.
ENDIF.
" cfRule node
lo_element_2 = lo_document->create_simple_element( name = lc_xml_node_cfrule
parent = lo_document ).
IF lo_style_cond->rule = zcl_excel_style_cond=>c_rule_textfunction.
IF lo_style_cond->mode_textfunction-textfunction = zcl_excel_style_cond=>c_textfunction_notcontains.
lv_value = `notContainsText`.
ELSE.
lv_value = lo_style_cond->mode_textfunction-textfunction.
ENDIF.
ELSE.
lv_value = lo_style_cond->rule.
ENDIF.
lo_element_2->set_attribute_ns( name = lc_xml_attr_type
value = lv_value ).
lv_value = lo_style_cond->priority.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element_2->set_attribute_ns( name = lc_xml_attr_priority
value = lv_value ).
CASE lo_style_cond->rule.
" Start >> Databar by Albert Lladanosa
WHEN zcl_excel_style_cond=>c_rule_databar.
ls_databar = lo_style_cond->mode_databar.
CLEAR lt_cfvo.
lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_databar
parent = lo_document ).
MOVE ls_databar-cfvo1_value TO ls_cfvo-value.
MOVE ls_databar-cfvo1_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
MOVE ls_databar-cfvo2_value TO ls_cfvo-value.
MOVE ls_databar-cfvo2_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
LOOP AT lt_cfvo INTO ls_cfvo.
" cfvo node
lo_element_4 = lo_document->create_simple_element( name = lc_xml_node_cfvo
parent = lo_document ).
lv_value = ls_cfvo-type.
lo_element_4->set_attribute_ns( name = lc_xml_attr_type
value = lv_value ).
lv_value = ls_cfvo-value.
lo_element_4->set_attribute_ns( name = lc_xml_attr_val
value = lv_value ).
lo_element_3->append_child( new_child = lo_element_4 ). " cfvo node
ENDLOOP.
lo_element_4 = lo_document->create_simple_element( name = lc_xml_node_color
parent = lo_document ).
lv_value = ls_databar-colorrgb.
lo_element_4->set_attribute_ns( name = lc_xml_attr_tabcolor_rgb
value = lv_value ).
lo_element_3->append_child( new_child = lo_element_4 ). " color node
lo_element_2->append_child( new_child = lo_element_3 ). " databar node
" End << Databar by Albert Lladanosa
WHEN zcl_excel_style_cond=>c_rule_colorscale.
ls_colorscale = lo_style_cond->mode_colorscale.
CLEAR: lt_cfvo, lt_colors.
lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_colorscale
parent = lo_document ).
MOVE ls_colorscale-cfvo1_value TO ls_cfvo-value.
MOVE ls_colorscale-cfvo1_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
MOVE ls_colorscale-cfvo2_value TO ls_cfvo-value.
MOVE ls_colorscale-cfvo2_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
MOVE ls_colorscale-cfvo3_value TO ls_cfvo-value.
MOVE ls_colorscale-cfvo3_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
APPEND ls_colorscale-colorrgb1 TO lt_colors.
APPEND ls_colorscale-colorrgb2 TO lt_colors.
APPEND ls_colorscale-colorrgb3 TO lt_colors.
LOOP AT lt_cfvo INTO ls_cfvo.
IF ls_cfvo IS INITIAL.
CONTINUE.
ENDIF.
" cfvo node
lo_element_4 = lo_document->create_simple_element( name = lc_xml_node_cfvo
parent = lo_document ).
lv_value = ls_cfvo-type.
lo_element_4->set_attribute_ns( name = lc_xml_attr_type
value = lv_value ).
lv_value = ls_cfvo-value.
lo_element_4->set_attribute_ns( name = lc_xml_attr_val
value = lv_value ).
lo_element_3->append_child( new_child = lo_element_4 ). " cfvo node
ENDLOOP.
LOOP AT lt_colors INTO ls_colors.
IF ls_colors IS INITIAL.
CONTINUE.
ENDIF.
lo_element_4 = lo_document->create_simple_element( name = lc_xml_node_color
parent = lo_document ).
lv_value = ls_colors-colorrgb.
lo_element_4->set_attribute_ns( name = lc_xml_attr_tabcolor_rgb
value = lv_value ).
lo_element_3->append_child( new_child = lo_element_4 ). " color node
ENDLOOP.
lo_element_2->append_child( new_child = lo_element_3 ). " databar node
WHEN zcl_excel_style_cond=>c_rule_iconset.
ls_iconset = lo_style_cond->mode_iconset.
CLEAR lt_cfvo.
" iconset node
lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_iconset
parent = lo_document ).
IF ls_iconset-iconset NE zcl_excel_style_cond=>c_iconset_3trafficlights.
lv_value = ls_iconset-iconset.
lo_element_3->set_attribute_ns( name = lc_xml_attr_iconset
value = lv_value ).
ENDIF.
" Set the showValue attribute
lv_value = ls_iconset-showvalue.
lo_element_3->set_attribute_ns( name = lc_xml_attr_showvalue
value = lv_value ).
CASE ls_iconset-iconset.
WHEN zcl_excel_style_cond=>c_iconset_3trafficlights2 OR
zcl_excel_style_cond=>c_iconset_3arrows OR
zcl_excel_style_cond=>c_iconset_3arrowsgray OR
zcl_excel_style_cond=>c_iconset_3flags OR
zcl_excel_style_cond=>c_iconset_3signs OR
zcl_excel_style_cond=>c_iconset_3symbols OR
zcl_excel_style_cond=>c_iconset_3symbols2 OR
zcl_excel_style_cond=>c_iconset_3trafficlights OR
zcl_excel_style_cond=>c_iconset_3trafficlights2.
MOVE ls_iconset-cfvo1_value TO ls_cfvo-value.
MOVE ls_iconset-cfvo1_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
MOVE ls_iconset-cfvo2_value TO ls_cfvo-value.
MOVE ls_iconset-cfvo2_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
MOVE ls_iconset-cfvo3_value TO ls_cfvo-value.
MOVE ls_iconset-cfvo3_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
WHEN zcl_excel_style_cond=>c_iconset_4arrows OR
zcl_excel_style_cond=>c_iconset_4arrowsgray OR
zcl_excel_style_cond=>c_iconset_4rating OR
zcl_excel_style_cond=>c_iconset_4redtoblack OR
zcl_excel_style_cond=>c_iconset_4trafficlights.
MOVE ls_iconset-cfvo1_value TO ls_cfvo-value.
MOVE ls_iconset-cfvo1_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
MOVE ls_iconset-cfvo2_value TO ls_cfvo-value.
MOVE ls_iconset-cfvo2_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
MOVE ls_iconset-cfvo3_value TO ls_cfvo-value.
MOVE ls_iconset-cfvo3_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
MOVE ls_iconset-cfvo4_value TO ls_cfvo-value.
MOVE ls_iconset-cfvo4_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
WHEN zcl_excel_style_cond=>c_iconset_5arrows OR
zcl_excel_style_cond=>c_iconset_5arrowsgray OR
zcl_excel_style_cond=>c_iconset_5quarters OR
zcl_excel_style_cond=>c_iconset_5rating.
MOVE ls_iconset-cfvo1_value TO ls_cfvo-value.
MOVE ls_iconset-cfvo1_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
MOVE ls_iconset-cfvo2_value TO ls_cfvo-value.
MOVE ls_iconset-cfvo2_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
MOVE ls_iconset-cfvo3_value TO ls_cfvo-value.
MOVE ls_iconset-cfvo3_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
MOVE ls_iconset-cfvo4_value TO ls_cfvo-value.
MOVE ls_iconset-cfvo4_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
MOVE ls_iconset-cfvo5_value TO ls_cfvo-value.
MOVE ls_iconset-cfvo5_type TO ls_cfvo-type.
APPEND ls_cfvo TO lt_cfvo.
WHEN OTHERS.
CLEAR lt_cfvo.
ENDCASE.
LOOP AT lt_cfvo INTO ls_cfvo.
" cfvo node
lo_element_4 = lo_document->create_simple_element( name = lc_xml_node_cfvo
parent = lo_document ).
lv_value = ls_cfvo-type.
lo_element_4->set_attribute_ns( name = lc_xml_attr_type
value = lv_value ).
lv_value = ls_cfvo-value.
lo_element_4->set_attribute_ns( name = lc_xml_attr_val
value = lv_value ).
lo_element_3->append_child( new_child = lo_element_4 ). " cfvo node
ENDLOOP.
lo_element_2->append_child( new_child = lo_element_3 ). " iconset node
WHEN zcl_excel_style_cond=>c_rule_cellis.
ls_cellis = lo_style_cond->mode_cellis.
READ TABLE me->styles_cond_mapping INTO ls_style_cond_mapping WITH KEY guid = ls_cellis-cell_style.
lv_value = ls_style_cond_mapping-dxf.
CONDENSE lv_value.
lo_element_2->set_attribute_ns( name = lc_xml_attr_dxfid
value = lv_value ).
lv_value = ls_cellis-operator.
lo_element_2->set_attribute_ns( name = lc_xml_attr_operator
value = lv_value ).
" formula node
lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_formula
parent = lo_document ).
lv_value = ls_cellis-formula.
lo_element_3->set_value( value = lv_value ).
lo_element_2->append_child( new_child = lo_element_3 ). " formula node
IF ls_cellis-formula2 IS NOT INITIAL.
lv_value = ls_cellis-formula2.
lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_formula
parent = lo_document ).
lo_element_3->set_value( value = lv_value ).
lo_element_2->append_child( new_child = lo_element_3 ). " 2nd formula node
ENDIF.
*--------------------------------------------------------------------------------------*
* The below code creates an EXM structure in the following format:
* -<conditionalFormatting sqref="G6:G12">-
* <cfRule operator="beginsWith" priority="4" dxfId="4" type="beginsWith" text="1">
* <formula>LEFT(G6,LEN("1"))="1"</formula>
* </cfRule>
* </conditionalFormatting>
*--------------------------------------------------------------------------------------*
WHEN zcl_excel_style_cond=>c_rule_textfunction.
ls_textfunction = lo_style_cond->mode_textfunction.
READ TABLE me->styles_cond_mapping INTO ls_style_cond_mapping WITH KEY guid = ls_cellis-cell_style.
lv_value = ls_style_cond_mapping-dxf.
CONDENSE lv_value.
lo_element_2->set_attribute_ns( name = lc_xml_attr_dxfid
value = lv_value ).
lv_value = ls_textfunction-textfunction.
lo_element_2->set_attribute_ns( name = lc_xml_attr_operator
value = lv_value ).
" text
lv_value = ls_textfunction-text.
lo_element_2->set_attribute_ns( name = lc_xml_attr_text
value = lv_value ).
" formula node
zcl_excel_common=>convert_range2column_a_row(
EXPORTING
i_range = lo_style_cond->get_dimension_range( )
IMPORTING
e_column_start = lv_column_start
e_row_start = lv_row_start ).
lv_cell_coords = |{ lv_column_start }{ lv_row_start }|.
CASE ls_textfunction-textfunction.
WHEN zcl_excel_style_cond=>c_textfunction_beginswith.
lv_value = |LEFT({ lv_cell_coords },LEN("{ escape( val = ls_textfunction-text format = cl_abap_format=>e_html_text ) }"))=|
&& |"{ escape( val = ls_textfunction-text format = cl_abap_format=>e_html_text ) }"|.
WHEN zcl_excel_style_cond=>c_textfunction_containstext.
lv_value = |NOT(ISERROR(SEARCH("{ escape( val = ls_textfunction-text format = cl_abap_format=>e_html_text ) }",{ lv_cell_coords })))|.
WHEN zcl_excel_style_cond=>c_textfunction_endswith.
lv_value = |RIGHT({ lv_cell_coords },LEN("{ escape( val = ls_textfunction-text format = cl_abap_format=>e_html_text ) }"))=|
&& |"{ escape( val = ls_textfunction-text format = cl_abap_format=>e_html_text ) }"|.
WHEN zcl_excel_style_cond=>c_textfunction_notcontains.
lv_value = |ISERROR(SEARCH("{ escape( val = ls_textfunction-text format = cl_abap_format=>e_html_text ) }",{ lv_cell_coords }))|.
WHEN OTHERS.
ENDCASE.
lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_formula
parent = lo_document ).
lo_element_3->set_value( value = lv_value ).
lo_element_2->append_child( new_child = lo_element_3 ). " formula node
WHEN zcl_excel_style_cond=>c_rule_expression.
ls_expression = lo_style_cond->mode_expression.
READ TABLE me->styles_cond_mapping INTO ls_style_cond_mapping WITH KEY guid = ls_expression-cell_style.
lv_value = ls_style_cond_mapping-dxf.
CONDENSE lv_value.
lo_element_2->set_attribute_ns( name = lc_xml_attr_dxfid
value = lv_value ).
" formula node
lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_formula
parent = lo_document ).
lv_value = ls_expression-formula.
lo_element_3->set_value( value = lv_value ).
lo_element_2->append_child( new_child = lo_element_3 ). " formula node
* begin of ins issue #366 - missing conditional rules: top10
WHEN zcl_excel_style_cond=>c_rule_top10.
ls_conditional_top10 = lo_style_cond->mode_top10.
READ TABLE me->styles_cond_mapping INTO ls_style_cond_mapping WITH KEY guid = ls_conditional_top10-cell_style.
lv_value = ls_style_cond_mapping-dxf.
CONDENSE lv_value.
lo_element_2->set_attribute_ns( name = lc_xml_attr_dxfid
value = lv_value ).
lv_value = ls_conditional_top10-topxx_count.
CONDENSE lv_value.
lo_element_2->set_attribute_ns( name = 'rank'
value = lv_value ).
IF ls_conditional_top10-bottom = 'X'.
lo_element_2->set_attribute_ns( name = 'bottom'
value = '1' ).
ENDIF.
IF ls_conditional_top10-percent = 'X'.
lo_element_2->set_attribute_ns( name = 'percent'
value ='1' ).
ENDIF.
WHEN zcl_excel_style_cond=>c_rule_above_average.
ls_conditional_above_avg = lo_style_cond->mode_above_average.
READ TABLE me->styles_cond_mapping INTO ls_style_cond_mapping WITH KEY guid = ls_conditional_above_avg-cell_style.
lv_value = ls_style_cond_mapping-dxf.
CONDENSE lv_value.
lo_element_2->set_attribute_ns( name = lc_xml_attr_dxfid
value = lv_value ).
IF ls_conditional_above_avg-above_average IS INITIAL. " = below average
lo_element_2->set_attribute_ns( name = 'aboveAverage'
value = '0' ).
ENDIF.
IF ls_conditional_above_avg-equal_average = 'X'. " = equal average also
lo_element_2->set_attribute_ns( name = 'equalAverage'
value = '1' ).
ENDIF.
IF ls_conditional_above_avg-standard_deviation <> 0. " standard deviation instead of value
lv_value = ls_conditional_above_avg-standard_deviation.
lo_element_2->set_attribute_ns( name = 'stdDev'
value = lv_value ).
ENDIF.
* end of ins issue #366 - missing conditional rules: top10
ENDCASE.
lo_element->append_child( new_child = lo_element_2 ). " cfRule node
lo_element_root->append_child( new_child = lo_element ). " Conditional formatting node
ENDWHILE.
IF io_worksheet->get_data_validations_size( ) GT 0.
" dataValidations node
lo_element = lo_document->create_simple_element( name = lc_xml_node_datavalidations
parent = lo_document ).
" Conditional formatting node
lo_iterator = io_worksheet->get_data_validations_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_data_validation ?= lo_iterator->get_next( ).
" dataValidation node
lo_element_2 = lo_document->create_simple_element( name = lc_xml_node_datavalidation
parent = lo_document ).
lv_value = lo_data_validation->type.
lo_element_2->set_attribute_ns( name = lc_xml_attr_type
value = lv_value ).
IF NOT lo_data_validation->operator IS INITIAL.
lv_value = lo_data_validation->operator.
lo_element_2->set_attribute_ns( name = lc_xml_attr_operator
value = lv_value ).
ENDIF.
IF lo_data_validation->allowblank EQ abap_true.
lv_value = '1'.
ELSE.
lv_value = '0'.
ENDIF.
lo_element_2->set_attribute_ns( name = lc_xml_attr_allowblank
value = lv_value ).
IF lo_data_validation->showinputmessage EQ abap_true.
lv_value = '1'.
ELSE.
lv_value = '0'.
ENDIF.
lo_element_2->set_attribute_ns( name = lc_xml_attr_showinputmessage
value = lv_value ).
IF lo_data_validation->showerrormessage EQ abap_true.
lv_value = '1'.
ELSE.
lv_value = '0'.
ENDIF.
lo_element_2->set_attribute_ns( name = lc_xml_attr_showerrormessage
value = lv_value ).
IF lo_data_validation->showdropdown EQ abap_true.
lv_value = '1'.
ELSE.
lv_value = '0'.
ENDIF.
lo_element_2->set_attribute_ns( name = lc_xml_attr_showdropdown
value = lv_value ).
IF NOT lo_data_validation->errortitle IS INITIAL.
lv_value = lo_data_validation->errortitle.
lo_element_2->set_attribute_ns( name = lc_xml_attr_errortitle
value = lv_value ).
ENDIF.
IF NOT lo_data_validation->error IS INITIAL.
lv_value = lo_data_validation->error.
lo_element_2->set_attribute_ns( name = lc_xml_attr_error
value = lv_value ).
ENDIF.
IF NOT lo_data_validation->errorstyle IS INITIAL.
lv_value = lo_data_validation->errorstyle.
lo_element_2->set_attribute_ns( name = lc_xml_attr_errorstyle
value = lv_value ).
ENDIF.
IF NOT lo_data_validation->prompttitle IS INITIAL.
lv_value = lo_data_validation->prompttitle.
lo_element_2->set_attribute_ns( name = lc_xml_attr_prompttitle
value = lv_value ).
ENDIF.
IF NOT lo_data_validation->prompt IS INITIAL.
lv_value = lo_data_validation->prompt.
lo_element_2->set_attribute_ns( name = lc_xml_attr_prompt
value = lv_value ).
ENDIF.
lv_cell_row_s = lo_data_validation->cell_row.
CONDENSE lv_cell_row_s.
CONCATENATE lo_data_validation->cell_column lv_cell_row_s INTO lv_value.
IF lo_data_validation->cell_row_to IS NOT INITIAL.
lv_cell_row_s = lo_data_validation->cell_row_to.
CONDENSE lv_cell_row_s.
CONCATENATE lv_value ':' lo_data_validation->cell_column_to lv_cell_row_s INTO lv_value.
ENDIF.
lo_element_2->set_attribute_ns( name = lc_xml_attr_sqref
value = lv_value ).
" formula1 node
lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_formula1
parent = lo_document ).
lv_value = lo_data_validation->formula1.
lo_element_3->set_value( value = lv_value ).
lo_element_2->append_child( new_child = lo_element_3 ). " formula1 node
" formula2 node
IF NOT lo_data_validation->formula2 IS INITIAL.
lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_formula2
parent = lo_document ).
lv_value = lo_data_validation->formula2.
lo_element_3->set_value( value = lv_value ).
lo_element_2->append_child( new_child = lo_element_3 ). " formula2 node
ENDIF.
lo_element->append_child( new_child = lo_element_2 ). " dataValidation node
ENDWHILE.
lo_element_root->append_child( new_child = lo_element ). " dataValidations node
ENDIF.
" Hyperlinks
DATA: lv_hyperlinks_count TYPE i,
lo_link TYPE REF TO zcl_excel_hyperlink.
lv_hyperlinks_count = io_worksheet->get_hyperlinks_size( ).
IF lv_hyperlinks_count > 0.
lo_element = lo_document->create_simple_element( name = 'hyperlinks'
parent = lo_document ).
lo_iterator = io_worksheet->get_hyperlinks_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_link ?= lo_iterator->get_next( ).
lo_element_2 = lo_document->create_simple_element( name = 'hyperlink'
parent = lo_element ).
lv_value = lo_link->get_ref( ).
lo_element_2->set_attribute_ns( name = 'ref'
value = lv_value ).
IF lo_link->is_internal( ) = abap_true.
lv_value = lo_link->get_url( ).
lo_element_2->set_attribute_ns( name = 'location'
value = lv_value ).
ELSE.
ADD 1 TO lv_relation_id.
lv_value = lv_relation_id.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element_2->set_attribute_ns( name = 'r:id'
value = lv_value ).
ENDIF.
lo_element->append_child( new_child = lo_element_2 ).
ENDWHILE.
lo_element_root->append_child( new_child = lo_element ).
ENDIF.
" PrintOptions
IF io_worksheet->print_gridlines = abap_true OR
io_worksheet->sheet_setup->vertical_centered = abap_true OR
io_worksheet->sheet_setup->horizontal_centered = abap_true.
lo_element = lo_document->create_simple_element( name = 'printOptions'
parent = lo_document ).
IF io_worksheet->print_gridlines = abap_true.
lo_element->set_attribute_ns( name = lc_xml_attr_gridlines
value = 'true' ).
ENDIF.
IF io_worksheet->sheet_setup->horizontal_centered = abap_true.
lo_element->set_attribute_ns( name = 'horizontalCentered'
value = 'true' ).
ENDIF.
IF io_worksheet->sheet_setup->vertical_centered = abap_true.
lo_element->set_attribute_ns( name = 'verticalCentered'
value = 'true' ).
ENDIF.
lo_element_root->append_child( new_child = lo_element ).
ENDIF.
" pageMargins node
lo_element = lo_document->create_simple_element( name = lc_xml_node_pagemargins
parent = lo_document ).
lv_value = io_worksheet->sheet_setup->margin_left.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_left
value = lv_value ).
lv_value = io_worksheet->sheet_setup->margin_right.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_right
value = lv_value ).
lv_value = io_worksheet->sheet_setup->margin_top.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_top
value = lv_value ).
lv_value = io_worksheet->sheet_setup->margin_bottom.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_bottom
value = lv_value ).
lv_value = io_worksheet->sheet_setup->margin_header.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_header
value = lv_value ).
lv_value = io_worksheet->sheet_setup->margin_footer.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_footer
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ). " pageMargins node
* pageSetup node
lo_element = lo_document->create_simple_element( name = lc_xml_node_pagesetup
parent = lo_document ).
IF io_worksheet->sheet_setup->black_and_white IS NOT INITIAL.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_blackandwhite
value = `1` ).
ENDIF.
IF io_worksheet->sheet_setup->cell_comments IS NOT INITIAL.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_cellcomments
value = io_worksheet->sheet_setup->cell_comments ).
ENDIF.
IF io_worksheet->sheet_setup->copies IS NOT INITIAL.
lv_value = io_worksheet->sheet_setup->copies.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_copies
value = lv_value ).
ENDIF.
IF io_worksheet->sheet_setup->draft IS NOT INITIAL.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_draft
value = `1` ).
ENDIF.
IF io_worksheet->sheet_setup->errors IS NOT INITIAL.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_errors
value = io_worksheet->sheet_setup->errors ).
ENDIF.
IF io_worksheet->sheet_setup->first_page_number IS NOT INITIAL.
lv_value = io_worksheet->sheet_setup->first_page_number.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_firstpagenumber
value = lv_value ).
ENDIF.
IF io_worksheet->sheet_setup->fit_to_page IS NOT INITIAL.
lv_value = io_worksheet->sheet_setup->fit_to_height.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_fittoheight
value = lv_value ).
lv_value = io_worksheet->sheet_setup->fit_to_width.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_fittowidth
value = lv_value ).
ENDIF.
IF io_worksheet->sheet_setup->horizontal_dpi IS NOT INITIAL.
lv_value = io_worksheet->sheet_setup->horizontal_dpi.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_horizontaldpi
value = lv_value ).
ENDIF.
IF io_worksheet->sheet_setup->orientation IS NOT INITIAL.
lv_value = io_worksheet->sheet_setup->orientation.
lo_element->set_attribute_ns( name = lc_xml_attr_orientation
value = lv_value ).
ENDIF.
IF io_worksheet->sheet_setup->page_order IS NOT INITIAL.
lo_element->set_attribute_ns( name = lc_xml_attr_pageorder
value = io_worksheet->sheet_setup->page_order ).
ENDIF.
IF io_worksheet->sheet_setup->paper_height IS NOT INITIAL.
lv_value = io_worksheet->sheet_setup->paper_height.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_paperheight
value = lv_value ).
ENDIF.
IF io_worksheet->sheet_setup->paper_size IS NOT INITIAL.
lv_value = io_worksheet->sheet_setup->paper_size.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_papersize
value = lv_value ).
ENDIF.
IF io_worksheet->sheet_setup->paper_width IS NOT INITIAL.
lv_value = io_worksheet->sheet_setup->paper_width.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_paperwidth
value = lv_value ).
ENDIF.
IF io_worksheet->sheet_setup->scale IS NOT INITIAL.
lv_value = io_worksheet->sheet_setup->scale.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_scale
value = lv_value ).
ENDIF.
IF io_worksheet->sheet_setup->use_first_page_num IS NOT INITIAL.
lo_element->set_attribute_ns( name = lc_xml_attr_usefirstpagenumber
value = `1` ).
ENDIF.
IF io_worksheet->sheet_setup->use_printer_defaults IS NOT INITIAL.
lo_element->set_attribute_ns( name = lc_xml_attr_useprinterdefaults
value = `1` ).
ENDIF.
IF io_worksheet->sheet_setup->vertical_dpi IS NOT INITIAL.
lv_value = io_worksheet->sheet_setup->vertical_dpi.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_verticaldpi
value = lv_value ).
ENDIF.
lo_element_root->append_child( new_child = lo_element ). " pageSetup node
* { headerFooter necessary? >
IF io_worksheet->sheet_setup->odd_header IS NOT INITIAL
OR io_worksheet->sheet_setup->odd_footer IS NOT INITIAL
OR io_worksheet->sheet_setup->diff_oddeven_headerfooter = abap_true.
lo_element = lo_document->create_simple_element( name = lc_xml_node_headerfooter
parent = lo_document ).
" Different header/footer for odd/even pages?
IF io_worksheet->sheet_setup->diff_oddeven_headerfooter = abap_true.
lo_element->set_attribute_ns( name = lc_xml_attr_differentoddeven
value = '1' ).
ENDIF.
" OddHeader
CLEAR: lv_value.
io_worksheet->sheet_setup->get_header_footer_string( IMPORTING ep_odd_header = lv_value ) .
IF lv_value IS NOT INITIAL.
lo_element_2 = lo_document->create_simple_element( name = lc_xml_node_oddheader
parent = lo_document ).
lo_element_2->set_value( value = lv_value ).
lo_element->append_child( new_child = lo_element_2 ).
ENDIF.
" OddFooter
CLEAR: lv_value.
io_worksheet->sheet_setup->get_header_footer_string( IMPORTING ep_odd_footer = lv_value ) .
IF lv_value IS NOT INITIAL.
lo_element_2 = lo_document->create_simple_element( name = lc_xml_node_oddfooter
parent = lo_document ).
lo_element_2->set_value( value = lv_value ).
lo_element->append_child( new_child = lo_element_2 ).
ENDIF.
" evenHeader
CLEAR: lv_value.
io_worksheet->sheet_setup->get_header_footer_string( IMPORTING ep_even_header = lv_value ) .
IF lv_value IS NOT INITIAL.
lo_element_2 = lo_document->create_simple_element( name = lc_xml_node_evenheader
parent = lo_document ).
lo_element_2->set_value( value = lv_value ).
lo_element->append_child( new_child = lo_element_2 ).
ENDIF.
" evenFooter
CLEAR: lv_value.
io_worksheet->sheet_setup->get_header_footer_string( IMPORTING ep_even_footer = lv_value ) .
IF lv_value IS NOT INITIAL.
lo_element_2 = lo_document->create_simple_element( name = lc_xml_node_evenfooter
parent = lo_document ).
lo_element_2->set_value( value = lv_value ).
lo_element->append_child( new_child = lo_element_2 ).
ENDIF.
lo_element_root->append_child( new_child = lo_element ). " headerFooter
ENDIF.
* issue #377 pagebreaks
TRY.
create_xl_sheet_pagebreaks( io_document = lo_document
io_parent = lo_element_root
io_worksheet = io_worksheet ) .
CATCH zcx_excel. " Ignore Hyperlink reading errors - pass everything we were able to identify
ENDTRY.
* drawing
DATA: lo_drawings TYPE REF TO zcl_excel_drawings.
lo_drawings = io_worksheet->get_drawings( ).
IF lo_drawings->is_empty( ) = abap_false.
lo_element = lo_document->create_simple_element( name = lc_xml_node_drawing
parent = lo_document ).
ADD 1 TO lv_relation_id.
lv_value = lv_relation_id.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element->set_attribute( name = 'r:id'
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
ENDIF.
* Begin - Add - Issue #180
" (Legacy) drawings for comments
DATA: lo_drawing_for_comments TYPE REF TO zcl_excel_comments.
lo_drawing_for_comments = io_worksheet->get_comments( ).
IF lo_drawing_for_comments->is_empty( ) = abap_false.
lo_element = lo_document->create_simple_element( name = lc_xml_node_drawing_for_cmt
parent = lo_document ).
ADD 1 TO lv_relation_id. " +1 for legacyDrawings
lv_value = lv_relation_id.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element->set_attribute( name = 'r:id'
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
ADD 1 TO lv_relation_id. " +1 for comments (not referenced in XL sheet but let's reserve the rId)
ENDIF.
* End - Add - Issue #180
* Header/Footer Image
DATA: lt_drawings TYPE zexcel_t_drawings.
lt_drawings = io_worksheet->get_header_footer_drawings( ).
IF lines( lt_drawings ) > 0. "Header or footer image exist
lo_element = lo_document->create_simple_element( name = lc_xml_node_drawing_for_hd_ft
parent = lo_document ).
ADD 1 TO lv_relation_id. " +1 for legacyDrawings
lv_value = lv_relation_id.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element->set_attribute( name = 'r:id'
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
ADD 1 TO lv_relation_id. " +1 for comments (not referenced in XL sheet but let's reserve the rId)
ENDIF.
*
* ignoredErrors
create_xl_sheet_ignored_errors( io_worksheet = io_worksheet io_document = lo_document io_element_root = lo_element_root ).
* tables
DATA lv_table_count TYPE i.
lv_table_count = io_worksheet->get_tables_size( ).
IF lv_table_count > 0.
lo_element = lo_document->create_simple_element( name = 'tableParts'
parent = lo_document ).
lv_value = lv_table_count.
CONDENSE lv_value.
lo_element->set_attribute_ns( name = 'count'
value = lv_value ).
lo_iterator = io_worksheet->get_tables_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_table ?= lo_iterator->get_next( ).
ADD 1 TO lv_relation_id.
lv_value = lv_relation_id.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element_2 = lo_document->create_simple_element( name = 'tablePart'
parent = lo_element ).
lo_element_2->set_attribute_ns( name = 'r:id'
value = lv_value ).
lo_element->append_child( new_child = lo_element_2 ).
ENDWHILE.
lo_element_root->append_child( new_child = lo_element ).
ENDIF.
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_xl_sheet_ignored_errors.
DATA: lo_element TYPE REF TO if_ixml_element,
lo_element2 TYPE REF TO if_ixml_element,
lt_ignored_errors TYPE zcl_excel_worksheet=>mty_th_ignored_errors.
FIELD-SYMBOLS: <ls_ignored_errors> TYPE zcl_excel_worksheet=>mty_s_ignored_errors.
lt_ignored_errors = io_worksheet->get_ignored_errors( ).
IF lt_ignored_errors IS NOT INITIAL.
lo_element = io_document->create_simple_element( name = 'ignoredErrors'
parent = io_document ).
LOOP AT lt_ignored_errors ASSIGNING <ls_ignored_errors>.
lo_element2 = io_document->create_simple_element( name = 'ignoredError'
parent = io_document ).
lo_element2->set_attribute_ns( name = 'sqref'
value = <ls_ignored_errors>-cell_coords ).
IF <ls_ignored_errors>-eval_error = abap_true.
lo_element2->set_attribute_ns( name = 'evalError'
value = '1' ).
ENDIF.
IF <ls_ignored_errors>-two_digit_text_year = abap_true.
lo_element2->set_attribute_ns( name = 'twoDigitTextYear'
value = '1' ).
ENDIF.
IF <ls_ignored_errors>-number_stored_as_text = abap_true.
lo_element2->set_attribute_ns( name = 'numberStoredAsText'
value = '1' ).
ENDIF.
IF <ls_ignored_errors>-formula = abap_true.
lo_element2->set_attribute_ns( name = 'formula'
value = '1' ).
ENDIF.
IF <ls_ignored_errors>-formula_range = abap_true.
lo_element2->set_attribute_ns( name = 'formulaRange'
value = '1' ).
ENDIF.
IF <ls_ignored_errors>-unlocked_formula = abap_true.
lo_element2->set_attribute_ns( name = 'unlockedFormula'
value = '1' ).
ENDIF.
IF <ls_ignored_errors>-empty_cell_reference = abap_true.
lo_element2->set_attribute_ns( name = 'emptyCellReference'
value = '1' ).
ENDIF.
IF <ls_ignored_errors>-list_data_validation = abap_true.
lo_element2->set_attribute_ns( name = 'listDataValidation'
value = '1' ).
ENDIF.
IF <ls_ignored_errors>-calculated_column = abap_true.
lo_element2->set_attribute_ns( name = 'calculatedColumn'
value = '1' ).
ENDIF.
lo_element->append_child( lo_element2 ).
ENDLOOP.
io_element_root->append_child( lo_element ).
ENDIF.
ENDMETHOD.
METHOD create_xl_sheet_column_formula.
TYPES: ls_column_formula_used TYPE mty_column_formula_used,
lv_column_alpha TYPE zexcel_cell_column_alpha,
lv_top_cell_coords TYPE zexcel_cell_coords,
lv_bottom_cell_coords TYPE zexcel_cell_coords,
lv_cell_coords TYPE zexcel_cell_coords,
lv_ref_value TYPE string,
lv_test_shared TYPE string,
lv_si TYPE i,
lv_1st_line_shared_formula TYPE abap_bool.
DATA: lv_value TYPE string,
ls_column_formula_used TYPE mty_column_formula_used,
lv_column_alpha TYPE zexcel_cell_column_alpha,
lv_top_cell_coords TYPE zexcel_cell_coords,
lv_bottom_cell_coords TYPE zexcel_cell_coords,
lv_cell_coords TYPE zexcel_cell_coords,
lv_ref_value TYPE string,
lv_1st_line_shared_formula TYPE abap_bool.
FIELD-SYMBOLS: <ls_column_formula> TYPE zcl_excel_worksheet=>mty_s_column_formula,
<ls_column_formula_used> TYPE mty_column_formula_used.
READ TABLE it_column_formulas WITH TABLE KEY id = is_sheet_content-column_formula_id ASSIGNING <ls_column_formula>.
ASSERT sy-subrc = 0.
lv_value = <ls_column_formula>-formula.
lv_1st_line_shared_formula = abap_false.
eo_element = io_document->create_simple_element( name = 'f'
parent = io_document ).
READ TABLE ct_column_formulas_used WITH TABLE KEY id = is_sheet_content-column_formula_id ASSIGNING <ls_column_formula_used>.
IF sy-subrc <> 0.
CLEAR ls_column_formula_used.
ls_column_formula_used-id = is_sheet_content-column_formula_id.
IF is_formula_shareable( ip_formula = lv_value ) = abap_true.
ls_column_formula_used-t = 'shared'.
ls_column_formula_used-si = cv_si.
CONDENSE ls_column_formula_used-si.
cv_si = cv_si + 1.
lv_1st_line_shared_formula = abap_true.
ENDIF.
INSERT ls_column_formula_used INTO TABLE ct_column_formulas_used ASSIGNING <ls_column_formula_used>.
ENDIF.
IF lv_1st_line_shared_formula = abap_true OR <ls_column_formula_used>-t <> 'shared'.
lv_column_alpha = zcl_excel_common=>convert_column2alpha( ip_column = is_sheet_content-cell_column ).
lv_top_cell_coords = |{ lv_column_alpha }{ <ls_column_formula>-table_top_left_row + 1 }|.
lv_bottom_cell_coords = |{ lv_column_alpha }{ <ls_column_formula>-table_bottom_right_row + 1 }|.
lv_cell_coords = |{ lv_column_alpha }{ is_sheet_content-cell_row }|.
IF lv_top_cell_coords = lv_cell_coords.
lv_ref_value = |{ lv_top_cell_coords }:{ lv_bottom_cell_coords }|.
ELSE.
lv_ref_value = |{ lv_cell_coords }:{ lv_bottom_cell_coords }|.
lv_value = zcl_excel_common=>shift_formula(
iv_reference_formula = lv_value
iv_shift_cols = 0
iv_shift_rows = is_sheet_content-cell_row - <ls_column_formula>-table_top_left_row - 1 ).
ENDIF.
ENDIF.
IF <ls_column_formula_used>-t = 'shared'.
eo_element->set_attribute( name = 't'
value = <ls_column_formula_used>-t ).
eo_element->set_attribute( name = 'si'
value = <ls_column_formula_used>-si ).
IF lv_1st_line_shared_formula = abap_true.
eo_element->set_attribute( name = 'ref'
value = lv_ref_value ).
eo_element->set_value( value = lv_value ).
ENDIF.
ELSE.
eo_element->set_value( value = lv_value ).
ENDIF.
ENDMETHOD.
METHOD create_xl_sheet_pagebreaks.
DATA: lo_pagebreaks TYPE REF TO zcl_excel_worksheet_pagebreaks,
lt_pagebreaks TYPE zcl_excel_worksheet_pagebreaks=>tt_pagebreak_at,
lt_rows TYPE HASHED TABLE OF int4 WITH UNIQUE KEY table_line,
lt_columns TYPE HASHED TABLE OF int4 WITH UNIQUE KEY table_line,
lo_node_rowbreaks TYPE REF TO if_ixml_element,
lo_node_colbreaks TYPE REF TO if_ixml_element,
lo_node_break TYPE REF TO if_ixml_element,
lv_value TYPE string.
FIELD-SYMBOLS: <ls_pagebreak> LIKE LINE OF lt_pagebreaks.
lo_pagebreaks = io_worksheet->get_pagebreaks( ).
CHECK lo_pagebreaks IS BOUND.
lt_pagebreaks = lo_pagebreaks->get_all_pagebreaks( ).
CHECK lt_pagebreaks IS NOT INITIAL. " No need to proceed if don't have any pagebreaks.
lo_node_rowbreaks = io_document->create_simple_element( name = 'rowBreaks'
parent = io_document ).
lo_node_colbreaks = io_document->create_simple_element( name = 'colBreaks'
parent = io_document ).
LOOP AT lt_pagebreaks ASSIGNING <ls_pagebreak>.
* Count how many rows and columns need to be broken
INSERT <ls_pagebreak>-cell_row INTO TABLE lt_rows.
IF sy-subrc = 0. " New
lv_value = <ls_pagebreak>-cell_row.
CONDENSE lv_value.
lo_node_break = io_document->create_simple_element( name = 'brk'
parent = io_document ).
lo_node_break->set_attribute( name = 'id' value = lv_value ).
lo_node_break->set_attribute( name = 'man' value = '1' ). " Manual break
lo_node_break->set_attribute( name = 'max' value = '16383' ). " Max columns
lo_node_rowbreaks->append_child( new_child = lo_node_break ).
ENDIF.
INSERT <ls_pagebreak>-cell_column INTO TABLE lt_columns.
IF sy-subrc = 0. " New
lv_value = <ls_pagebreak>-cell_column.
CONDENSE lv_value.
lo_node_break = io_document->create_simple_element( name = 'brk'
parent = io_document ).
lo_node_break->set_attribute( name = 'id' value = lv_value ).
lo_node_break->set_attribute( name = 'man' value = '1' ). " Manual break
lo_node_break->set_attribute( name = 'max' value = '1048575' ). " Max rows
lo_node_colbreaks->append_child( new_child = lo_node_break ).
ENDIF.
ENDLOOP.
lv_value = lines( lt_rows ).
CONDENSE lv_value.
lo_node_rowbreaks->set_attribute( name = 'count' value = lv_value ).
lo_node_rowbreaks->set_attribute( name = 'manualBreakCount' value = lv_value ).
lv_value = lines( lt_rows ).
CONDENSE lv_value.
lo_node_colbreaks->set_attribute( name = 'count' value = lv_value ).
lo_node_colbreaks->set_attribute( name = 'manualBreakCount' value = lv_value ).
io_parent->append_child( new_child = lo_node_rowbreaks ).
io_parent->append_child( new_child = lo_node_colbreaks ).
ENDMETHOD.
METHOD create_xl_sheet_rels.
** Constant node name
DATA: lc_xml_node_relationships TYPE string VALUE 'Relationships',
lc_xml_node_relationship TYPE string VALUE 'Relationship',
" Node attributes
lc_xml_attr_id TYPE string VALUE 'Id',
lc_xml_attr_type TYPE string VALUE 'Type',
lc_xml_attr_target TYPE string VALUE 'Target',
lc_xml_attr_target_mode TYPE string VALUE 'TargetMode',
lc_xml_val_external TYPE string VALUE 'External',
" Node namespace
lc_xml_node_rels_ns TYPE string VALUE 'http://schemas.openxmlformats.org/package/2006/relationships',
lc_xml_node_rid_table_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/table',
lc_xml_node_rid_printer_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings',
lc_xml_node_rid_drawing_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing',
lc_xml_node_rid_comment_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments', " (+) Issue #180
lc_xml_node_rid_drawing_cmt_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing', " (+) Issue #180
lc_xml_node_rid_link_tp TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element TYPE REF TO if_ixml_element,
lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_table TYPE REF TO zcl_excel_table,
lo_link TYPE REF TO zcl_excel_hyperlink.
DATA: lv_value TYPE string,
lv_relation_id TYPE i,
lv_index_str TYPE string,
lv_comment_index TYPE i.
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
**********************************************************************
* STEP 3: Create main node relationships
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_relationships
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns'
value = lc_xml_node_rels_ns ).
**********************************************************************
* STEP 4: Create subnodes
" Add sheet Relationship nodes here
lv_relation_id = 0.
lo_iterator = io_worksheet->get_hyperlinks_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_link ?= lo_iterator->get_next( ).
CHECK lo_link->is_internal( ) = abap_false. " issue #340 - don't put internal links here
ADD 1 TO lv_relation_id.
lv_value = lv_relation_id.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_id
value = lv_value ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid_link_tp ).
lv_value = lo_link->get_url( ).
lo_element->set_attribute_ns( name = lc_xml_attr_target
value = lv_value ).
lo_element->set_attribute_ns( name = lc_xml_attr_target_mode
value = lc_xml_val_external ).
lo_element_root->append_child( new_child = lo_element ).
ENDWHILE.
* drawing
DATA: lo_drawings TYPE REF TO zcl_excel_drawings.
lo_drawings = io_worksheet->get_drawings( ).
IF lo_drawings->is_empty( ) = abap_false.
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
ADD 1 TO lv_relation_id.
lv_value = lv_relation_id.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element->set_attribute_ns( name = lc_xml_attr_id
value = lv_value ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid_drawing_tp ).
lv_index_str = iv_drawing_index.
CONDENSE lv_index_str NO-GAPS.
MOVE me->c_xl_drawings TO lv_value.
REPLACE 'xl' WITH '..' INTO lv_value.
REPLACE '#' WITH lv_index_str INTO lv_value.
lo_element->set_attribute_ns( name = lc_xml_attr_target
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
ENDIF.
* Begin - Add - Issue #180
DATA: lo_comments TYPE REF TO zcl_excel_comments.
lv_comment_index = iv_comment_index.
lo_comments = io_worksheet->get_comments( ).
IF lo_comments->is_empty( ) = abap_false.
" Drawing for comment
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
ADD 1 TO lv_relation_id.
ADD 1 TO lv_comment_index.
lv_value = lv_relation_id.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element->set_attribute_ns( name = lc_xml_attr_id
value = lv_value ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid_drawing_cmt_tp ).
lv_index_str = iv_comment_index.
CONDENSE lv_index_str NO-GAPS.
MOVE me->cl_xl_drawing_for_comments TO lv_value.
REPLACE 'xl' WITH '..' INTO lv_value.
REPLACE '#' WITH lv_index_str INTO lv_value.
lo_element->set_attribute_ns( name = lc_xml_attr_target
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
" Comment
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
ADD 1 TO lv_relation_id.
lv_value = lv_relation_id.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element->set_attribute_ns( name = lc_xml_attr_id
value = lv_value ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid_comment_tp ).
lv_index_str = iv_comment_index.
CONDENSE lv_index_str NO-GAPS.
MOVE me->c_xl_comments TO lv_value.
REPLACE 'xl' WITH '..' INTO lv_value.
REPLACE '#' WITH lv_index_str INTO lv_value.
lo_element->set_attribute_ns( name = lc_xml_attr_target
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
ENDIF.
* End - Add - Issue #180
**********************************************************************
* header footer image
DATA: lt_drawings TYPE zexcel_t_drawings.
lt_drawings = io_worksheet->get_header_footer_drawings( ).
IF lines( lt_drawings ) > 0. "Header or footer image exist
ADD 1 TO lv_relation_id.
" Drawing for comment/header/footer
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
lv_value = lv_relation_id.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element->set_attribute_ns( name = lc_xml_attr_id
value = lv_value ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid_drawing_cmt_tp ).
lv_index_str = lv_comment_index.
CONDENSE lv_index_str NO-GAPS.
MOVE me->cl_xl_drawing_for_comments TO lv_value.
REPLACE 'xl' WITH '..' INTO lv_value.
REPLACE '#' WITH lv_index_str INTO lv_value.
lo_element->set_attribute_ns( name = lc_xml_attr_target
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
ENDIF.
*** End Header Footer
**********************************************************************
lo_iterator = io_worksheet->get_tables_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_table ?= lo_iterator->get_next( ).
ADD 1 TO lv_relation_id.
lv_value = lv_relation_id.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_id
value = lv_value ).
lo_element->set_attribute_ns( name = lc_xml_attr_type
value = lc_xml_node_rid_table_tp ).
lv_value = lo_table->get_name( ).
CONCATENATE '../tables/' lv_value '.xml' INTO lv_value.
lo_element->set_attribute_ns( name = lc_xml_attr_target
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
ENDWHILE.
* IF io_worksheet->get_print_settings( )->is_empty( ) = abap_false.
* ADD 1 TO lv_relation_id.
* lv_value = lv_relation_id.
* CONDENSE lv_value.
* CONCATENATE 'rId' lv_value INTO lv_value.
*
* lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
* parent = lo_document ).
* lo_element->set_attribute_ns( name = lc_xml_attr_id
* value = lv_value ).
* lo_element->set_attribute_ns( name = lc_xml_attr_type
* value = lc_xml_node_rid_printer_tp ).
*
* lv_index_str = iv_printer_index.
* CONDENSE lv_index_str NO-GAPS.
* MOVE me->c_xl_printersettings TO lv_value.
* REPLACE 'xl' WITH '..' INTO lv_value.
* REPLACE '#' WITH lv_index_str INTO lv_value.
* lo_element->set_attribute_ns( name = lc_xml_attr_target
* value = lv_value ).
*
* lo_element_root->append_child( new_child = lo_element ).
* ENDIF.
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_xl_sheet_sheet_data.
TYPES: BEGIN OF lty_table_area,
left TYPE i,
right TYPE i,
top TYPE i,
bottom TYPE i,
END OF lty_table_area.
CONSTANTS: lc_dummy_cell_content TYPE zexcel_s_cell_data-cell_value VALUE '})~~~ This is a dummy value for ABAP2XLSX and you should never find this in a real excelsheet Ihope'.
CONSTANTS: lc_xml_node_sheetdata TYPE string VALUE 'sheetData', " SheetData tag
lc_xml_node_row TYPE string VALUE 'row', " Row tag
lc_xml_attr_r TYPE string VALUE 'r', " Cell: row-attribute
lc_xml_attr_spans TYPE string VALUE 'spans', " Cell: spans-attribute
lc_xml_node_c TYPE string VALUE 'c', " Cell tag
lc_xml_node_v TYPE string VALUE 'v', " Cell: value
lc_xml_node_f TYPE string VALUE 'f', " Cell: formula
lc_xml_attr_s TYPE string VALUE 's', " Cell: style
lc_xml_attr_t TYPE string VALUE 't'. " Cell: type
DATA: col_count TYPE int4,
lo_autofilters TYPE REF TO zcl_excel_autofilters,
lo_autofilter TYPE REF TO zcl_excel_autofilter,
l_autofilter_hidden TYPE flag,
lt_values TYPE zexcel_t_autofilter_values,
ls_values TYPE zexcel_s_autofilter_values,
ls_area TYPE zexcel_s_autofilter_area,
lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_table TYPE REF TO zcl_excel_table,
lt_table_areas TYPE SORTED TABLE OF lty_table_area WITH NON-UNIQUE KEY left right top bottom,
ls_table_area LIKE LINE OF lt_table_areas,
lo_column TYPE REF TO zcl_excel_column,
ls_sheet_content LIKE LINE OF io_worksheet->sheet_content,
ls_sheet_content_empty LIKE LINE OF io_worksheet->sheet_content,
lv_current_row TYPE i,
lv_next_row TYPE i,
lv_last_row TYPE i,
* lts_row_dimensions TYPE zexcel_t_worksheet_rowdimensio,
lo_row_iterator TYPE REF TO cl_object_collection_iterator,
lo_row TYPE REF TO zcl_excel_row,
lo_row_empty TYPE REF TO zcl_excel_row,
lts_row_outlines TYPE zcl_excel_worksheet=>mty_ts_outlines_row,
ls_last_row TYPE zexcel_s_cell_data,
ls_style_mapping TYPE zexcel_s_styles_mapping,
lo_element_2 TYPE REF TO if_ixml_element,
lo_element_3 TYPE REF TO if_ixml_element,
lo_element_4 TYPE REF TO if_ixml_element,
lv_value TYPE string,
lv_style_guid TYPE zexcel_cell_style.
DATA: lt_column_formulas_used TYPE mty_column_formulas_used,
lv_si TYPE i.
FIELD-SYMBOLS: <ls_sheet_content> TYPE zexcel_s_cell_data,
<ls_row_outline> LIKE LINE OF lts_row_outlines.
" sheetData node
rv_ixml_sheet_data_root = io_document->create_simple_element( name = lc_xml_node_sheetdata
parent = io_document ).
" Get column count
col_count = io_worksheet->get_highest_column( ).
" Get autofilter
*lv_guid = io_worksheet->get_guid( ) .
lo_autofilters = excel->get_autofilters_reference( ).
lo_autofilter = lo_autofilters->get( io_worksheet = io_worksheet ) .
IF lo_autofilter IS BOUND.
lt_values = lo_autofilter->get_values( ) .
ls_area = lo_autofilter->get_filter_area( ) .
l_autofilter_hidden = abap_true. " First defautl is not showing
ENDIF.
*--------------------------------------------------------------------*
*issue #220 - If cell in tables-area don't use default from row or column or sheet - Coding 1 - start
*--------------------------------------------------------------------*
*Build table to hold all table-areas attached to this sheet
lo_iterator = io_worksheet->get_tables_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_table ?= lo_iterator->get_next( ).
ls_table_area-left = zcl_excel_common=>convert_column2int( lo_table->settings-top_left_column ).
ls_table_area-right = lo_table->get_right_column_integer( ).
ls_table_area-top = lo_table->settings-top_left_row.
ls_table_area-bottom = lo_table->get_bottom_row_integer( ).
INSERT ls_table_area INTO TABLE lt_table_areas.
ENDWHILE.
*--------------------------------------------------------------------*
*issue #220 - If cell in tables-area don't use default from row or column or sheet - Coding 1 - end
*--------------------------------------------------------------------*
*We have problems when the first rows or trailing rows are not set but we have rowinformation
*to solve this we add dummycontent into first and last line that will not be set
*Set first line if necessary
READ TABLE io_worksheet->sheet_content TRANSPORTING NO FIELDS WITH KEY cell_row = 1.
IF sy-subrc <> 0.
ls_sheet_content_empty-cell_row = 1.
ls_sheet_content_empty-cell_column = 1.
ls_sheet_content_empty-cell_value = lc_dummy_cell_content.
INSERT ls_sheet_content_empty INTO TABLE io_worksheet->sheet_content.
ENDIF.
*Set last line if necessary
*Last row with cell content
lv_last_row = io_worksheet->get_highest_row( ).
*Last line with row-information set directly ( like line height, hidden-status ... )
lo_row_iterator = io_worksheet->get_rows_iterator( ).
WHILE lo_row_iterator->has_next( ) = abap_true.
lo_row ?= lo_row_iterator->get_next( ).
IF lo_row->get_row_index( ) > lv_last_row.
lv_last_row = lo_row->get_row_index( ).
ENDIF.
ENDWHILE.
*Last line with row-information set indirectly by row outline
lts_row_outlines = io_worksheet->get_row_outlines( ).
LOOP AT lts_row_outlines ASSIGNING <ls_row_outline>.
IF <ls_row_outline>-collapsed = 'X'.
lv_current_row = <ls_row_outline>-row_to + 1. " collapsed-status may be set on following row
ELSE.
lv_current_row = <ls_row_outline>-row_to. " collapsed-status may be set on following row
ENDIF.
IF lv_current_row > lv_last_row.
lv_last_row = lv_current_row.
ENDIF.
ENDLOOP.
READ TABLE io_worksheet->sheet_content TRANSPORTING NO FIELDS WITH KEY cell_row = lv_last_row.
IF sy-subrc <> 0.
ls_sheet_content_empty-cell_row = lv_last_row.
ls_sheet_content_empty-cell_column = 1.
ls_sheet_content_empty-cell_value = lc_dummy_cell_content.
INSERT ls_sheet_content_empty INTO TABLE io_worksheet->sheet_content.
ENDIF.
CLEAR ls_sheet_content.
LOOP AT io_worksheet->sheet_content INTO ls_sheet_content.
IF lt_values IS INITIAL. " no values attached to autofilter " issue #368 autofilter filtering too much
CLEAR l_autofilter_hidden.
ELSE.
READ TABLE lt_values INTO ls_values WITH KEY column = ls_last_row-cell_column.
IF sy-subrc = 0 AND ls_values-value = ls_last_row-cell_value.
CLEAR l_autofilter_hidden.
ENDIF.
ENDIF.
CLEAR ls_style_mapping.
*Create row element
*issues #346,#154, #195 - problems when we have information in row_dimension but no cell content in that row
*Get next line that may have to be added. If we have empty lines this is the next line after previous cell content
*Otherwise it is the line of the current cell content
lv_current_row = ls_last_row-cell_row + 1.
IF lv_current_row > ls_sheet_content-cell_row.
lv_current_row = ls_sheet_content-cell_row.
ENDIF.
*Fill in empty lines if necessary - assign an emtpy sheet content
lv_next_row = lv_current_row.
WHILE lv_next_row <= ls_sheet_content-cell_row.
lv_current_row = lv_next_row.
lv_next_row = lv_current_row + 1.
IF lv_current_row = ls_sheet_content-cell_row. " cell value found in this row
ASSIGN ls_sheet_content TO <ls_sheet_content>.
ELSE.
*Check if empty row is really necessary - this is basically the case when we have information in row_dimension
lo_row_empty = io_worksheet->get_row( lv_current_row ).
CHECK lo_row_empty->get_row_height( ) >= 0 OR
lo_row_empty->get_collapsed( io_worksheet ) = abap_true OR
lo_row_empty->get_outline_level( io_worksheet ) > 0 OR
lo_row_empty->get_xf_index( ) <> 0.
" Dummyentry A1
ls_sheet_content_empty-cell_row = lv_current_row.
ls_sheet_content_empty-cell_column = 1.
ASSIGN ls_sheet_content_empty TO <ls_sheet_content>.
ENDIF.
IF ls_last_row-cell_row NE <ls_sheet_content>-cell_row.
IF lo_autofilter IS BOUND.
IF ls_area-row_start >= ls_last_row-cell_row OR " One less for header
ls_area-row_end < ls_last_row-cell_row .
CLEAR l_autofilter_hidden.
ENDIF.
ELSE.
CLEAR l_autofilter_hidden.
ENDIF.
IF ls_last_row-cell_row IS NOT INITIAL.
" Row visibility of previos row.
IF lo_row->get_visible( io_worksheet ) = abap_false OR
l_autofilter_hidden = abap_true.
lo_element_2->set_attribute_ns( name = 'hidden' value = 'true' ).
ENDIF.
* lv_xstring_partial = render_ixml_element_no_header( lo_element_2 ).
* CONCATENATE lv_xstring lv_xstring_partial
* INTO lv_xstring IN BYTE MODE.
rv_ixml_sheet_data_root->append_child( new_child = lo_element_2 ). " row node
ENDIF.
" Add new row
lo_element_2 = io_document->create_simple_element( name = lc_xml_node_row
parent = io_document ).
" r
lv_value = <ls_sheet_content>-cell_row.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element_2->set_attribute_ns( name = lc_xml_attr_r
value = lv_value ).
" Spans
lv_value = col_count.
CONCATENATE '1:' lv_value INTO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element_2->set_attribute_ns( name = lc_xml_attr_spans
value = lv_value ).
lo_row = io_worksheet->get_row( <ls_sheet_content>-cell_row ).
" Row dimensions
IF lo_row->get_custom_height( ) = abap_true.
lo_element_2->set_attribute_ns( name = 'customHeight' value = '1' ).
ENDIF.
IF lo_row->get_row_height( ) >= 0.
lv_value = lo_row->get_row_height( ).
lo_element_2->set_attribute_ns( name = 'ht' value = lv_value ).
ENDIF.
" Collapsed
IF lo_row->get_collapsed( io_worksheet ) = abap_true.
lo_element_2->set_attribute_ns( name = 'collapsed' value = 'true' ).
ENDIF.
" Outline level
IF lo_row->get_outline_level( io_worksheet ) > 0.
lv_value = lo_row->get_outline_level( io_worksheet ).
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element_2->set_attribute_ns( name = 'outlineLevel' value = lv_value ).
ENDIF.
" Style
IF lo_row->get_xf_index( ) <> 0.
lv_value = lo_row->get_xf_index( ).
lo_element_2->set_attribute_ns( name = 's' value = lv_value ).
lo_element_2->set_attribute_ns( name = 'customFormat' value = '1' ).
ENDIF.
IF lt_values IS INITIAL. " no values attached to autofilter " issue #368 autofilter filtering too much
CLEAR l_autofilter_hidden.
ELSE.
l_autofilter_hidden = abap_true. " First default is not showing
ENDIF.
ELSE.
ENDIF.
ENDWHILE.
lo_element_3 = io_document->create_simple_element( name = lc_xml_node_c
parent = io_document ).
lo_element_3->set_attribute_ns( name = lc_xml_attr_r
value = <ls_sheet_content>-cell_coords ).
*begin of change issue #157 - allow column cellstyle
*if no cellstyle is set, look into column, then into sheet
IF <ls_sheet_content>-cell_style IS NOT INITIAL.
lv_style_guid = <ls_sheet_content>-cell_style.
ELSE.
*--------------------------------------------------------------------*
*issue #220 - If cell in tables-area don't use default from row or column or sheet - Coding 2 - start
*--------------------------------------------------------------------*
*Check if cell in any of the table areas
LOOP AT lt_table_areas TRANSPORTING NO FIELDS WHERE top <= <ls_sheet_content>-cell_row
AND bottom >= <ls_sheet_content>-cell_row
AND left <= <ls_sheet_content>-cell_column
AND right >= <ls_sheet_content>-cell_column.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
CLEAR lv_style_guid. " No style --> EXCEL will use built-in-styles as declared in the tables-section
ELSE.
*--------------------------------------------------------------------*
*issue #220 - If cell in tables-area don't use default from row or column or sheet - Coding 2 - end
*--------------------------------------------------------------------*
lv_style_guid = io_worksheet->zif_excel_sheet_properties~get_style( ).
lo_column ?= io_worksheet->get_column( <ls_sheet_content>-cell_column ).
IF lo_column->get_column_index( ) = <ls_sheet_content>-cell_column.
lv_style_guid = lo_column->get_column_style_guid( ).
IF lv_style_guid IS INITIAL.
lv_style_guid = io_worksheet->zif_excel_sheet_properties~get_style( ).
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
*issue #220 - If cell in tables-area don't use default from row or column or sheet - Coding 3 - start
*--------------------------------------------------------------------*
ENDIF.
*--------------------------------------------------------------------*
*issue #220 - If cell in tables-area don't use default from row or column or sheet - Coding 3 - end
*--------------------------------------------------------------------*
ENDIF.
* IF <ls_sheet_content>-cell_style IS NOT INITIAL.
* READ TABLE styles_mapping INTO ls_style_mapping WITH KEY guid = <ls_sheet_content>-cell_style.
IF lv_style_guid IS NOT INITIAL.
READ TABLE styles_mapping INTO ls_style_mapping WITH KEY guid = lv_style_guid.
*end of change issue #157 - allow column cellstyles
lv_value = ls_style_mapping-style.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element_3->set_attribute_ns( name = lc_xml_attr_s
value = lv_value ).
ENDIF.
" For cells with formula ignore the value - Excel will calculate it
IF <ls_sheet_content>-cell_formula IS NOT INITIAL.
" fomula node
lo_element_4 = io_document->create_simple_element( name = lc_xml_node_f
parent = io_document ).
lv_value = <ls_sheet_content>-cell_formula.
CONDENSE lv_value.
lo_element_4->set_value( value = lv_value ).
lo_element_3->append_child( new_child = lo_element_4 ). " fomula node
ELSEIF <ls_sheet_content>-column_formula_id <> 0.
create_xl_sheet_column_formula(
EXPORTING
io_document = io_document
it_column_formulas = io_worksheet->column_formulas
is_sheet_content = <ls_sheet_content>
IMPORTING
eo_element = lo_element_4
CHANGING
ct_column_formulas_used = lt_column_formulas_used
cv_si = lv_si ).
lo_element_3->append_child( new_child = lo_element_4 ).
ELSEIF <ls_sheet_content>-cell_value IS NOT INITIAL "cell can have just style or formula
AND <ls_sheet_content>-cell_value <> lc_dummy_cell_content.
IF <ls_sheet_content>-data_type IS NOT INITIAL.
IF <ls_sheet_content>-data_type EQ 's_leading_blanks'.
lo_element_3->set_attribute_ns( name = lc_xml_attr_t
value = 's' ).
ELSE.
lo_element_3->set_attribute_ns( name = lc_xml_attr_t
value = <ls_sheet_content>-data_type ).
ENDIF.
ENDIF.
" value node
lo_element_4 = io_document->create_simple_element( name = lc_xml_node_v
parent = io_document ).
IF <ls_sheet_content>-data_type EQ 's' OR <ls_sheet_content>-data_type EQ 's_leading_blanks'.
lv_value = me->get_shared_string_index( ip_cell_value = <ls_sheet_content>-cell_value
it_rtf = <ls_sheet_content>-rtf_tab ).
CONDENSE lv_value.
lo_element_4->set_value( value = lv_value ).
ELSE.
lv_value = <ls_sheet_content>-cell_value.
CONDENSE lv_value.
lo_element_4->set_value( value = lv_value ).
ENDIF.
lo_element_3->append_child( new_child = lo_element_4 ). " value node
ENDIF.
lo_element_2->append_child( new_child = lo_element_3 ). " column node
ls_last_row = <ls_sheet_content>.
ENDLOOP.
IF sy-subrc = 0.
READ TABLE lt_values INTO ls_values WITH KEY column = ls_last_row-cell_column.
IF sy-subrc = 0 AND ls_values-value = ls_last_row-cell_value.
CLEAR l_autofilter_hidden.
ENDIF.
IF lo_autofilter IS BOUND.
IF ls_area-row_start >= ls_last_row-cell_row OR " One less for header
ls_area-row_end < ls_last_row-cell_row .
CLEAR l_autofilter_hidden.
ENDIF.
ELSE.
CLEAR l_autofilter_hidden.
ENDIF.
" Row visibility of previos row.
IF lo_row->get_visible( ) = abap_false OR
l_autofilter_hidden = abap_true.
lo_element_2->set_attribute_ns( name = 'hidden' value = 'true' ).
ENDIF.
* lv_xstring_partial = render_ixml_element_no_header( lo_element_2 ).
* CONCATENATE lv_xstring lv_xstring_partial
* INTO lv_xstring IN BYTE MODE.
rv_ixml_sheet_data_root->append_child( new_child = lo_element_2 ). " row node
ENDIF.
DELETE io_worksheet->sheet_content WHERE cell_value = lc_dummy_cell_content. " Get rid of dummyentries
ENDMETHOD.
METHOD create_xl_styles.
*--------------------------------------------------------------------*
* ToDos:
* 2do§1 dxfs-cellstyles are used in conditional formats:
* CellIs, Expression, top10 ( forthcoming above average as well )
* create own method to write dsfx-cellstyle to be reuseable by all these
*--------------------------------------------------------------------*
** Constant node name
CONSTANTS: lc_xml_node_stylesheet TYPE string VALUE 'styleSheet',
" font
lc_xml_node_fonts TYPE string VALUE 'fonts',
lc_xml_node_font TYPE string VALUE 'font',
lc_xml_node_color TYPE string VALUE 'color',
" fill
lc_xml_node_fills TYPE string VALUE 'fills',
lc_xml_node_fill TYPE string VALUE 'fill',
lc_xml_node_patternfill TYPE string VALUE 'patternFill',
lc_xml_node_fgcolor TYPE string VALUE 'fgColor',
lc_xml_node_bgcolor TYPE string VALUE 'bgColor',
lc_xml_node_gradientfill TYPE string VALUE 'gradientFill',
lc_xml_node_stop TYPE string VALUE 'stop',
" borders
lc_xml_node_borders TYPE string VALUE 'borders',
lc_xml_node_border TYPE string VALUE 'border',
lc_xml_node_left TYPE string VALUE 'left',
lc_xml_node_right TYPE string VALUE 'right',
lc_xml_node_top TYPE string VALUE 'top',
lc_xml_node_bottom TYPE string VALUE 'bottom',
lc_xml_node_diagonal TYPE string VALUE 'diagonal',
" numfmt
lc_xml_node_numfmts TYPE string VALUE 'numFmts',
lc_xml_node_numfmt TYPE string VALUE 'numFmt',
" Styles
lc_xml_node_cellstylexfs TYPE string VALUE 'cellStyleXfs',
lc_xml_node_xf TYPE string VALUE 'xf',
lc_xml_node_cellxfs TYPE string VALUE 'cellXfs',
lc_xml_node_cellstyles TYPE string VALUE 'cellStyles',
lc_xml_node_cellstyle TYPE string VALUE 'cellStyle',
lc_xml_node_dxfs TYPE string VALUE 'dxfs',
lc_xml_node_tablestyles TYPE string VALUE 'tableStyles',
" Colors
lc_xml_node_colors TYPE string VALUE 'colors',
lc_xml_node_indexedcolors TYPE string VALUE 'indexedColors',
lc_xml_node_rgbcolor TYPE string VALUE 'rgbColor',
lc_xml_node_mrucolors TYPE string VALUE 'mruColors',
" Alignment
lc_xml_node_alignment TYPE string VALUE 'alignment',
" Protection
lc_xml_node_protection TYPE string VALUE 'protection',
" Node attributes
lc_xml_attr_count TYPE string VALUE 'count',
lc_xml_attr_val TYPE string VALUE 'val',
lc_xml_attr_theme TYPE string VALUE 'theme',
lc_xml_attr_rgb TYPE string VALUE 'rgb',
lc_xml_attr_indexed TYPE string VALUE 'indexed',
lc_xml_attr_tint TYPE string VALUE 'tint',
lc_xml_attr_style TYPE string VALUE 'style',
lc_xml_attr_position TYPE string VALUE 'position',
lc_xml_attr_degree TYPE string VALUE 'degree',
lc_xml_attr_patterntype TYPE string VALUE 'patternType',
lc_xml_attr_numfmtid TYPE string VALUE 'numFmtId',
lc_xml_attr_fontid TYPE string VALUE 'fontId',
lc_xml_attr_fillid TYPE string VALUE 'fillId',
lc_xml_attr_borderid TYPE string VALUE 'borderId',
lc_xml_attr_xfid TYPE string VALUE 'xfId',
lc_xml_attr_applynumberformat TYPE string VALUE 'applyNumberFormat',
lc_xml_attr_applyprotection TYPE string VALUE 'applyProtection',
lc_xml_attr_applyfont TYPE string VALUE 'applyFont',
lc_xml_attr_applyfill TYPE string VALUE 'applyFill',
lc_xml_attr_applyborder TYPE string VALUE 'applyBorder',
lc_xml_attr_name TYPE string VALUE 'name',
lc_xml_attr_builtinid TYPE string VALUE 'builtinId',
lc_xml_attr_defaulttablestyle TYPE string VALUE 'defaultTableStyle',
lc_xml_attr_defaultpivotstyle TYPE string VALUE 'defaultPivotStyle',
lc_xml_attr_applyalignment TYPE string VALUE 'applyAlignment',
lc_xml_attr_horizontal TYPE string VALUE 'horizontal',
lc_xml_attr_formatcode TYPE string VALUE 'formatCode',
lc_xml_attr_vertical TYPE string VALUE 'vertical',
lc_xml_attr_wraptext TYPE string VALUE 'wrapText',
lc_xml_attr_textrotation TYPE string VALUE 'textRotation',
lc_xml_attr_shrinktofit TYPE string VALUE 'shrinkToFit',
lc_xml_attr_indent TYPE string VALUE 'indent',
lc_xml_attr_locked TYPE string VALUE 'locked',
lc_xml_attr_hidden TYPE string VALUE 'hidden',
lc_xml_attr_diagonalup TYPE string VALUE 'diagonalUp',
lc_xml_attr_diagonaldown TYPE string VALUE 'diagonalDown',
" Node namespace
lc_xml_node_ns TYPE string VALUE 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',
lc_xml_attr_type TYPE string VALUE 'type',
lc_xml_attr_bottom TYPE string VALUE 'bottom',
lc_xml_attr_top TYPE string VALUE 'top',
lc_xml_attr_right TYPE string VALUE 'right',
lc_xml_attr_left TYPE string VALUE 'left'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element_fonts TYPE REF TO if_ixml_element,
lo_element_font TYPE REF TO if_ixml_element,
lo_element_fills TYPE REF TO if_ixml_element,
lo_element_fill TYPE REF TO if_ixml_element,
lo_element_borders TYPE REF TO if_ixml_element,
lo_element_border TYPE REF TO if_ixml_element,
lo_element_numfmts TYPE REF TO if_ixml_element,
lo_element_numfmt TYPE REF TO if_ixml_element,
lo_element_cellxfs TYPE REF TO if_ixml_element,
lo_element TYPE REF TO if_ixml_element,
lo_sub_element TYPE REF TO if_ixml_element,
lo_sub_element_2 TYPE REF TO if_ixml_element,
lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_iterator2 TYPE REF TO cl_object_collection_iterator,
lo_worksheet TYPE REF TO zcl_excel_worksheet,
lo_style_cond TYPE REF TO zcl_excel_style_cond,
lo_style TYPE REF TO zcl_excel_style.
DATA: lt_fonts TYPE zexcel_t_style_font,
ls_font TYPE zexcel_s_style_font,
lt_fills TYPE zexcel_t_style_fill,
ls_fill TYPE zexcel_s_style_fill,
lt_borders TYPE zexcel_t_style_border,
ls_border TYPE zexcel_s_style_border,
lt_numfmts TYPE zexcel_t_style_numfmt,
ls_numfmt TYPE zexcel_s_style_numfmt,
lt_protections TYPE zexcel_t_style_protection,
ls_protection TYPE zexcel_s_style_protection,
lt_alignments TYPE zexcel_t_style_alignment,
ls_alignment TYPE zexcel_s_style_alignment,
lt_cellxfs TYPE zexcel_t_cellxfs,
ls_cellxfs TYPE zexcel_s_cellxfs,
ls_styles_mapping TYPE zexcel_s_styles_mapping,
lt_colors TYPE zexcel_t_style_color_argb,
ls_color LIKE LINE OF lt_colors.
DATA: lv_value TYPE string,
lv_dfx_count TYPE i,
lv_fonts_count TYPE i,
lv_fills_count TYPE i,
lv_borders_count TYPE i,
lv_cellxfs_count TYPE i.
TYPES: BEGIN OF ts_built_in_format,
num_format TYPE zexcel_number_format,
id TYPE sytabix,
END OF ts_built_in_format.
DATA: lt_built_in_num_formats TYPE HASHED TABLE OF ts_built_in_format WITH UNIQUE KEY num_format,
ls_built_in_num_format LIKE LINE OF lt_built_in_num_formats.
FIELD-SYMBOLS: <ls_built_in_format> LIKE LINE OF lt_built_in_num_formats,
<ls_reader_built_in> LIKE LINE OF zcl_excel_style_number_format=>mt_built_in_num_formats.
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
***********************************************************************
* STEP 3: Create main node relationships
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_stylesheet
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns'
value = lc_xml_node_ns ).
**********************************************************************
* STEP 4: Create subnodes
lo_element_fonts = lo_document->create_simple_element( name = lc_xml_node_fonts
parent = lo_document ).
lo_element_fills = lo_document->create_simple_element( name = lc_xml_node_fills
parent = lo_document ).
lo_element_borders = lo_document->create_simple_element( name = lc_xml_node_borders
parent = lo_document ).
lo_element_cellxfs = lo_document->create_simple_element( name = lc_xml_node_cellxfs
parent = lo_document ).
lo_element_numfmts = lo_document->create_simple_element( name = lc_xml_node_numfmts
parent = lo_document ).
* Prepare built-in number formats.
LOOP AT zcl_excel_style_number_format=>mt_built_in_num_formats ASSIGNING <ls_reader_built_in>.
ls_built_in_num_format-id = <ls_reader_built_in>-id.
ls_built_in_num_format-num_format = <ls_reader_built_in>-format->format_code.
INSERT ls_built_in_num_format INTO TABLE lt_built_in_num_formats.
ENDLOOP.
* Compress styles
lo_iterator = excel->get_styles_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_style ?= lo_iterator->get_next( ).
ls_font = lo_style->font->get_structure( ).
ls_fill = lo_style->fill->get_structure( ).
ls_border = lo_style->borders->get_structure( ).
ls_alignment = lo_style->alignment->get_structure( ).
ls_protection = lo_style->protection->get_structure( ).
ls_numfmt = lo_style->number_format->get_structure( ).
CLEAR ls_cellxfs.
* Compress fonts
READ TABLE lt_fonts FROM ls_font TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
ls_cellxfs-fontid = sy-tabix.
ELSE.
APPEND ls_font TO lt_fonts.
DESCRIBE TABLE lt_fonts LINES ls_cellxfs-fontid.
ENDIF.
SUBTRACT 1 FROM ls_cellxfs-fontid.
* Compress alignment
READ TABLE lt_alignments FROM ls_alignment TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
ls_cellxfs-alignmentid = sy-tabix.
ELSE.
APPEND ls_alignment TO lt_alignments.
DESCRIBE TABLE lt_alignments LINES ls_cellxfs-alignmentid.
ENDIF.
SUBTRACT 1 FROM ls_cellxfs-alignmentid.
* Compress fills
READ TABLE lt_fills FROM ls_fill TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
ls_cellxfs-fillid = sy-tabix.
ELSE.
APPEND ls_fill TO lt_fills.
DESCRIBE TABLE lt_fills LINES ls_cellxfs-fillid.
ENDIF.
SUBTRACT 1 FROM ls_cellxfs-fillid.
* Compress borders
READ TABLE lt_borders FROM ls_border TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
ls_cellxfs-borderid = sy-tabix.
ELSE.
APPEND ls_border TO lt_borders.
DESCRIBE TABLE lt_borders LINES ls_cellxfs-borderid.
ENDIF.
SUBTRACT 1 FROM ls_cellxfs-borderid.
* Compress protection
IF ls_protection-locked EQ c_on AND ls_protection-hidden EQ c_off.
ls_cellxfs-applyprotection = 0.
ELSE.
READ TABLE lt_protections FROM ls_protection TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
ls_cellxfs-protectionid = sy-tabix.
ELSE.
APPEND ls_protection TO lt_protections.
DESCRIBE TABLE lt_protections LINES ls_cellxfs-protectionid.
ENDIF.
ls_cellxfs-applyprotection = 1.
ENDIF.
SUBTRACT 1 FROM ls_cellxfs-protectionid.
* Compress number formats
"-----------
IF ls_numfmt-numfmt NE zcl_excel_style_number_format=>c_format_date_std." and ls_numfmt-NUMFMT ne 'STD_NDEC'. " ALE Changes on going
"---
IF ls_numfmt IS NOT INITIAL.
* issue #389 - Problem with built-in format ( those are not being taken account of )
* There are some internal number formats built-in into EXCEL
* Use these instead of duplicating the entries here, since they seem to be language-dependant and adjust to user settings in excel
READ TABLE lt_built_in_num_formats ASSIGNING <ls_built_in_format> WITH TABLE KEY num_format = ls_numfmt-numfmt.
IF sy-subrc = 0.
ls_cellxfs-numfmtid = <ls_built_in_format>-id.
ELSE.
READ TABLE lt_numfmts FROM ls_numfmt TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
ls_cellxfs-numfmtid = sy-tabix.
ELSE.
APPEND ls_numfmt TO lt_numfmts.
DESCRIBE TABLE lt_numfmts LINES ls_cellxfs-numfmtid.
ENDIF.
ADD zcl_excel_common=>c_excel_numfmt_offset TO ls_cellxfs-numfmtid. " Add OXML offset for custom styles
ENDIF.
ls_cellxfs-applynumberformat = 1.
ELSE.
ls_cellxfs-applynumberformat = 0.
ENDIF.
"----------- " ALE changes on going
ELSE.
ls_cellxfs-applynumberformat = 1.
IF ls_numfmt-numfmt EQ zcl_excel_style_number_format=>c_format_date_std.
ls_cellxfs-numfmtid = 14.
* elseif ls_numfmt-NUMFMT eq 'STD_NDEC'.
* ls_cellxfs-numfmtid = 2.
ENDIF.
ENDIF.
"---
IF ls_cellxfs-fontid NE 0.
ls_cellxfs-applyfont = 1.
ELSE.
ls_cellxfs-applyfont = 0.
ENDIF.
IF ls_cellxfs-alignmentid NE 0.
ls_cellxfs-applyalignment = 1.
ELSE.
ls_cellxfs-applyalignment = 0.
ENDIF.
IF ls_cellxfs-fillid NE 0.
ls_cellxfs-applyfill = 1.
ELSE.
ls_cellxfs-applyfill = 0.
ENDIF.
IF ls_cellxfs-borderid NE 0.
ls_cellxfs-applyborder = 1.
ELSE.
ls_cellxfs-applyborder = 0.
ENDIF.
* Remap styles
READ TABLE lt_cellxfs FROM ls_cellxfs TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
ls_styles_mapping-style = sy-tabix.
ELSE.
APPEND ls_cellxfs TO lt_cellxfs.
DESCRIBE TABLE lt_cellxfs LINES ls_styles_mapping-style.
ENDIF.
SUBTRACT 1 FROM ls_styles_mapping-style.
ls_styles_mapping-guid = lo_style->get_guid( ).
APPEND ls_styles_mapping TO me->styles_mapping.
ENDWHILE.
" create numfmt elements
LOOP AT lt_numfmts INTO ls_numfmt.
lo_element_numfmt = lo_document->create_simple_element( name = lc_xml_node_numfmt
parent = lo_document ).
lv_value = sy-tabix + zcl_excel_common=>c_excel_numfmt_offset.
CONDENSE lv_value.
lo_element_numfmt->set_attribute_ns( name = lc_xml_attr_numfmtid
value = lv_value ).
lv_value = ls_numfmt-numfmt.
* REPLACE ALL OCCURRENCES OF '.' IN lv_value WITH '\.'.
lo_element_numfmt->set_attribute_ns( name = lc_xml_attr_formatcode
value = lv_value ).
lo_element_numfmts->append_child( new_child = lo_element_numfmt ).
ENDLOOP.
" create font elements
LOOP AT lt_fonts INTO ls_font.
lo_element_font = lo_document->create_simple_element( name = lc_xml_node_font
parent = lo_document ).
create_xl_styles_font_node( io_document = lo_document
io_parent = lo_element_font
is_font = ls_font ).
lo_element_fonts->append_child( new_child = lo_element_font ).
ENDLOOP.
" create fill elements
LOOP AT lt_fills INTO ls_fill.
lo_element_fill = lo_document->create_simple_element( name = lc_xml_node_fill
parent = lo_document ).
IF ls_fill-gradtype IS NOT INITIAL.
"gradient
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_gradientfill
parent = lo_document ).
IF ls_fill-gradtype-degree IS NOT INITIAL.
lv_value = ls_fill-gradtype-degree.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_degree value = lv_value ).
ENDIF.
IF ls_fill-gradtype-type IS NOT INITIAL.
lv_value = ls_fill-gradtype-type.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_type value = lv_value ).
ENDIF.
IF ls_fill-gradtype-bottom IS NOT INITIAL.
lv_value = ls_fill-gradtype-bottom.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_bottom value = lv_value ).
ENDIF.
IF ls_fill-gradtype-top IS NOT INITIAL.
lv_value = ls_fill-gradtype-top.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_top value = lv_value ).
ENDIF.
IF ls_fill-gradtype-right IS NOT INITIAL.
lv_value = ls_fill-gradtype-right.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_right value = lv_value ).
ENDIF.
IF ls_fill-gradtype-left IS NOT INITIAL.
lv_value = ls_fill-gradtype-left.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_left value = lv_value ).
ENDIF.
IF ls_fill-gradtype-position3 IS NOT INITIAL.
"create <stop> elements for gradients, we can have 2 or 3 stops in each gradient
lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_stop
parent = lo_sub_element ).
lv_value = ls_fill-gradtype-position1.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_position value = lv_value ).
create_xl_styles_color_node(
io_document = lo_document
io_parent = lo_sub_element_2
is_color = ls_fill-bgcolor
iv_color_elem_name = lc_xml_node_color ).
lo_sub_element->append_child( new_child = lo_sub_element_2 ).
lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_stop
parent = lo_sub_element ).
lv_value = ls_fill-gradtype-position2.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_position
value = lv_value ).
create_xl_styles_color_node(
io_document = lo_document
io_parent = lo_sub_element_2
is_color = ls_fill-fgcolor
iv_color_elem_name = lc_xml_node_color ).
lo_sub_element->append_child( new_child = lo_sub_element_2 ).
lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_stop
parent = lo_sub_element ).
lv_value = ls_fill-gradtype-position3.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_position
value = lv_value ).
create_xl_styles_color_node(
io_document = lo_document
io_parent = lo_sub_element_2
is_color = ls_fill-bgcolor
iv_color_elem_name = lc_xml_node_color ).
lo_sub_element->append_child( new_child = lo_sub_element_2 ).
ELSE.
"create <stop> elements for gradients, we can have 2 or 3 stops in each gradient
lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_stop
parent = lo_sub_element ).
lv_value = ls_fill-gradtype-position1.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_position value = lv_value ).
create_xl_styles_color_node(
io_document = lo_document
io_parent = lo_sub_element_2
is_color = ls_fill-bgcolor
iv_color_elem_name = lc_xml_node_color ).
lo_sub_element->append_child( new_child = lo_sub_element_2 ).
lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_stop
parent = lo_sub_element ).
lv_value = ls_fill-gradtype-position2.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_position
value = lv_value ).
create_xl_styles_color_node(
io_document = lo_document
io_parent = lo_sub_element_2
is_color = ls_fill-fgcolor
iv_color_elem_name = lc_xml_node_color ).
lo_sub_element->append_child( new_child = lo_sub_element_2 ).
ENDIF.
ELSE.
"pattern
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_patternfill
parent = lo_document ).
lv_value = ls_fill-filltype.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_patterntype
value = lv_value ).
" fgcolor
create_xl_styles_color_node(
io_document = lo_document
io_parent = lo_sub_element
is_color = ls_fill-fgcolor
iv_color_elem_name = lc_xml_node_fgcolor ).
IF ls_fill-fgcolor-rgb IS INITIAL AND
ls_fill-fgcolor-indexed EQ zcl_excel_style_color=>c_indexed_not_set AND
ls_fill-fgcolor-theme EQ zcl_excel_style_color=>c_theme_not_set AND
ls_fill-fgcolor-tint IS INITIAL AND ls_fill-bgcolor-indexed EQ zcl_excel_style_color=>c_indexed_sys_foreground.
" bgcolor
create_xl_styles_color_node(
io_document = lo_document
io_parent = lo_sub_element
is_color = ls_fill-bgcolor
iv_color_elem_name = lc_xml_node_bgcolor ).
ENDIF.
ENDIF.
lo_element_fill->append_child( new_child = lo_sub_element )."pattern
lo_element_fills->append_child( new_child = lo_element_fill ).
ENDLOOP.
" create border elements
LOOP AT lt_borders INTO ls_border.
lo_element_border = lo_document->create_simple_element( name = lc_xml_node_border
parent = lo_document ).
IF ls_border-diagonalup IS NOT INITIAL.
lv_value = ls_border-diagonalup.
CONDENSE lv_value.
lo_element_border->set_attribute_ns( name = lc_xml_attr_diagonalup
value = lv_value ).
ENDIF.
IF ls_border-diagonaldown IS NOT INITIAL.
lv_value = ls_border-diagonaldown.
CONDENSE lv_value.
lo_element_border->set_attribute_ns( name = lc_xml_attr_diagonaldown
value = lv_value ).
ENDIF.
"left
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_left
parent = lo_document ).
IF ls_border-left_style IS NOT INITIAL.
lv_value = ls_border-left_style.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_style
value = lv_value ).
ENDIF.
create_xl_styles_color_node(
io_document = lo_document
io_parent = lo_sub_element
is_color = ls_border-left_color ).
lo_element_border->append_child( new_child = lo_sub_element ).
"right
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_right
parent = lo_document ).
IF ls_border-right_style IS NOT INITIAL.
lv_value = ls_border-right_style.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_style
value = lv_value ).
ENDIF.
create_xl_styles_color_node(
io_document = lo_document
io_parent = lo_sub_element
is_color = ls_border-right_color ).
lo_element_border->append_child( new_child = lo_sub_element ).
"top
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_top
parent = lo_document ).
IF ls_border-top_style IS NOT INITIAL.
lv_value = ls_border-top_style.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_style
value = lv_value ).
ENDIF.
create_xl_styles_color_node(
io_document = lo_document
io_parent = lo_sub_element
is_color = ls_border-top_color ).
lo_element_border->append_child( new_child = lo_sub_element ).
"bottom
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_bottom
parent = lo_document ).
IF ls_border-bottom_style IS NOT INITIAL.
lv_value = ls_border-bottom_style.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_style
value = lv_value ).
ENDIF.
create_xl_styles_color_node(
io_document = lo_document
io_parent = lo_sub_element
is_color = ls_border-bottom_color ).
lo_element_border->append_child( new_child = lo_sub_element ).
"diagonal
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_diagonal
parent = lo_document ).
IF ls_border-diagonal_style IS NOT INITIAL.
lv_value = ls_border-diagonal_style.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_style
value = lv_value ).
ENDIF.
create_xl_styles_color_node(
io_document = lo_document
io_parent = lo_sub_element
is_color = ls_border-diagonal_color ).
lo_element_border->append_child( new_child = lo_sub_element ).
lo_element_borders->append_child( new_child = lo_element_border ).
ENDLOOP.
" update attribute "count"
DESCRIBE TABLE lt_fonts LINES lv_fonts_count.
MOVE lv_fonts_count TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element_fonts->set_attribute_ns( name = lc_xml_attr_count
value = lv_value ).
DESCRIBE TABLE lt_fills LINES lv_fills_count.
MOVE lv_fills_count TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element_fills->set_attribute_ns( name = lc_xml_attr_count
value = lv_value ).
DESCRIBE TABLE lt_borders LINES lv_borders_count.
MOVE lv_borders_count TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element_borders->set_attribute_ns( name = lc_xml_attr_count
value = lv_value ).
DESCRIBE TABLE lt_cellxfs LINES lv_cellxfs_count.
MOVE lv_cellxfs_count TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element_cellxfs->set_attribute_ns( name = lc_xml_attr_count
value = lv_value ).
" Append to root node
lo_element_root->append_child( new_child = lo_element_numfmts ).
lo_element_root->append_child( new_child = lo_element_fonts ).
lo_element_root->append_child( new_child = lo_element_fills ).
lo_element_root->append_child( new_child = lo_element_borders ).
" cellstylexfs node
lo_element = lo_document->create_simple_element( name = lc_xml_node_cellstylexfs
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_count
value = '1' ).
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_xf
parent = lo_document ).
lo_sub_element->set_attribute_ns( name = lc_xml_attr_numfmtid
value = c_off ).
lo_sub_element->set_attribute_ns( name = lc_xml_attr_fontid
value = c_off ).
lo_sub_element->set_attribute_ns( name = lc_xml_attr_fillid
value = c_off ).
lo_sub_element->set_attribute_ns( name = lc_xml_attr_borderid
value = c_off ).
lo_element->append_child( new_child = lo_sub_element ).
lo_element_root->append_child( new_child = lo_element ).
LOOP AT lt_cellxfs INTO ls_cellxfs.
lo_element = lo_document->create_simple_element( name = lc_xml_node_xf
parent = lo_document ).
MOVE ls_cellxfs-numfmtid TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element->set_attribute_ns( name = lc_xml_attr_numfmtid
value = lv_value ).
MOVE ls_cellxfs-fontid TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element->set_attribute_ns( name = lc_xml_attr_fontid
value = lv_value ).
MOVE ls_cellxfs-fillid TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element->set_attribute_ns( name = lc_xml_attr_fillid
value = lv_value ).
MOVE ls_cellxfs-borderid TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element->set_attribute_ns( name = lc_xml_attr_borderid
value = lv_value ).
MOVE ls_cellxfs-xfid TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element->set_attribute_ns( name = lc_xml_attr_xfid
value = lv_value ).
IF ls_cellxfs-applynumberformat EQ 1.
MOVE ls_cellxfs-applynumberformat TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element->set_attribute_ns( name = lc_xml_attr_applynumberformat
value = lv_value ).
ENDIF.
IF ls_cellxfs-applyfont EQ 1.
MOVE ls_cellxfs-applyfont TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element->set_attribute_ns( name = lc_xml_attr_applyfont
value = lv_value ).
ENDIF.
IF ls_cellxfs-applyfill EQ 1.
MOVE ls_cellxfs-applyfill TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element->set_attribute_ns( name = lc_xml_attr_applyfill
value = lv_value ).
ENDIF.
IF ls_cellxfs-applyborder EQ 1.
MOVE ls_cellxfs-applyborder TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element->set_attribute_ns( name = lc_xml_attr_applyborder
value = lv_value ).
ENDIF.
IF ls_cellxfs-applyalignment EQ 1. " depends on each style not for all the sheet
MOVE ls_cellxfs-applyalignment TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_element->set_attribute_ns( name = lc_xml_attr_applyalignment
value = lv_value ).
lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_alignment
parent = lo_document ).
ADD 1 TO ls_cellxfs-alignmentid. "Table index starts from 1
READ TABLE lt_alignments INTO ls_alignment INDEX ls_cellxfs-alignmentid.
SUBTRACT 1 FROM ls_cellxfs-alignmentid.
IF ls_alignment-horizontal IS NOT INITIAL.
MOVE ls_alignment-horizontal TO lv_value.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_horizontal
value = lv_value ).
ENDIF.
IF ls_alignment-vertical IS NOT INITIAL.
MOVE ls_alignment-vertical TO lv_value.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_vertical
value = lv_value ).
ENDIF.
IF ls_alignment-wraptext EQ abap_true.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_wraptext
value = c_on ).
ENDIF.
IF ls_alignment-textrotation IS NOT INITIAL.
MOVE ls_alignment-textrotation TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_textrotation
value = lv_value ).
ENDIF.
IF ls_alignment-shrinktofit EQ abap_true.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_shrinktofit
value = c_on ).
ENDIF.
IF ls_alignment-indent IS NOT INITIAL.
MOVE ls_alignment-indent TO lv_value.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_indent
value = lv_value ).
ENDIF.
lo_element->append_child( new_child = lo_sub_element_2 ).
ENDIF.
IF ls_cellxfs-applyprotection EQ 1.
MOVE ls_cellxfs-applyprotection TO lv_value.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_applyprotection
value = lv_value ).
lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_protection
parent = lo_document ).
ADD 1 TO ls_cellxfs-protectionid. "Table index starts from 1
READ TABLE lt_protections INTO ls_protection INDEX ls_cellxfs-protectionid.
SUBTRACT 1 FROM ls_cellxfs-protectionid.
IF ls_protection-locked IS NOT INITIAL.
MOVE ls_protection-locked TO lv_value.
CONDENSE lv_value.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_locked
value = lv_value ).
ENDIF.
IF ls_protection-hidden IS NOT INITIAL.
MOVE ls_protection-hidden TO lv_value.
CONDENSE lv_value.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_hidden
value = lv_value ).
ENDIF.
lo_element->append_child( new_child = lo_sub_element_2 ).
ENDIF.
lo_element_cellxfs->append_child( new_child = lo_element ).
ENDLOOP.
lo_element_root->append_child( new_child = lo_element_cellxfs ).
" cellStyles node
lo_element = lo_document->create_simple_element( name = lc_xml_node_cellstyles
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_count
value = '1' ).
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_cellstyle
parent = lo_document ).
lo_sub_element->set_attribute_ns( name = lc_xml_attr_name
value = 'Normal' ).
lo_sub_element->set_attribute_ns( name = lc_xml_attr_xfid
value = c_off ).
lo_sub_element->set_attribute_ns( name = lc_xml_attr_builtinid
value = c_off ).
lo_element->append_child( new_child = lo_sub_element ).
lo_element_root->append_child( new_child = lo_element ).
" dxfs node
lo_element = lo_document->create_simple_element( name = lc_xml_node_dxfs
parent = lo_document ).
lo_iterator = me->excel->get_worksheets_iterator( ).
" get sheets
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_worksheet ?= lo_iterator->get_next( ).
" Conditional formatting styles into exch sheet
lo_iterator2 = lo_worksheet->get_style_cond_iterator( ).
WHILE lo_iterator2->has_next( ) EQ abap_true.
lo_style_cond ?= lo_iterator2->get_next( ).
CASE lo_style_cond->rule.
* begin of change issue #366 - missing conditional rules: top10, move dfx-styles to own method
WHEN zcl_excel_style_cond=>c_rule_cellis.
me->create_dxf_style( EXPORTING
iv_cell_style = lo_style_cond->mode_cellis-cell_style
io_dxf_element = lo_element
io_ixml_document = lo_document
it_cellxfs = lt_cellxfs
it_fonts = lt_fonts
it_fills = lt_fills
CHANGING
cv_dfx_count = lv_dfx_count ).
WHEN zcl_excel_style_cond=>c_rule_expression.
me->create_dxf_style( EXPORTING
iv_cell_style = lo_style_cond->mode_expression-cell_style
io_dxf_element = lo_element
io_ixml_document = lo_document
it_cellxfs = lt_cellxfs
it_fonts = lt_fonts
it_fills = lt_fills
CHANGING
cv_dfx_count = lv_dfx_count ).
WHEN zcl_excel_style_cond=>c_rule_top10.
me->create_dxf_style( EXPORTING
iv_cell_style = lo_style_cond->mode_top10-cell_style
io_dxf_element = lo_element
io_ixml_document = lo_document
it_cellxfs = lt_cellxfs
it_fonts = lt_fonts
it_fills = lt_fills
CHANGING
cv_dfx_count = lv_dfx_count ).
WHEN zcl_excel_style_cond=>c_rule_above_average.
me->create_dxf_style( EXPORTING
iv_cell_style = lo_style_cond->mode_above_average-cell_style
io_dxf_element = lo_element
io_ixml_document = lo_document
it_cellxfs = lt_cellxfs
it_fonts = lt_fonts
it_fills = lt_fills
CHANGING
cv_dfx_count = lv_dfx_count ).
* begin of change issue #366 - missing conditional rules: top10, move dfx-styles to own method
WHEN OTHERS.
CONTINUE.
ENDCASE.
ENDWHILE.
ENDWHILE.
lv_value = lv_dfx_count.
CONDENSE lv_value.
lo_element->set_attribute_ns( name = lc_xml_attr_count
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
" tableStyles node
lo_element = lo_document->create_simple_element( name = lc_xml_node_tablestyles
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_count
value = '0' ).
lo_element->set_attribute_ns( name = lc_xml_attr_defaulttablestyle
value = zcl_excel_table=>builtinstyle_medium9 ).
lo_element->set_attribute_ns( name = lc_xml_attr_defaultpivotstyle
value = zcl_excel_table=>builtinstyle_pivot_light16 ).
lo_element_root->append_child( new_child = lo_element ).
"write legacy color palette in case any indexed color was changed
IF excel->legacy_palette->is_modified( ) = abap_true.
lo_element = lo_document->create_simple_element( name = lc_xml_node_colors
parent = lo_document ).
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_indexedcolors
parent = lo_document ).
lo_element->append_child( new_child = lo_sub_element ).
lt_colors = excel->legacy_palette->get_colors( ).
LOOP AT lt_colors INTO ls_color.
lo_sub_element_2 = lo_document->create_simple_element( name = lc_xml_node_rgbcolor
parent = lo_document ).
lv_value = ls_color.
lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_rgb
value = lv_value ).
lo_sub_element->append_child( new_child = lo_sub_element_2 ).
ENDLOOP.
lo_element_root->append_child( new_child = lo_element ).
ENDIF.
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_xl_styles_color_node.
DATA: lo_sub_element TYPE REF TO if_ixml_element,
lv_value TYPE string.
CONSTANTS: lc_xml_attr_theme TYPE string VALUE 'theme',
lc_xml_attr_rgb TYPE string VALUE 'rgb',
lc_xml_attr_indexed TYPE string VALUE 'indexed',
lc_xml_attr_tint TYPE string VALUE 'tint'.
"add node only if at least one attribute is set
CHECK is_color-rgb IS NOT INITIAL OR
is_color-indexed <> zcl_excel_style_color=>c_indexed_not_set OR
is_color-theme <> zcl_excel_style_color=>c_theme_not_set OR
is_color-tint IS NOT INITIAL.
lo_sub_element = io_document->create_simple_element(
name = iv_color_elem_name
parent = io_parent ).
IF is_color-rgb IS NOT INITIAL.
lv_value = is_color-rgb.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_rgb
value = lv_value ).
ENDIF.
IF is_color-indexed <> zcl_excel_style_color=>c_indexed_not_set.
lv_value = zcl_excel_common=>number_to_excel_string( is_color-indexed ).
lo_sub_element->set_attribute_ns( name = lc_xml_attr_indexed
value = lv_value ).
ENDIF.
IF is_color-theme <> zcl_excel_style_color=>c_theme_not_set.
lv_value = zcl_excel_common=>number_to_excel_string( is_color-theme ).
lo_sub_element->set_attribute_ns( name = lc_xml_attr_theme
value = lv_value ).
ENDIF.
IF is_color-tint IS NOT INITIAL.
lv_value = zcl_excel_common=>number_to_excel_string( is_color-tint ).
lo_sub_element->set_attribute_ns( name = lc_xml_attr_tint
value = lv_value ).
ENDIF.
io_parent->append_child( new_child = lo_sub_element ).
ENDMETHOD.
METHOD create_xl_styles_font_node.
CONSTANTS: lc_xml_node_b TYPE string VALUE 'b', "bold
lc_xml_node_i TYPE string VALUE 'i', "italic
lc_xml_node_u TYPE string VALUE 'u', "underline
lc_xml_node_strike TYPE string VALUE 'strike', "strikethrough
lc_xml_node_sz TYPE string VALUE 'sz',
lc_xml_node_name TYPE string VALUE 'name',
lc_xml_node_rfont TYPE string VALUE 'rFont',
lc_xml_node_family TYPE string VALUE 'family',
lc_xml_node_scheme TYPE string VALUE 'scheme',
lc_xml_attr_val TYPE string VALUE 'val'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_font TYPE REF TO if_ixml_element,
ls_font TYPE zexcel_s_style_font,
lo_sub_element TYPE REF TO if_ixml_element,
lv_value TYPE string.
lo_document = io_document.
lo_element_font = io_parent.
ls_font = is_font.
IF ls_font-bold EQ abap_true.
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_b
parent = lo_document ).
lo_element_font->append_child( new_child = lo_sub_element ).
ENDIF.
IF ls_font-italic EQ abap_true.
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_i
parent = lo_document ).
lo_element_font->append_child( new_child = lo_sub_element ).
ENDIF.
IF ls_font-underline EQ abap_true.
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_u
parent = lo_document ).
lv_value = ls_font-underline_mode.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_val
value = lv_value ).
lo_element_font->append_child( new_child = lo_sub_element ).
ENDIF.
IF ls_font-strikethrough EQ abap_true.
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_strike
parent = lo_document ).
lo_element_font->append_child( new_child = lo_sub_element ).
ENDIF.
"size
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_sz
parent = lo_document ).
lv_value = ls_font-size.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_val
value = lv_value ).
lo_element_font->append_child( new_child = lo_sub_element ).
"color
create_xl_styles_color_node(
io_document = lo_document
io_parent = lo_element_font
is_color = ls_font-color ).
"name
IF iv_use_rtf = abap_false.
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_name
parent = lo_document ).
ELSE.
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_rfont
parent = lo_document ).
ENDIF.
lv_value = ls_font-name.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_val
value = lv_value ).
lo_element_font->append_child( new_child = lo_sub_element ).
"family
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_family
parent = lo_document ).
lv_value = ls_font-family.
SHIFT lv_value RIGHT DELETING TRAILING space.
SHIFT lv_value LEFT DELETING LEADING space.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_val
value = lv_value ).
lo_element_font->append_child( new_child = lo_sub_element ).
"scheme
IF ls_font-scheme IS NOT INITIAL.
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_scheme
parent = lo_document ).
lv_value = ls_font-scheme.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_val
value = lv_value ).
lo_element_font->append_child( new_child = lo_sub_element ).
ENDIF.
ENDMETHOD.
METHOD create_xl_table.
DATA: lc_xml_node_table TYPE string VALUE 'table',
lc_xml_node_relationship TYPE string VALUE 'Relationship',
" Node attributes
lc_xml_attr_id TYPE string VALUE 'id',
lc_xml_attr_name TYPE string VALUE 'name',
lc_xml_attr_display_name TYPE string VALUE 'displayName',
lc_xml_attr_ref TYPE string VALUE 'ref',
lc_xml_attr_totals TYPE string VALUE 'totalsRowShown',
" Node namespace
lc_xml_node_table_ns TYPE string VALUE 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',
" Node id
lc_xml_node_ridx_id TYPE string VALUE 'rId#'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element TYPE REF TO if_ixml_element,
lo_element2 TYPE REF TO if_ixml_element,
lo_element3 TYPE REF TO if_ixml_element,
lv_table_name TYPE string,
lv_id TYPE i,
lv_match TYPE i,
lv_ref TYPE string,
lv_value TYPE string,
lv_num_columns TYPE i,
ls_fieldcat TYPE zexcel_s_fieldcatalog.
**********************************************************************
* STEP 1: Create xml
lo_document = create_xml_document( ).
**********************************************************************
* STEP 3: Create main node table
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_table
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns'
value = lc_xml_node_table_ns ).
lv_id = io_table->get_id( ).
lv_value = zcl_excel_common=>number_to_excel_string( ip_value = lv_id ).
lo_element_root->set_attribute_ns( name = lc_xml_attr_id
value = lv_value ).
FIND ALL OCCURRENCES OF REGEX '[^_a-zA-Z0-9]' IN io_table->settings-table_name IGNORING CASE MATCH COUNT lv_match.
IF io_table->settings-table_name IS NOT INITIAL AND lv_match EQ 0.
" Name rules (https://support.microsoft.com/en-us/office/rename-an-excel-table-fbf49a4f-82a3-43eb-8ba2-44d21233b114)
" - You can't use "C", "c", "R", or "r" for the name, because they're already designated as a shortcut for selecting the column or row for the active cell when you enter them in the Name or Go To box.
" - Don't use cell references — Names can't be the same as a cell reference, such as Z$100 or R1C1
IF ( strlen( io_table->settings-table_name ) = 1 AND io_table->settings-table_name CO 'CcRr' )
OR zcl_excel_common=>shift_formula(
iv_reference_formula = io_table->settings-table_name
iv_shift_cols = 0
iv_shift_rows = 1 ) <> io_table->settings-table_name.
lv_table_name = io_table->get_name( ).
ELSE.
lv_table_name = io_table->settings-table_name.
ENDIF.
ELSE.
lv_table_name = io_table->get_name( ).
ENDIF.
lo_element_root->set_attribute_ns( name = lc_xml_attr_name
value = lv_table_name ).
lo_element_root->set_attribute_ns( name = lc_xml_attr_display_name
value = lv_table_name ).
lv_ref = io_table->get_reference( ).
lo_element_root->set_attribute_ns( name = lc_xml_attr_ref
value = lv_ref ).
IF io_table->has_totals( ) = abap_true.
lo_element_root->set_attribute_ns( name = 'totalsRowCount'
value = '1' ).
ELSE.
lo_element_root->set_attribute_ns( name = lc_xml_attr_totals
value = '0' ).
ENDIF.
**********************************************************************
* STEP 4: Create subnodes
" autoFilter
IF io_table->settings-nofilters EQ abap_false.
lo_element = lo_document->create_simple_element( name = 'autoFilter'
parent = lo_document ).
lv_ref = io_table->get_reference( ip_include_totals_row = abap_false ).
lo_element->set_attribute_ns( name = 'ref'
value = lv_ref ).
lo_element_root->append_child( new_child = lo_element ).
ENDIF.
"columns
lo_element = lo_document->create_simple_element( name = 'tableColumns'
parent = lo_document ).
* lo_columns = io_table->get_columns( ).
LOOP AT io_table->fieldcat INTO ls_fieldcat WHERE dynpfld = abap_true.
ADD 1 TO lv_num_columns.
ENDLOOP.
lv_value = lv_num_columns.
CONDENSE lv_value.
lo_element->set_attribute_ns( name = 'count'
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
LOOP AT io_table->fieldcat INTO ls_fieldcat WHERE dynpfld = abap_true.
lo_element2 = lo_document->create_simple_element_ns( name = 'tableColumn'
parent = lo_element ).
lv_value = ls_fieldcat-position.
SHIFT lv_value LEFT DELETING LEADING '0'.
lo_element2->set_attribute_ns( name = 'id'
value = lv_value ).
lv_value = ls_fieldcat-scrtext_l.
" The text "_x...._", with "_x" not "_X", with exactly 4 ".", each being 0-9 a-f or A-F (case insensitive), is interpreted
" like Unicode character U+.... (e.g. "_x0041_" is rendered like "A") is for characters.
" To not interpret it, Excel replaces the first "_" is to be replaced with "_x005f_".
IF lv_value CS '_x'.
REPLACE ALL OCCURRENCES OF REGEX '_(x[0-9a-fA-F]{4}_)' IN lv_value WITH '_x005f_$1' RESPECTING CASE.
ENDIF.
" XML chapter 2.2: Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
" NB: although Excel supports _x0009_, it's not rendered except if you edit the text.
" Excel considers _x000d_ as being an error (_x000a_ is sufficient and rendered).
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>newline IN lv_value WITH '_x000a_'.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf(1) IN lv_value WITH ``.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN lv_value WITH '_x0009_'.
lo_element2->set_attribute_ns( name = 'name'
value = lv_value ).
IF ls_fieldcat-totals_function IS NOT INITIAL.
lo_element2->set_attribute_ns( name = 'totalsRowFunction'
value = ls_fieldcat-totals_function ).
ENDIF.
IF ls_fieldcat-column_formula IS NOT INITIAL.
lv_value = ls_fieldcat-column_formula.
CONDENSE lv_value.
lo_element3 = lo_document->create_simple_element_ns( name = 'calculatedColumnFormula'
parent = lo_element2 ).
lo_element3->set_value( lv_value ).
lo_element2->append_child( new_child = lo_element3 ).
ENDIF.
lo_element->append_child( new_child = lo_element2 ).
ENDLOOP.
lo_element = lo_document->create_simple_element( name = 'tableStyleInfo'
parent = lo_element_root ).
lo_element->set_attribute_ns( name = 'name'
value = io_table->settings-table_style ).
lo_element->set_attribute_ns( name = 'showFirstColumn'
value = '0' ).
lo_element->set_attribute_ns( name = 'showLastColumn'
value = '0' ).
IF io_table->settings-show_row_stripes = abap_true.
lv_value = '1'.
ELSE.
lv_value = '0'.
ENDIF.
lo_element->set_attribute_ns( name = 'showRowStripes'
value = lv_value ).
IF io_table->settings-show_column_stripes = abap_true.
lv_value = '1'.
ELSE.
lv_value = '0'.
ENDIF.
lo_element->set_attribute_ns( name = 'showColumnStripes'
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD create_xl_theme.
DATA: lo_theme TYPE REF TO zcl_excel_theme.
excel->get_theme(
IMPORTING
eo_theme = lo_theme
).
IF lo_theme IS INITIAL.
CREATE OBJECT lo_theme.
ENDIF.
ep_content = lo_theme->write_theme( ).
ENDMETHOD.
METHOD create_xl_workbook.
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-07
* - ...
* changes: aligning code
* adding comments to explain what we are trying to achieve
*--------------------------------------------------------------------*
* issue#235 - repeat rows/columns
* - Stefan Schmoecker, 2012-12-01
* changes: correction of pointer to localSheetId
*--------------------------------------------------------------------*
** Constant node name
DATA: lc_xml_node_workbook TYPE string VALUE 'workbook',
lc_xml_node_fileversion TYPE string VALUE 'fileVersion',
lc_xml_node_workbookpr TYPE string VALUE 'workbookPr',
lc_xml_node_bookviews TYPE string VALUE 'bookViews',
lc_xml_node_workbookview TYPE string VALUE 'workbookView',
lc_xml_node_sheets TYPE string VALUE 'sheets',
lc_xml_node_sheet TYPE string VALUE 'sheet',
lc_xml_node_calcpr TYPE string VALUE 'calcPr',
lc_xml_node_workbookprotection TYPE string VALUE 'workbookProtection',
lc_xml_node_definednames TYPE string VALUE 'definedNames',
lc_xml_node_definedname TYPE string VALUE 'definedName',
" Node attributes
lc_xml_attr_appname TYPE string VALUE 'appName',
lc_xml_attr_lastedited TYPE string VALUE 'lastEdited',
lc_xml_attr_lowestedited TYPE string VALUE 'lowestEdited',
lc_xml_attr_rupbuild TYPE string VALUE 'rupBuild',
lc_xml_attr_xwindow TYPE string VALUE 'xWindow',
lc_xml_attr_ywindow TYPE string VALUE 'yWindow',
lc_xml_attr_windowwidth TYPE string VALUE 'windowWidth',
lc_xml_attr_windowheight TYPE string VALUE 'windowHeight',
lc_xml_attr_activetab TYPE string VALUE 'activeTab',
lc_xml_attr_name TYPE string VALUE 'name',
lc_xml_attr_sheetid TYPE string VALUE 'sheetId',
lc_xml_attr_state TYPE string VALUE 'state',
lc_xml_attr_id TYPE string VALUE 'id',
lc_xml_attr_calcid TYPE string VALUE 'calcId',
lc_xml_attr_lockrevision TYPE string VALUE 'lockRevision',
lc_xml_attr_lockstructure TYPE string VALUE 'lockStructure',
lc_xml_attr_lockwindows TYPE string VALUE 'lockWindows',
lc_xml_attr_revisionspassword TYPE string VALUE 'revisionsPassword',
lc_xml_attr_workbookpassword TYPE string VALUE 'workbookPassword',
lc_xml_attr_hidden TYPE string VALUE 'hidden',
lc_xml_attr_localsheetid TYPE string VALUE 'localSheetId',
" Node namespace
lc_r_ns TYPE string VALUE 'r',
lc_xml_node_ns TYPE string VALUE 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',
lc_xml_node_r_ns TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
" Node id
lc_xml_node_ridx_id TYPE string VALUE 'rId#'.
DATA: lo_document TYPE REF TO if_ixml_document,
lo_element_root TYPE REF TO if_ixml_element,
lo_element TYPE REF TO if_ixml_element,
lo_element_range TYPE REF TO if_ixml_element,
lo_sub_element TYPE REF TO if_ixml_element,
lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_iterator_range TYPE REF TO cl_object_collection_iterator,
lo_worksheet TYPE REF TO zcl_excel_worksheet,
lo_range TYPE REF TO zcl_excel_range,
lo_autofilters TYPE REF TO zcl_excel_autofilters,
lo_autofilter TYPE REF TO zcl_excel_autofilter.
DATA: lv_xml_node_ridx_id TYPE string,
lv_value TYPE string,
lv_syindex TYPE string,
lv_active_sheet TYPE zexcel_active_worksheet.
**********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP
lo_document = create_xml_document( ).
**********************************************************************
* STEP 3: Create main node
lo_element_root = lo_document->create_simple_element( name = lc_xml_node_workbook
parent = lo_document ).
lo_element_root->set_attribute_ns( name = 'xmlns'
value = lc_xml_node_ns ).
lo_element_root->set_attribute_ns( name = 'xmlns:r'
value = lc_xml_node_r_ns ).
**********************************************************************
* STEP 4: Create subnode
" fileVersion node
lo_element = lo_document->create_simple_element( name = lc_xml_node_fileversion
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_appname
value = 'xl' ).
lo_element->set_attribute_ns( name = lc_xml_attr_lastedited
value = '4' ).
lo_element->set_attribute_ns( name = lc_xml_attr_lowestedited
value = '4' ).
lo_element->set_attribute_ns( name = lc_xml_attr_rupbuild
value = '4506' ).
lo_element_root->append_child( new_child = lo_element ).
" fileVersion node
lo_element = lo_document->create_simple_element( name = lc_xml_node_workbookpr
parent = lo_document ).
* lo_element->set_attribute_ns( name = lc_xml_attr_themeversion
* value = '124226' ).
lo_element_root->append_child( new_child = lo_element ).
" workbookProtection node
IF me->excel->zif_excel_book_protection~protected EQ abap_true.
lo_element = lo_document->create_simple_element( name = lc_xml_node_workbookprotection
parent = lo_document ).
MOVE me->excel->zif_excel_book_protection~workbookpassword TO lv_value.
IF lv_value IS NOT INITIAL.
lo_element->set_attribute_ns( name = lc_xml_attr_workbookpassword
value = lv_value ).
ENDIF.
MOVE me->excel->zif_excel_book_protection~revisionspassword TO lv_value.
IF lv_value IS NOT INITIAL.
lo_element->set_attribute_ns( name = lc_xml_attr_revisionspassword
value = lv_value ).
ENDIF.
MOVE me->excel->zif_excel_book_protection~lockrevision TO lv_value.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_lockrevision
value = lv_value ).
MOVE me->excel->zif_excel_book_protection~lockstructure TO lv_value.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_lockstructure
value = lv_value ).
MOVE me->excel->zif_excel_book_protection~lockwindows TO lv_value.
CONDENSE lv_value NO-GAPS.
lo_element->set_attribute_ns( name = lc_xml_attr_lockwindows
value = lv_value ).
lo_element_root->append_child( new_child = lo_element ).
ENDIF.
" bookviews node
lo_element = lo_document->create_simple_element( name = lc_xml_node_bookviews
parent = lo_document ).
" bookview node
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_workbookview
parent = lo_document ).
lo_sub_element->set_attribute_ns( name = lc_xml_attr_xwindow
value = '120' ).
lo_sub_element->set_attribute_ns( name = lc_xml_attr_ywindow
value = '120' ).
lo_sub_element->set_attribute_ns( name = lc_xml_attr_windowwidth
value = '19035' ).
lo_sub_element->set_attribute_ns( name = lc_xml_attr_windowheight
value = '8445' ).
" Set Active Sheet
lv_active_sheet = excel->get_active_sheet_index( ).
* issue #365 - test if sheet exists - otherwise set active worksheet to 1
lo_worksheet = excel->get_worksheet_by_index( lv_active_sheet ).
IF lo_worksheet IS NOT BOUND.
lv_active_sheet = 1.
excel->set_active_sheet_index( lv_active_sheet ).
ENDIF.
IF lv_active_sheet > 1.
lv_active_sheet = lv_active_sheet - 1.
lv_value = lv_active_sheet.
CONDENSE lv_value.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_activetab
value = lv_value ).
ENDIF.
lo_element->append_child( new_child = lo_sub_element )." bookview node
lo_element_root->append_child( new_child = lo_element )." bookviews node
" sheets node
lo_element = lo_document->create_simple_element( name = lc_xml_node_sheets
parent = lo_document ).
lo_iterator = excel->get_worksheets_iterator( ).
" ranges node
lo_element_range = lo_document->create_simple_element( name = lc_xml_node_definednames " issue 163 +
parent = lo_document ). " issue 163 +
WHILE lo_iterator->has_next( ) EQ abap_true.
" sheet node
lo_sub_element = lo_document->create_simple_element_ns( name = lc_xml_node_sheet
parent = lo_document ).
lo_worksheet ?= lo_iterator->get_next( ).
lv_syindex = sy-index. " question by Stefan Schmöcker 2012-12-02: sy-index seems to do the job - but is it proven to work or purely coincedence
lv_value = lo_worksheet->get_title( ).
SHIFT lv_syindex RIGHT DELETING TRAILING space.
SHIFT lv_syindex LEFT DELETING LEADING space.
lv_xml_node_ridx_id = lc_xml_node_ridx_id.
REPLACE ALL OCCURRENCES OF '#' IN lv_xml_node_ridx_id WITH lv_syindex.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_name
value = lv_value ).
lo_sub_element->set_attribute_ns( name = lc_xml_attr_sheetid
value = lv_syindex ).
IF lo_worksheet->zif_excel_sheet_properties~hidden EQ zif_excel_sheet_properties=>c_hidden.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_state
value = 'hidden' ).
ELSEIF lo_worksheet->zif_excel_sheet_properties~hidden EQ zif_excel_sheet_properties=>c_veryhidden.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_state
value = 'veryHidden' ).
ENDIF.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_id
prefix = lc_r_ns
value = lv_xml_node_ridx_id ).
lo_element->append_child( new_child = lo_sub_element ). " sheet node
" issue 163 >>>
lo_iterator_range = lo_worksheet->get_ranges_iterator( ).
*--------------------------------------------------------------------*
* Defined names sheetlocal: Ranges, Repeat rows and columns
*--------------------------------------------------------------------*
WHILE lo_iterator_range->has_next( ) EQ abap_true.
" range node
lo_sub_element = lo_document->create_simple_element_ns( name = lc_xml_node_definedname
parent = lo_document ).
lo_range ?= lo_iterator_range->get_next( ).
lv_value = lo_range->name.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_name
value = lv_value ).
* lo_sub_element->set_attribute_ns( name = lc_xml_attr_localsheetid "del #235 Repeat rows/cols - EXCEL starts couting from zero
* value = lv_xml_node_ridx_id ). "del #235 Repeat rows/cols - and needs absolute referencing to localSheetId
lv_value = lv_syindex - 1. "ins #235 Repeat rows/cols
CONDENSE lv_value NO-GAPS. "ins #235 Repeat rows/cols
lo_sub_element->set_attribute_ns( name = lc_xml_attr_localsheetid
value = lv_value ).
lv_value = lo_range->get_value( ).
lo_sub_element->set_value( value = lv_value ).
lo_element_range->append_child( new_child = lo_sub_element ). " range node
ENDWHILE.
" issue 163 <<<
ENDWHILE.
lo_element_root->append_child( new_child = lo_element )." sheets node
*--------------------------------------------------------------------*
* Defined names workbookgolbal: Ranges
*--------------------------------------------------------------------*
* " ranges node
* lo_element = lo_document->create_simple_element( name = lc_xml_node_definednames " issue 163 -
* parent = lo_document ). " issue 163 -
lo_iterator = excel->get_ranges_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
" range node
lo_sub_element = lo_document->create_simple_element_ns( name = lc_xml_node_definedname
parent = lo_document ).
lo_range ?= lo_iterator->get_next( ).
lv_value = lo_range->name.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_name
value = lv_value ).
lv_value = lo_range->get_value( ).
lo_sub_element->set_value( value = lv_value ).
lo_element_range->append_child( new_child = lo_sub_element ). " range node
ENDWHILE.
*--------------------------------------------------------------------*
* Defined names - Autofilters ( also sheetlocal )
*--------------------------------------------------------------------*
lo_autofilters = excel->get_autofilters_reference( ).
IF lo_autofilters->is_empty( ) = abap_false.
lo_iterator = excel->get_worksheets_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_worksheet ?= lo_iterator->get_next( ).
lv_syindex = sy-index - 1 .
lo_autofilter = lo_autofilters->get( io_worksheet = lo_worksheet ).
IF lo_autofilter IS BOUND.
lo_sub_element = lo_document->create_simple_element_ns( name = lc_xml_node_definedname
parent = lo_document ).
lv_value = lo_autofilters->c_autofilter.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_name
value = lv_value ).
lv_value = lv_syindex.
CONDENSE lv_value NO-GAPS.
lo_sub_element->set_attribute_ns( name = lc_xml_attr_localsheetid
value = lv_value ).
lv_value = '1'. " Always hidden
lo_sub_element->set_attribute_ns( name = lc_xml_attr_hidden
value = lv_value ).
lv_value = lo_autofilter->get_filter_reference( ).
lo_sub_element->set_value( value = lv_value ).
lo_element_range->append_child( new_child = lo_sub_element ). " range node
ENDIF.
ENDWHILE.
ENDIF.
lo_element_root->append_child( new_child = lo_element_range ). " ranges node
" calcPr node
lo_element = lo_document->create_simple_element( name = lc_xml_node_calcpr
parent = lo_document ).
lo_element->set_attribute_ns( name = lc_xml_attr_calcid
value = '125725' ).
lo_element_root->append_child( new_child = lo_element ).
**********************************************************************
* STEP 5: Create xstring stream
ep_content = render_xml_document( lo_document ).
ENDMETHOD.
METHOD flag2bool.
IF ip_flag EQ abap_true.
ep_boolean = 'true'.
ELSE.
ep_boolean = 'false'.
ENDIF.
ENDMETHOD.
METHOD get_shared_string_index.
DATA ls_shared_string TYPE zexcel_s_shared_string.
* READ TABLE shared_strings INTO ls_shared_string WITH KEY string_value = ip_cell_value BINARY SEARCH.
IF it_rtf IS INITIAL.
READ TABLE shared_strings INTO ls_shared_string WITH TABLE KEY string_value = ip_cell_value.
ep_index = ls_shared_string-string_no.
ELSE.
LOOP AT shared_strings INTO ls_shared_string WHERE string_value = ip_cell_value
AND rtf_tab = it_rtf.
ep_index = ls_shared_string-string_no.
EXIT.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD is_formula_shareable.
DATA: lv_test_shared TYPE string.
ep_shareable = abap_false.
IF ip_formula NA '!'.
lv_test_shared = zcl_excel_common=>shift_formula(
iv_reference_formula = ip_formula
iv_shift_cols = 1
iv_shift_rows = 1 ).
IF lv_test_shared <> ip_formula.
ep_shareable = abap_true.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD set_vml_shape_footer.
CONSTANTS: lc_shape TYPE string VALUE '<v:shape id="{ID}" o:spid="_x0000_s1025" type="#_x0000_t75" style=''position:absolute;margin-left:0;margin-top:0;width:{WIDTH}pt;height:{HEIGHT}pt; z-index:1''>',
lc_shape_image TYPE string VALUE '<v:imagedata o:relid="{RID}" o:title="Logo Title"/><o:lock v:ext="edit" rotation="t"/></v:shape>',
lc_shape_header_center TYPE string VALUE 'CH',
lc_shape_header_left TYPE string VALUE 'LH',
lc_shape_header_right TYPE string VALUE 'RH',
lc_shape_footer_center TYPE string VALUE 'CF',
lc_shape_footer_left TYPE string VALUE 'LF',
lc_shape_footer_right TYPE string VALUE 'RF'.
DATA: lv_content_left TYPE string,
lv_content_center TYPE string,
lv_content_right TYPE string,
lv_content_image_left TYPE string,
lv_content_image_center TYPE string,
lv_content_image_right TYPE string,
lv_value TYPE string,
ls_drawing_position TYPE zexcel_drawing_position.
IF is_footer-left_image IS NOT INITIAL.
lv_content_left = lc_shape.
REPLACE '{ID}' IN lv_content_left WITH lc_shape_footer_left.
ls_drawing_position = is_footer-left_image->get_position( ).
IF ls_drawing_position-size-height IS NOT INITIAL.
lv_value = ls_drawing_position-size-height.
ELSE.
lv_value = '100'.
ENDIF.
CONDENSE lv_value.
REPLACE '{HEIGHT}' IN lv_content_left WITH lv_value.
IF ls_drawing_position-size-width IS NOT INITIAL.
lv_value = ls_drawing_position-size-width.
ELSE.
lv_value = '100'.
ENDIF.
CONDENSE lv_value.
REPLACE '{WIDTH}' IN lv_content_left WITH lv_value.
lv_content_image_left = lc_shape_image.
lv_value = is_footer-left_image->get_index( ).
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
REPLACE '{RID}' IN lv_content_image_left WITH lv_value.
ENDIF.
IF is_footer-center_image IS NOT INITIAL.
lv_content_center = lc_shape.
REPLACE '{ID}' IN lv_content_center WITH lc_shape_footer_center.
ls_drawing_position = is_footer-left_image->get_position( ).
IF ls_drawing_position-size-height IS NOT INITIAL.
lv_value = ls_drawing_position-size-height.
ELSE.
lv_value = '100'.
ENDIF.
CONDENSE lv_value.
REPLACE '{HEIGHT}' IN lv_content_center WITH lv_value.
IF ls_drawing_position-size-width IS NOT INITIAL.
lv_value = ls_drawing_position-size-width.
ELSE.
lv_value = '100'.
ENDIF.
CONDENSE lv_value.
REPLACE '{WIDTH}' IN lv_content_center WITH lv_value.
lv_content_image_center = lc_shape_image.
lv_value = is_footer-center_image->get_index( ).
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
REPLACE '{RID}' IN lv_content_image_center WITH lv_value.
ENDIF.
IF is_footer-right_image IS NOT INITIAL.
lv_content_right = lc_shape.
REPLACE '{ID}' IN lv_content_right WITH lc_shape_footer_right.
ls_drawing_position = is_footer-left_image->get_position( ).
IF ls_drawing_position-size-height IS NOT INITIAL.
lv_value = ls_drawing_position-size-height.
ELSE.
lv_value = '100'.
ENDIF.
CONDENSE lv_value.
REPLACE '{HEIGHT}' IN lv_content_right WITH lv_value.
IF ls_drawing_position-size-width IS NOT INITIAL.
lv_value = ls_drawing_position-size-width.
ELSE.
lv_value = '100'.
ENDIF.
CONDENSE lv_value.
REPLACE '{WIDTH}' IN lv_content_right WITH lv_value.
lv_content_image_right = lc_shape_image.
lv_value = is_footer-right_image->get_index( ).
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
REPLACE '{RID}' IN lv_content_image_right WITH lv_value.
ENDIF.
CONCATENATE lv_content_left
lv_content_image_left
lv_content_center
lv_content_image_center
lv_content_right
lv_content_image_right
INTO ep_content.
ENDMETHOD.
METHOD set_vml_shape_header.
* CONSTANTS: lc_shape TYPE string VALUE '<v:shape id="{ID}" o:spid="_x0000_s1025" type="#_x0000_t75" style=''position:absolute;margin-left:0;margin-top:0;width:198.75pt;height:48.75pt; z-index:1''>',
CONSTANTS: lc_shape TYPE string VALUE '<v:shape id="{ID}" o:spid="_x0000_s1025" type="#_x0000_t75" style=''position:absolute;margin-left:0;margin-top:0;width:{WIDTH}pt;height:{HEIGHT}pt; z-index:1''>',
lc_shape_image TYPE string VALUE '<v:imagedata o:relid="{RID}" o:title="Logo Title"/><o:lock v:ext="edit" rotation="t"/></v:shape>',
lc_shape_header_center TYPE string VALUE 'CH',
lc_shape_header_left TYPE string VALUE 'LH',
lc_shape_header_right TYPE string VALUE 'RH',
lc_shape_footer_center TYPE string VALUE 'CF',
lc_shape_footer_left TYPE string VALUE 'LF',
lc_shape_footer_right TYPE string VALUE 'RF'.
DATA: lv_content_left TYPE string,
lv_content_center TYPE string,
lv_content_right TYPE string,
lv_content_image_left TYPE string,
lv_content_image_center TYPE string,
lv_content_image_right TYPE string,
lv_value TYPE string,
ls_drawing_position TYPE zexcel_drawing_position.
CLEAR ep_content.
IF is_header-left_image IS NOT INITIAL.
lv_content_left = lc_shape.
REPLACE '{ID}' IN lv_content_left WITH lc_shape_header_left.
ls_drawing_position = is_header-left_image->get_position( ).
IF ls_drawing_position-size-height IS NOT INITIAL.
lv_value = ls_drawing_position-size-height.
ELSE.
lv_value = '100'.
ENDIF.
CONDENSE lv_value.
REPLACE '{HEIGHT}' IN lv_content_left WITH lv_value.
IF ls_drawing_position-size-width IS NOT INITIAL.
lv_value = ls_drawing_position-size-width.
ELSE.
lv_value = '100'.
ENDIF.
CONDENSE lv_value.
REPLACE '{WIDTH}' IN lv_content_left WITH lv_value.
lv_content_image_left = lc_shape_image.
lv_value = is_header-left_image->get_index( ).
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
REPLACE '{RID}' IN lv_content_image_left WITH lv_value.
ENDIF.
IF is_header-center_image IS NOT INITIAL.
lv_content_center = lc_shape.
REPLACE '{ID}' IN lv_content_center WITH lc_shape_header_center.
ls_drawing_position = is_header-center_image->get_position( ).
IF ls_drawing_position-size-height IS NOT INITIAL.
lv_value = ls_drawing_position-size-height.
ELSE.
lv_value = '100'.
ENDIF.
CONDENSE lv_value.
REPLACE '{HEIGHT}' IN lv_content_center WITH lv_value.
IF ls_drawing_position-size-width IS NOT INITIAL.
lv_value = ls_drawing_position-size-width.
ELSE.
lv_value = '100'.
ENDIF.
CONDENSE lv_value.
REPLACE '{WIDTH}' IN lv_content_center WITH lv_value.
lv_content_image_center = lc_shape_image.
lv_value = is_header-center_image->get_index( ).
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
REPLACE '{RID}' IN lv_content_image_center WITH lv_value.
ENDIF.
IF is_header-right_image IS NOT INITIAL.
lv_content_right = lc_shape.
REPLACE '{ID}' IN lv_content_right WITH lc_shape_header_right.
ls_drawing_position = is_header-right_image->get_position( ).
IF ls_drawing_position-size-height IS NOT INITIAL.
lv_value = ls_drawing_position-size-height.
ELSE.
lv_value = '100'.
ENDIF.
CONDENSE lv_value.
REPLACE '{HEIGHT}' IN lv_content_right WITH lv_value.
IF ls_drawing_position-size-width IS NOT INITIAL.
lv_value = ls_drawing_position-size-width.
ELSE.
lv_value = '100'.
ENDIF.
CONDENSE lv_value.
REPLACE '{WIDTH}' IN lv_content_right WITH lv_value.
lv_content_image_right = lc_shape_image.
lv_value = is_header-right_image->get_index( ).
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value.
REPLACE '{RID}' IN lv_content_image_right WITH lv_value.
ENDIF.
CONCATENATE lv_content_left
lv_content_image_left
lv_content_center
lv_content_image_center
lv_content_right
lv_content_image_right
INTO ep_content.
ENDMETHOD.
METHOD set_vml_string.
DATA:
ld_1 TYPE string,
ld_2 TYPE string,
ld_3 TYPE string,
ld_4 TYPE string,
ld_5 TYPE string,
ld_7 TYPE string,
lv_relation_id TYPE i,
lo_iterator TYPE REF TO cl_object_collection_iterator,
lo_worksheet TYPE REF TO zcl_excel_worksheet,
ls_odd_header TYPE zexcel_s_worksheet_head_foot,
ls_odd_footer TYPE zexcel_s_worksheet_head_foot,
ls_even_header TYPE zexcel_s_worksheet_head_foot,
ls_even_footer TYPE zexcel_s_worksheet_head_foot.
* INIT_RESULT
CLEAR ep_content.
* BODY
ld_1 = '<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1"/></o:shapelayout>'.
ld_2 = '<v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"/><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"/>'.
ld_3 = '<v:f eqn="sum @0 1 0"/><v:f eqn="sum 0 0 @1"/><v:f eqn="prod @2 1 2"/><v:f eqn="prod @3 21600 pixelWidth"/><v:f eqn="prod @3 21600 pixelHeight"/><v:f eqn="sum @0 0 1"/><v:f eqn="prod @6 1 2"/><v:f eqn="prod @7 21600 pixelWidth"/>'.
ld_4 = '<v:f eqn="sum @8 21600 0"/><v:f eqn="prod @7 21600 pixelHeight"/><v:f eqn="sum @10 21600 0"/></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/><o:lock v:ext="edit" aspectratio="t"/></v:shapetype>'.
CONCATENATE ld_1
ld_2
ld_3
ld_4
INTO ep_content.
lv_relation_id = 0.
lo_iterator = me->excel->get_worksheets_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true.
lo_worksheet ?= lo_iterator->get_next( ).
lo_worksheet->sheet_setup->get_header_footer( IMPORTING ep_odd_header = ls_odd_header
ep_odd_footer = ls_odd_footer
ep_even_header = ls_even_header
ep_even_footer = ls_even_footer ).
ld_5 = me->set_vml_shape_header( ls_odd_header ).
CONCATENATE ep_content
ld_5
INTO ep_content.
ld_5 = me->set_vml_shape_header( ls_even_header ).
CONCATENATE ep_content
ld_5
INTO ep_content.
ld_5 = me->set_vml_shape_footer( ls_odd_footer ).
CONCATENATE ep_content
ld_5
INTO ep_content.
ld_5 = me->set_vml_shape_footer( ls_even_footer ).
CONCATENATE ep_content
ld_5
INTO ep_content.
ENDWHILE.
ld_7 = '</xml>'.
CONCATENATE ep_content
ld_7
INTO ep_content.
ENDMETHOD.
METHOD create_xml_document.
DATA lo_encoding TYPE REF TO if_ixml_encoding.
lo_encoding = me->ixml->create_encoding( byte_order = if_ixml_encoding=>co_platform_endian
character_set = 'utf-8' ).
ro_document = me->ixml->create_document( ).
ro_document->set_encoding( lo_encoding ).
ro_document->set_standalone( abap_true ).
ENDMETHOD.
METHOD render_xml_document.
DATA lo_streamfactory TYPE REF TO if_ixml_stream_factory.
DATA lo_ostream TYPE REF TO if_ixml_ostream.
DATA lo_renderer TYPE REF TO if_ixml_renderer.
DATA lv_string TYPE string.
" So that the rendering of io_document to a XML text in UTF-8 XSTRING works for all Unicode characters (Chinese,
" emoticons, etc.) the method CREATE_OSTREAM_CSTRING must be used instead of CREATE_OSTREAM_XSTRING as explained
" in note 2922674 below (original there: https://launchpad.support.sap.com/#/notes/2922674), and then the STRING
" variable can be converted into UTF-8.
"
" Excerpt from Note 2922674 - Support for Unicode Characters U+10000 to U+10FFFF in the iXML kernel library / ABAP package SIXML.
"
" You are running a unicode system with SAP Netweaver / SAP_BASIS release equal or lower than 7.51.
"
" Some functions in the iXML kernel library / ABAP package SIXML does not fully or incorrectly support unicode
" characters of the supplementary planes. This is caused by using UCS-2 in codepage conversion functions.
" Therefore, when reading from iXML input steams, the characters from the supplementary planes, that are not
" supported by UCS-2, might be replaced by the character #. When writing to iXML output streams, UTF-16 surrogate
" pairs, representing characters from the supplementary planes, might be incorrectly encoded in UTF-8.
"
" The characters incorrectly encoded in UTF-8, might be accepted as input for the iXML parser or external parsers,
" but might also be rejected.
"
" Support for unicode characters of the supplementary planes was introduced for SAP_BASIS 7.51 or lower with note
" 2220720, but later withdrawn with note 2346627 for functional issues.
"
" Characters of the supplementary planes are supported with ABAP Platform 1709 / SAP_BASIS 7.52 and higher.
"
" Please note, that the iXML runtime behaves like the ABAP runtime concerning the handling of unicode characters of
" the supplementary planes. In iXML and ABAP, these characters have length 2 (as returned by ABAP build-in function
" STRLEN), and string processing functions like SUBSTRING might split these characters into 2 invalid characters
" with length 1. These invalid characters are commonly referred to as broken surrogate pairs.
"
" A workaround for the incorrect UTF-8 encoding in SAP_BASIS 7.51 or lower is to render the document to an ABAP
" variable with type STRING using a output stream created with factory method IF_IXML_STREAM_FACTORY=>CREATE_OSTREAM_CSTRING
" and then to convert the STRING variable to UTF-8 using method CL_ABAP_CODEPAGE=>CONVERT_TO.
" 1) RENDER TO XML STRING
lo_streamfactory = me->ixml->create_stream_factory( ).
lo_ostream = lo_streamfactory->create_ostream_cstring( string = lv_string ).
lo_renderer = me->ixml->create_renderer( ostream = lo_ostream document = io_document ).
lo_renderer->render( ).
" 2) CONVERT IT TO UTF-8
"-----------------
" The beginning of the XML string has these 57 characters:
" X<?xml version="1.0" encoding="utf-16" standalone="yes"?>
" (where "X" is the special character corresponding to the utf-16 BOM, hexadecimal FFFE or FEFF,
" but there's no "X" in non-Unicode SAP systems)
" The encoding must be removed otherwise Excel would fail to decode correctly the UTF-8 XML.
" For a better performance, it's assumed that "encoding" is in the first 100 characters.
IF strlen( lv_string ) < 100.
REPLACE REGEX 'encoding="[^"]+"' IN lv_string WITH ``.
ELSE.
REPLACE REGEX 'encoding="[^"]+"' IN SECTION LENGTH 100 OF lv_string WITH ``.
ENDIF.
" Convert XML text to UTF-8 (NB: if 2 first bytes are the UTF-16 BOM, they are converted into 3 bytes of UTF-8 BOM)
ep_content = cl_abap_codepage=>convert_to( source = lv_string ).
" Add the UTF-8 Byte Order Mark if missing (NB: that serves as substitute of "encoding")
IF xstrlen( ep_content ) >= 3 AND ep_content(3) <> cl_abap_char_utilities=>byte_order_mark_utf8.
CONCATENATE cl_abap_char_utilities=>byte_order_mark_utf8 ep_content INTO ep_content IN BYTE MODE.
ENDIF.
ENDMETHOD.
METHOD zif_excel_writer~write_file.
me->excel = io_excel.
ep_file = me->create( ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
1069,
5276,
62,
16002,
62,
12726,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1168,
5097,
62,
6369,
34,
3698,
62,
18564,
2043,
1137,
62,
12726,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
1069,
5276,
62,
16002,
764,
198,
220,
220,
220,
337,
36252,
50,
23772,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
198,
9,
1,
9,
6861,
6805,
286,
1398,
1168,
5097,
62,
6369,
34,
3698,
62,
18564,
2043,
1137,
62,
12726,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
285,
774,
62,
28665,
62,
687,
4712,
62,
1484,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
41876,
1976,
1069,
5276,
62,
82,
62,
3846,
62,
7890,
12,
28665,
62,
687,
4712,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33721,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
0,
2099,
25,
4888,
11,
3503,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
285,
774,
62,
28665,
62,
687,
4712,
62,
1484,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
774,
62,
28665,
62,
687,
25283,
62,
1484,
41876,
367,
11211,
1961,
43679,
3963,
285,
774,
62,
28665,
62,
687,
4712,
62,
1484,
13315,
4725,
33866,
8924,
35374,
4686,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
11299,
62,
19199,
41876,
4731,
26173,
8924,
44438,
19746,
62,
31431,
4083,
19875,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
15390,
1676,
862,
62,
1324,
41876,
4731,
26173,
8924,
705,
15390,
2964,
862,
14,
1324,
13,
19875,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
15390,
1676,
862,
62,
7295,
41876,
4731,
26173,
8924,
705,
15390,
2964,
862,
14,
7295,
13,
19875,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
39468,
5748,
41876,
4731,
26173,
8924,
705,
62,
2411,
82,
11757,
2411,
82,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
87,
75,
62,
9948,
66,
7983,
41876,
4731,
26173,
8924,
705,
87,
75,
14,
9948,
66,
35491,
13,
19875,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
87,
75,
62,
19334,
654,
41876,
4731,
26173,
8924,
705,
87,
75,
14,
19334,
654,
14,
19334,
278,
2,
13,
19875,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
87,
75,
62,
19334,
654,
62,
2411,
82,
41876,
4731,
26173,
8924,
705,
87,
75,
14,
19334,
654,
47835,
2411,
82,
14,
19334,
278,
2,
13,
19875,
13,
2411,
82,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
87,
75,
62,
39468,
5748,
41876,
4731,
26173,
8924,
705,
87,
75,
47835,
2411,
82,
14,
1818,
2070,
13,
19875,
13,
2411,
82,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
87,
75,
62,
28710,
37336,
41876,
4731,
26173,
8924,
705,
87,
75,
14,
28710,
13290,
654,
13,
19875,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
87,
75,
62,
21760,
41876,
4731,
26173,
8924,
705,
87,
75,
14,
5225,
258,
1039,
14,
21760,
2,
13,
19875,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
87,
75,
62,
21760,
62,
2411,
82,
41876,
4731,
26173,
8924,
705,
87,
75,
14,
5225,
258,
1039,
47835,
2411,
82,
14,
21760,
2,
13,
19875,
13,
2411,
82,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
87,
75,
62,
47720,
41876,
4731,
26173,
8924,
705,
87,
75,
14,
47720,
13,
19875,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
87,
75,
62,
43810,
41876,
4731,
26173,
8924,
705,
87,
75,
14,
43810,
14,
43810,
16,
13,
19875,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
87,
75,
62,
1818,
2070,
41876,
4731,
26173,
8924,
705,
87,
75,
14,
1818,
2070,
13,
19875,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
42865,
27336,
41876,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
764,
198,
220,
220,
220,
42865,
4888,
62,
37336,
41876,
1976,
1069,
5276,
62,
83,
62,
28710,
62,
8841,
764,
198,
220,
220,
220,
42865,
12186,
62,
17561,
62,
76,
5912,
41876,
1976,
1069,
5276,
62,
83,
62,
47720,
62,
17561,
62,
76,
5912,
764,
198,
220,
220,
220,
42865,
12186,
62,
76,
5912,
41876,
1976,
1069,
5276,
62,
83,
62,
47720,
62,
76,
5912,
764,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
87,
75,
62,
15944,
41876,
4731,
26173,
8924,
705,
87,
75,
14,
15944,
2,
13,
19875,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
537,
62,
87,
75,
62,
19334,
278,
62,
1640,
62,
15944,
41876,
4731,
26173,
8924,
705,
87,
75,
14,
19334,
654,
14,
85,
4029,
25302,
278,
2,
13,
85,
4029,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
87,
75,
62,
19334,
654,
62,
85,
4029,
62,
2411,
82,
41876,
4731,
26173,
8924,
705,
87,
75,
14,
19334,
654,
47835,
2411,
82,
14,
85,
4029,
25302,
278,
2,
13,
85,
4029,
13,
2411,
82,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
42865,
220,
844,
4029,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
13,
628,
220,
220,
220,
337,
36252,
50,
2251,
62,
87,
75,
62,
21760,
62,
21760,
62,
7890,
198,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
INTERFACE zif_abapgit_definitions
PUBLIC .
TYPES:
ty_type TYPE c LENGTH 6 .
TYPES:
ty_bitbyte TYPE c LENGTH 8 .
TYPES:
ty_sha1 TYPE c LENGTH 40 .
TYPES: ty_sha1_tt TYPE STANDARD TABLE OF ty_sha1 WITH DEFAULT KEY .
TYPES:
ty_adler32 TYPE x LENGTH 4 .
TYPES ty_item_state TYPE c LENGTH 1.
TYPES:
BEGIN OF ty_file_signature,
path TYPE string,
filename TYPE string,
sha1 TYPE ty_sha1,
END OF ty_file_signature .
TYPES:
ty_file_signatures_tt TYPE STANDARD TABLE OF
ty_file_signature WITH DEFAULT KEY .
TYPES:
ty_file_signatures_ts TYPE SORTED TABLE OF
ty_file_signature WITH UNIQUE KEY path filename .
TYPES:
BEGIN OF ty_file.
INCLUDE TYPE ty_file_signature.
TYPES: data TYPE xstring,
END OF ty_file .
TYPES:
ty_files_tt TYPE STANDARD TABLE OF ty_file WITH DEFAULT KEY
WITH UNIQUE SORTED KEY file_path COMPONENTS path filename
WITH NON-UNIQUE SORTED KEY file COMPONENTS filename.
TYPES:
ty_string_tt TYPE STANDARD TABLE OF string WITH DEFAULT KEY .
TYPES ty_git_branch_type TYPE c LENGTH 2 .
TYPES:
BEGIN OF ty_git_branch,
sha1 TYPE ty_sha1,
name TYPE string,
type TYPE ty_git_branch_type,
is_head TYPE abap_bool,
display_name TYPE string,
END OF ty_git_branch .
TYPES:
ty_git_branch_list_tt TYPE STANDARD TABLE OF ty_git_branch WITH DEFAULT KEY
WITH NON-UNIQUE SORTED KEY name_key
COMPONENTS name.
TYPES:
BEGIN OF ty_git_tag,
sha1 TYPE ty_sha1,
object TYPE ty_sha1,
name TYPE string,
type TYPE ty_git_branch_type,
display_name TYPE string,
tagger_name TYPE string,
tagger_email TYPE string,
message TYPE string,
body TYPE string,
END OF ty_git_tag .
TYPES:
ty_git_tag_list_tt TYPE STANDARD TABLE OF ty_git_tag WITH DEFAULT KEY .
TYPES:
BEGIN OF ty_git_user,
name TYPE string,
email TYPE string,
END OF ty_git_user .
TYPES:
BEGIN OF ty_comment,
committer TYPE ty_git_user,
author TYPE ty_git_user,
comment TYPE string,
END OF ty_comment .
TYPES:
BEGIN OF ty_item,
obj_type TYPE tadir-object,
obj_name TYPE tadir-obj_name,
devclass TYPE devclass,
inactive TYPE abap_bool,
END OF ty_item .
TYPES:
ty_items_tt TYPE STANDARD TABLE OF ty_item WITH DEFAULT KEY .
TYPES:
ty_items_ts TYPE SORTED TABLE OF ty_item WITH UNIQUE KEY obj_type obj_name .
TYPES:
BEGIN OF ty_file_item,
file TYPE ty_file,
item TYPE ty_item,
END OF ty_file_item .
TYPES:
ty_files_item_tt TYPE STANDARD TABLE OF ty_file_item WITH DEFAULT KEY .
TYPES:
ty_yes_no TYPE c LENGTH 1,
ty_yes_no_partial TYPE c LENGTH 1.
TYPES:
BEGIN OF ty_overwrite.
INCLUDE TYPE ty_item.
TYPES:
action TYPE i,
icon TYPE icon_d,
text TYPE string,
decision TYPE ty_yes_no,
END OF ty_overwrite .
TYPES:
ty_overwrite_tt TYPE STANDARD TABLE OF ty_overwrite WITH DEFAULT KEY
WITH UNIQUE HASHED KEY object_type_and_name
COMPONENTS obj_type obj_name .
TYPES:
BEGIN OF ty_requirements,
met TYPE ty_yes_no,
decision TYPE ty_yes_no,
END OF ty_requirements .
TYPES:
BEGIN OF ty_dependencies,
met TYPE ty_yes_no,
END OF ty_dependencies .
TYPES:
BEGIN OF ty_transport_type,
request TYPE trfunction,
task TYPE trfunction,
END OF ty_transport_type .
TYPES:
BEGIN OF ty_transport,
required TYPE abap_bool,
transport TYPE trkorr,
type TYPE ty_transport_type,
END OF ty_transport .
TYPES:
BEGIN OF ty_deserialize_checks,
overwrite TYPE ty_overwrite_tt,
warning_package TYPE ty_overwrite_tt,
requirements TYPE ty_requirements,
dependencies TYPE ty_dependencies,
transport TYPE ty_transport,
END OF ty_deserialize_checks .
TYPES:
BEGIN OF ty_delete_checks,
transport TYPE ty_transport,
END OF ty_delete_checks .
TYPES:
BEGIN OF ty_metadata,
class TYPE string,
version TYPE string,
delete_tadir TYPE abap_bool,
ddic TYPE abap_bool,
END OF ty_metadata .
TYPES:
BEGIN OF ty_repo_file,
path TYPE string,
filename TYPE string,
is_changed TYPE abap_bool,
rstate TYPE ty_item_state,
lstate TYPE ty_item_state,
END OF ty_repo_file .
TYPES:
ty_repo_file_tt TYPE STANDARD TABLE OF ty_repo_file WITH DEFAULT KEY .
TYPES:
ty_chmod TYPE c LENGTH 6 .
TYPES:
BEGIN OF ty_object,
sha1 TYPE ty_sha1,
type TYPE ty_type,
data TYPE xstring,
adler32 TYPE ty_adler32,
index TYPE i,
END OF ty_object .
TYPES:
ty_objects_tt TYPE STANDARD TABLE OF ty_object WITH DEFAULT KEY
WITH NON-UNIQUE SORTED KEY sha COMPONENTS sha1
WITH NON-UNIQUE SORTED KEY type COMPONENTS type sha1 .
TYPES:
BEGIN OF ty_tadir,
pgmid TYPE tadir-pgmid,
object TYPE tadir-object,
obj_name TYPE tadir-obj_name,
devclass TYPE tadir-devclass,
korrnum TYPE tadir-korrnum, " todo, I think this field can be removed after #2464 -Hvam
delflag TYPE tadir-delflag,
genflag TYPE tadir-genflag,
path TYPE string,
END OF ty_tadir .
TYPES:
ty_tadir_tt TYPE STANDARD TABLE OF ty_tadir WITH DEFAULT KEY .
TYPES:
BEGIN OF ty_result,
obj_type TYPE tadir-object,
obj_name TYPE tadir-obj_name,
inactive TYPE abap_bool,
path TYPE string,
filename TYPE string,
package TYPE devclass,
match TYPE abap_bool,
lstate TYPE ty_item_state,
rstate TYPE ty_item_state,
packmove TYPE abap_bool,
END OF ty_result .
TYPES:
ty_results_tt TYPE STANDARD TABLE OF ty_result WITH DEFAULT KEY .
TYPES:
ty_results_ts_path TYPE HASHED TABLE OF ty_result WITH UNIQUE KEY path filename .
TYPES:
BEGIN OF ty_stage_files,
local TYPE ty_files_item_tt,
remote TYPE ty_files_tt,
status TYPE ty_results_ts_path,
END OF ty_stage_files .
TYPES:
BEGIN OF ty_tpool.
INCLUDE TYPE textpool.
TYPES: split TYPE c LENGTH 8.
TYPES: END OF ty_tpool .
TYPES:
ty_tpool_tt TYPE STANDARD TABLE OF ty_tpool WITH DEFAULT KEY .
TYPES:
BEGIN OF ty_sotr,
header TYPE sotr_head,
entries TYPE sotr_text_tt,
END OF ty_sotr .
TYPES:
ty_sotr_tt TYPE STANDARD TABLE OF ty_sotr WITH DEFAULT KEY .
TYPES:
ty_sotr_use_tt TYPE STANDARD TABLE OF sotr_use WITH DEFAULT KEY .
TYPES:
BEGIN OF ty_obj_attribute,
cmpname TYPE seocmpname,
attkeyfld TYPE seokeyfld,
attbusobj TYPE seobusobj,
END OF ty_obj_attribute .
TYPES:
ty_obj_attribute_tt TYPE STANDARD TABLE OF ty_obj_attribute WITH DEFAULT KEY
WITH NON-UNIQUE SORTED KEY cmpname COMPONENTS cmpname .
TYPES:
BEGIN OF ty_transport_to_branch,
branch_name TYPE string,
commit_text TYPE string,
END OF ty_transport_to_branch .
TYPES:
BEGIN OF ty_create,
name TYPE string,
parent TYPE string,
END OF ty_create .
TYPES:
BEGIN OF ty_commit,
sha1 TYPE ty_sha1,
parent1 TYPE ty_sha1,
parent2 TYPE ty_sha1,
author TYPE string,
email TYPE string,
time TYPE string,
message TYPE string,
body TYPE STANDARD TABLE OF string WITH DEFAULT KEY,
branch TYPE string,
merge TYPE string,
tags TYPE STANDARD TABLE OF string WITH DEFAULT KEY,
create TYPE STANDARD TABLE OF ty_create WITH DEFAULT KEY,
compressed TYPE abap_bool,
END OF ty_commit .
TYPES:
ty_commit_tt TYPE STANDARD TABLE OF ty_commit WITH DEFAULT KEY .
TYPES:
BEGIN OF ty_diff,
patch_flag TYPE abap_bool,
new_num TYPE c LENGTH 6,
new TYPE string,
result TYPE c LENGTH 1,
old_num TYPE c LENGTH 6,
old TYPE string,
short TYPE abap_bool,
beacon TYPE i,
END OF ty_diff .
TYPES:
ty_diffs_tt TYPE STANDARD TABLE OF ty_diff
WITH DEFAULT KEY
WITH NON-UNIQUE SORTED KEY new_num COMPONENTS new_num
WITH NON-UNIQUE SORTED KEY old_num COMPONENTS old_num.
TYPES:
BEGIN OF ty_count,
insert TYPE i,
delete TYPE i,
update TYPE i,
END OF ty_count .
TYPES:
BEGIN OF ty_expanded,
path TYPE string,
name TYPE string,
sha1 TYPE ty_sha1,
chmod TYPE ty_chmod,
END OF ty_expanded .
TYPES:
ty_expanded_tt TYPE STANDARD TABLE OF ty_expanded WITH DEFAULT KEY .
TYPES:
BEGIN OF ty_ancestor,
commit TYPE ty_sha1,
tree TYPE ty_sha1,
time TYPE string,
body TYPE string,
END OF ty_ancestor .
TYPES:
BEGIN OF ty_repo_item,
obj_type TYPE tadir-object,
obj_name TYPE tadir-obj_name,
inactive TYPE abap_bool,
sortkey TYPE i,
path TYPE string,
is_dir TYPE abap_bool,
changes TYPE i,
lstate TYPE ty_item_state,
rstate TYPE ty_item_state,
files TYPE ty_repo_file_tt,
changed_by TYPE xubname,
packmove TYPE abap_bool,
END OF ty_repo_item .
TYPES:
ty_repo_item_tt TYPE STANDARD TABLE OF ty_repo_item WITH DEFAULT KEY .
TYPES:
BEGIN OF ty_s_user_settings,
max_lines TYPE i,
adt_jump_enabled TYPE abap_bool,
show_default_repo TYPE abap_bool,
link_hints_enabled TYPE abap_bool,
link_hint_key TYPE c LENGTH 1,
parallel_proc_disabled TYPE abap_bool,
icon_scaling TYPE c LENGTH 1,
ui_theme TYPE string,
hide_sapgui_hint TYPE abap_bool,
activate_wo_popup TYPE abap_bool,
END OF ty_s_user_settings .
TYPES:
ty_dokil_tt TYPE STANDARD TABLE OF dokil
WITH NON-UNIQUE DEFAULT KEY .
TYPES:
BEGIN OF ty_col_spec,
tech_name TYPE string,
display_name TYPE string,
css_class TYPE string,
add_tz TYPE abap_bool,
title TYPE string,
allow_order_by TYPE abap_bool,
END OF ty_col_spec,
ty_col_spec_tt TYPE STANDARD TABLE OF ty_col_spec
WITH NON-UNIQUE KEY tech_name.
TYPES:
ty_proxy_bypass_url TYPE c LENGTH 255,
ty_range_proxy_bypass_url TYPE RANGE OF ty_proxy_bypass_url.
TYPES:
BEGIN OF ty_version,
major TYPE i,
minor TYPE i,
patch TYPE i,
prerelase TYPE string,
prerelase_patch TYPE i,
END OF ty_version.
TYPES:
BEGIN OF ty_alv_column,
name TYPE string,
text TYPE string,
length TYPE lvc_outlen,
show_icon TYPE abap_bool,
END OF ty_alv_column,
ty_alv_column_tt TYPE TABLE OF ty_alv_column WITH DEFAULT KEY.
TYPES:
ty_deserialization_step TYPE string.
TYPES:
ty_deserialization_step_tt TYPE STANDARD TABLE OF ty_deserialization_step
WITH DEFAULT KEY .
TYPES ty_sci_result TYPE c LENGTH 1.
CONSTANTS:
BEGIN OF c_sci_result,
no_run TYPE ty_sci_result VALUE '',
failed TYPE ty_sci_result VALUE 'F',
warning TYPE ty_sci_result VALUE 'W',
passed TYPE ty_sci_result VALUE 'P',
END OF c_sci_result.
CONSTANTS:
BEGIN OF c_git_branch_type,
branch TYPE ty_git_branch_type VALUE 'HD',
lightweight_tag TYPE ty_git_branch_type VALUE 'TG',
annotated_tag TYPE ty_git_branch_type VALUE 'AT',
other TYPE ty_git_branch_type VALUE 'ZZ',
END OF c_git_branch_type .
CONSTANTS c_head_name TYPE string VALUE 'HEAD' ##NO_TEXT.
CONSTANTS:
BEGIN OF c_git_branch,
main TYPE string VALUE 'refs/heads/main',
prefix TYPE string VALUE 'refs/',
heads_prefix TYPE string VALUE 'refs/heads/',
heads TYPE string VALUE 'refs/heads/*',
tags_prefix TYPE string VALUE 'refs/tags/',
tags TYPE string VALUE 'refs/tags/*',
END OF c_git_branch.
CONSTANTS:
BEGIN OF c_diff,
insert TYPE c LENGTH 1 VALUE 'I',
delete TYPE c LENGTH 1 VALUE 'D',
update TYPE c LENGTH 1 VALUE 'U',
END OF c_diff .
CONSTANTS:
BEGIN OF c_type,
commit TYPE ty_type VALUE 'commit', "#EC NOTEXT
tree TYPE ty_type VALUE 'tree', "#EC NOTEXT
ref_d TYPE ty_type VALUE 'ref_d', "#EC NOTEXT
tag TYPE ty_type VALUE 'tag', "#EC NOTEXT
blob TYPE ty_type VALUE 'blob', "#EC NOTEXT
END OF c_type .
CONSTANTS:
BEGIN OF c_state, " https://git-scm.com/docs/git-status
unchanged TYPE ty_item_state VALUE '',
added TYPE ty_item_state VALUE 'A',
modified TYPE ty_item_state VALUE 'M',
deleted TYPE ty_item_state VALUE 'D',
mixed TYPE ty_item_state VALUE '*',
END OF c_state .
CONSTANTS:
BEGIN OF c_chmod,
file TYPE ty_chmod VALUE '100644',
executable TYPE ty_chmod VALUE '100755',
dir TYPE ty_chmod VALUE '40000 ',
END OF c_chmod .
CONSTANTS c_crlf TYPE c LENGTH 2 VALUE cl_abap_char_utilities=>cr_lf ##NO_TEXT.
CONSTANTS c_newline TYPE c LENGTH 1 VALUE cl_abap_char_utilities=>newline ##NO_TEXT.
CONSTANTS c_english TYPE spras VALUE 'E' ##NO_TEXT.
CONSTANTS c_root_dir TYPE string VALUE '/' ##NO_TEXT.
CONSTANTS c_dot_abapgit TYPE string VALUE '.abapgit.xml' ##NO_TEXT.
CONSTANTS c_author_regex TYPE string VALUE '^(.+) <(.*)> (\d{10})\s?.\d{4}$' ##NO_TEXT.
CONSTANTS:
BEGIN OF c_action,
repo_refresh TYPE string VALUE 'repo_refresh',
repo_remove TYPE string VALUE 'repo_remove',
repo_settings TYPE string VALUE 'repo_settings',
repo_local_settings TYPE string VALUE 'repo_local_settings',
repo_remote_settings TYPE string VALUE 'repo_remote_settings',
repo_background TYPE string VALUE 'repo_background',
repo_infos TYPE string VALUE 'repo_infos',
repo_purge TYPE string VALUE 'repo_purge',
repo_newonline TYPE string VALUE 'repo_newonline',
repo_newoffline TYPE string VALUE 'repo_newoffline',
repo_add_all_obj_to_trans_req TYPE string VALUE 'repo_add_all_obj_to_trans_req',
repo_refresh_checksums TYPE string VALUE 'repo_refresh_checksums',
repo_toggle_fav TYPE string VALUE 'repo_toggle_fav',
repo_transport_to_branch TYPE string VALUE 'repo_transport_to_branch',
repo_syntax_check TYPE string VALUE 'repo_syntax_check',
repo_code_inspector TYPE string VALUE 'repo_code_inspector',
repo_open_in_master_lang TYPE string VALUE 'repo_open_in_master_lang',
repo_log TYPE string VALUE 'repo_log',
abapgit_home TYPE string VALUE 'abapgit_home',
zip_import TYPE string VALUE 'zip_import',
zip_export TYPE string VALUE 'zip_export',
zip_package TYPE string VALUE 'zip_package',
zip_transport TYPE string VALUE 'zip_transport',
zip_object TYPE string VALUE 'zip_object',
rfc_compare TYPE string VALUE 'rfc_compare',
performance_test TYPE string VALUE 'performance_test',
ie_devtools TYPE string VALUE 'ie_devtools',
git_pull TYPE string VALUE 'git_pull',
git_reset TYPE string VALUE 'git_reset',
git_branch_create TYPE string VALUE 'git_branch_create',
git_branch_switch TYPE string VALUE 'git_branch_switch',
git_branch_delete TYPE string VALUE 'git_branch_delete',
git_tag_create TYPE string VALUE 'git_tag_create',
git_tag_delete TYPE string VALUE 'git_tag_delete',
git_tag_switch TYPE string VALUE 'git_tag_switch',
git_commit TYPE string VALUE 'git_commit',
db_display TYPE string VALUE 'db_display',
db_edit TYPE string VALUE 'db_edit',
bg_update TYPE string VALUE 'bg_update',
go_back TYPE string VALUE 'go_back',
go_explore TYPE string VALUE 'go_explore',
go_repo TYPE string VALUE 'go_repo',
go_db TYPE string VALUE 'go_db',
go_background TYPE string VALUE 'go_background',
go_background_run TYPE string VALUE 'go_background_run',
go_repo_diff TYPE string VALUE 'go_repo_diff',
go_file_diff TYPE string VALUE 'go_fill_diff',
go_stage TYPE string VALUE 'go_stage',
go_commit TYPE string VALUE 'go_commit',
go_branch_overview TYPE string VALUE 'go_branch_overview',
go_tag_overview TYPE string VALUE 'go_tag_overview',
go_debuginfo TYPE string VALUE 'go_debuginfo',
go_settings TYPE string VALUE 'go_settings',
go_settings_personal TYPE string VALUE 'go_settings_personal',
go_tutorial TYPE string VALUE 'go_tutorial',
go_patch TYPE string VALUE 'go_patch',
jump TYPE string VALUE 'jump',
jump_transport TYPE string VALUE 'jump_transport',
jump_user TYPE string VALUE 'jump_user',
url TYPE string VALUE 'url',
goto_source TYPE string VALUE 'goto_source',
show_callstack TYPE string VALUE 'show_callstack',
change_order_by TYPE string VALUE 'change_order_by',
toggle_favorites TYPE string VALUE 'toggle_favorites',
goto_message TYPE string VALUE 'goto_message',
direction TYPE string VALUE 'direction',
documentation TYPE string VALUE 'documentation',
changelog TYPE string VALUE 'changelog',
clipboard TYPE string VALUE 'clipboard',
END OF c_action.
CONSTANTS c_spagpa_param_repo_key TYPE c LENGTH 20 VALUE 'REPO_KEY' ##NO_TEXT.
CONSTANTS c_spagpa_param_package TYPE c LENGTH 20 VALUE 'PACKAGE' ##NO_TEXT.
CONSTANTS c_yes TYPE ty_yes_no VALUE 'Y'.
CONSTANTS c_no TYPE ty_yes_no VALUE 'N'.
CONSTANTS c_partial TYPE ty_yes_no_partial VALUE 'P'.
TYPES:
ty_method TYPE c LENGTH 1 .
TYPES:
BEGIN OF ty_stage,
file TYPE ty_file,
method TYPE ty_method,
status TYPE ty_result,
END OF ty_stage .
TYPES:
ty_stage_tt TYPE SORTED TABLE OF ty_stage
WITH UNIQUE KEY file-path file-filename .
CONSTANTS:
BEGIN OF c_method,
add TYPE ty_method VALUE 'A',
rm TYPE ty_method VALUE 'R',
ignore TYPE ty_method VALUE 'I',
skip TYPE ty_method VALUE '?',
END OF c_method .
TYPES:
ty_languages TYPE STANDARD TABLE OF laiso WITH DEFAULT KEY.
TYPES:
BEGIN OF ty_i18n_params,
main_language TYPE sy-langu,
main_language_only TYPE abap_bool,
translation_languages TYPE ty_languages,
END OF ty_i18n_params .
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
198,
220,
44731,
764,
628,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
4906,
220,
220,
220,
41876,
269,
406,
49494,
718,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
2545,
26327,
41876,
269,
406,
49494,
807,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
26270,
16,
220,
220,
220,
41876,
269,
406,
49494,
2319,
764,
198,
220,
24412,
47,
1546,
25,
1259,
62,
26270,
16,
62,
926,
41876,
49053,
9795,
43679,
3963,
1259,
62,
26270,
16,
13315,
5550,
38865,
35374,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
324,
1754,
2624,
41876,
2124,
406,
49494,
604,
764,
198,
220,
24412,
47,
1546,
1259,
62,
9186,
62,
5219,
41876,
269,
406,
49494,
352,
13,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
7753,
62,
12683,
1300,
11,
198,
220,
220,
220,
220,
220,
3108,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
29472,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
427,
64,
16,
220,
220,
220,
220,
41876,
1259,
62,
26270,
16,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
7753,
62,
12683,
1300,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
7753,
62,
12683,
6691,
62,
926,
41876,
49053,
9795,
43679,
3963,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1259,
62,
7753,
62,
12683,
1300,
13315,
5550,
38865,
35374,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
7753,
62,
12683,
6691,
62,
912,
41876,
311,
9863,
1961,
43679,
3963,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1259,
62,
7753,
62,
12683,
1300,
13315,
4725,
33866,
8924,
35374,
3108,
29472,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
7753,
13,
198,
220,
220,
220,
220,
220,
3268,
5097,
52,
7206,
41876,
1259,
62,
7753,
62,
12683,
1300,
13,
198,
220,
24412,
47,
1546,
25,
1366,
41876,
2124,
8841,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
7753,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
16624,
62,
926,
41876,
49053,
9795,
43679,
3963,
1259,
62,
7753,
13315,
5550,
38865,
35374,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
4725,
33866,
8924,
311,
9863,
1961,
35374,
2393,
62,
6978,
24301,
1340,
15365,
3108,
29472,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
44521,
12,
4944,
33866,
8924,
311,
9863,
1961,
35374,
2393,
24301,
1340,
15365,
29472,
13,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
8841,
62,
926,
41876,
49053,
9795,
43679,
3963,
4731,
13315,
5550,
38865,
35374,
764,
198,
220,
24412,
47,
1546,
1259,
62,
18300,
62,
1671,
3702,
62,
4906,
41876,
269,
406,
49494,
362,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
18300,
62,
1671,
3702,
11,
198,
220,
220,
220,
220,
220,
427,
64,
16,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
26270,
16,
11,
198,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
18300,
62,
1671,
3702,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
318,
62,
2256,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
3359,
62,
3672,
41876,
4731,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
18300,
62,
1671,
3702,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
18300,
62,
1671,
3702,
62,
4868,
62,
926,
41876,
49053,
9795,
43679,
3963,
1259,
62,
18300,
62,
1671,
3702,
13315,
5550,
38865,
35374,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
44521,
12,
4944,
33866,
8924,
311,
9863,
1961,
35374,
1438,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24301,
1340,
15365,
1438,
13,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
18300,
62,
12985,
11,
198,
220,
220,
220,
220,
220,
427,
64,
16,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
26270,
16,
11,
198,
220,
220,
220,
220,
220,
2134,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
26270,
16,
11,
198,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
18300,
62,
1671,
3702,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
3359,
62,
3672,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
7621,
1362,
62,
3672,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
7621,
1362,
62,
12888,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
3275,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
1767,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
18300,
62,
12985,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
18300,
62,
12985,
62,
4868,
62,
926,
41876,
49053,
9795,
43679,
3963,
1259,
62,
18300,
62,
12985,
13315,
5550,
38865,
35374,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
18300,
62,
7220,
11,
198,
220,
220,
220,
220,
220,
1438,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
3053,
41876,
4731,
11
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_gui_page_diff DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_gui_page
CREATE PUBLIC.
PUBLIC SECTION.
TYPES:
BEGIN OF ty_file_diff,
path TYPE string,
filename TYPE string,
obj_type TYPE string,
obj_name TYPE string,
lstate TYPE char1,
rstate TYPE char1,
fstate TYPE char1, " FILE state - Abstraction for shorter ifs
o_diff TYPE REF TO zcl_abapgit_diff,
changed_by TYPE xubname,
type TYPE string,
END OF ty_file_diff.
TYPES:
tt_file_diff TYPE STANDARD TABLE OF ty_file_diff
WITH NON-UNIQUE DEFAULT KEY
WITH NON-UNIQUE SORTED KEY secondary
COMPONENTS path filename.
CONSTANTS:
BEGIN OF c_fstate,
local TYPE char1 VALUE 'L',
remote TYPE char1 VALUE 'R',
both TYPE char1 VALUE 'B',
END OF c_fstate.
METHODS constructor
IMPORTING
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
!is_file TYPE zif_abapgit_definitions=>ty_file OPTIONAL
!is_object TYPE zif_abapgit_definitions=>ty_item OPTIONAL
RAISING
zcx_abapgit_exception.
METHODS zif_abapgit_gui_event_handler~on_event
REDEFINITION.
PROTECTED SECTION.
DATA mv_unified TYPE abap_bool VALUE abap_true ##NO_TEXT.
DATA mo_repo TYPE REF TO zcl_abapgit_repo.
DATA mt_diff_files TYPE tt_file_diff .
METHODS:
get_normalized_fname_with_path
IMPORTING
is_diff TYPE ty_file_diff
RETURNING
VALUE(rv_filename) TYPE string,
normalize_path
IMPORTING
iv_path TYPE string
RETURNING
VALUE(rv_normalized) TYPE string,
normalize_filename
IMPORTING
iv_filename TYPE string
RETURNING
VALUE(rv_normalized) TYPE string,
render_content REDEFINITION,
scripts REDEFINITION,
add_menu_end
IMPORTING
io_menu TYPE REF TO zcl_abapgit_html_toolbar ,
calculate_diff
IMPORTING
is_file TYPE zif_abapgit_definitions=>ty_file OPTIONAL
is_object TYPE zif_abapgit_definitions=>ty_item OPTIONAL
RAISING
zcx_abapgit_exception,
add_menu_begin
IMPORTING
io_menu TYPE REF TO zcl_abapgit_html_toolbar,
render_table_head_non_unified
IMPORTING
io_html TYPE REF TO zcl_abapgit_html
is_diff TYPE ty_file_diff,
render_beacon_begin_of_row
IMPORTING
io_html TYPE REF TO zcl_abapgit_html
is_diff TYPE ty_file_diff,
render_diff_head_after_state
IMPORTING
io_html TYPE REF TO zcl_abapgit_html
is_diff TYPE ty_file_diff,
insert_nav
RETURNING
VALUE(rv_insert_nav) TYPE abap_bool,
render_line_split_row
IMPORTING
io_html TYPE REF TO zcl_abapgit_html
iv_filename TYPE string
is_diff_line TYPE zif_abapgit_definitions=>ty_diff
iv_index TYPE sy-tabix
iv_fstate TYPE char1
iv_new TYPE string
iv_old TYPE string
RAISING
zcx_abapgit_exception,
build_menu
RETURNING
VALUE(ro_menu) TYPE REF TO zcl_abapgit_html_toolbar.
PRIVATE SECTION.
CONSTANTS:
BEGIN OF c_actions,
toggle_unified TYPE string VALUE 'toggle_unified',
END OF c_actions .
DATA mt_delayed_lines TYPE zif_abapgit_definitions=>ty_diffs_tt .
DATA mv_repo_key TYPE zif_abapgit_persistence=>ty_repo-key .
DATA mv_seed TYPE string . " Unique page id to bind JS sessionStorage
METHODS render_diff
IMPORTING
!is_diff TYPE ty_file_diff
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html
RAISING
zcx_abapgit_exception .
METHODS render_diff_head
IMPORTING
!is_diff TYPE ty_file_diff
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS render_table_head
IMPORTING
!is_diff TYPE ty_file_diff
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS render_beacon
IMPORTING
!is_diff_line TYPE zif_abapgit_definitions=>ty_diff
!is_diff TYPE ty_file_diff
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS render_line_split
IMPORTING
!is_diff_line TYPE zif_abapgit_definitions=>ty_diff
!iv_filename TYPE string
!iv_fstate TYPE char1
!iv_index TYPE sy-tabix
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html
RAISING
zcx_abapgit_exception .
METHODS render_line_unified
IMPORTING
!is_diff_line TYPE zif_abapgit_definitions=>ty_diff OPTIONAL
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS append_diff
IMPORTING
!it_remote TYPE zif_abapgit_definitions=>ty_files_tt
!it_local TYPE zif_abapgit_definitions=>ty_files_item_tt
!is_status TYPE zif_abapgit_definitions=>ty_result
RAISING
zcx_abapgit_exception .
METHODS is_binary
IMPORTING
!iv_d1 TYPE xstring
!iv_d2 TYPE xstring
RETURNING
VALUE(rv_yes) TYPE abap_bool .
METHODS add_jump_sub_menu
IMPORTING
!io_menu TYPE REF TO zcl_abapgit_html_toolbar .
METHODS add_filter_sub_menu
IMPORTING
io_menu TYPE REF TO zcl_abapgit_html_toolbar .
METHODS render_lines
IMPORTING
is_diff TYPE ty_file_diff
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html
RAISING
zcx_abapgit_exception.
METHODS render_table_head_unified
IMPORTING
io_html TYPE REF TO zcl_abapgit_html.
ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_PAGE_DIFF IMPLEMENTATION.
METHOD add_filter_sub_menu.
DATA:
lo_sub_filter TYPE REF TO zcl_abapgit_html_toolbar,
lt_types TYPE string_table,
lt_users TYPE string_table.
FIELD-SYMBOLS: <ls_diff> LIKE LINE OF mt_diff_files,
<lv_i> TYPE string.
" Get unique
LOOP AT mt_diff_files ASSIGNING <ls_diff>.
APPEND <ls_diff>-type TO lt_types.
APPEND <ls_diff>-changed_by TO lt_users.
ENDLOOP.
SORT lt_types.
DELETE ADJACENT DUPLICATES FROM lt_types.
SORT lt_users.
DELETE ADJACENT DUPLICATES FROM lt_users.
IF lines( lt_types ) > 1 OR lines( lt_users ) > 1.
CREATE OBJECT lo_sub_filter EXPORTING iv_id = 'diff-filter'.
" File types
IF lines( lt_types ) > 1.
lo_sub_filter->add( iv_txt = 'TYPE' iv_typ = zif_abapgit_html=>c_action_type-separator ).
LOOP AT lt_types ASSIGNING <lv_i>.
lo_sub_filter->add( iv_txt = <lv_i>
iv_typ = zif_abapgit_html=>c_action_type-onclick
iv_aux = 'type'
iv_chk = abap_true ).
ENDLOOP.
ENDIF.
" Changed by
IF lines( lt_users ) > 1.
lo_sub_filter->add( iv_txt = 'CHANGED BY' iv_typ = zif_abapgit_html=>c_action_type-separator ).
LOOP AT lt_users ASSIGNING <lv_i>.
lo_sub_filter->add( iv_txt = <lv_i>
iv_typ = zif_abapgit_html=>c_action_type-onclick
iv_aux = 'changed-by'
iv_chk = abap_true ).
ENDLOOP.
ENDIF.
io_menu->add( iv_txt = 'Filter'
io_sub = lo_sub_filter ) ##NO_TEXT.
ENDIF.
ENDMETHOD.
METHOD add_jump_sub_menu.
DATA: lo_sub_jump TYPE REF TO zcl_abapgit_html_toolbar,
lv_jump_target TYPE string.
FIELD-SYMBOLS: <ls_diff> LIKE LINE OF mt_diff_files.
CREATE OBJECT lo_sub_jump EXPORTING iv_id = 'jump'.
LOOP AT mt_diff_files ASSIGNING <ls_diff>.
lv_jump_target = <ls_diff>-path && <ls_diff>-filename.
lo_sub_jump->add(
iv_id = |li_jump_{ sy-tabix }|
iv_txt = lv_jump_target
iv_typ = zif_abapgit_html=>c_action_type-onclick ).
ENDLOOP.
io_menu->add( iv_txt = 'Jump'
io_sub = lo_sub_jump ) ##NO_TEXT.
ENDMETHOD.
METHOD add_menu_begin.
ENDMETHOD.
METHOD add_menu_end.
io_menu->add( iv_txt = 'Split/Unified view'
iv_act = c_actions-toggle_unified ) ##NO_TEXT.
ENDMETHOD.
METHOD append_diff.
DATA:
lv_offs TYPE i,
ls_r_dummy LIKE LINE OF it_remote ##NEEDED,
ls_l_dummy LIKE LINE OF it_local ##NEEDED.
FIELD-SYMBOLS: <ls_remote> LIKE LINE OF it_remote,
<ls_local> LIKE LINE OF it_local,
<ls_diff> LIKE LINE OF mt_diff_files.
READ TABLE it_remote ASSIGNING <ls_remote>
WITH KEY filename = is_status-filename
path = is_status-path.
IF sy-subrc <> 0.
ASSIGN ls_r_dummy TO <ls_remote>.
ENDIF.
READ TABLE it_local ASSIGNING <ls_local>
WITH KEY file-filename = is_status-filename
file-path = is_status-path.
IF sy-subrc <> 0.
ASSIGN ls_l_dummy TO <ls_local>.
ENDIF.
IF <ls_local> IS INITIAL AND <ls_remote> IS INITIAL.
zcx_abapgit_exception=>raise( |DIFF: file not found { is_status-filename }| ).
ENDIF.
APPEND INITIAL LINE TO mt_diff_files ASSIGNING <ls_diff>.
<ls_diff>-path = is_status-path.
<ls_diff>-filename = is_status-filename.
<ls_diff>-obj_type = is_status-obj_type.
<ls_diff>-obj_name = is_status-obj_name.
<ls_diff>-lstate = is_status-lstate.
<ls_diff>-rstate = is_status-rstate.
IF <ls_diff>-lstate IS NOT INITIAL AND <ls_diff>-rstate IS NOT INITIAL.
<ls_diff>-fstate = c_fstate-both.
ELSEIF <ls_diff>-lstate IS NOT INITIAL.
<ls_diff>-fstate = c_fstate-local.
ELSE. "rstate IS NOT INITIAL, lstate = empty.
<ls_diff>-fstate = c_fstate-remote.
ENDIF.
" Changed by
IF <ls_local>-item-obj_type IS NOT INITIAL.
<ls_diff>-changed_by = to_lower( zcl_abapgit_objects=>changed_by( <ls_local>-item ) ).
ENDIF.
" Extension
IF <ls_local>-file-filename IS NOT INITIAL.
<ls_diff>-type = reverse( <ls_local>-file-filename ).
ELSE.
<ls_diff>-type = reverse( <ls_remote>-filename ).
ENDIF.
FIND FIRST OCCURRENCE OF '.' IN <ls_diff>-type MATCH OFFSET lv_offs.
<ls_diff>-type = reverse( substring( val = <ls_diff>-type len = lv_offs ) ).
IF <ls_diff>-type <> 'xml' AND <ls_diff>-type <> 'abap'.
<ls_diff>-type = 'other'.
ENDIF.
IF <ls_diff>-type = 'other'
AND is_binary( iv_d1 = <ls_remote>-data iv_d2 = <ls_local>-file-data ) = abap_true.
<ls_diff>-type = 'binary'.
ENDIF.
" Diff data
IF <ls_diff>-type <> 'binary'.
IF <ls_diff>-fstate = c_fstate-remote. " Remote file leading changes
CREATE OBJECT <ls_diff>-o_diff
EXPORTING
iv_new = <ls_remote>-data
iv_old = <ls_local>-file-data.
ELSE. " Local leading changes or both were modified
CREATE OBJECT <ls_diff>-o_diff
EXPORTING
iv_new = <ls_local>-file-data
iv_old = <ls_remote>-data.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD build_menu.
CREATE OBJECT ro_menu.
add_menu_begin( ro_menu ).
add_jump_sub_menu( ro_menu ).
add_filter_sub_menu( ro_menu ).
add_menu_end( ro_menu ).
ENDMETHOD.
METHOD calculate_diff.
DATA: lt_remote TYPE zif_abapgit_definitions=>ty_files_tt,
lt_local TYPE zif_abapgit_definitions=>ty_files_item_tt,
lt_status TYPE zif_abapgit_definitions=>ty_results_tt.
FIELD-SYMBOLS: <ls_status> LIKE LINE OF lt_status.
CLEAR: mt_diff_files.
lt_remote = mo_repo->get_files_remote( ).
lt_local = mo_repo->get_files_local( ).
mo_repo->reset_status( ).
lt_status = mo_repo->status( ).
IF is_file IS NOT INITIAL. " Diff for one file
READ TABLE lt_status ASSIGNING <ls_status>
WITH KEY path = is_file-path filename = is_file-filename.
append_diff( it_remote = lt_remote
it_local = lt_local
is_status = <ls_status> ).
ELSEIF is_object IS NOT INITIAL. " Diff for whole object
LOOP AT lt_status ASSIGNING <ls_status>
WHERE obj_type = is_object-obj_type
AND obj_name = is_object-obj_name
AND match IS INITIAL.
append_diff( it_remote = lt_remote
it_local = lt_local
is_status = <ls_status> ).
ENDLOOP.
ELSE. " Diff for the whole repo
SORT lt_status BY
path ASCENDING
filename ASCENDING.
LOOP AT lt_status ASSIGNING <ls_status> WHERE match IS INITIAL.
append_diff( it_remote = lt_remote
it_local = lt_local
is_status = <ls_status> ).
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD constructor.
DATA: lv_ts TYPE timestamp.
super->constructor( ).
ms_control-page_title = 'DIFF'.
mv_unified = zcl_abapgit_persistence_user=>get_instance( )->get_diff_unified( ).
mv_repo_key = iv_key.
mo_repo ?= zcl_abapgit_repo_srv=>get_instance( )->get( iv_key ).
GET TIME STAMP FIELD lv_ts.
mv_seed = |diff{ lv_ts }|. " Generate based on time
ASSERT is_file IS INITIAL OR is_object IS INITIAL. " just one passed
calculate_diff(
is_file = is_file
is_object = is_object ).
IF lines( mt_diff_files ) = 0.
zcx_abapgit_exception=>raise( 'PAGE_DIFF ERROR: No diff files found' ).
ENDIF.
ms_control-page_menu = build_menu( ).
ENDMETHOD.
METHOD get_normalized_fname_with_path.
rv_filename = normalize_path( is_diff-path )
&& `_`
&& normalize_filename( is_diff-filename ).
ENDMETHOD.
METHOD insert_nav.
ENDMETHOD.
METHOD is_binary.
FIELD-SYMBOLS <lv_data> LIKE iv_d1.
IF iv_d1 IS NOT INITIAL. " One of them might be new and so empty
ASSIGN iv_d1 TO <lv_data>.
ELSE.
ASSIGN iv_d2 TO <lv_data>.
ENDIF.
rv_yes = zcl_abapgit_utils=>is_binary( <lv_data> ).
ENDMETHOD.
METHOD normalize_filename.
rv_normalized = replace( val = iv_filename
sub = '.'
occ = 0
with = '_' ).
ENDMETHOD.
METHOD normalize_path.
rv_normalized = replace( val = iv_path
sub = '/'
occ = 0
with = '_' ).
ENDMETHOD.
METHOD render_beacon.
DATA: lv_beacon TYPE string,
lt_beacons TYPE zif_abapgit_definitions=>ty_string_tt.
CREATE OBJECT ro_html.
IF is_diff_line-beacon > 0.
lt_beacons = is_diff-o_diff->get_beacons( ).
READ TABLE lt_beacons INTO lv_beacon INDEX is_diff_line-beacon.
ELSE.
lv_beacon = '---'.
ENDIF.
ro_html->add( '<thead class="nav_line">' ).
ro_html->add( '<tr>' ).
render_beacon_begin_of_row(
io_html = ro_html
is_diff = is_diff ).
IF mv_unified = abap_true.
ro_html->add( '<th class="num"></th>' ).
ro_html->add( '<th class="mark"></th>' ).
ro_html->add( |<th>@@ { is_diff_line-new_num } @@ { lv_beacon }</th>| ).
ELSE.
ro_html->add( |<th colspan="6">@@ { is_diff_line-new_num } @@ { lv_beacon }</th>| ).
ENDIF.
ro_html->add( '</tr>' ).
ro_html->add( '</thead>' ).
ENDMETHOD.
METHOD render_beacon_begin_of_row.
io_html->add( '<th class="num"></th>' ).
ENDMETHOD.
METHOD render_content.
DATA: ls_diff_file LIKE LINE OF mt_diff_files,
li_progress TYPE REF TO zif_abapgit_progress.
CREATE OBJECT ro_html.
li_progress = zcl_abapgit_progress=>get_instance( lines( mt_diff_files ) ).
ro_html->add( |<div id="diff-list" data-repo-key="{ mv_repo_key }">| ).
ro_html->add( zcl_abapgit_gui_chunk_lib=>render_js_error_banner( ) ).
LOOP AT mt_diff_files INTO ls_diff_file.
li_progress->show(
iv_current = sy-tabix
iv_text = |Render Diff - { ls_diff_file-filename }| ).
ro_html->add( render_diff( ls_diff_file ) ).
ENDLOOP.
IF sy-subrc <> 0.
ro_html->add( |No more diffs| ).
ENDIF.
ro_html->add( '</div>' ).
ENDMETHOD.
METHOD render_diff.
CREATE OBJECT ro_html.
ro_html->add( |<div class="diff" data-type="{ is_diff-type
}" data-changed-by="{ is_diff-changed_by
}" data-file="{ is_diff-path && is_diff-filename }">| ). "#EC NOTEXT
ro_html->add( render_diff_head( is_diff ) ).
" Content
IF is_diff-type <> 'binary'.
ro_html->add( '<div class="diff_content">' ). "#EC NOTEXT
ro_html->add( |<table class="diff_tab syntax-hl" id={ is_diff-filename }>| ). "#EC NOTEXT
ro_html->add( render_table_head( is_diff ) ).
ro_html->add( render_lines( is_diff ) ).
ro_html->add( '</table>' ). "#EC NOTEXT
ELSE.
ro_html->add( '<div class="diff_content paddings center grey">' ). "#EC NOTEXT
ro_html->add( 'The content seems to be binary.' ). "#EC NOTEXT
ro_html->add( 'Cannot display as diff.' ). "#EC NOTEXT
ENDIF.
ro_html->add( '</div>' ). "#EC NOTEXT
ro_html->add( '</div>' ). "#EC NOTEXT
ENDMETHOD.
METHOD render_diff_head.
DATA: ls_stats TYPE zif_abapgit_definitions=>ty_count,
lv_adt_link TYPE string.
CREATE OBJECT ro_html.
ro_html->add( '<div class="diff_head">' ). "#EC NOTEXT
ro_html->add_icon(
iv_name = 'chevron-down'
iv_hint = 'Collapse/Expand'
iv_class = 'cursor-pointer'
iv_onclick = 'onDiffCollapse(event)' ).
IF is_diff-type <> 'binary'.
ls_stats = is_diff-o_diff->stats( ).
IF is_diff-fstate = c_fstate-both. " Merge stats into 'update' if both were changed
ls_stats-update = ls_stats-update + ls_stats-insert + ls_stats-delete.
CLEAR: ls_stats-insert, ls_stats-delete.
ENDIF.
ro_html->add( |<span class="diff_banner diff_ins">+ { ls_stats-insert }</span>| ).
ro_html->add( |<span class="diff_banner diff_del">- { ls_stats-delete }</span>| ).
ro_html->add( |<span class="diff_banner diff_upd">~ { ls_stats-update }</span>| ).
ENDIF.
" no links for nonexistent or deleted objects
IF is_diff-lstate IS NOT INITIAL AND is_diff-lstate <> 'D'.
lv_adt_link = zcl_abapgit_html=>a(
iv_txt = |{ is_diff-path }{ is_diff-filename }|
iv_typ = zif_abapgit_html=>c_action_type-sapevent
iv_act = |jump?TYPE={ is_diff-obj_type }&NAME={ is_diff-obj_name }| ).
ENDIF.
IF lv_adt_link IS NOT INITIAL.
ro_html->add( |<span class="diff_name">{ lv_adt_link }</span>| ). "#EC NOTEXT
ELSE.
ro_html->add( |<span class="diff_name">{ is_diff-path }{ is_diff-filename }</span>| ). "#EC NOTEXT
ENDIF.
ro_html->add( zcl_abapgit_gui_chunk_lib=>render_item_state(
iv_lstate = is_diff-lstate
iv_rstate = is_diff-rstate ) ).
render_diff_head_after_state(
io_html = ro_html
is_diff = is_diff ).
ro_html->add( |<span class="diff_changed_by">last change by: <span class="user">{
is_diff-changed_by }</span></span>| ).
ro_html->add( '</div>' ). "#EC NOTEXT
ENDMETHOD.
METHOD render_diff_head_after_state.
IF is_diff-fstate = c_fstate-both AND mv_unified = abap_true.
io_html->add( '<span class="attention pad-sides">Attention: Unified mode'
&& ' highlighting for MM assumes local file is newer ! </span>' ). "#EC NOTEXT
ENDIF.
ENDMETHOD.
METHOD render_lines.
DATA: lo_highlighter TYPE REF TO zcl_abapgit_syntax_highlighter,
lt_diffs TYPE zif_abapgit_definitions=>ty_diffs_tt,
lv_insert_nav TYPE abap_bool,
lv_tabix TYPE syst-tabix.
FIELD-SYMBOLS <ls_diff> LIKE LINE OF lt_diffs.
lo_highlighter = zcl_abapgit_syntax_highlighter=>create( is_diff-filename ).
CREATE OBJECT ro_html.
lt_diffs = is_diff-o_diff->get( ).
lv_insert_nav = insert_nav( ).
LOOP AT lt_diffs ASSIGNING <ls_diff>.
lv_tabix = sy-tabix.
IF <ls_diff>-short = abap_false.
lv_insert_nav = abap_true.
CONTINUE.
ENDIF.
IF lv_insert_nav = abap_true. " Insert separator line with navigation
ro_html->add( render_beacon( is_diff_line = <ls_diff> is_diff = is_diff ) ).
lv_insert_nav = abap_false.
ENDIF.
IF lo_highlighter IS BOUND.
<ls_diff>-new = lo_highlighter->process_line( <ls_diff>-new ).
<ls_diff>-old = lo_highlighter->process_line( <ls_diff>-old ).
ELSE.
<ls_diff>-new = escape( val = <ls_diff>-new format = cl_abap_format=>e_html_attr ).
<ls_diff>-old = escape( val = <ls_diff>-old format = cl_abap_format=>e_html_attr ).
ENDIF.
CONDENSE <ls_diff>-new_num. "get rid of leading spaces
CONDENSE <ls_diff>-old_num.
IF mv_unified = abap_true.
ro_html->add( render_line_unified( is_diff_line = <ls_diff> ) ).
ELSE.
ro_html->add( render_line_split( is_diff_line = <ls_diff>
iv_filename = get_normalized_fname_with_path( is_diff )
iv_fstate = is_diff-fstate
iv_index = lv_tabix ) ).
ENDIF.
ENDLOOP.
IF mv_unified = abap_true.
ro_html->add( render_line_unified( ) ). " Release delayed lines
ENDIF.
ENDMETHOD.
METHOD render_line_split.
DATA: lv_new TYPE string,
lv_old TYPE string,
lv_mark TYPE string,
lv_bg TYPE string.
CREATE OBJECT ro_html.
" New line
lv_mark = ` `.
IF is_diff_line-result IS NOT INITIAL.
IF iv_fstate = c_fstate-both OR is_diff_line-result = zif_abapgit_definitions=>c_diff-update.
lv_bg = ' diff_upd'.
lv_mark = `~`.
ELSEIF is_diff_line-result = zif_abapgit_definitions=>c_diff-insert.
lv_bg = ' diff_ins'.
lv_mark = `+`.
ENDIF.
ENDIF.
lv_new = |<td class="num diff_others" line-num="{ is_diff_line-new_num }"></td>|
&& |<td class="mark diff_others">{ lv_mark }</td>|
&& |<td class="code{ lv_bg } diff_left">{ is_diff_line-new }</td>|.
" Old line
CLEAR lv_bg.
lv_mark = ` `.
IF is_diff_line-result IS NOT INITIAL.
IF iv_fstate = c_fstate-both OR is_diff_line-result = zif_abapgit_definitions=>c_diff-update.
lv_bg = ' diff_upd'.
lv_mark = `~`.
ELSEIF is_diff_line-result = zif_abapgit_definitions=>c_diff-delete.
lv_bg = ' diff_del'.
lv_mark = `-`.
ENDIF.
ENDIF.
lv_old = |<td class="num diff_others" line-num="{ is_diff_line-old_num }"></td>|
&& |<td class="mark diff_others">{ lv_mark }</td>|
&& |<td class="code{ lv_bg } diff_right">{ is_diff_line-old }</td>|.
" render line, inverse sides if remote is newer
ro_html->add( '<tr>' ). "#EC NOTEXT
render_line_split_row(
io_html = ro_html
iv_filename = iv_filename
is_diff_line = is_diff_line
iv_index = iv_index
iv_fstate = iv_fstate
iv_old = lv_old
iv_new = lv_new ).
ro_html->add( '</tr>' ). "#EC NOTEXT
ENDMETHOD.
METHOD render_line_split_row.
IF iv_fstate = c_fstate-remote. " Remote file leading changes
io_html->add( iv_old ). " local
io_html->add( iv_new ). " remote
ELSE. " Local leading changes or both were modified
io_html->add( iv_new ). " local
io_html->add( iv_old ). " remote
ENDIF.
ENDMETHOD.
METHOD render_line_unified.
FIELD-SYMBOLS <ls_diff_line> LIKE LINE OF mt_delayed_lines.
CREATE OBJECT ro_html.
" Release delayed subsequent update lines
IF is_diff_line-result <> zif_abapgit_definitions=>c_diff-update.
LOOP AT mt_delayed_lines ASSIGNING <ls_diff_line>.
ro_html->add( '<tr>' ). "#EC NOTEXT
ro_html->add( |<td class="num diff_others" line-num="{ <ls_diff_line>-old_num }"></td>|
&& |<td class="num diff_others" line-num=""></td>|
&& |<td class="mark diff_others">-</td>|
&& |<td class="code diff_del diff_unified">{ <ls_diff_line>-old }</td>| ).
ro_html->add( '</tr>' ). "#EC NOTEXT
ENDLOOP.
LOOP AT mt_delayed_lines ASSIGNING <ls_diff_line>.
ro_html->add( '<tr>' ). "#EC NOTEXT
ro_html->add( |<td class="num diff_others" line-num=""></td>|
&& |<td class="num diff_others" line-num="{ <ls_diff_line>-new_num }"></td>|
&& |<td class="mark diff_others">+</td>|
&& |<td class="code diff_ins diff_others">{ <ls_diff_line>-new }</td>| ).
ro_html->add( '</tr>' ). "#EC NOTEXT
ENDLOOP.
CLEAR mt_delayed_lines.
ENDIF.
ro_html->add( '<tr>' ). "#EC NOTEXT
CASE is_diff_line-result.
WHEN zif_abapgit_definitions=>c_diff-update.
APPEND is_diff_line TO mt_delayed_lines. " Delay output of subsequent updates
WHEN zif_abapgit_definitions=>c_diff-insert.
ro_html->add( |<td class="num diff_others" line-num=""></td>|
&& |<td class="num diff_others" line-num="{ is_diff_line-new_num }"></td>|
&& |<td class="mark diff_others">+</td>|
&& |<td class="code diff_ins diff_others">{ is_diff_line-new }</td>| ).
WHEN zif_abapgit_definitions=>c_diff-delete.
ro_html->add( |<td class="num diff_others" line-num="{ is_diff_line-old_num }"></td>|
&& |<td class="num diff_others" line-num=""></td>|
&& |<td class="mark diff_others">-</td>|
&& |<td class="code diff_del diff_unified">{ is_diff_line-old }</td>| ).
WHEN OTHERS. "none
ro_html->add( |<td class="num diff_others" line-num="{ is_diff_line-old_num }"></td>|
&& |<td class="num diff_others" line-num="{ is_diff_line-new_num }"></td>|
&& |<td class="mark diff_others"> </td>|
&& |<td class="code diff_unified">{ is_diff_line-old }</td>| ).
ENDCASE.
ro_html->add( '</tr>' ). "#EC NOTEXT
ENDMETHOD.
METHOD render_table_head.
CREATE OBJECT ro_html.
ro_html->add( '<thead class="header">' ). "#EC NOTEXT
ro_html->add( '<tr>' ). "#EC NOTEXT
IF mv_unified = abap_true.
render_table_head_unified( ro_html ).
ELSE.
render_table_head_non_unified(
io_html = ro_html
is_diff = is_diff ).
ENDIF.
ro_html->add( '</tr>' ). "#EC NOTEXT
ro_html->add( '</thead>' ). "#EC NOTEXT
ENDMETHOD.
METHOD render_table_head_non_unified.
io_html->add( '<th class="num"></th>' ). "#EC NOTEXT
io_html->add( '<th class="mark"></th>' ). "#EC NOTEXT
io_html->add( '<th>LOCAL</th>' ). "#EC NOTEXT
io_html->add( '<th class="num"></th>' ). "#EC NOTEXT
io_html->add( '<th class="mark"></th>' ). "#EC NOTEXT
io_html->add( '<th>REMOTE</th>' ). "#EC NOTEXT
ENDMETHOD.
METHOD render_table_head_unified.
io_html->add( '<th class="num">old</th>' ). "#EC NOTEXT
io_html->add( '<th class="num">new</th>' ). "#EC NOTEXT
io_html->add( '<th class="mark"></th>' ). "#EC NOTEXT
io_html->add( '<th>code</th>' ). "#EC NOTEXT
ENDMETHOD.
METHOD scripts.
ro_html = super->scripts( ).
ro_html->add( 'restoreScrollPosition();' ).
ro_html->add( 'var gHelper = new DiffHelper({' ).
ro_html->add( | seed: "{ mv_seed }",| ).
ro_html->add( ' ids: {' ).
ro_html->add( ' jump: "jump",' ).
ro_html->add( ' diffList: "diff-list",' ).
ro_html->add( ' filterMenu: "diff-filter",' ).
ro_html->add( ' }' ).
ro_html->add( '});' ).
ro_html->add( 'addMarginBottom();' ).
ro_html->add( 'var gGoJumpPalette = new CommandPalette(enumerateJumpAllFiles, {' ).
ro_html->add( ' toggleKey: "F2",' ).
ro_html->add( ' hotkeyDescription: "Jump to file ..."' ).
ro_html->add( '});' ).
" Feature for selecting ABAP code by column and copy to clipboard
ro_html->add( 'var columnSelection = new DiffColumnSelection();' ).
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
CASE iv_action.
WHEN c_actions-toggle_unified. " Toggle file diplay
mv_unified = zcl_abapgit_persistence_user=>get_instance( )->toggle_diff_unified( ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN OTHERS.
super->zif_abapgit_gui_event_handler~on_event(
EXPORTING
iv_action = iv_action
iv_getdata = iv_getdata
it_postdata = it_postdata
IMPORTING
ei_page = ei_page
ev_state = ev_state ).
ENDCASE.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
26069,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
198,
220,
29244,
6158,
44731,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
7753,
62,
26069,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3108,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
29472,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
26181,
62,
4906,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
26181,
62,
3672,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
5219,
220,
220,
220,
220,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
374,
5219,
220,
220,
220,
220,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
277,
5219,
220,
220,
220,
220,
41876,
1149,
16,
11,
366,
45811,
1181,
532,
2275,
301,
7861,
329,
12238,
611,
82,
198,
220,
220,
220,
220,
220,
220,
220,
267,
62,
26069,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26069,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3421,
62,
1525,
41876,
2124,
549,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
7753,
62,
26069,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
256,
83,
62,
7753,
62,
26069,
41876,
49053,
9795,
43679,
3963,
1259,
62,
7753,
62,
26069,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
44521,
12,
4944,
33866,
8924,
311,
9863,
1961,
35374,
9233,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24301,
1340,
15365,
3108,
29472,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
69,
5219,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1957,
220,
41876,
1149,
16,
26173,
8924,
705,
43,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
6569,
41876,
1149,
16,
26173,
8924,
705,
49,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
1111,
220,
220,
41876,
1149,
16,
26173,
8924,
705,
33,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
69,
5219,
13,
628,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
2539,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
7753,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
7753,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
15252,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
337,
36252,
50,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
62,
30281,
93,
261,
62,
15596,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
42865,
285,
85,
62,
403,
1431,
41876,
450,
499,
62,
30388,
26173,
8924,
450,
499,
62,
7942,
22492,
15285,
62,
32541,
13,
198,
220,
220,
220,
42865,
6941,
62,
260,
7501,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
13,
198,
220,
220,
220,
42865,
45079,
62,
26069,
62,
16624,
41876,
256,
83,
62,
7753,
62,
26069,
764,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
651,
62,
11265,
1143,
62,
69,
3672,
62,
4480,
62,
6978,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
26069,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
7753,
62,
26069,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
34345,
8,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
3487,
1096,
62,
6978,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
6978,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
11265,
1143,
8,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
3487,
1096,
62,
34345,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
34345,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
11265,
1143,
8,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
8543,
62,
11299,
23848,
36,
20032,
17941,
11,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,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_object_ddlx DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
DATA: mo_persistence TYPE REF TO if_wb_object_persist.
PRIVATE SECTION.
METHODS:
get_persistence
RETURNING
VALUE(ri_persistence) TYPE REF TO if_wb_object_persist
RAISING
zcx_abapgit_exception,
clear_fields
CHANGING
cs_data TYPE any,
clear_field
IMPORTING
iv_fieldname TYPE csequence
CHANGING
cs_metadata TYPE any.
ENDCLASS.
CLASS zcl_abapgit_object_ddlx IMPLEMENTATION.
METHOD clear_field.
FIELD-SYMBOLS: <lg_field> TYPE data.
ASSIGN COMPONENT iv_fieldname
OF STRUCTURE cs_metadata
TO <lg_field>.
ASSERT sy-subrc = 0.
CLEAR: <lg_field>.
ENDMETHOD.
METHOD clear_fields.
FIELD-SYMBOLS: <lg_metadata> TYPE any.
ASSIGN COMPONENT 'METADATA'
OF STRUCTURE cs_data
TO <lg_metadata>.
ASSERT sy-subrc = 0.
clear_field( EXPORTING iv_fieldname = 'CHANGED_AT'
CHANGING cs_metadata = <lg_metadata> ).
clear_field( EXPORTING iv_fieldname = 'CHANGED_BY'
CHANGING cs_metadata = <lg_metadata> ).
clear_field( EXPORTING iv_fieldname = 'CREATED_AT'
CHANGING cs_metadata = <lg_metadata> ).
clear_field( EXPORTING iv_fieldname = 'CREATED_BY'
CHANGING cs_metadata = <lg_metadata> ).
clear_field( EXPORTING iv_fieldname = 'RESPONSIBLE'
CHANGING cs_metadata = <lg_metadata> ).
clear_field( EXPORTING iv_fieldname = 'PACKAGE_REF-NAME'
CHANGING cs_metadata = <lg_metadata> ).
clear_field( EXPORTING iv_fieldname = 'CONTAINER_REF-PACKAGE_NAME'
CHANGING cs_metadata = <lg_metadata> ).
ENDMETHOD.
METHOD get_persistence.
TRY.
IF mo_persistence IS NOT BOUND.
CREATE OBJECT mo_persistence
TYPE ('CL_DDLX_ADT_OBJECT_PERSIST').
ENDIF.
CATCH cx_root.
zcx_abapgit_exception=>raise( `DDLX not supported` ).
ENDTRY.
ri_persistence = mo_persistence.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown.
ENDMETHOD.
METHOD zif_abapgit_object~compare_to_remote_version.
CREATE OBJECT ro_comparison_result TYPE zcl_abapgit_comparison_null.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_object_key TYPE seu_objkey,
li_data_model TYPE REF TO if_wb_object_data_model,
lv_text TYPE string,
lx_error TYPE REF TO cx_root.
lv_object_key = ms_item-obj_name.
TRY.
CREATE OBJECT li_data_model TYPE ('CL_DDLX_WB_OBJECT_DATA').
get_persistence( )->delete( p_object_key = lv_object_key
p_version = swbm_version_active ).
CATCH cx_root INTO lx_error.
lv_text = lx_error->get_text( ).
zcx_abapgit_exception=>raise( lv_text ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: li_data_model TYPE REF TO if_wb_object_data_model,
lr_data TYPE REF TO data,
lv_text TYPE string,
lx_error TYPE REF TO cx_root.
FIELD-SYMBOLS: <lg_data> TYPE any.
TRY.
CREATE DATA lr_data
TYPE ('CL_DDLX_WB_OBJECT_DATA=>TY_OBJECT_DATA').
ASSIGN lr_data->* TO <lg_data>.
io_xml->read(
EXPORTING
iv_name = 'DDLX'
CHANGING
cg_data = <lg_data> ).
CREATE OBJECT li_data_model
TYPE ('CL_DDLX_WB_OBJECT_DATA').
li_data_model->set_data( <lg_data> ).
get_persistence( )->save( li_data_model ).
CATCH cx_root INTO lx_error.
lv_text = lx_error->get_text( ).
zcx_abapgit_exception=>raise( lv_text ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_object_key TYPE seu_objkey.
lv_object_key = ms_item-obj_name.
rv_bool = abap_true.
TRY.
get_persistence( )->get( p_object_key = lv_object_key
p_version = swbm_version_active
p_existence_check_only = abap_true ).
CATCH cx_swb_exception.
rv_bool = abap_false.
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-ddic = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~has_changed_since.
rv_changed = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
TRY.
jump_adt( i_obj_name = ms_item-obj_name
i_obj_type = ms_item-obj_type ).
CATCH zcx_abapgit_exception.
zcx_abapgit_exception=>raise( 'DDLX Jump Error' ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lv_object_key TYPE seu_objkey,
li_data_model TYPE REF TO if_wb_object_data_model,
li_persistence TYPE REF TO if_wb_object_persist,
lr_data TYPE REF TO data,
lv_text TYPE string,
lx_error TYPE REF TO cx_root.
FIELD-SYMBOLS: <lg_data> TYPE any.
lv_object_key = ms_item-obj_name.
TRY.
CREATE DATA lr_data
TYPE ('CL_DDLX_WB_OBJECT_DATA=>TY_OBJECT_DATA').
ASSIGN lr_data->* TO <lg_data>.
CREATE OBJECT li_data_model
TYPE ('CL_DDLX_WB_OBJECT_DATA').
li_persistence = get_persistence( ).
li_persistence->get(
EXPORTING
p_object_key = lv_object_key
p_version = swbm_version_active
CHANGING
p_object_data = li_data_model ).
li_data_model->get_data(
IMPORTING
p_data = <lg_data> ).
clear_fields( CHANGING cs_data = <lg_data> ).
io_xml->add( iv_name = 'DDLX'
ig_data = <lg_data> ).
CATCH cx_root INTO lx_error.
lv_text = lx_error->get_text( ).
zcx_abapgit_exception=>raise( lv_text ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'ESDICT'
iv_argument = |{ ms_item-obj_type }{ ms_item-obj_name }| ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
1860,
75,
87,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
628,
220,
220,
220,
42865,
25,
6941,
62,
19276,
13274,
41876,
4526,
37,
5390,
611,
62,
39346,
62,
15252,
62,
19276,
396,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
651,
62,
19276,
13274,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
19276,
13274,
8,
41876,
4526,
37,
5390,
611,
62,
39346,
62,
15252,
62,
19276,
396,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
628,
220,
220,
220,
220,
220,
1598,
62,
25747,
198,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
50115,
62,
7890,
41876,
597,
11,
628,
220,
220,
220,
220,
220,
1598,
62,
3245,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3245,
3672,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
50115,
62,
38993,
220,
41876,
597,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
1860,
75,
87,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1598,
62,
3245,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
75,
70,
62,
3245,
29,
41876,
1366,
13,
628,
220,
220,
220,
24994,
16284,
24301,
1340,
3525,
21628,
62,
3245,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3963,
19269,
18415,
11335,
50115,
62,
38993,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5390,
1279,
75,
70,
62,
3245,
28401,
198,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
628,
220,
220,
220,
30301,
1503,
25,
1279,
75,
70,
62,
3245,
28401,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1598,
62,
25747,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
75,
70,
62,
38993,
29,
41876,
597,
13,
628,
220,
220,
220,
24994,
16284,
24301,
1340,
3525,
705,
47123,
2885,
13563,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3963,
19269,
18415,
11335,
50115,
62,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5390,
1279,
75,
70,
62,
38993,
28401,
198,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
628,
220,
220,
220,
1598,
62,
3245,
7,
7788,
15490,
2751,
21628,
62,
3245,
3672,
796,
705,
3398,
15567,
1961,
62,
1404,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
220,
50115,
62,
38993,
220,
796,
1279,
75,
70,
62,
38993,
29,
6739,
628,
220,
220,
220,
1598,
62,
3245,
7,
7788,
15490,
2751,
21628,
62,
3245,
3672,
796,
705,
3398,
15567,
1961,
62,
17513,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
220,
50115,
62,
38993,
220,
796,
1279,
75,
70,
62,
38993,
29,
6739,
628,
220,
220,
220,
1598,
62,
3245,
7,
7788,
15490,
2751,
21628,
62,
3245,
3672,
796,
705,
43387,
11617,
62,
1404,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
220,
50115,
62,
38993,
220,
796,
1279,
75,
70,
62,
38993,
29,
6739,
628,
220,
220,
220,
1598,
62,
3245,
7,
7788,
15490,
2751,
21628,
62,
3245,
3672,
796,
705,
43387,
11617,
62,
17513,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
220,
50115,
62,
38993,
220,
796,
1279,
75,
70,
62,
38993,
29,
6739,
628,
220,
220,
220,
1598,
62,
3245,
7,
7788,
15490,
2751,
21628,
62,
3245,
3672,
796,
705,
19535,
47,
19213,
34563,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
220,
50115,
62,
38993,
220,
796,
1279,
75,
70,
62,
38993,
29,
6739,
628,
220,
220,
220,
1598,
62,
3245,
7,
7788,
15490,
2751,
21628,
62,
3245,
3672,
796,
705,
47,
8120,
11879,
62,
31688,
12,
20608,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
220,
50115,
62,
38993,
220,
796,
1279,
75,
70,
62,
38993,
29,
6739,
628,
220,
220,
220,
1598,
62,
3245,
7,
7788,
15490,
2751,
21628,
62,
3245,
3672,
796,
705,
10943,
30339,
1137,
62,
31688,
12,
47,
8120,
11879,
62,
20608,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
220,
50115,
62,
38993,
220,
796,
1279,
75,
70,
62,
38993,
29,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
19276,
13274,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
16876,
6941,
62,
19276,
13274,
3180,
5626,
347,
15919,
13,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
6941,
62,
19276,
13274,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
19203,
5097,
62,
16458,
43,
55,
62,
2885,
51,
62,
9864,
23680,
62,
47,
4877,
8808,
27691,
628,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
"! <p class="shorttext synchronized" lang="en">Custom CDS Parser</p>
CLASS zcl_sat_adt_cds_parser DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
TYPES:
BEGIN OF ty_s_datasource_element,
name TYPE string,
alias TYPE string,
type TYPE string,
sql_relation TYPE string,
entity_type TYPE zsat_entity_type,
description TYPE string,
package TYPE string,
owner TYPE string,
END OF ty_s_datasource_element .
TYPES:
ty_t_datasource_element TYPE STANDARD TABLE OF ty_s_datasource_element WITH EMPTY KEY .
TYPES:
BEGIN OF ty_s_datasource_part,
kind TYPE string,
elements TYPE ty_t_datasource_element,
END OF ty_s_datasource_part .
TYPES:
ty_t_datasource_part TYPE STANDARD TABLE OF ty_s_datasource_part WITH EMPTY KEY .
CONSTANTS:
BEGIN OF c_dependency_tree_property,
type TYPE string VALUE 'TYPE',
alias TYPE string VALUE 'ALIAS',
entity_name TYPE string VALUE 'ENTITY_NAME',
relation TYPE string VALUE 'RELATION',
END OF c_dependency_tree_property .
CONSTANTS:
BEGIN OF c_sql_relation,
from TYPE string VALUE 'FROM',
association TYPE string VALUE 'ASSOCIATION',
inner_join TYPE string VALUE 'INNER_JOIN',
left_outer_join TYPE string VALUE 'LEFT_OUTER_JOIN',
right_outer_join TYPE string VALUE 'RIGHT_OUTER_JOIN',
full_outer_join TYPE string VALUE 'FULL_OUTER_JOIN',
cross_join TYPE string VALUE 'CROSS_JOIN',
END OF c_sql_relation .
CONSTANTS:
BEGIN OF c_node_type,
associations TYPE string VALUE 'ASSOCIATIONS',
select TYPE string VALUE 'SELECT',
result TYPE string VALUE 'RESULT',
union TYPE string VALUE 'UNION',
union_all TYPE string VALUE 'UNION_ALL',
END OF c_node_type .
DATA ms_select_element_info TYPE zsat_adt_element_info READ-ONLY .
DATA mv_cds_view TYPE zsat_cds_view_name READ-ONLY .
"! <p class="shorttext synchronized" lang="en">CONSTRUCTOR</p>
METHODS constructor
IMPORTING
!iv_cds TYPE zsat_cds_view_name .
"! <p class="shorttext synchronized" lang="en">Parse CDS View</p>
METHODS parse_cds
IMPORTING
!if_select_part TYPE abap_bool DEFAULT abap_true
if_associations TYPE abap_bool OPTIONAL.
PROTECTED SECTION.
PRIVATE SECTION.
DATA mo_interpreter TYPE REF TO lcl_ddl_stmnt_interpreter .
"! <p class="shorttext synchronized" lang="en">Fills ADT URIs</p>
METHODS fill_adt_uris
IMPORTING
!io_node_helper TYPE REF TO lcl_node_helper .
"! <p class="shorttext synchronized" lang="en">Fill data source descriptions</p>
METHODS fill_datasource_information
IMPORTING
!io_node_helper TYPE REF TO lcl_node_helper .
"! <p class="shorttext synchronized" lang="en">Fill CDS view descriptions</p>
METHODS fill_cds_view_info
IMPORTING
!io_node_helper TYPE REF TO lcl_node_helper .
"! <p class="shorttext synchronized" lang="en">Fill table descriptions</p>
METHODS fill_table_info
IMPORTING
!io_node_helper TYPE REF TO lcl_node_helper .
"! <p class="shorttext synchronized" lang="en">Fill view descriptions</p>
METHODS fill_view_info
IMPORTING
io_node_helper TYPE REF TO lcl_node_helper .
METHODS add_table_function_info
IMPORTING
io_node_helper TYPE REF TO lcl_node_helper.
ENDCLASS.
CLASS zcl_sat_adt_cds_parser IMPLEMENTATION.
METHOD constructor.
mv_cds_view = iv_cds.
ENDMETHOD.
METHOD parse_cds.
DATA: lv_ddlname TYPE ddlname,
lv_entity TYPE zsat_entity_id.
*.. Determine the correct DDL name first
SELECT SINGLE ddlname,
entityid
FROM zsat_p_cdsviewbase
WHERE entityid = @mv_cds_view
OR ddlname = @mv_cds_view
INTO (@lv_ddlname, @lv_entity).
CHECK sy-subrc = 0.
SELECT SINGLE
FROM ddddlsrc
FIELDS *
WHERE ddlname = @lv_ddlname
INTO @DATA(ls_cds).
CHECK sy-subrc = 0.
DATA(lo_parser) = NEW cl_ddl_parser( ).
DATA(lo_stmnt) = lo_parser->parse_cds(
it_sources = VALUE #( ( ls_cds ) )
iv_bitset = cl_ddl_parser=>set_bitmask(
iv_semantic = abap_true
iv_ars_check_off = abap_true
iv_trace = abap_false
iv_locally = abap_false
iv_aiepp = abap_false
iv_extresol = abap_true )
).
DATA(lo_node_helper) = NEW lcl_node_helper(
iv_name = |{ lv_entity }|
iv_entity_name = |{ lv_entity }|
).
IF lo_stmnt IS BOUND.
CASE lo_stmnt->get_type( ).
WHEN cl_qlast_constants=>ddlstmt_type_view_definition.
mo_interpreter = NEW lcl_ddl_view_stmnt_intrpt(
if_associations = if_associations
io_node_helper = lo_node_helper
io_stmnt = CAST cl_qlast_view_definition( lo_stmnt ) ).
WHEN cl_qlast_constants=>ddlstmt_type_tab_func_define.
mo_interpreter = NEW lcl_ddl_tab_func_stmnt_intrpt(
io_node_helper = lo_node_helper
io_stmnt = CAST cl_qlast_tab_func_definition( lo_stmnt ) ).
WHEN cl_qlast_constants=>ddlstmt_type_entity_definition.
ENDCASE.
ENDIF.
IF mo_interpreter IS BOUND.
mo_interpreter->interpret( ).
fill_datasource_information( lo_node_helper ).
fill_adt_uris( lo_node_helper ).
lo_node_helper->convert_node_to_elem_info(
EXPORTING io_node = lo_node_helper->mo_root_node
CHANGING cs_elem_info = ms_select_element_info
).
ENDIF.
ENDMETHOD.
METHOD fill_adt_uris.
TYPES:
BEGIN OF lty_uri,
name TYPE zsat_entity_id,
ddlname TYPE ddlname,
entity_type TYPE zsat_entity_type,
END OF lty_uri.
DATA: lt_uri TYPE STANDARD TABLE OF lty_uri.
FIELD-SYMBOLS: <ls_node> TYPE lcl_node=>ty_s_cached_node.
lt_uri = VALUE #(
( LINES OF VALUE #( FOR cds IN io_node_helper->mt_cds_views ( name = cds-name entity_type = cds-node->entity_type ddlname = cds-node->ddls_name ) ) )
( LINES OF VALUE #( FOR table IN io_node_helper->mt_tables ( name = table-name entity_type = table-node->entity_type ) ) )
( LINES OF VALUE #( FOR view IN io_node_helper->mt_views ( name = view-name entity_type = view-node->entity_type ) ) )
).
SORT lt_uri BY name.
DELETE ADJACENT DUPLICATES FROM lt_uri COMPARING name.
LOOP AT lt_uri INTO DATA(ls_uri).
DATA(ls_adt_object) = zcl_sat_adt_util=>create_adt_uri(
iv_type = ls_uri-entity_type
iv_name = ls_uri-name
iv_name2 = |{ ls_uri-ddlname }|
).
IF ls_uri-entity_type = zif_sat_c_entity_type=>cds_view.
LOOP AT io_node_helper->mt_cds_views ASSIGNING <ls_node> WHERE name = ls_uri-name.
<ls_node>-node->uri = ls_adt_object-uri.
<ls_node>-node->adt_type = ls_adt_object-type.
ENDLOOP.
ELSE.
LOOP AT io_node_helper->mt_tables ASSIGNING <ls_node> WHERE name = ls_uri-name.
<ls_node>-node->uri = ls_adt_object-uri.
<ls_node>-node->adt_type = ls_adt_object-type.
ENDLOOP.
LOOP AT io_node_helper->mt_views ASSIGNING <ls_node> WHERE name = ls_uri-name.
<ls_node>-node->uri = ls_adt_object-uri.
<ls_node>-node->adt_type = ls_adt_object-type.
ENDLOOP.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD fill_datasource_information.
fill_cds_view_info( io_node_helper ).
fill_table_info( io_node_helper ).
fill_view_info( io_node_helper ).
add_table_function_info( io_node_helper ).
ENDMETHOD.
METHOD fill_cds_view_info.
DATA: lt_cds_range TYPE RANGE OF ddstrucobjname.
CHECK io_node_helper->mt_cds_views IS NOT INITIAL.
lt_cds_range = VALUE #( FOR cds IN io_node_helper->mt_cds_views ( sign = 'I' option = 'EQ' low = cds-name ) ).
SELECT entityid,
rawentityid,
ddlname,
viewname,
\_apistate-apistate AS apistate,
sourcetype AS source_type,
developmentpackage,
createdby,
description
FROM zsat_i_cdsentity
WHERE entityid IN @lt_cds_range
OR ddlname IN @lt_cds_range
INTO TABLE @DATA(lt_entity_and_text).
LOOP AT io_node_helper->mt_cds_views ASSIGNING FIELD-SYMBOL(<ls_node>).
ASSIGN lt_entity_and_text[ ddlname = <ls_node>-name ] TO FIELD-SYMBOL(<ls_entity_info>).
IF sy-subrc <> 0.
ASSIGN lt_entity_and_text[ entityid = <ls_node>-name ] TO <ls_entity_info>.
ENDIF.
CHECK sy-subrc = 0.
<ls_node>-name =
<ls_node>-node->name =
<ls_node>-node->entity_name = <ls_entity_info>-entityid.
<ls_node>-node->raw_entity_name = <ls_entity_info>-rawentityid.
<ls_node>-node->ddls_name = <ls_entity_info>-ddlname.
<ls_node>-node->api_state = <ls_entity_info>-apistate.
<ls_node>-node->source_type = <ls_entity_info>-source_type.
<ls_node>-node->description = <ls_entity_info>-description.
<ls_node>-node->owner = <ls_entity_info>-createdby.
<ls_node>-node->package = <ls_entity_info>-developmentpackage.
ENDLOOP.
ENDMETHOD.
METHOD fill_table_info.
DATA: lt_tabname_range TYPE RANGE OF tabname.
CHECK io_node_helper->mt_tables IS NOT INITIAL.
lt_tabname_range = VALUE #( FOR table IN io_node_helper->mt_tables ( sign = 'I' option = 'EQ' low = table-name ) ).
SELECT tablename AS entityid,
tablename AS rawentityid,
developmentpackage,
createdby,
description
FROM zsat_i_databasetable
WHERE tablename IN @lt_tabname_range
INTO TABLE @DATA(lt_entity_and_text).
LOOP AT io_node_helper->mt_tables ASSIGNING FIELD-SYMBOL(<ls_node>).
ASSIGN lt_entity_and_text[ entityid = <ls_node>-name ] TO FIELD-SYMBOL(<ls_entity_info>).
CHECK sy-subrc = 0.
<ls_node>-node->description = <ls_entity_info>-description.
<ls_node>-node->owner = <ls_entity_info>-createdby.
<ls_node>-node->package = <ls_entity_info>-developmentpackage.
ENDLOOP.
ENDMETHOD.
METHOD fill_view_info.
DATA: lt_view_range TYPE RANGE OF viewname.
FIELD-SYMBOLS: <ls_node> TYPE lcl_node=>ty_s_cached_node.
lt_view_range = VALUE #( FOR view IN io_node_helper->mt_views ( sign = 'I' option = 'EQ' low = view-name ) ).
*.. Determine view information
CHECK lt_view_range IS NOT INITIAL.
SELECT entityid,
rawentityid,
ddlname,
viewname,
\_apistate-apistate AS apistate,
sourcetype AS source_type,
developmentpackage,
createdby,
description
FROM zsat_i_cdsentity
WHERE viewname IN @lt_view_range
INTO TABLE @DATA(lt_entity_and_text).
LOOP AT io_node_helper->mt_views ASSIGNING <ls_node>.
ASSIGN lt_entity_and_text[ viewname = <ls_node>-name ] TO FIELD-SYMBOL(<ls_entity_info>).
CHECK sy-subrc = 0.
<ls_node>-name =
<ls_node>-node->name =
<ls_node>-node->entity_name = <ls_entity_info>-entityid.
<ls_node>-node->raw_entity_name = <ls_entity_info>-rawentityid.
<ls_node>-node->entity_type = zif_sat_c_entity_type=>cds_view.
<ls_node>-node->ddls_name = <ls_entity_info>-ddlname.
<ls_node>-node->api_state = <ls_entity_info>-apistate.
<ls_node>-node->source_type = <ls_entity_info>-source_type.
<ls_node>-node->description = <ls_entity_info>-description.
<ls_node>-node->owner = <ls_entity_info>-createdby.
<ls_node>-node->package = <ls_entity_info>-developmentpackage.
*.... move the node to the CDS view tables
io_node_helper->mt_cds_views = VALUE #( BASE io_node_helper->mt_cds_views
( name = <ls_entity_info>-entityid node = <ls_node>-node )
).
DELETE io_node_helper->mt_views.
ENDLOOP.
*.. Fill datasource information for remaining 'true' database views
CHECK io_node_helper->mt_views IS NOT INITIAL.
lt_view_range = VALUE #( FOR view IN io_node_helper->mt_views ( sign = 'I' option = 'EQ' low = view-name ) ).
SELECT viewname AS entityid,
viewname AS rawentityid,
developmentpackage,
createdby,
description
FROM zsat_i_databaseview
WHERE viewname IN @lt_view_range
INTO CORRESPONDING FIELDS OF TABLE @lt_entity_and_text.
CHECK sy-subrc = 0.
LOOP AT io_node_helper->mt_views ASSIGNING <ls_node>.
ASSIGN lt_entity_and_text[ viewname = <ls_node>-name ] TO <ls_entity_info>.
CHECK sy-subrc = 0.
<ls_node>-node->name = <ls_entity_info>-entityid.
<ls_node>-node->raw_entity_name = <ls_entity_info>-rawentityid.
<ls_node>-node->description = <ls_entity_info>-description.
<ls_node>-node->owner = <ls_entity_info>-createdby.
<ls_node>-node->package = <ls_entity_info>-developmentpackage.
ENDLOOP.
ENDMETHOD.
METHOD add_table_function_info.
TYPES:
BEGIN OF lty_s_amdp,
name TYPE ddamdpname,
class TYPE string,
method TYPE string,
uri TYPE string,
type TYPE string,
entities TYPE RANGE OF zsat_entity_id,
END OF lty_s_amdp.
DATA: lt_table_func_cds_range TYPE RANGE OF zsat_entity_id,
lt_class_name_range TYPE RANGE OF seoclsname,
lt_amdp_info TYPE STANDARD TABLE OF lty_s_amdp.
lt_table_func_cds_range = VALUE #( FOR table_function IN io_node_helper->mt_cds_views
WHERE ( node->source_type = zif_sat_c_cds_view_type=>table_function )
( sign = 'I' option = 'EQ' low = table_function-node->entity_name ) ).
CHECK lt_table_func_cds_range IS NOT INITIAL.
SELECT amdp_name AS name,
strucobjn AS entity
FROM ddtbfuncdep
WHERE strucobjn IN @lt_table_func_cds_range
ORDER BY amdp_name
INTO TABLE @DATA(lt_table_func).
CHECK sy-subrc = 0.
lt_amdp_info = CORRESPONDING #( lt_table_func ).
DELETE ADJACENT DUPLICATES FROM lt_amdp_info COMPARING name.
LOOP AT lt_amdp_info ASSIGNING FIELD-SYMBOL(<ls_amdp_info>).
SPLIT <ls_amdp_info>-name AT '=>' INTO <ls_amdp_info>-class <ls_amdp_info>-method.
*.... TODO: use cl_src_adt_res_obj_struc to read the object structure to be able
*.......... to get the ADT URI for the specific AMDP method
DATA(ls_adt_object) = zcl_sat_adt_util=>create_adt_uri(
iv_tadir_type = 'CLAS'
iv_name = CONV #( <ls_amdp_info>-class )
).
lt_class_name_range = VALUE #( BASE lt_class_name_range ( sign = 'I' option = 'EQ' low = <ls_amdp_info>-class ) ).
<ls_amdp_info>-uri = ls_adt_object-uri.
<ls_amdp_info>-type = ls_adt_object-type.
*.... collect range of applicable CDS views for this table function
<ls_amdp_info>-entities = VALUE #( FOR cds IN lt_table_func WHERE ( name = <ls_amdp_info>-name ) ( sign = 'I' option = 'EQ' low = cds-entity ) ).
ENDLOOP.
SELECT clsname,
descript
FROM seoclasstx
WHERE clsname IN @lt_class_name_range
AND langu = @sy-langu
INTO TABLE @DATA(lt_description).
LOOP AT lt_amdp_info ASSIGNING <ls_amdp_info>.
DATA(lv_description) = VALUE #( lt_description[ clsname = <ls_amdp_info>-class ]-descript OPTIONAL ).
LOOP AT io_node_helper->mt_cds_views ASSIGNING FIELD-SYMBOL(<ls_cds_node>) WHERE name IN <ls_amdp_info>-entities.
DATA(lo_amdp_node) = NEW lcl_node( ).
lo_amdp_node->adt_type = <ls_amdp_info>-type.
lo_amdp_node->name = <ls_amdp_info>-class.
lo_amdp_node->raw_entity_name = <ls_amdp_info>-class.
lo_amdp_node->relation = 'FROM'.
lo_amdp_node->description = lv_description.
lo_amdp_node->uri = <ls_amdp_info>-uri.
<ls_cds_node>-node->children = VALUE #( ( lo_amdp_node ) ).
ENDLOOP.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
15022,
327,
5258,
23042,
263,
3556,
79,
29,
198,
31631,
1976,
565,
62,
49720,
62,
324,
83,
62,
66,
9310,
62,
48610,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
82,
62,
19608,
292,
1668,
62,
30854,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
16144,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
44161,
62,
49501,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9312,
62,
4906,
220,
41876,
1976,
49720,
62,
26858,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
6764,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
5301,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4870,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
82,
62,
19608,
292,
1668,
62,
30854,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
83,
62,
19608,
292,
1668,
62,
30854,
41876,
49053,
9795,
43679,
3963,
1259,
62,
82,
62,
19608,
292,
1668,
62,
30854,
13315,
38144,
9936,
35374,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
82,
62,
19608,
292,
1668,
62,
3911,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1611,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4847,
41876,
1259,
62,
83,
62,
19608,
292,
1668,
62,
30854,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
82,
62,
19608,
292,
1668,
62,
3911,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
83,
62,
19608,
292,
1668,
62,
3911,
41876,
49053,
9795,
43679,
3963,
1259,
62,
82,
62,
19608,
292,
1668,
62,
3911,
13315,
38144,
9936,
35374,
764,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
45841,
1387,
62,
21048,
62,
26745,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
25216,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
16144,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
1847,
43429,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
9312,
62,
3672,
41876,
4731,
26173,
8924,
705,
3525,
9050,
62,
20608,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
8695,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
16448,
6234,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
45841,
1387,
62,
21048,
62,
26745,
764,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
25410,
62,
49501,
11,
198,
220,
220,
220,
220,
220,
220,
220,
422,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
10913,
2662,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
8112,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
10705,
4503,
40,
6234,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
8434,
62,
22179,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
1268,
21479,
62,
45006,
1268,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
1364,
62,
39605,
62,
22179,
220,
41876,
4731,
26173,
8924,
705,
2538,
9792,
62,
2606,
5781,
62,
45006,
1268,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
826,
62,
39605,
62,
22179,
41876,
4731,
26173,
8924,
705,
49,
9947,
62,
2606,
5781,
62,
45006,
1268,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
1336,
62,
39605,
62,
22179,
220,
41876,
4731,
26173,
8924,
705,
37,
9994,
62,
2606,
5781,
62,
45006,
1268,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
3272,
62,
22179,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
9419,
18420,
62,
45006,
1268,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
25410,
62,
49501,
764,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
17440,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
15814,
41876,
4731,
26173,
8924,
705,
10705,
4503,
40,
18421,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
2922,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
46506,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
19535,
16724,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
6441,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
4944,
2849,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
6441,
62,
439,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
4944,
2849,
62,
7036,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
17440,
62,
4906,
764,
198,
220,
220,
220,
42865,
13845,
62,
19738,
62,
30854,
62,
10951,
41876,
1976,
49720,
62,
324,
83,
62,
30854,
62,
10951,
20832,
12,
1340,
11319,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
66,
9310,
62,
1177,
41876,
1976,
49720,
62,
66,
9310,
62,
1177,
62,
3672,
20832,
12,
1340,
11319,
764,
628,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
10943,
46126,
1581,
3556,
79,
29,
198,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62
] | [
1,
1,
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------------------------------------------------------------*
*& Report ZDEMO_EXCEL28
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zdemo_excel28.
DATA: lo_excel TYPE REF TO zcl_excel,
lo_excel_writer TYPE REF TO zif_excel_writer,
lo_worksheet TYPE REF TO zcl_excel_worksheet,
lo_column TYPE REF TO zcl_excel_column.
DATA: lv_file TYPE xstring,
lv_bytecount TYPE i,
lt_file_tab TYPE solix_tab.
DATA: lv_full_path TYPE string,
lv_workdir TYPE string,
lv_file_separator TYPE c.
CONSTANTS: lv_default_file_name TYPE string VALUE '28_HelloWorld.csv'.
PARAMETERS: p_path TYPE string.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
cl_gui_frontend_services=>directory_browse( EXPORTING initial_folder = p_path
CHANGING selected_folder = p_path ).
INITIALIZATION.
cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = lv_workdir ).
cl_gui_cfw=>flush( ).
p_path = lv_workdir.
START-OF-SELECTION.
IF p_path IS INITIAL.
p_path = lv_workdir.
ENDIF.
cl_gui_frontend_services=>get_file_separator( CHANGING file_separator = lv_file_separator ).
CONCATENATE p_path lv_file_separator lv_default_file_name INTO lv_full_path.
" Creates active sheet
CREATE OBJECT lo_excel.
" Get active sheet
lo_worksheet = lo_excel->get_active_worksheet( ).
lo_worksheet->set_title( ip_title = 'Sheet1' ).
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Hello world' ).
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = sy-datum ).
lo_worksheet->set_cell( ip_column = 'C' ip_row = 3 ip_value = sy-uzeit ).
lo_column = lo_worksheet->get_column( 'B' ).
lo_column->set_width( 11 ).
lo_worksheet = lo_excel->add_new_worksheet( ).
lo_worksheet->set_title( ip_title = 'Sheet2' ).
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'This is the second sheet' ).
CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_csv.
zcl_excel_writer_csv=>set_delimiter( ip_value = cl_abap_char_utilities=>horizontal_tab ).
zcl_excel_writer_csv=>set_enclosure( ip_value = '''' ).
zcl_excel_writer_csv=>set_endofline( ip_value = cl_abap_char_utilities=>cr_lf ).
zcl_excel_writer_csv=>set_active_sheet_index( i_active_worksheet = 2 ).
* zcl_excel_writer_csv=>set_active_sheet_index_by_name( I_WORKSHEET_NAME = 'Sheet2' ).
lv_file = lo_excel_writer->write_file( lo_excel ).
" Convert to binary
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = lv_file
IMPORTING
output_length = lv_bytecount
TABLES
binary_tab = lt_file_tab.
* " This method is only available on AS ABAP > 6.40
* lt_file_tab = cl_bcs_convert=>xstring_to_solix( iv_xstring = lv_file ).
* lv_bytecount = xstrlen( lv_file ).
" Save the file
REPLACE FIRST OCCURRENCE OF '.csv' IN lv_full_path WITH '_Sheet2.csv'.
cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = lv_bytecount
filename = lv_full_path
filetype = 'BIN'
CHANGING data_tab = lt_file_tab ).
* zcl_excel_writer_csv=>set_active_sheet_index( i_active_worksheet = 2 ).
zcl_excel_writer_csv=>set_active_sheet_index_by_name( i_worksheet_name = 'Sheet1' ).
lv_file = lo_excel_writer->write_file( lo_excel ).
REPLACE FIRST OCCURRENCE OF '_Sheet2.csv' IN lv_full_path WITH '_Sheet1.csv'.
" Convert to binary
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = lv_file
IMPORTING
output_length = lv_bytecount
TABLES
binary_tab = lt_file_tab.
* " This method is only available on AS ABAP > 6.40
* lt_file_tab = cl_bcs_convert=>xstring_to_solix( iv_xstring = lv_file ).
* lv_bytecount = xstrlen( lv_file ).
" Save the file
cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = lv_bytecount
filename = lv_full_path
filetype = 'BIN'
CHANGING data_tab = lt_file_tab ).
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
220,
1168,
39429,
46,
62,
6369,
34,
3698,
2078,
198,
9,
5,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
198,
9,
5,
198,
9,
5,
10097,
30934,
9,
198,
198,
2200,
15490,
1976,
9536,
78,
62,
1069,
5276,
2078,
13,
198,
198,
26947,
25,
2376,
62,
1069,
5276,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
11,
198,
220,
220,
220,
220,
220,
2376,
62,
1069,
5276,
62,
16002,
41876,
4526,
37,
5390,
1976,
361,
62,
1069,
5276,
62,
16002,
11,
198,
220,
220,
220,
220,
220,
2376,
62,
5225,
25473,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
5225,
25473,
11,
198,
220,
220,
220,
220,
220,
2376,
62,
28665,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
28665,
13,
198,
198,
26947,
25,
300,
85,
62,
7753,
220,
220,
220,
220,
220,
41876,
2124,
8841,
11,
198,
220,
220,
220,
220,
220,
300,
85,
62,
26327,
9127,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
300,
83,
62,
7753,
62,
8658,
220,
41876,
1540,
844,
62,
8658,
13,
198,
198,
26947,
25,
300,
85,
62,
12853,
62,
6978,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
300,
85,
62,
1818,
15908,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
300,
85,
62,
7753,
62,
25512,
1352,
41876,
269,
13,
198,
198,
10943,
2257,
1565,
4694,
25,
300,
85,
62,
12286,
62,
7753,
62,
3672,
41876,
4731,
26173,
8924,
705,
2078,
62,
15496,
10603,
13,
40664,
4458,
198,
198,
27082,
2390,
2767,
4877,
25,
279,
62,
6978,
41876,
4731,
13,
198,
198,
1404,
33493,
2849,
12,
6173,
2200,
1677,
6177,
26173,
8924,
12,
2200,
35780,
7473,
279,
62,
6978,
13,
628,
220,
537,
62,
48317,
62,
8534,
437,
62,
30416,
14804,
34945,
62,
25367,
325,
7,
7788,
15490,
2751,
4238,
62,
43551,
220,
796,
279,
62,
6978,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
6163,
62,
43551,
796,
279,
62,
6978,
6739,
198,
198,
1268,
2043,
12576,
14887,
6234,
13,
198,
220,
537,
62,
48317,
62,
8534,
437,
62,
30416,
14804,
1136,
62,
82,
499,
48317,
62,
1818,
15908,
7,
5870,
15567,
2751,
31841,
1818,
15908,
796,
300,
85,
62,
1818,
15908,
6739,
198,
220,
537,
62,
48317,
62,
12993,
86,
14804,
25925,
7,
6739,
198,
220,
279,
62,
6978,
796,
300,
85,
62,
1818,
15908,
13,
198,
198,
2257,
7227,
12,
19238,
12,
46506,
2849,
13,
628,
220,
16876,
279,
62,
6978,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
279,
62,
6978,
796,
300,
85,
62,
1818,
15908,
13,
198,
220,
23578,
5064,
13,
198,
220,
537,
62,
48317,
62,
8534,
437,
62,
30416,
14804,
1136,
62,
7753,
62,
25512,
1352,
7,
5870,
15567,
2751,
2393,
62,
25512,
1352,
796,
300,
85,
62,
7753,
62,
25512,
1352,
6739,
198,
220,
39962,
1404,
1677,
6158,
279,
62,
6978,
300,
85,
62,
7753,
62,
25512,
1352,
300,
85,
62,
12286,
62,
7753,
62,
3672,
39319,
300,
85,
62,
12853,
62,
6978,
13,
628,
220,
366,
7921,
274,
4075,
9629,
198,
220,
29244,
6158,
25334,
23680,
2376,
62,
1069,
5276,
13,
628,
220,
366,
3497,
4075,
9629,
198,
220,
2376,
62,
5225,
25473,
796,
2376,
62,
1069,
5276,
3784,
1136,
62,
5275,
62,
5225,
25473,
7,
6739,
198,
220,
2376,
62,
5225,
25473,
3784,
2617,
62,
7839,
7,
20966,
62,
7839,
796,
705,
3347,
316,
16,
6,
6739,
198,
220,
2376,
62,
5225,
25473,
3784,
2617,
62,
3846,
7,
20966,
62,
28665,
796,
705,
33,
6,
20966,
62,
808,
796,
362,
20966,
62,
8367,
796,
705,
15496,
995,
6,
6739,
198,
220,
2376,
62,
5225,
25473,
3784,
2617,
62,
3846,
7,
20966,
62,
28665,
796,
705,
33,
6,
20966,
62,
808,
796,
513,
20966,
62,
8367,
796,
827,
12,
19608,
388,
6739,
198,
220,
2376,
62,
5225,
25473,
3784,
2617,
62,
3846,
7,
20966,
62,
28665,
796,
705,
34,
6,
20966,
62,
808,
796,
513,
20966,
62,
8367,
796,
827,
12,
84,
2736,
270,
6739,
628,
220,
2376,
62,
28665,
796,
2376,
62,
5225,
25473,
3784,
1136,
62,
28665,
7,
705,
33,
6,
6739,
198,
220,
2376,
62,
28665,
3784,
2617,
62,
10394,
7,
1367,
6739,
628,
220,
2376,
62,
5225,
25473,
796,
2376,
62,
1069,
5276,
3784,
2860,
62,
3605,
62,
5225,
25473,
7,
6739,
198,
220,
2376,
62,
5225,
25473,
3784,
2617,
62,
7839,
7,
20966,
62,
7839,
796,
705,
3347,
316,
17,
6,
6739,
198,
220,
2376,
62,
5225,
25473,
3784,
2617,
62,
3846,
7,
20966,
62,
28665,
796,
705,
33,
6,
20966,
62,
808,
796,
362,
20966,
62,
8367,
796,
705,
1212,
318,
262,
1218,
9629,
6,
6739,
628,
220,
29244,
6158,
25334,
23680,
2376,
62,
1069,
5276,
62,
16002,
41876,
1976,
565,
62,
1069,
5276,
62,
16002,
62,
40664,
13,
198,
220,
1976,
565,
62,
1069,
5276,
62,
16002,
62,
40664,
14804,
2617,
62,
12381,
320,
2676,
7,
20966,
62,
8367,
796,
537,
62,
397,
499,
62,
10641,
62,
315,
2410,
14804,
17899,
38342,
62,
8658,
6739,
198,
220,
1976,
565,
62,
1069,
5276,
62,
16002,
62,
40664,
14804,
2617,
62,
268,
17966,
7,
20966,
62,
8367,
796,
705,
7061,
6,
6739,
198,
220,
1976,
565,
62,
1069,
5276,
62,
16002,
62,
40664,
14804,
2617,
62,
437,
1659,
1370,
7,
20966,
62,
8367,
796,
537,
62,
397,
499,
62,
10641,
62,
315,
2410,
14804,
6098,
62,
1652,
6739,
628,
220,
1976,
565,
62,
1069,
5276,
62,
16002,
62,
40664,
14804,
2617,
62,
5275,
62,
21760,
62,
9630,
7,
1312,
62,
5275,
62,
5225,
25473,
796,
362,
6739,
198,
9,
220,
1976,
565,
62,
1069,
5276,
62,
16002,
62,
40664,
14804,
2617,
62,
5275,
62,
21760,
62,
9630,
62,
1525,
62,
3672,
7,
220,
314,
62,
33249,
9693,
36
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*---------------------------------------------------------------------*
* view related PAI modules
* generation date: 03/21/2021 at 18:29:58
* view maintenance generator version: #001407#
*---------------------------------------------------------------------*
*...processing: PUFLE_TESTV.....................................*
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
| [
9,
10097,
30934,
9,
198,
9,
220,
220,
220,
1570,
3519,
8147,
40,
13103,
198,
9,
220,
220,
5270,
3128,
25,
7643,
14,
2481,
14,
1238,
2481,
379,
1248,
25,
1959,
25,
3365,
198,
9,
220,
220,
1570,
9262,
17301,
2196,
25,
1303,
405,
1415,
2998,
2,
198,
9,
10097,
30934,
9,
198,
9,
986,
36948,
25,
24676,
37,
2538,
62,
51,
6465,
53,
8864,
12359,
9,
198,
9,
10097,
30934,
9,
198,
9,
10097,
30934,
9,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ycl_a2g_json_manualrule DEFINITION
PUBLIC
INHERITING FROM ycl_a2g_jsonbase
CREATE PUBLIC .
PUBLIC SECTION.
"! Build the class
"! @parameter if_msg_manager | message managere where soter alla message triggered by the applicaition
METHODS constructor
IMPORTING if_msg_manager TYPE REF TO yif_a2g_msg_manager.
TYPES: BEGIN OF ty_s_json_manualrule,
groups TYPE ycl_a2g_json_ManualRuleGroup=>ty_t_json_ManualRuleGroup,
END OF ty_s_json_manualrule.
TYPES ty_t_json_manualrule TYPE STANDARD TABLE OF ty_s_json_manualrule WITH NON-UNIQUE DEFAULT KEY.
PROTECTED SECTION.
METHODS generate_rules REDEFINITION.
METHODS rebuild_data REDEFINITION.
METHODS push_data REDEFINITION.
DATA: gs_manualrule TYPE ty_s_json_manualrule.
PRIVATE SECTION.
ENDCLASS.
CLASS ycl_a2g_json_manualrule IMPLEMENTATION.
METHOD push_data.
ENDMETHOD.
METHOD rebuild_data.
ENDMETHOD.
METHOD constructor.
super->constructor( if_msg_manager ).
me->gv_data = REF #( me->gs_manualrule ).
ENDMETHOD.
METHOD generate_rules.
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
805,
723,
25135,
5550,
20032,
17941,
198,
220,
44731,
198,
3268,
16879,
2043,
2751,
16034,
331,
565,
62,
64,
17,
70,
62,
17752,
8692,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
366,
0,
10934,
262,
1398,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
611,
62,
19662,
62,
37153,
930,
3275,
6687,
260,
810,
264,
19543,
477,
64,
3275,
13973,
416,
262,
2161,
64,
653,
198,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
611,
62,
19662,
62,
37153,
41876,
4526,
37,
5390,
331,
361,
62,
64,
17,
70,
62,
19662,
62,
37153,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
82,
62,
17752,
62,
805,
723,
25135,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2628,
220,
220,
220,
41876,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
5124,
723,
31929,
13247,
14804,
774,
62,
83,
62,
17752,
62,
5124,
723,
31929,
13247,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
82,
62,
17752,
62,
805,
723,
25135,
13,
198,
220,
220,
220,
24412,
47,
1546,
1259,
62,
83,
62,
17752,
62,
805,
723,
25135,
41876,
49053,
9795,
43679,
3963,
1259,
62,
82,
62,
17752,
62,
805,
723,
25135,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
7716,
62,
38785,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
17884,
62,
7890,
220,
220,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
4574,
62,
7890,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
13,
628,
220,
220,
220,
42865,
25,
308,
82,
62,
805,
723,
25135,
220,
41876,
1259,
62,
82,
62,
17752,
62,
805,
723,
25135,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
805,
723,
25135,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
4574,
62,
7890,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
17884,
62,
7890,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
611,
62,
19662,
62,
37153,
6739,
198,
220,
220,
220,
502,
3784,
70,
85,
62,
7890,
796,
4526,
37,
1303,
7,
502,
3784,
14542,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ZCL_OO_TUTORIAL_6_TESTER DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES IF_OO_ADT_CLASSRUN.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_OO_TUTORIAL_6_TESTER IMPLEMENTATION.
METHOD IF_OO_ADT_CLASSRUN~MAIN.
SELECT * FROM /DMO/FLIGHT
WHERE CARRIER_ID = `UA`
INTO TABLE @DATA(FLIGHTS).
LOOP AT FLIGHTS REFERENCE INTO DATA(FLIGHT).
TRY.
DATA(FLIGHT_OBJECT) = ZCL_OO_TUTORIAL_6_BASE=>GET_FLIGHT_OBJECT(
CARRIER_ID = FLIGHT->CARRIER_ID
CONNECTION_ID = FLIGHT->CONNECTION_ID
FLIGHT_DATE = FLIGHT->FLIGHT_DATE ).
OUT->WRITE( FLIGHT_OBJECT->GET_FLIGHT_DETAILS( ) ).
OUT->WRITE( FLIGHT_OBJECT->CALCULATE_FLIGHT_PRICE( ) ).
IF FLIGHT->PLANE_TYPE_ID CS ZCL_OO_TUTORIAL_6_BASE=>PLANE_TYPE-B747.
DATA(FLIGHT_747) = CAST ZCL_OO_TUTORIAL_6_747( FLIGHT_OBJECT ).
FLIGHT_747->GET_INFLIGHT_MOVIES( ).
OUT->WRITE( FLIGHT_747->GET_INFLIGHT_MOVIES( ) ).
ENDIF.
OUT->WRITE( ` ` ).
CATCH ZCX_OO_TUTORIAL INTO DATA(CX_FLIGHT).
OUT->WRITE( CX_FLIGHT->GET_TEXT( ) ).
ENDTRY.
ENDLOOP.
if sy-subrc = 0.
endif.
ENDMETHOD.
ENDCLASS.
| [
31631,
1168,
5097,
62,
6684,
62,
51,
3843,
1581,
12576,
62,
21,
62,
51,
1546,
5781,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
16876,
62,
6684,
62,
2885,
51,
62,
31631,
49,
4944,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6684,
62,
51,
3843,
1581,
12576,
62,
21,
62,
51,
1546,
5781,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
16876,
62,
6684,
62,
2885,
51,
62,
31631,
49,
4944,
93,
5673,
1268,
13,
198,
220,
220,
220,
33493,
1635,
16034,
1220,
35,
11770,
14,
3697,
9947,
198,
220,
220,
220,
220,
220,
220,
220,
33411,
17368,
7112,
1137,
62,
2389,
796,
4600,
34970,
63,
198,
220,
220,
220,
220,
220,
220,
220,
39319,
43679,
2488,
26947,
7,
3697,
34874,
737,
628,
220,
220,
220,
17579,
3185,
5161,
9977,
34874,
4526,
24302,
18310,
39319,
42865,
7,
3697,
9947,
737,
198,
220,
220,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
3697,
9947,
62,
9864,
23680,
8,
796,
1168,
5097,
62,
6684,
62,
51,
3843,
1581,
12576,
62,
21,
62,
33,
11159,
14804,
18851,
62,
3697,
9947,
62,
9864,
23680,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17368,
7112,
1137,
62,
2389,
796,
9977,
9947,
3784,
20034,
7112,
1137,
62,
2389,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7102,
45,
24565,
62,
2389,
796,
9977,
9947,
3784,
10943,
45,
24565,
62,
2389,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9977,
9947,
62,
35,
6158,
796,
9977,
9947,
3784,
3697,
9947,
62,
35,
6158,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16289,
3784,
18564,
12709,
7,
9977,
9947,
62,
9864,
23680,
3784,
18851,
62,
3697,
9947,
62,
35,
20892,
45484,
7,
1267,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16289,
3784,
18564,
12709,
7,
9977,
9947,
62,
9864,
23680,
3784,
34,
1847,
34,
6239,
6158,
62,
3697,
9947,
62,
4805,
8476,
7,
1267,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16876,
9977,
9947,
3784,
6489,
30525,
62,
25216,
62,
2389,
9429,
1168,
5097,
62,
6684,
62,
51,
3843,
1581,
12576,
62,
21,
62,
33,
11159,
14804,
6489,
30525,
62,
25216,
12,
33,
48882,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
3697,
9947,
62,
48882,
8,
796,
327,
11262,
1168,
5097,
62,
6684,
62,
51,
3843,
1581,
12576,
62,
21,
62,
48882,
7,
9977,
9947,
62,
9864,
23680,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9977,
9947,
62,
48882,
3784,
18851,
62,
1268,
3697,
9947,
62,
44,
8874,
11015,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16289,
3784,
18564,
12709,
7,
9977,
9947,
62,
48882,
3784,
18851,
62,
1268,
3697,
9947,
62,
44,
8874,
11015,
7,
220,
1267,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16289,
3784,
18564,
12709,
7,
4600,
4600,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
327,
11417,
1168,
34,
55,
62,
6684,
62,
51,
3843,
1581,
12576,
39319,
42865,
7,
34,
55,
62,
3697,
9947,
737,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16289,
3784,
18564,
12709,
7,
220,
327,
55,
62,
3697,
9947,
3784,
18851,
62,
32541,
7,
220,
1267,
6739,
198,
220,
220,
220,
220,
220,
23578,
40405,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
611,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
45762,
13,
628,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_gtt_mia_tm_tools DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS get_tor_root_tor_id
IMPORTING
!iv_key TYPE /bobf/conf_key
RETURNING
VALUE(rv_tor_id) TYPE /scmtms/tor_id .
CLASS-METHODS get_tor_items_for_dlv_items
IMPORTING
!it_lips TYPE zif_gtt_mia_app_types=>tt_lipsvb_key
!iv_tor_cat TYPE /scmtms/tor_category OPTIONAL
EXPORTING
!et_key TYPE /bobf/t_frw_key
!et_fu_item TYPE /scmtms/t_tor_item_tr_k
RAISING
cx_udm_message .
CLASS-METHODS is_fu_relevant
IMPORTING
!it_lips TYPE zif_gtt_mia_app_types=>tt_lipsvb_key
RETURNING
VALUE(rv_result) TYPE abap_bool
RAISING
cx_udm_message .
PROTECTED SECTION.
PRIVATE SECTION.
CLASS-METHODS get_tor_item_selparam_for_lips
IMPORTING
!it_lips TYPE zif_gtt_mia_app_types=>tt_lipsvb_key
EXPORTING
!et_selparam TYPE /bobf/t_frw_query_selparam .
CLASS-METHODS filter_tor_items_by_tor_cat
IMPORTING
!iv_tor_cat TYPE /scmtms/tor_category
CHANGING
!ct_key TYPE /bobf/t_frw_key .
ENDCLASS.
CLASS zcl_gtt_mia_tm_tools IMPLEMENTATION.
METHOD filter_tor_items_by_tor_cat.
DATA: lo_srv_mgr TYPE REF TO /bobf/if_tra_service_manager,
lt_tor_root TYPE /scmtms/t_tor_root_k,
lv_tor_cat TYPE /scmtms/tor_category.
lo_srv_mgr = /bobf/cl_tra_serv_mgr_factory=>get_service_manager(
/scmtms/if_tor_c=>sc_bo_key ).
LOOP AT ct_key ASSIGNING FIELD-SYMBOL(<ls_key>).
TRY.
lo_srv_mgr->retrieve_by_association(
EXPORTING
iv_node_key = /scmtms/if_tor_c=>sc_node-item_tr
it_key = VALUE #( ( <ls_key> ) )
iv_association = /scmtms/if_tor_c=>sc_association-item_tr-to_parent
iv_fill_data = abap_true
IMPORTING
et_data = lt_tor_root ).
CATCH /bobf/cx_frw_contrct_violation.
CLEAR lt_tor_root.
ENDTRY.
lv_tor_cat = VALUE #( lt_tor_root[ 1 ]-tor_cat OPTIONAL ).
IF lv_tor_cat <> iv_tor_cat.
DELETE ct_key.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD get_tor_items_for_dlv_items.
DATA: lo_srv_mgr TYPE REF TO /bobf/if_tra_service_manager,
lo_message TYPE REF TO /bobf/if_frw_message,
lt_altkey TYPE /scmtms/t_base_document_w_item,
lt_selparam TYPE /bobf/t_frw_query_selparam,
lt_key TYPE /bobf/t_frw_key.
CLEAR: et_key[], et_fu_item[].
lo_srv_mgr = /bobf/cl_tra_serv_mgr_factory=>get_service_manager(
/scmtms/if_tor_c=>sc_bo_key ).
lt_altkey = VALUE #(
FOR ls_lips IN it_lips
( base_btd_tco = zif_gtt_mia_app_constants=>cs_base_btd_tco-inb_dlv
base_btd_id = |{ ls_lips-vbeln ALPHA = IN }|
base_btditem_id = |{ ls_lips-posnr ALPHA = IN }|
base_btd_logsys = zcl_gtt_mia_tools=>get_logical_system( ) )
).
get_tor_item_selparam_for_lips(
EXPORTING
it_lips = it_lips
IMPORTING
et_selparam = lt_selparam ).
TRY.
lo_srv_mgr->convert_altern_key(
EXPORTING
iv_node_key = /scmtms/if_tor_c=>sc_node-item_tr
iv_altkey_key = /scmtms/if_tor_c=>sc_alternative_key-item_tr-base_document
it_key = lt_altkey
IMPORTING
et_key = et_key ).
lo_srv_mgr->query(
EXPORTING
iv_query_key = /scmtms/if_tor_c=>sc_query-item_tr-qdb_query_by_attributes
it_selection_parameters = lt_selparam
IMPORTING
et_key = lt_key
).
et_key = VALUE #( BASE et_key
( LINES OF lt_key ) ).
DELETE et_key WHERE key IS INITIAL.
SORT et_key BY key.
DELETE ADJACENT DUPLICATES FROM et_key COMPARING key.
IF iv_tor_cat IS SUPPLIED.
filter_tor_items_by_tor_cat(
EXPORTING
iv_tor_cat = iv_tor_cat
CHANGING
ct_key = et_key ).
ENDIF.
IF et_fu_item IS REQUESTED.
lo_srv_mgr->retrieve(
EXPORTING
iv_node_key = /scmtms/if_tor_c=>sc_node-item_tr
it_key = et_key
iv_fill_data = abap_true
IMPORTING
et_data = et_fu_item ).
ENDIF.
CATCH /bobf/cx_frw_contrct_violation.
ENDTRY.
ENDMETHOD.
METHOD get_tor_item_selparam_for_lips.
DATA: lv_base_btd_id TYPE /scmtms/base_btd_id,
lv_base_btd_item_id TYPE /scmtms/base_btd_item_id.
CLEAR: et_selparam[].
LOOP AT it_lips ASSIGNING FIELD-SYMBOL(<ls_lips>).
lv_base_btd_id = |{ <ls_lips>-vbeln ALPHA = IN }|.
lv_base_btd_item_id = |{ <ls_lips>-posnr ALPHA = IN }|.
et_selparam = VALUE #( BASE et_selparam
(
attribute_name = /scmtms/if_tor_c=>sc_query_attribute-item_tr-qdb_query_by_attributes-base_btd_id
low = lv_base_btd_id
option = 'EQ'
sign = 'I'
)
(
attribute_name = /scmtms/if_tor_c=>sc_query_attribute-item_tr-qdb_query_by_attributes-base_btditem_id
low = lv_base_btd_item_id
option = 'EQ'
sign = 'I'
)
).
ENDLOOP.
ENDMETHOD.
METHOD get_tor_root_tor_id.
DATA: lo_srv_mgr TYPE REF TO /bobf/if_tra_service_manager,
lt_tor_root TYPE /scmtms/t_tor_root_k.
lo_srv_mgr = /bobf/cl_tra_serv_mgr_factory=>get_service_manager(
/scmtms/if_tor_c=>sc_bo_key ).
TRY.
lo_srv_mgr->retrieve(
EXPORTING
iv_node_key = /scmtms/if_tor_c=>sc_node-root
it_key = VALUE #( ( key = iv_key ) )
iv_fill_data = abap_true
it_requested_attributes = VALUE #( ( /scmtms/if_tor_c=>sc_node_attribute-root-tor_id ) )
IMPORTING
et_data = lt_tor_root ).
rv_tor_id = VALUE #( lt_tor_root[ 1 ]-tor_id OPTIONAL ).
CATCH /bobf/cx_frw_contrct_violation.
ENDTRY.
ENDMETHOD.
METHOD is_fu_relevant.
DATA: lt_key TYPE /bobf/t_frw_key.
get_tor_items_for_dlv_items(
EXPORTING
it_lips = it_lips
iv_tor_cat = /scmtms/if_tor_const=>sc_tor_category-freight_unit
IMPORTING
et_key = lt_key ).
rv_result = boolc( lt_key[] IS NOT INITIAL ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
70,
926,
62,
20730,
62,
17209,
62,
31391,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
13165,
62,
15763,
62,
13165,
62,
312,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
10414,
62,
2539,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
13165,
62,
312,
8,
41876,
1220,
1416,
16762,
907,
14,
13165,
62,
312,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
13165,
62,
23814,
62,
1640,
62,
67,
6780,
62,
23814,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
75,
2419,
220,
220,
220,
41876,
1976,
361,
62,
70,
926,
62,
20730,
62,
1324,
62,
19199,
14804,
926,
62,
75,
2419,
85,
65,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
13165,
62,
9246,
41876,
1220,
1416,
16762,
907,
14,
13165,
62,
22872,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
316,
62,
2539,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
83,
62,
8310,
86,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
316,
62,
20942,
62,
9186,
41876,
1220,
1416,
16762,
907,
14,
83,
62,
13165,
62,
9186,
62,
2213,
62,
74,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
463,
76,
62,
20500,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
20942,
62,
49659,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
75,
2419,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
70,
926,
62,
20730,
62,
1324,
62,
19199,
14804,
926,
62,
75,
2419,
85,
65,
62,
2539,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
20274,
8,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
463,
76,
62,
20500,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
13165,
62,
9186,
62,
741,
17143,
62,
1640,
62,
75,
2419,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
75,
2419,
220,
220,
220,
220,
41876,
1976,
361,
62,
70,
926,
62,
20730,
62,
1324,
62,
19199,
14804,
926,
62,
75,
2419,
85,
65,
62,
2539,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
316,
62,
741,
17143,
41876,
1220,
65,
672,
69,
14,
83,
62,
8310,
86,
62,
22766,
62,
741,
17143,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
8106,
62,
13165,
62,
23814,
62,
1525,
62,
13165,
62,
9246,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
13165,
62,
9246,
41876,
1220,
1416,
16762,
907,
14,
13165,
62,
22872,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
310,
62,
2539,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
83,
62,
8310,
86,
62,
2539,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
70,
926,
62,
20730,
62,
17209,
62,
31391,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
8106,
62,
13165,
62,
23814,
62,
1525,
62,
13165,
62,
9246,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
27891,
85,
62,
76,
2164,
220,
41876,
4526,
37,
5390,
1220,
65,
672,
69,
14,
361,
62,
9535,
62,
15271,
62,
37153,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
13165,
62,
15763,
41876,
1220,
1416,
16762,
907,
14,
83,
62,
13165,
62,
15763,
62,
74,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
13165,
62,
9246,
220,
41876,
1220,
1416,
16762,
907,
14,
13165,
62,
22872,
13,
628,
220,
220,
220,
2376,
62,
27891,
85,
62,
76,
2164,
220,
220,
220,
796,
1220,
65,
672,
69,
14,
565,
62,
9535,
62,
3168,
62,
76,
2164,
62,
69,
9548,
14804,
1136,
62,
15271,
62,
37153,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1220,
1416,
16762,
907,
14,
361,
62,
13165,
62,
66,
14804,
1416,
62,
2127,
62,
2539,
6739,
628,
220,
220,
220,
17579,
3185,
5161,
269,
83,
62,
2539,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
7278,
62,
2539,
29,
737,
198,
220,
220,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
27891,
85,
62,
76,
2164,
3784,
1186,
30227,
62,
1525,
62,
562,
41003,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
17440,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
1220,
1416,
16762,
907,
14,
361,
62,
13165,
62,
66,
14804,
1416,
62,
17440,
12,
9186,
62,
2213,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
26173,
8924,
1303,
7,
357,
1279,
7278,
62,
2539,
29,
1267,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_object_xinx DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
METHODS:
constructor
IMPORTING
is_item TYPE zif_abapgit_definitions=>ty_item
iv_language TYPE spras.
PRIVATE SECTION.
TYPES: BEGIN OF ty_extension_index,
dd12v TYPE dd12v,
t_dd17v TYPE STANDARD TABLE OF dd17v
WITH NON-UNIQUE DEFAULT KEY,
END OF ty_extension_index.
DATA:
mv_name TYPE ddobjname,
mv_id TYPE ddobjectid.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_XINX IMPLEMENTATION.
METHOD constructor.
super->constructor( is_item = is_item
iv_language = iv_language ).
cl_wb_object_type=>get_key_components_from_id(
EXPORTING
p_key = |{ ms_item-obj_name }|
p_external_id = swbm_c_type_ddic_db_tabxinx
IMPORTING
p_key_component1 = mv_name
p_key_component2 = mv_id
EXCEPTIONS
too_many_key_components = 1
objecttype_not_existing = 2
OTHERS = 3 ).
ASSERT sy-subrc = 0.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown. " todo
ENDMETHOD.
METHOD zif_abapgit_object~compare_to_remote_version.
CREATE OBJECT ro_comparison_result TYPE zcl_abapgit_comparison_null.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
" RS_DD_INDX_DELETE calls the GUI. Someday we need a better solution
CALL FUNCTION 'RS_DD_INDX_DELETE'
EXPORTING
objname = mv_name
indexname = mv_id
extension = abap_true
EXCEPTIONS
object_not_found = 1
object_not_specified = 2
permission_failure = 3
action_cancelled = 4
OTHERS = 5.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from RS_DD_INDX_DELETE { sy-subrc }| ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_extension_index TYPE ty_extension_index,
lv_rc TYPE sy-subrc.
io_xml->read(
EXPORTING
iv_name = 'XINX'
CHANGING
cg_data = ls_extension_index ).
tadir_insert( iv_package ).
CALL FUNCTION 'DDIF_INDX_PUT'
EXPORTING
name = mv_name
id = mv_id
dd12v_wa = ls_extension_index-dd12v
TABLES
dd17v_tab = ls_extension_index-t_dd17v
EXCEPTIONS
indx_not_found = 1
name_inconsistent = 2
indx_inconsistent = 3
put_failure = 4
put_refused = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from DDIF_INDX_PUT { sy-subrc }| ).
ENDIF.
CALL FUNCTION 'DDIF_INDX_ACTIVATE'
EXPORTING
name = mv_name
id = mv_id
IMPORTING
rc = lv_rc
EXCEPTIONS
not_found = 1
put_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from DDIF_INDX_ACTIVATE { sy-subrc }| ).
ENDIF.
IF lv_rc <> 0.
zcx_abapgit_exception=>raise( |Cannot activate extension index { mv_id } of table { mv_name }| ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_dd12v TYPE dd12v.
CALL FUNCTION 'DDIF_INDX_GET'
EXPORTING
name = mv_name
id = mv_id
IMPORTING
dd12v_wa = lv_dd12v
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
rv_bool = boolc( lv_dd12v IS NOT INITIAL ).
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
ENDMETHOD.
METHOD zif_abapgit_object~has_changed_since.
rv_changed = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ms_item-obj_name
object_type = ms_item-obj_type
in_new_window = abap_true
EXCEPTIONS
not_executed = 1
invalid_object_type = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from RS_TOOL_ACCESS { sy-subrc }| ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_extension_index TYPE ty_extension_index.
CALL FUNCTION 'DDIF_INDX_GET'
EXPORTING
name = mv_name
id = mv_id
langu = sy-langu
IMPORTING
dd12v_wa = ls_extension_index-dd12v
TABLES
dd17v_tab = ls_extension_index-t_dd17v
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from DDIF_INDX_GET { sy-subrc }| ).
ENDIF.
CLEAR: ls_extension_index-dd12v-as4user,
ls_extension_index-dd12v-as4date,
ls_extension_index-dd12v-as4time.
io_xml->add( iv_name = 'XINX'
ig_data = ls_extension_index ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
87,
28413,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
9186,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16129,
41876,
7500,
292,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
2302,
3004,
62,
9630,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49427,
1065,
85,
220,
220,
41876,
49427,
1065,
85,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
62,
1860,
1558,
85,
41876,
49053,
9795,
43679,
3963,
49427,
1558,
85,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
2302,
3004,
62,
9630,
13,
198,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
285,
85,
62,
3672,
41876,
49427,
26801,
3672,
11,
198,
220,
220,
220,
220,
220,
285,
85,
62,
312,
220,
220,
41876,
49427,
15252,
312,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
55,
1268,
55,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
2208,
3784,
41571,
273,
7,
318,
62,
9186,
220,
220,
220,
220,
796,
318,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16129,
796,
21628,
62,
16129,
6739,
628,
220,
220,
220,
537,
62,
39346,
62,
15252,
62,
4906,
14804,
1136,
62,
2539,
62,
5589,
3906,
62,
6738,
62,
312,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
930,
90,
13845,
62,
9186,
12,
26801,
62,
3672,
1782,
91,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
22615,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
1509,
20475,
62,
66,
62,
4906,
62,
1860,
291,
62,
9945,
62,
8658,
87,
28413,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
2539,
62,
42895,
16,
220,
220,
220,
220,
220,
220,
220,
796,
285,
85,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
2539,
62,
42895,
17,
220,
220,
220,
220,
220,
220,
220,
796,
285,
85,
62,
312,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
1165,
62,
21834,
62,
2539,
62,
5589,
3906,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
4906,
62,
1662,
62,
25687,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
513,
6739,
628,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
40985,
62,
1525,
13,
198,
220,
220,
220,
374,
85,
62,
7220,
796,
269,
62,
7220,
62,
34680,
13,
366,
284,
4598,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5589,
533,
62,
1462,
62,
47960,
62,
9641,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
686,
62,
785,
1845,
1653,
62,
20274,
41876,
1976,
565,
62,
397,
499,
18300,
62,
785,
1845,
1653,
62,
8423,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
33678,
13,
628,
220,
220,
220,
366,
19340,
62,
16458,
62,
12115,
55,
62,
7206,
2538,
9328,
3848,
262,
25757,
13,
9995,
23712,
356,
761,
257,
1365,
4610,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
6998,
62,
16458,
62,
12115,
55,
62,
7206,
2538,
9328,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
26181,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
285,
85,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
6376,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
285,
85,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
7552,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
1662,
62,
9275,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
1662,
62,
23599,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
7170,
62,
32165,
495,
220,
220,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
2223,
62,
66,
590,
3353,
220,
220,
220,
220,
796,
604,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ycl_a2g_json_datavalidrule DEFINITION
PUBLIC
INHERITING FROM ycl_a2g_jsonbase
CREATE PUBLIC .
PUBLIC SECTION.
"! Build the class
"! @parameter if_msg_manager | message managere where soter alla message triggered by the applicaition
METHODS constructor
IMPORTING if_msg_manager TYPE REF TO yif_a2g_msg_manager.
TYPES: BEGIN OF ty_s_json_datavalidrule,
condition TYPE ycl_a2g_json_BooleanCondition=>ty_s_json_BooleanCondition,
inputMessage type string,
strict type string,
showCustomUi type string,
END OF ty_s_json_datavalidrule.
TYPES ty_t_json_datavalidrule TYPE STANDARD TABLE OF ty_s_json_datavalidrule WITH NON-UNIQUE DEFAULT KEY.
PROTECTED SECTION.
METHODS generate_rules REDEFINITION.
METHODS rebuild_data REDEFINITION.
METHODS push_data REDEFINITION.
DATA: gs_datavalidrule TYPE ty_s_json_datavalidrule.
PRIVATE SECTION.
ENDCLASS.
CLASS ycl_a2g_json_datavalidrule IMPLEMENTATION.
METHOD push_data.
ENDMETHOD.
METHOD rebuild_data.
ENDMETHOD.
METHOD constructor.
super->constructor( if_msg_manager ).
me->gv_data = REF #( me->gs_datavalidrule ).
ENDMETHOD.
METHOD generate_rules.
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
19608,
9226,
312,
25135,
5550,
20032,
17941,
198,
220,
44731,
198,
3268,
16879,
2043,
2751,
16034,
331,
565,
62,
64,
17,
70,
62,
17752,
8692,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
366,
0,
10934,
262,
1398,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
611,
62,
19662,
62,
37153,
930,
3275,
6687,
260,
810,
264,
19543,
477,
64,
3275,
13973,
416,
262,
2161,
64,
653,
198,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
611,
62,
19662,
62,
37153,
41876,
4526,
37,
5390,
331,
361,
62,
64,
17,
70,
62,
19662,
62,
37153,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
82,
62,
17752,
62,
19608,
9226,
312,
25135,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4006,
220,
41876,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
46120,
13087,
48362,
14804,
774,
62,
82,
62,
17752,
62,
46120,
13087,
48362,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
12837,
2099,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7646,
2099,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
905,
15022,
52,
72,
2099,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
82,
62,
17752,
62,
19608,
9226,
312,
25135,
13,
198,
220,
220,
220,
24412,
47,
1546,
1259,
62,
83,
62,
17752,
62,
19608,
9226,
312,
25135,
41876,
49053,
9795,
43679,
3963,
1259,
62,
82,
62,
17752,
62,
19608,
9226,
312,
25135,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
7716,
62,
38785,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
17884,
62,
7890,
220,
220,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
4574,
62,
7890,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
13,
628,
220,
220,
220,
42865,
25,
308,
82,
62,
19608,
9226,
312,
25135,
220,
41876,
1259,
62,
82,
62,
17752,
62,
19608,
9226,
312,
25135,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
19608,
9226,
312,
25135,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
4574,
62,
7890,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
17884,
62,
7890,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
611,
62,
19662,
62,
37153,
6739,
198,
220,
220,
220,
502,
3784,
70,
85,
62,
7890,
796,
4526,
37,
1303,
7,
502,
3784,
14542,
62,
19608,
9226,
312,
25135,
220,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
7716,
62,
38785,
13,
198,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_apack_helper DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS are_dependencies_met
IMPORTING
!it_dependencies TYPE zif_abapgit_apack_definitions=>ty_dependencies
RETURNING
VALUE(rv_status) TYPE zif_abapgit_definitions=>ty_yes_no
RAISING
zcx_abapgit_exception.
CLASS-METHODS dependencies_popup
IMPORTING
!it_dependencies TYPE zif_abapgit_apack_definitions=>ty_dependencies
RAISING
zcx_abapgit_exception.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_manifest_declaration,
clsname TYPE seometarel-clsname,
devclass TYPE devclass,
END OF ty_manifest_declaration,
ty_manifest_declarations TYPE STANDARD TABLE OF ty_manifest_declaration WITH NON-UNIQUE DEFAULT KEY.
TYPES:
BEGIN OF ty_dependency_status,
met TYPE zif_abapgit_definitions=>ty_yes_no_partial.
INCLUDE TYPE zif_abapgit_apack_definitions=>ty_dependency.
TYPES: END OF ty_dependency_status,
ty_dependency_statuses TYPE STANDARD TABLE OF ty_dependency_status WITH NON-UNIQUE DEFAULT KEY.
CLASS-METHODS get_dependencies_met_status
IMPORTING
!it_dependencies TYPE zif_abapgit_apack_definitions=>ty_dependencies
RETURNING
VALUE(rt_status) TYPE ty_dependency_statuses
RAISING
zcx_abapgit_exception.
CLASS-METHODS get_installed_packages
RETURNING
VALUE(rt_packages) TYPE zif_abapgit_apack_definitions=>ty_descriptors
RAISING
zcx_abapgit_exception.
CLASS-METHODS show_dependencies_popup
IMPORTING
!it_dependencies TYPE ty_dependency_statuses
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_APACK_HELPER IMPLEMENTATION.
METHOD are_dependencies_met.
DATA: lt_dependencies_status TYPE ty_dependency_statuses.
IF it_dependencies IS INITIAL.
rv_status = zif_abapgit_definitions=>gc_yes.
RETURN.
ENDIF.
lt_dependencies_status = get_dependencies_met_status( it_dependencies ).
LOOP AT lt_dependencies_status TRANSPORTING NO FIELDS WHERE met <> 'Y'.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
rv_status = zif_abapgit_definitions=>gc_no.
ELSE.
rv_status = zif_abapgit_definitions=>gc_yes.
ENDIF.
ENDMETHOD.
METHOD dependencies_popup.
DATA: lt_met_status TYPE ty_dependency_statuses.
lt_met_status = get_dependencies_met_status( it_dependencies ).
show_dependencies_popup( lt_met_status ).
ENDMETHOD.
METHOD get_dependencies_met_status.
DATA: lt_installed_packages TYPE zif_abapgit_apack_definitions=>ty_descriptors,
ls_installed_package TYPE zif_abapgit_apack_definitions=>ty_descriptor,
ls_dependecy TYPE zif_abapgit_apack_definitions=>ty_dependency,
ls_dependecy_popup TYPE ty_dependency_status.
IF it_dependencies IS INITIAL.
RETURN.
ENDIF.
lt_installed_packages = get_installed_packages( ).
LOOP AT it_dependencies INTO ls_dependecy.
CLEAR: ls_dependecy_popup.
MOVE-CORRESPONDING ls_dependecy TO ls_dependecy_popup.
READ TABLE lt_installed_packages INTO ls_installed_package
WITH KEY group_id = ls_dependecy-group_id
artifact_id = ls_dependecy-artifact_id.
IF sy-subrc <> 0.
ls_dependecy_popup-met = zif_abapgit_definitions=>gc_no.
ELSE.
TRY.
zcl_abapgit_version=>check_dependant_version( is_current = ls_installed_package-sem_version
is_dependant = ls_dependecy-sem_version ).
ls_dependecy_popup-met = zif_abapgit_definitions=>gc_yes.
CATCH zcx_abapgit_exception.
ls_dependecy_popup-met = zif_abapgit_definitions=>gc_partial.
ENDTRY.
ENDIF.
INSERT ls_dependecy_popup INTO TABLE rt_status.
ENDLOOP.
ENDMETHOD.
METHOD get_installed_packages.
DATA: lo_apack_reader TYPE REF TO zcl_abapgit_apack_reader,
lt_manifest_implementation TYPE ty_manifest_declarations,
ls_manifest_implementation TYPE ty_manifest_declaration,
lo_manifest_provider TYPE REF TO object,
ls_descriptor TYPE zif_abapgit_apack_definitions=>ty_descriptor.
SELECT seometarel~clsname tadir~devclass FROM seometarel "#EC CI_NOORDER
INNER JOIN tadir ON seometarel~clsname = tadir~obj_name "#EC CI_BUFFJOIN
INTO TABLE lt_manifest_implementation
WHERE tadir~pgmid = 'R3TR'
AND tadir~object = 'CLAS'
AND seometarel~version = '1'
AND ( seometarel~refclsname = 'ZIF_APACK_MANIFEST' OR seometarel~refclsname = 'IF_APACK_MANIFEST' ).
LOOP AT lt_manifest_implementation INTO ls_manifest_implementation.
CLEAR: lo_manifest_provider, lo_apack_reader.
TRY.
CREATE OBJECT lo_manifest_provider TYPE (ls_manifest_implementation-clsname).
CATCH cx_sy_create_object_error.
CLEAR: lo_manifest_provider.
ENDTRY.
IF lo_manifest_provider IS NOT BOUND.
CONTINUE.
ENDIF.
lo_apack_reader = zcl_abapgit_apack_reader=>create_instance( ls_manifest_implementation-devclass ).
lo_apack_reader->copy_manifest_descriptor( io_manifest_provider = lo_manifest_provider ).
ls_descriptor = lo_apack_reader->get_manifest_descriptor( ).
IF ls_descriptor IS NOT INITIAL.
INSERT ls_descriptor INTO TABLE rt_packages.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD show_dependencies_popup.
TYPES:
BEGIN OF ty_color_line,
exception(1) TYPE c,
color TYPE lvc_t_scol.
INCLUDE TYPE ty_dependency_status.
TYPES: t_hyperlink TYPE salv_t_int4_column,
END OF ty_color_line.
TYPES: ty_color_tab TYPE STANDARD TABLE OF ty_color_line WITH DEFAULT KEY.
DATA: lo_alv TYPE REF TO cl_salv_table,
lo_functional_settings TYPE REF TO cl_salv_functional_settings,
lo_hyperlinks TYPE REF TO cl_salv_hyperlinks,
lo_column TYPE REF TO cl_salv_column,
lo_column_table TYPE REF TO cl_salv_column_table,
lo_columns TYPE REF TO cl_salv_columns_table,
lt_columns TYPE salv_t_column_ref,
ls_column LIKE LINE OF lt_columns,
lt_color_table TYPE ty_color_tab,
lt_color_negative TYPE lvc_t_scol,
lt_color_normal TYPE lvc_t_scol,
lt_color_positive TYPE lvc_t_scol,
ls_color TYPE lvc_s_scol,
lv_handle TYPE i,
ls_hyperlink TYPE salv_s_int4_column,
lv_hyperlink TYPE service_rl,
lx_ex TYPE REF TO cx_root.
FIELD-SYMBOLS: <ls_line> TYPE ty_color_line,
<ls_dependency> LIKE LINE OF it_dependencies.
IF it_dependencies IS INITIAL.
RETURN.
ENDIF.
CLEAR: ls_color.
ls_color-color-col = col_negative.
APPEND ls_color TO lt_color_negative.
CLEAR: ls_color.
ls_color-color-col = col_normal.
APPEND ls_color TO lt_color_normal.
CLEAR: ls_color.
ls_color-color-col = col_positive.
APPEND ls_color TO lt_color_positive.
TRY.
cl_salv_table=>factory( IMPORTING r_salv_table = lo_alv
CHANGING t_table = lt_color_table ).
lo_functional_settings = lo_alv->get_functional_settings( ).
lo_hyperlinks = lo_functional_settings->get_hyperlinks( ).
lo_columns = lo_alv->get_columns( ).
lt_columns = lo_columns->get( ).
LOOP AT lt_columns INTO ls_column WHERE columnname CP 'SEM_VERSION-*'.
ls_column-r_column->set_technical( ).
ENDLOOP.
lo_column = lo_columns->get_column( 'MET' ).
lo_column->set_technical( ).
lo_column = lo_columns->get_column( 'GROUP_ID' ).
lo_column->set_short_text( 'Org/ProjId' ).
lo_columns->set_color_column( 'COLOR' ).
lo_columns->set_exception_column( 'EXCEPTION' ).
lo_columns->set_hyperlink_entry_column( 'T_HYPERLINK' ).
lo_columns->set_optimize( ).
lo_column = lo_columns->get_column( 'GROUP_ID' ).
lo_column->set_short_text( 'Org/ProjId' ).
lo_column = lo_columns->get_column( 'ARTIFACT_ID' ).
lo_column->set_short_text( 'Proj. Name' ).
lo_column = lo_columns->get_column( 'GIT_URL' ).
lo_column->set_short_text( 'Git URL' ).
lo_column_table ?= lo_column.
lo_column_table->set_cell_type( if_salv_c_cell_type=>link ).
lo_column = lo_columns->get_column( 'VERSION' ).
lo_column->set_short_text( 'Version' ).
lo_column = lo_columns->get_column( 'TARGET_PACKAGE' ).
lo_column->set_technical( ).
lo_hyperlinks = lo_functional_settings->get_hyperlinks( ).
CLEAR: lv_handle, ls_color.
LOOP AT it_dependencies ASSIGNING <ls_dependency>.
lv_handle = lv_handle + 1.
APPEND INITIAL LINE TO lt_color_table ASSIGNING <ls_line>.
MOVE-CORRESPONDING <ls_dependency> TO <ls_line>.
CASE <ls_line>-met.
WHEN zif_abapgit_definitions=>gc_yes.
<ls_line>-color = lt_color_positive.
<ls_line>-exception = '3'.
WHEN zif_abapgit_definitions=>gc_partial.
<ls_line>-color = lt_color_normal.
<ls_line>-exception = '2'.
WHEN zif_abapgit_definitions=>gc_no.
<ls_line>-color = lt_color_negative.
<ls_line>-exception = '1'.
ENDCASE.
CLEAR: ls_hyperlink.
ls_hyperlink-columnname = 'GIT_URL'.
ls_hyperlink-value = lv_handle.
APPEND ls_hyperlink TO <ls_line>-t_hyperlink.
lv_hyperlink = <ls_line>-git_url.
lo_hyperlinks->add_hyperlink( handle = lv_handle
hyperlink = lv_hyperlink ).
ENDLOOP.
UNASSIGN <ls_line>.
lo_alv->set_screen_popup( start_column = 30
end_column = 120
start_line = 10
end_line = 20 ).
lo_alv->get_display_settings( )->set_list_header( 'APACK dependencies' ).
lo_alv->display( ).
CATCH cx_salv_msg cx_salv_not_found cx_salv_data_error cx_salv_existing INTO lx_ex.
zcx_abapgit_exception=>raise( lx_ex->get_text( ) ).
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
499,
441,
62,
2978,
525,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
389,
62,
45841,
3976,
62,
4164,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
45841,
3976,
41876,
1976,
361,
62,
397,
499,
18300,
62,
499,
441,
62,
4299,
50101,
14804,
774,
62,
45841,
3976,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
13376,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
8505,
62,
3919,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
20086,
62,
12924,
929,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
45841,
3976,
41876,
1976,
361,
62,
397,
499,
18300,
62,
499,
441,
62,
4299,
50101,
14804,
774,
62,
45841,
3976,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
805,
8409,
62,
32446,
10186,
11,
198,
220,
220,
220,
220,
220,
220,
220,
537,
82,
3672,
220,
41876,
384,
908,
20318,
12,
565,
82,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1614,
4871,
41876,
1614,
4871,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
805,
8409,
62,
32446,
10186,
11,
198,
220,
220,
220,
220,
220,
1259,
62,
805,
8409,
62,
32446,
24355,
41876,
49053,
9795,
43679,
3963,
1259,
62,
805,
8409,
62,
32446,
10186,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
45841,
1387,
62,
13376,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1138,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
8505,
62,
3919,
62,
47172,
13,
198,
220,
220,
220,
220,
220,
220,
220,
3268,
5097,
52,
7206,
41876,
1976,
361,
62,
397,
499,
18300,
62,
499,
441,
62,
4299,
50101,
14804,
774,
62,
45841,
1387,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
23578,
3963,
1259,
62,
45841,
1387,
62,
13376,
11,
198,
220,
220,
220,
220,
220,
1259,
62,
45841,
1387,
62,
14269,
2664,
41876,
49053,
9795,
43679,
3963,
1259,
62,
45841,
1387,
62,
13376,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
45841,
3976,
62,
4164,
62,
13376,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
45841,
3976,
41876,
1976,
361,
62,
397,
499,
18300,
62,
499,
441,
62,
4299,
50101,
14804,
774,
62,
45841,
3976,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
13376,
8,
41876,
1259,
62,
45841,
1387,
62,
14269,
2664,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
37050,
62,
43789,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
43789,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
499,
441,
62,
4299,
50101,
14804,
774,
62,
20147,
1968,
669,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
905,
62,
45841,
3976,
62,
12924,
929,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
45841,
3976,
41876,
1259,
62,
45841,
1387,
62,
14269,
2664,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
2969,
8120,
62,
39,
3698,
18973,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
389,
62,
45841,
3976,
62,
4164,
13,
628,
220,
220,
220,
42865,
25,
300,
83,
62,
45841,
3976,
62,
13376,
41876,
1259,
62,
45841,
1387,
62,
14269,
2664,
13,
628,
220,
220,
220,
16876,
340,
62,
45841,
3976,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
13376,
796,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
36484,
62,
8505,
13,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
300,
83,
62,
45841,
3976,
62,
13376,
796,
651,
62,
45841,
3976,
62,
4164,
62,
13376,
7,
340,
62,
45841,
3976,
6739,
628,
220,
220,
220,
17579,
3185,
5161,
300,
83,
62,
45841,
3976,
62,
13376,
48213,
4303,
9863,
2751,
8005,
18930,
3698,
5258,
33411,
1138,
1279,
29,
705,
56,
4458,
198,
220,
220,
220,
220,
220,
7788,
2043,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
16876,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
13376,
796,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
36484,
62,
3919,
13,
198,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
13376,
796,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
36484,
62,
8505
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
REPORT z_vari_scan.
********************************************************************************
* See https://github.com/striezl/VariScan
*
* The MIT License (MIT)
*
* Copyright (c) 2020 VariScan Contributers
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
********************************************************************************
DATA: t_varid TYPE TABLE OF varid,
s_varid LIKE LINE OF t_varid,
valuetab TYPE TABLE OF rsparams,
lines TYPE i,
percent TYPE p DECIMALS 2,
match TYPE flag,
devclass TYPE tadir-devclass,
taskmgr TYPE REF TO z_cl_vari_taskmgr,
searchterm TYPE string,
taskid TYPE num8,
columns TYPE REF TO cl_salv_columns_table,
display TYPE REF TO cl_salv_display_settings,
lkey TYPE salv_s_layout_key,
layout TYPE REF TO cl_salv_layout,
auth_badi TYPE REF TO z_vari_auth,
alv TYPE REF TO cl_salv_table,
authorized TYPE flag,
dynsel TYPE string,
blacklist TYPE flag,
auth_missing TYPE abap_bool.
CONSTANTS: ablm_blacklist TYPE string VALUE 'ABLM_BLACKLIST'.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-b01.
SELECT-OPTIONS: so_rep FOR s_varid-report,
so_devcl FOR devclass.
PARAMETERS: p_term(45) OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE TEXT-b02.
PARAMETERS: p_tasks TYPE int1 DEFAULT 5 OBLIGATORY,
p_srvgrp TYPE rfcgr.
SELECTION-SCREEN END OF BLOCK b2.
INITIALIZATION.
* AUTHORITY-CHECK OBJECT 'ZVARI' ID 'ZVARI' FIELD 'X'.
GET BADI auth_badi.
CALL BADI auth_badi->check_authority
RECEIVING
ok = authorized.
IF authorized = abap_false.
MESSAGE e000(z_vari).
ENDIF.
"Default exclusions which have caused problems, e.g. dumps, might differ on various systems
so_rep-option = 'EQ'.
so_rep-sign = 'E'.
so_rep-low = 'RCCARCH3'.
APPEND so_rep.
so_rep-low = 'RPRPAY00'.
APPEND so_rep TO so_rep[].
so_devcl-option = 'CP'.
so_devcl-sign = 'E'.
so_devcl-low = 'PC*'.
APPEND so_devcl.
so_devcl-option = 'EQ'.
so_devcl-low = 'SAPWL_OLD_COLLECTOR'.
APPEND so_devcl.
START-OF-SELECTION.
* SELECT devclass FROM tdevc
* INTO TABLE @DATA(t_devcl)
* WHERE devclass IN @so_devcl.
* LOOP AT t_devcl INTO data(devcl).
* AUTHORITY-CHECK OBJECT 'S_PROGRAM'
* ID 'P_GROUP' FIELD devcl
* ID 'P_ACTION' FIELD 'VARIANT'.
* IF sy-subrc <> 0.
* "
* ENDIF.
* ENDLOOP.
SELECT * FROM varid
INTO TABLE t_varid
WHERE report IN so_rep
ORDER BY report variant.
lines = lines( t_varid ).
CREATE OBJECT taskmgr
EXPORTING
max_tasks = p_tasks.
SELECT COUNT(*) FROM dd02l
WHERE tabname = 'ABLM_BLACKLIST'
AND tabclass = 'TRANSP'.
IF sy-subrc = 0.
blacklist = 'X'.
ENDIF.
LOOP AT t_varid INTO s_varid.
CLEAR: valuetab, match.
IF sy-tabix MOD 10 = 0.
percent = 100 * sy-tabix / lines.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = percent
text = |{ TEXT-000 } { percent }%|.
ENDIF.
DATA secu TYPE trdir-secu.
CLEAR secu.
SELECT SINGLE secu FROM trdir
INNER JOIN tadir ON tadir~object = 'PROG' AND trdir~name = tadir~obj_name
INTO secu
WHERE name = s_varid-report
AND subc = '1'
AND uccheck = 'X'
* AND ( rstat = 'K' OR rstat = 'P' )
AND rstat NE 'S' "Exclude System Programs
AND devclass IN so_devcl.
CHECK sy-subrc = 0.
CALL BADI auth_badi->check_authority_secu
EXPORTING
secu = secu
RECEIVING
ok = authorized.
IF authorized = abap_false.
auth_missing = abap_true.
CONTINUE.
ENDIF.
"This is to avoid dumps in S/4
IF blacklist IS NOT INITIAL.
dynsel = | EXECTYPE = 'PROG' AND EXECNAME = '{ s_varid-report }' |.
SELECT COUNT(*) FROM (ablm_blacklist)
WHERE (dynsel).
CHECK sy-subrc NE 0.
ENDIF.
taskmgr->task_add( p_srvgrp ).
taskid = taskmgr->get_task_id( ).
searchterm = p_term.
CALL FUNCTION 'Z_VARI_SCAN'
STARTING NEW TASK taskid
CALLING taskmgr->task_end ON END OF TASK
EXPORTING
report = s_varid-report
variant = s_varid-variant
searchterm = searchterm.
ENDLOOP.
taskmgr->wait_to_end( ).
IF auth_missing = abap_true.
MESSAGE s001(z_vari) DISPLAY LIKE 'W'.
ENDIF.
* DATA log LIKE LINE OF taskmgr->log_t. "ToDo
* LOOP AT taskmgr->log_t INTO log.
* WRITE: / log-task, log-msg.
* ENDLOOP.
cl_salv_table=>factory(
IMPORTING
r_salv_table = alv
CHANGING
t_table = taskmgr->vari_out_all
).
alv->set_screen_status(
pfstatus = 'ALV1'
report = sy-repid
set_functions = alv->c_functions_all ).
columns ?= alv->get_columns( ).
columns->set_optimize( abap_true ).
display ?= alv->get_display_settings( ).
display->set_striped_pattern( abap_true ).
lkey-report = sy-repid.
layout ?= alv->get_layout( ).
layout->set_key( lkey ).
layout->set_default( abap_true ).
layout->set_save_restriction( ).
alv->display( ).
| [
2200,
15490,
1976,
62,
25641,
62,
35836,
13,
198,
17174,
17174,
8412,
198,
9,
4091,
3740,
1378,
12567,
13,
785,
14,
301,
5034,
48274,
14,
23907,
33351,
198,
9,
198,
9,
383,
17168,
13789,
357,
36393,
8,
198,
9,
198,
9,
15069,
357,
66,
8,
12131,
15965,
33351,
25767,
364,
198,
9,
198,
9,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
9,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
12340,
284,
1730,
198,
9,
287,
262,
10442,
1231,
17504,
11,
1390,
1231,
17385,
262,
2489,
198,
9,
284,
779,
11,
4866,
11,
13096,
11,
20121,
11,
7715,
11,
14983,
11,
850,
43085,
11,
290,
14,
273,
3677,
198,
9,
9088,
286,
262,
10442,
11,
290,
284,
8749,
6506,
284,
4150,
262,
10442,
318,
198,
9,
30760,
284,
466,
523,
11,
2426,
284,
262,
1708,
3403,
25,
198,
9,
198,
9,
383,
2029,
6634,
4003,
290,
428,
7170,
4003,
2236,
307,
3017,
287,
477,
198,
9,
9088,
393,
8904,
16690,
286,
262,
10442,
13,
198,
9,
198,
9,
3336,
47466,
3180,
36592,
2389,
1961,
366,
1921,
3180,
1600,
42881,
34764,
56,
3963,
15529,
509,
12115,
11,
7788,
32761,
6375,
198,
9,
8959,
49094,
11,
47783,
2751,
21728,
5626,
40880,
5390,
3336,
34764,
11015,
3963,
34482,
3398,
1565,
5603,
25382,
11,
198,
9,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
5357,
44521,
1268,
10913,
2751,
12529,
13,
3268,
8005,
49261,
50163,
3336,
198,
9,
37195,
20673,
6375,
27975,
38162,
9947,
367,
15173,
4877,
9348,
43031,
19146,
7473,
15529,
47666,
3955,
11,
29506,
25552,
6375,
25401,
198,
9,
43031,
25382,
11,
7655,
2767,
16879,
3268,
3537,
40282,
3963,
27342,
10659,
11,
309,
9863,
6375,
25401,
54,
24352,
11,
5923,
1797,
2751,
16034,
11,
198,
9,
16289,
3963,
6375,
3268,
7102,
45,
24565,
13315,
3336,
47466,
6375,
3336,
23210,
6375,
25401,
5550,
1847,
20754,
3268,
3336,
198,
9,
47466,
13,
198,
17174,
17174,
8412,
198,
198,
26947,
25,
256,
62,
7785,
312,
220,
220,
220,
220,
220,
41876,
43679,
3963,
1401,
312,
11,
198,
220,
220,
220,
220,
220,
264,
62,
7785,
312,
220,
220,
220,
220,
220,
34178,
48920,
3963,
256,
62,
7785,
312,
11,
198,
220,
220,
220,
220,
220,
1188,
84,
316,
397,
220,
220,
220,
220,
41876,
43679,
3963,
44608,
37266,
11,
198,
220,
220,
220,
220,
220,
3951,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
1411,
220,
220,
220,
220,
220,
41876,
279,
27196,
3955,
23333,
362,
11,
198,
220,
220,
220,
220,
220,
2872,
220,
220,
220,
220,
220,
220,
220,
41876,
6056,
11,
198,
220,
220,
220,
220,
220,
1614,
4871,
220,
220,
220,
220,
41876,
36264,
343,
12,
7959,
4871,
11,
198,
220,
220,
220,
220,
220,
4876,
76,
2164,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
62,
565,
62,
25641,
62,
35943,
76,
2164,
11,
198,
220,
220,
220,
220,
220,
2989,
4354,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
4876,
312,
220,
220,
220,
220,
220,
220,
41876,
997,
23,
11,
198,
220,
220,
220,
220,
220,
15180,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
537,
62,
21680,
85,
62,
28665,
82,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
3359,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
537,
62,
21680,
85,
62,
13812,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
300,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
220,
220,
220,
220,
220,
220,
220,
24143,
62,
82,
62,
39786,
62,
2539,
11,
198,
220,
220,
220,
220,
220,
12461,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
537,
62,
21680,
85,
62,
39786,
11,
198,
220,
220,
220,
220,
220,
6284,
62,
65,
9189,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
62,
25641,
62,
18439,
11,
198,
220,
220,
220,
220,
220,
435,
85,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
537,
62,
21680,
85,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
10435,
220,
220,
41876,
6056,
11,
198,
220,
220,
220,
220,
220,
37860,
741,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
38810,
220,
220,
220,
41876,
6056,
11,
198,
220,
220,
220,
220,
220,
6284,
62,
45688,
41876,
450,
499,
62,
30388,
13,
198,
198,
10943,
2257,
1565,
4694,
25,
46624,
76,
62,
13424,
4868,
41876,
4731,
26173,
8924,
705,
6242,
31288,
62,
9148,
8120,
45849,
4458,
198,
198,
46506,
2849,
12,
6173,
2200,
1677,
347,
43312,
3963,
9878,
11290,
275,
16,
13315,
8782,
10067,
37977,
2538,
40383,
12,
65,
486,
13,
198,
46506,
12,
3185,
51,
11053,
25,
523,
62,
7856,
7473,
264,
62,
7785,
312,
12,
13116,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
523,
62,
7959,
565,
7473,
1614,
4871,
13,
198,
27082,
2390,
2767,
4877,
25,
279,
62,
4354,
7,
2231,
8,
440,
9148,
3528,
1404,
15513,
13,
198,
46506,
2849,
12,
6173,
2200,
1677,
23578,
3963,
9878,
11290,
275,
16,
13,
198,
46506,
2849,
12,
6173,
2200,
1677,
347,
43312,
3963,
9878,
11290,
275,
17,
13315,
8782,
10067,
37977,
2538,
40383,
12,
65,
2999,
13,
198,
27082,
2390,
2767,
4877,
25,
279,
62,
83,
6791,
220,
41876,
493,
16,
5550,
38865,
642,
440,
9148,
3528,
1404,
15513,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
62,
27891,
85,
2164,
79,
41876,
374,
16072,
2164,
13,
198,
46506,
2849,
12,
6173,
2200,
1677,
23578,
3963,
9878,
11290,
275,
17,
13,
198,
198,
1268,
2043,
12576,
14887,
6234,
13,
198,
198,
9,
220,
44746,
9050,
12,
50084,
25334,
23680,
705,
57,
53,
33604,
6,
4522,
705,
57,
53,
33604,
6,
18930,
24639,
705,
55,
4458,
198,
220,
17151,
33934,
40,
6284,
62,
65,
9189,
13,
198,
220,
42815,
33934,
40,
6284,
62,
65,
9189,
3784,
9122,
62,
9800,
414,
198,
220,
220,
220,
19644,
36,
3824,
2751,
198,
220,
220,
220,
220,
220,
12876,
796,
10435,
13,
198,
220,
16876,
10435,
796,
450,
499
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_object_ecsd DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_object_ecatt_super
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS:
constructor
IMPORTING
!is_item TYPE zif_abapgit_definitions=>ty_item
!iv_language TYPE spras.
PROTECTED SECTION.
METHODS:
get_object_type REDEFINITION,
get_upload REDEFINITION,
get_download REDEFINITION.
ENDCLASS.
CLASS zcl_abapgit_object_ecsd IMPLEMENTATION.
METHOD constructor.
super->constructor( is_item = is_item
iv_language = iv_language ).
ENDMETHOD.
METHOD get_object_type.
rv_object_type = cl_apl_ecatt_const=>obj_type_system_data.
ENDMETHOD.
METHOD get_upload.
CREATE OBJECT ro_upload TYPE zcl_abapgit_ecatt_system_upl.
ENDMETHOD.
METHOD get_download.
CREATE OBJECT ro_download TYPE zcl_abapgit_ecatt_system_downl.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
721,
21282,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
721,
1078,
62,
16668,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
9186,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
16129,
41876,
7500,
292,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
651,
62,
15252,
62,
4906,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
651,
62,
25850,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
651,
62,
15002,
23848,
36,
20032,
17941,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
721,
21282,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
2208,
3784,
41571,
273,
7,
318,
62,
9186,
220,
220,
220,
220,
796,
318,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16129,
796,
21628,
62,
16129,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
15252,
62,
4906,
13,
628,
220,
220,
220,
374,
85,
62,
15252,
62,
4906,
796,
537,
62,
64,
489,
62,
721,
1078,
62,
9979,
14804,
26801,
62,
4906,
62,
10057,
62,
7890,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
25850,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
686,
62,
25850,
41876,
1976,
565,
62,
397,
499,
18300,
62,
721,
1078,
62,
10057,
62,
84,
489,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
15002,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
686,
62,
15002,
41876,
1976,
565,
62,
397,
499,
18300,
62,
721,
1078,
62,
10057,
62,
2902,
75,
13,
628,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ZCL_BOOK_DYN_SELSCR definition
public
final
create public .
*"* public components of class ZCL_BOOK_DYN_SELSCR
*"* do not include other source files here!!!
public section.
type-pools SYDB0 .
class-methods DYN_SCREEN_PBO
importing
!IV_DYNNR type SYDYNNR optional
!IS_DYN_FIELD_SETTINGS type ZBOOK_DYN_SELSCR_FIELDS
preferred parameter IV_DYNNR .
class-methods REFRESH_DYN_SCREEN
importing
!IV_REPID type SYREPID default SY-CPROG
!IV_DYNNR type SYDYNNR optional
!IV_DYN_SELSCR_FIELDS type ZBOOK_DYN_SELSCR_FIELDS optional
preferred parameter IV_REPID .
protected section.
*"* protected components of class ZCL_BOOK_TICKET_DYN_SELSCR
*"* do not include other source files here!!!
private section.
*"* private components of class ZCL_BOOK_DYN_SELSCR
*"* do not include other source files here!!!
types:
BEGIN OF gty_screen_progs,
program LIKE sy-repid,
ldbpg LIKE sy-ldbpg, " Datenbankprogramm
variprog LIKE sy-repid, " Variantenprogramm
after_first_pbo(1) TYPE c, " Erstes PBO vorbei
restrict_set(1) TYPE c, " Einmal Restriktionen gesetzt
title LIKE sy-title, " Standardtitel
any_variants(1) TYPE c,
submode(2) TYPE c,
status_submode(2) TYPE c,
dynsel(1) TYPE c,
report_writer(1) TYPE c, " SPEZIALVARIANTENPFLEGE REPORTWRITER.
sscr TYPE STANDARD TABLE OF rsscr WITH NON-UNIQUE DEFAULT KEY,
dynref TYPE STANDARD TABLE OF sydb0_dynref WITH NON-UNIQUE DEFAULT KEY,
texts TYPE STANDARD TABLE OF rsseltexts WITH NON-UNIQUE DEFAULT KEY,
* modtext type sydb0_modtext occurs 0,
hash(10) TYPE c,
END OF gty_screen_progs .
types:
gtyt_rsscr TYPE STANDARD TABLE OF rsscr WITH NON-UNIQUE DEFAULT KEY .
class-data GT_FIRST_RSSCR type GTYT_RSSCR .
class-data GS_FIRST_SCREEN_PROG type GTY_SCREEN_PROGS .
class-data GS_LAST_DYN_FIELDS type ZBOOK_DYN_SELSCR_FIELDS .
ENDCLASS.
CLASS ZCL_BOOK_DYN_SELSCR IMPLEMENTATION.
METHOD dyn_screen_pbo.
* Liste aufbauen, welche Parameter belegt sind und damit angezeigt weden sollen
TYPES: BEGIN OF lty_used_dynfields,
group1 TYPE screen-group1,
used TYPE flag,
END OF lty_used_dynfields.
DATA: lth_used_dynfields TYPE HASHED TABLE OF lty_used_dynfields WITH UNIQUE KEY group1,
ls_used_dynfield LIKE LINE OF lth_used_dynfields.
DATA: lo_structdescr TYPE REF TO cl_abap_structdescr.
FIELD-SYMBOLS: <lv_component> LIKE LINE OF lo_structdescr->components,
<ls_used_dynfield> LIKE LINE OF lth_used_dynfields,
<lv_fieldname> TYPE zbook_dyn_selscr_fields-p_dyn01.
*--------------------------------------------------------------------*
* Für die sehr kurze Struktur mit 4 Parametern und 4 SelOpts könnte man das hier
* jetzt auch hart codieren - aber falls das mal erweitert werden soll bzw. um
* die RTTI zu zeigen kann das auch gleich allgemein erledigt werden
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* Die "simple" Methode hier auskommentiert als Beispiel,
* falls das für das Buch schöner sein sollte
*--------------------------------------------------------------------*
* if is_DYN_field_settings-p_dyn01 is not INITIAL.
* insert 'P01' into table lth_used.
* endif.
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* Strukturbeschreibung der dynamischen Feldnamenstruktur holen
*--------------------------------------------------------------------*
lo_structdescr ?= cl_abap_structdescr=>describe_by_data( is_dyn_field_settings ).
LOOP AT lo_structdescr->components ASSIGNING <lv_component>.
*--------------------------------------------------------------------*
* Prüfen, ob das Feld belegt ist - theor. könnte man auch noch prüfen ob das Feld existiert (DD03L)
*--------------------------------------------------------------------*
CLEAR ls_used_dynfield.
CONCATENATE <lv_component>-name(1) <lv_component>-name+5(2) " Alle Felder haben die Form "P_DYNxx" oder "S_DYNxx" mit korrespondierenden
INTO ls_used_dynfield-group1. " Screen-Group1-Belegung "Pxx" oder "Sxx"
INSERT ls_used_dynfield INTO TABLE lth_used_dynfields ASSIGNING <ls_used_dynfield>.
CHECK sy-subrc = 0. " Duplikate werden ignoriert - sollten auch nicht vorkommen
ASSIGN COMPONENT <lv_component>-name OF STRUCTURE is_dyn_field_settings TO <lv_fieldname>. " Jetzt die Belegung des Feldes überprüfen
CHECK sy-subrc = 0. " sollte immer = 0 sein, da die RTTI ja gerade diese Struktur gelesen hat
CHECK <lv_fieldname> IS NOT INITIAL. " Feld belegt --> es muss angezeigt werden
<ls_used_dynfield>-used = 'X'.
ENDLOOP.
LOOP AT SCREEN.
READ TABLE lth_used_dynfields ASSIGNING <ls_used_dynfield> WITH TABLE KEY group1 = screen-group1.
CHECK sy-subrc = 0. " Das Feld ist eins der dynamischen Felder
CHECK <ls_used_dynfield>-used = ' '. " Aber es ist nicht belegt --> ausblenden
screen-input = 0.
screen-invisible = 1.
MODIFY SCREEN.
ENDLOOP.
ENDMETHOD.
METHOD refresh_dyn_screen.
DATA: lv_repid TYPE syrepid,
lt_rsccr LIKE gt_first_rsscr,
ls_this_screen_prog LIKE gs_first_screen_prog.
*--------------------------------------------------------------------*
* Beim 1. Durchlaufen des AT-SELECTION-SCREEN OUTPUT hat ABAP die Dyn.
* Parameter noch nicht gesetzt. Dieses jungfräuliche Layout wird
* gepuffert um beim Wechsel der dyn. Selectionsfelder SAP zu zwingen
* den Dynpro neu aufzubauen.
*--------------------------------------------------------------------*
IF gt_first_rsscr IS INITIAL.
* Save dynamic screen without any replacementes so far
PERFORM set_things_4_sub_v IN PROGRAM rsdbrunt IF FOUND
TABLES gt_first_rsscr
USING lv_repid
gs_first_screen_prog.
*--------------------------------------------------------------------*
* Falls sich die Belegung der dyn. Felder geändert hat muss jetzt
* die gepufferte Version zurückgeschrieben werden
* ACHTUNG - Hier muss ich nochmal umstellen auf instanziierte Version
* oder über statische Tabelle für alle Dynpros
* Das hier erst mal zum Testen, ob das überhaupt funktioniert.
*--------------------------------------------------------------------*
ELSEIF iv_dyn_selscr_fields <> gs_last_dyn_fields OR
iv_dyn_selscr_fields IS NOT SUPPLIED. " Force refresh
* Reset dynamic screen to version without any replacementes
PERFORM set_things_4_sub_v IN PROGRAM rsdbrunt IF FOUND
TABLES lt_rsccr
USING lv_repid
ls_this_screen_prog.
CHECK ls_this_screen_prog IS NOT INITIAL.
PERFORM reset_dynref IN PROGRAM rsdbrunt IF FOUND.
PERFORM set_things_4_sub_v IN PROGRAM rsdbrunt IF FOUND
TABLES lt_rsccr
USING lv_repid
ls_this_screen_prog.
PERFORM restore_things_from_sub_v IN PROGRAM rsdbrunt IF FOUND
TABLES gt_first_rsscr
USING lv_repid
gs_first_screen_prog.
ENDIF.
IF iv_dyn_selscr_fields IS SUPPLIED.
gs_last_dyn_fields = iv_dyn_selscr_fields.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
5097,
62,
39453,
62,
35,
40760,
62,
50,
3698,
6173,
49,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
1171,
764,
198,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1168,
5097,
62,
39453,
62,
35,
40760,
62,
50,
3698,
6173,
49,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
11377,
2665,
13,
198,
220,
2099,
12,
7742,
82,
19704,
11012,
15,
764,
628,
220,
1398,
12,
24396,
82,
360,
40760,
62,
6173,
2200,
1677,
62,
47,
8202,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
35,
56,
6144,
49,
2099,
19704,
35,
56,
6144,
49,
11902,
198,
220,
220,
220,
220,
220,
5145,
1797,
62,
35,
40760,
62,
44603,
62,
28480,
51,
20754,
2099,
1168,
39453,
62,
35,
40760,
62,
50,
3698,
6173,
49,
62,
11674,
3698,
5258,
198,
220,
220,
220,
9871,
11507,
8363,
62,
35,
56,
6144,
49,
764,
198,
220,
1398,
12,
24396,
82,
4526,
10913,
44011,
62,
35,
40760,
62,
6173,
2200,
1677,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
35316,
2389,
2099,
19704,
35316,
2389,
4277,
19704,
12,
34,
4805,
7730,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
35,
56,
6144,
49,
2099,
19704,
35,
56,
6144,
49,
11902,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
35,
40760,
62,
50,
3698,
6173,
49,
62,
11674,
3698,
5258,
2099,
1168,
39453,
62,
35,
40760,
62,
50,
3698,
6173,
49,
62,
11674,
3698,
5258,
11902,
198,
220,
220,
220,
9871,
11507,
8363,
62,
35316,
2389,
764,
198,
24326,
2665,
13,
198,
9,
1,
9,
6861,
6805,
286,
1398,
1168,
5097,
62,
39453,
62,
51,
11860,
2767,
62,
35,
40760,
62,
50,
3698,
6173,
49,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
19734,
2665,
13,
198,
9,
1,
9,
2839,
6805,
286,
1398,
1168,
5097,
62,
39453,
62,
35,
40760,
62,
50,
3698,
6173,
49,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
628,
220,
3858,
25,
198,
220,
220,
220,
347,
43312,
3963,
308,
774,
62,
9612,
62,
1676,
14542,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1430,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34178,
827,
12,
7856,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
9945,
6024,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34178,
827,
12,
335,
65,
6024,
11,
220,
220,
220,
220,
220,
220,
220,
220,
366,
16092,
268,
17796,
23065,
76,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1401,
541,
3828,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34178,
827,
12,
7856,
312,
11,
220,
220,
220,
220,
220,
220,
220,
220,
366,
38215,
268,
23065,
76,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
706,
62,
11085,
62,
79,
2127,
7,
16,
8,
220,
220,
41876,
269,
11,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
5256,
301,
274,
350,
8202,
410,
273,
1350,
72,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4239,
62,
2617,
7,
16,
8,
220,
220,
220,
220,
220,
41876,
269,
11,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
412,
259,
7617,
8324,
12602,
5378,
268,
308,
274,
23773,
83,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3670,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34178,
827,
12,
7839,
11,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8997,
83,
270,
417,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
597,
62,
25641,
1187,
7,
16,
8,
220,
220,
220,
220,
220,
41876,
269,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
850,
14171,
7,
17,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3722,
62,
7266,
14171,
7,
17,
8,
220,
220,
220,
41876,
269,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37860,
741,
7,
16,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
989,
62,
16002,
7,
16,
8,
220,
220,
220,
220,
41876,
269,
11,
220,
220,
220,
220,
220,
220,
220,
220,
366,
6226,
36,
57,
12576,
53,
33604,
8643,
1677,
42668,
2538,
8264,
39099,
18564,
2043,
1137,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
1416,
81,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
374,
824,
6098,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37860,
5420,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
827,
9945,
15,
62,
67,
2047,
5420,
220,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13399,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
44608,
741,
5239,
82,
220,
220,
220,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
11,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
953,
5239,
2099,
827,
9945,
15,
62,
4666,
5239,
8833,
657,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12234,
7,
940,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
220,
220,
3963,
308,
774,
62,
9612,
62,
1676,
14542,
764,
198,
220,
3858
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
INTERFACE zif_dbbr_jumplist_var_ids
PUBLIC .
CONSTANTS:
"! Type - ZDBBR_jumpdest_data_ui_itab
c_t_jumpfields TYPE string VALUE 'GT_JUMPFIELDS',
"! Type - ZDBBR_jumpdest_data_ui
c_s_jumpfield TYPE string VALUE 'GS_JUMPFIELD',
"! Type - ZDBBR_jumpparam_data_ui_itab
c_t_params TYPE string VALUE 'GT_PARAMS',
"! Type - ZDBBR_jumpparam_data_ui
c_s_param TYPE string VALUE 'GS_PARAM',
"! Type - cxtab_control
c_jump_fields_tc TYPE string VALUE 'JUMP_FIELDS_TC',
"! Type - cxtab_control
c_params_tc TYPE string VALUE 'PARAMS_TC',
"! Type - ZDBBR_button
c_bt_param_details TYPE string VALUE 'PARAM_DETAILS',
c_r_jumplist_controller TYPE string VALUE 'GR_JUMPLIST_CONTROLLER' ##NO_text,
c_r_jumplist_table TYPE string VALUE 'GR_JUMPLIST_TABLE' ##NO_TEXT,
c_r_jumplist_param_controller TYPE string VALUE 'GR_JUMPLIST_PARAM_CONTROLLER' ##no_text,
c_r_jumplist_param_table TYPE string VALUE 'GR_JUMPLIST_PARAM_TABLE' ##NO_text
.
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
9945,
1671,
62,
73,
388,
489,
396,
62,
7785,
62,
2340,
198,
220,
44731,
764,
198,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
366,
0,
5994,
532,
1168,
11012,
11473,
62,
43327,
16520,
62,
7890,
62,
9019,
62,
270,
397,
198,
220,
220,
220,
269,
62,
83,
62,
43327,
25747,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
19555,
62,
41,
20476,
11674,
3698,
5258,
3256,
198,
220,
220,
220,
366,
0,
5994,
532,
1168,
11012,
11473,
62,
43327,
16520,
62,
7890,
62,
9019,
198,
220,
220,
220,
269,
62,
82,
62,
43327,
3245,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
14313,
62,
41,
20476,
44603,
3256,
198,
220,
220,
220,
366,
0,
5994,
532,
1168,
11012,
11473,
62,
73,
388,
381,
41158,
62,
7890,
62,
9019,
62,
270,
397,
198,
220,
220,
220,
269,
62,
83,
62,
37266,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
19555,
62,
27082,
40834,
3256,
198,
220,
220,
220,
366,
0,
5994,
532,
1168,
11012,
11473,
62,
73,
388,
381,
41158,
62,
7890,
62,
9019,
198,
220,
220,
220,
269,
62,
82,
62,
17143,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
14313,
62,
27082,
2390,
3256,
198,
220,
220,
220,
366,
0,
5994,
532,
269,
742,
397,
62,
13716,
198,
220,
220,
220,
269,
62,
43327,
62,
25747,
62,
23047,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
41,
20476,
62,
11674,
3698,
5258,
62,
4825,
3256,
198,
220,
220,
220,
366,
0,
5994,
532,
269,
742,
397,
62,
13716,
198,
220,
220,
220,
269,
62,
37266,
62,
23047,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
27082,
40834,
62,
4825,
3256,
198,
220,
220,
220,
366,
0,
5994,
532,
1168,
11012,
11473,
62,
16539,
198,
220,
220,
220,
269,
62,
18347,
62,
17143,
62,
36604,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
27082,
2390,
62,
35,
20892,
45484,
3256,
628,
220,
220,
220,
269,
62,
81,
62,
73,
388,
489,
396,
62,
36500,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
10761,
62,
41,
5883,
6489,
8808,
62,
10943,
5446,
46,
3069,
1137,
6,
22492,
15285,
62,
5239,
11,
198,
220,
220,
220,
269,
62,
81,
62,
73,
388,
489,
396,
62,
11487,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
10761,
62,
41,
5883,
6489,
8808,
62,
38148,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
269,
62,
81,
62,
73,
388,
489,
396,
62,
17143,
62,
36500,
41876,
4731,
26173,
8924,
705,
10761,
62,
41,
5883,
6489,
8808,
62,
27082,
2390,
62,
10943,
5446,
46,
3069,
1137,
6,
22492,
3919,
62,
5239,
11,
198,
220,
220,
220,
269,
62,
81,
62,
73,
388,
489,
396,
62,
17143,
62,
11487,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
10761,
62,
41,
5883,
6489,
8808,
62,
27082,
2390,
62,
38148,
6,
22492,
15285,
62,
5239,
628,
220,
220,
220,
764,
198,
10619,
41358,
49836,
13,
198
] | [
1,
1,
1,
1,
1,
1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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*******************************************************************
* System-defined Include-files. *
*******************************************************************
INCLUDE LZTEMPEMAILTOP. " Global Declarations
INCLUDE LZTEMPEMAILUXX. " Function Modules
*******************************************************************
* User-defined Include-files (if necessary). *
*******************************************************************
* INCLUDE LZTEMPEMAILF... " Subroutines
* INCLUDE LZTEMPEMAILO... " PBO-Modules
* INCLUDE LZTEMPEMAILI... " PAI-Modules
* INCLUDE LZTEMPEMAILE... " Events
* INCLUDE LZTEMPEMAILP... " Local class implement.
* INCLUDE LZTEMPEMAILT99. " ABAP Unit tests
| [
17174,
17174,
8162,
198,
9,
220,
220,
4482,
12,
23211,
40348,
12,
16624,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
17174,
17174,
8162,
198,
220,
3268,
5097,
52,
7206,
406,
57,
51,
39494,
27630,
4146,
35222,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8060,
16691,
24355,
198,
220,
3268,
5097,
52,
7206,
406,
57,
51,
39494,
27630,
4146,
52,
8051,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
15553,
3401,
5028,
198,
198,
17174,
17174,
8162,
198,
9,
220,
220,
11787,
12,
23211,
40348,
12,
16624,
357,
361,
3306,
737,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
17174,
17174,
8162,
198,
9,
3268,
5097,
52,
7206,
406,
57,
51,
39494,
27630,
4146,
37,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3834,
81,
448,
1127,
198,
9,
3268,
5097,
52,
7206,
406,
57,
51,
39494,
27630,
4146,
46,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
350,
8202,
12,
5841,
5028,
198,
9,
3268,
5097,
52,
7206,
406,
57,
51,
39494,
27630,
4146,
40,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8147,
40,
12,
5841,
5028,
198,
9,
3268,
5097,
52,
7206,
406,
57,
51,
39494,
3620,
20185,
2538,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
18715,
198,
9,
3268,
5097,
52,
7206,
406,
57,
51,
39494,
27630,
4146,
47,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
10714,
1398,
3494,
13,
198,
9,
3268,
5097,
52,
7206,
406,
57,
51,
39494,
27630,
4146,
51,
2079,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9564,
2969,
11801,
5254,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
interface ZIF_EXCEL_SHEET_PROPERTIES
public .
constants C_HIDDEN type ZEXCEL_SHEET_HIDDEN value 'X'. "#EC NOTEXT
constants C_VERYHIDDEN type ZEXCEL_SHEET_HIDDEN value '2'. "#EC NOTEXT
constants C_HIDEZERO type ZEXCEL_SHEET_SHOWZEROS value ''. "#EC NOTEXT
constants C_SHOWZERO type ZEXCEL_SHEET_SHOWZEROS value 'X'. "#EC NOTEXT
constants C_VISIBLE type ZEXCEL_SHEET_HIDDEN value ''. "#EC NOTEXT
data HIDDEN type ZEXCEL_SHEET_HIDDEN .
data SHOW_ZEROS type ZEXCEL_SHEET_SHOWZEROS .
data STYLE type ZEXCEL_CELL_STYLE .
data ZOOMSCALE type ZEXCEL_SHEET_ZOOMSCALE .
data ZOOMSCALE_NORMAL type ZEXCEL_SHEET_ZOOMSCALE .
data ZOOMSCALE_PAGELAYOUTVIEW type ZEXCEL_SHEET_ZOOMSCALE .
data ZOOMSCALE_SHEETLAYOUTVIEW type ZEXCEL_SHEET_ZOOMSCALE .
data SUMMARYBELOW type ZEXCEL_SHEET_SUMMARY .
constants C_BELOW_ON type ZEXCEL_SHEET_SUMMARY value 1. "#EC NOTEXT
constants C_BELOW_OFF type ZEXCEL_SHEET_SUMMARY value 0. "#EC NOTEXT
data SUMMARYRIGHT type ZEXCEL_SHEET_SUMMARY .
constants C_RIGHT_ON type ZEXCEL_SHEET_SUMMARY value 1. "#EC NOTEXT
constants C_RIGHT_OFF type ZEXCEL_SHEET_SUMMARY value 0. "#EC NOTEXT
data SELECTED type ZEXCEL_SHEET_SELECTED .
constants C_SELECTED type ZEXCEL_SHEET_SELECTED value 'X'. "#EC NOTEXT
data HIDE_COLUMNS_FROM type ZEXCEL_CELL_COLUMN_ALPHA .
methods INITIALIZE .
methods GET_STYLE
returning
value(EP_STYLE) type ZEXCEL_CELL_STYLE .
methods SET_STYLE
importing
!IP_STYLE type ZEXCEL_CELL_STYLE .
endinterface.
| [
39994,
1168,
5064,
62,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
4805,
3185,
17395,
11015,
198,
220,
1171,
764,
628,
198,
220,
38491,
327,
62,
39,
2389,
41819,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
39,
2389,
41819,
1988,
705,
55,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
5959,
56,
39,
2389,
41819,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
39,
2389,
41819,
1988,
705,
17,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
39,
14114,
57,
34812,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
9693,
3913,
57,
1137,
2640,
1988,
705,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
9693,
3913,
57,
34812,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
9693,
3913,
57,
1137,
2640,
1988,
705,
55,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
29817,
34563,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
39,
2389,
41819,
1988,
705,
4458,
25113,
2943,
5626,
13918,
198,
220,
1366,
367,
2389,
41819,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
39,
2389,
41819,
764,
198,
220,
1366,
37041,
62,
57,
1137,
2640,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
9693,
3913,
57,
1137,
2640,
764,
198,
220,
1366,
3563,
56,
2538,
2099,
1168,
6369,
34,
3698,
62,
5222,
3069,
62,
2257,
56,
2538,
764,
198,
220,
1366,
1168,
46,
2662,
6173,
21358,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
57,
46,
2662,
6173,
21358,
764,
198,
220,
1366,
1168,
46,
2662,
6173,
21358,
62,
35510,
42126,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
57,
46,
2662,
6173,
21358,
764,
198,
220,
1366,
1168,
46,
2662,
6173,
21358,
62,
4537,
38,
3698,
4792,
2606,
6849,
40,
6217,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
57,
46,
2662,
6173,
21358,
764,
198,
220,
1366,
1168,
46,
2662,
6173,
21358,
62,
9693,
36,
2767,
43,
4792,
2606,
6849,
40,
6217,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
57,
46,
2662,
6173,
21358,
764,
198,
220,
1366,
35683,
44,
13153,
33,
3698,
3913,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
50,
5883,
44,
13153,
764,
198,
220,
38491,
327,
62,
33,
3698,
3913,
62,
1340,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
50,
5883,
44,
13153,
1988,
352,
13,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
33,
3698,
3913,
62,
27977,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
50,
5883,
44,
13153,
1988,
657,
13,
25113,
2943,
5626,
13918,
198,
220,
1366,
35683,
44,
13153,
49,
9947,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
50,
5883,
44,
13153,
764,
198,
220,
38491,
327,
62,
49,
9947,
62,
1340,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
50,
5883,
44,
13153,
1988,
352,
13,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
49,
9947,
62,
27977,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
50,
5883,
44,
13153,
1988,
657,
13,
25113,
2943,
5626,
13918,
198,
220,
1366,
33493,
1961,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
46506,
1961,
764,
198,
220,
38491,
327,
62,
46506,
1961,
2099,
1168,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
46506,
1961,
1988,
705,
55,
4458,
25113,
2943,
5626,
13918,
198,
220,
1366,
367,
14114,
62,
25154,
5883,
8035,
62,
10913,
2662,
2099,
1168,
6369,
34,
3698,
62,
5222,
3069,
62,
25154,
5883,
45,
62,
1847,
47,
7801,
764,
628,
220,
5050,
3268,
2043,
12576,
35400,
764,
198,
220,
5050,
17151,
62,
2257,
56,
2538,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
8905,
62,
2257,
56,
2538,
8,
2099,
1168,
6369,
34,
3698,
62,
5222,
3069,
62,
2257,
56,
2538,
764,
198,
220,
5050,
25823,
62,
2257,
56,
2538,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
4061,
62,
2257,
56,
2538,
2099,
1168,
6369,
34,
3698,
62,
5222,
3069,
62,
2257,
56,
2538,
764,
198,
437,
39994,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ltcl_main DEFINITION FINAL FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
DATA model_builder TYPE REF TO z2mse_extr3_model_builder_mock.
DATA f_cut TYPE REF TO z2mse_extr3_element_manager.
METHODS:
main FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_main IMPLEMENTATION.
METHOD main.
model_builder = NEW #( ).
f_cut = NEW #( i_model_builder = model_builder
i_exclude_found_sap_intf = abap_true
i_interface_use_structure = abap_false ).
DATA element TYPE REF TO z2mse_extr3_elements_mock.
DATA element_act TYPE REF TO z2mse_extr3_elements.
element = NEW #( i_element_manager = f_cut ).
DATA element_id_act TYPE z2mse_extr3_element_manager=>element_id_type.
element_id_act = f_cut->add_element( element = element
is_specific = abap_false ).
cl_abap_unit_assert=>assert_equals( msg = 'New element has to be reported to the model builder'
exp = element_id_act
act = model_builder->last_reported_new_element_id ).
cl_abap_unit_assert=>assert_equals( msg = 'New ID has to be 1' exp = 1 act = element_id_act ).
element_act = f_cut->get_element( i_element_id = 1 ).
cl_abap_unit_assert=>assert_equals( msg = 'Expect stored reference back' exp = element act = element_act ).
" Now build an association
DATA association TYPE REF TO z2mse_extr3_association_mock.
association = NEW #( i_element_manager = f_cut ).
f_cut->add_association( EXPORTING element_1 = 1
element_2 = 2
association = association ).
f_cut->add_association( EXPORTING element_1 = 1
element_2 = 2
association = association ).
DATA: associations_act TYPE z2mse_extr3_element_manager=>associations_type,
associations_exp TYPE z2mse_extr3_element_manager=>associations_type.
associations_act = f_cut->get_associations( i_element_id = 1 ).
associations_exp = VALUE #( ( element_id1 = 1 element_id2 = 2 association = association ) ).
cl_abap_unit_assert=>assert_equals( msg = 'Expect correct association when searched for first element'
exp = associations_exp
act = associations_act ).
associations_act = f_cut->get_associations( i_element_id = 2 ).
cl_abap_unit_assert=>assert_equals( msg = 'Expect correct association when searched for second element'
exp = associations_exp
act = associations_act ).
associations_act = f_cut->get_associations( i_element_id = 3 ).
associations_exp = VALUE #( ).
cl_abap_unit_assert=>assert_equals( msg = 'Expect no association for not existing id'
exp = associations_exp
act = associations_act ).
" Test building model
f_cut->make_model( ).
associations_exp = VALUE #( ( element_id1 = 1 element_id2 = 2 association = association ) ).
cl_abap_unit_assert=>assert_equals( msg = 'The element ID has to be transfered to make the model'
exp = 1
act = element->last_element_id ).
cl_abap_unit_assert=>assert_equals( msg = 'The associations have to be transfered to make the model'
exp = associations_exp
act = element->last_associations ).
" z2mse_extr3_association_mock
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
12417,
5550,
20032,
17941,
25261,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
2746,
62,
38272,
41876,
4526,
37,
5390,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
19849,
62,
38272,
62,
76,
735,
13,
198,
220,
220,
220,
42865,
277,
62,
8968,
41876,
4526,
37,
5390,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
30854,
62,
37153,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
1388,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
10619,
31631,
13,
628,
198,
31631,
300,
83,
565,
62,
12417,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
1388,
13,
198,
220,
220,
220,
2746,
62,
38272,
796,
12682,
1303,
7,
6739,
198,
220,
220,
220,
277,
62,
8968,
796,
12682,
1303,
7,
1312,
62,
19849,
62,
38272,
796,
2746,
62,
38272,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
1069,
9152,
62,
9275,
62,
82,
499,
62,
600,
69,
796,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
39994,
62,
1904,
62,
301,
5620,
796,
450,
499,
62,
9562,
6739,
198,
220,
220,
220,
42865,
5002,
41876,
4526,
37,
5390,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
68,
3639,
62,
76,
735,
13,
198,
220,
220,
220,
42865,
5002,
62,
529,
41876,
4526,
37,
5390,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
68,
3639,
13,
198,
220,
220,
220,
5002,
796,
12682,
1303,
7,
1312,
62,
30854,
62,
37153,
796,
277,
62,
8968,
6739,
628,
220,
220,
220,
42865,
5002,
62,
312,
62,
529,
41876,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
30854,
62,
37153,
14804,
30854,
62,
312,
62,
4906,
13,
628,
220,
220,
220,
5002,
62,
312,
62,
529,
796,
277,
62,
8968,
3784,
2860,
62,
30854,
7,
5002,
796,
5002,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
11423,
796,
450,
499,
62,
9562,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
31456,
796,
705,
3791,
5002,
468,
284,
307,
2098,
284,
262,
2746,
27098,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
5002,
62,
312,
62,
529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
719,
796,
2746,
62,
38272,
3784,
12957,
62,
26263,
62,
3605,
62,
30854,
62,
312,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
31456,
796,
705,
3791,
4522,
468,
284,
307,
352,
6,
1033,
796,
352,
719,
796,
5002,
62,
312,
62,
529,
6739,
628,
220,
220,
220,
5002,
62,
529,
796,
277,
62,
8968,
3784,
1136,
62,
30854,
7,
1312,
62,
30854,
62,
312,
796,
352,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
31456,
796,
705,
3109,
806,
8574,
4941,
736,
6,
1033,
796,
5002,
719,
796,
5002,
62,
529,
6739,
628,
220,
220,
220,
366,
2735,
1382,
281,
8112,
628,
220,
220,
220,
42865,
8112,
41876,
4526,
37,
5390,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
562,
41003,
62,
76,
735,
13,
198,
220,
220,
220,
8112,
796,
12682,
1303,
7,
1312,
62,
30854,
62,
37153,
796,
277,
62,
8968,
6739,
628,
220,
220,
220,
277,
62,
8968,
3784,
2860,
62,
562,
41003,
7,
7788,
15490,
2751,
5002,
62,
16,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5002,
62,
17,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8112,
796,
8112,
6739,
628,
220,
220,
220,
277,
62,
8968,
3784,
2860,
62,
562,
41003,
7,
7788,
15490,
2751,
5002,
62,
16,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5002,
62,
17,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8112,
796,
8112,
6739,
628,
220,
220,
220,
42865,
25,
15814,
62,
529,
41876,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
30854,
62,
37153,
14804,
562,
1733,
602,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15814,
62,
11201,
41876,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
30854,
62,
37153,
14804,
562,
1733,
602,
62,
4906,
13,
628,
220,
220,
220,
15814,
62,
529,
796,
277,
62,
8968,
3784,
1136,
62,
562,
1733,
602,
7,
1312,
62,
30854,
62,
312,
796,
352,
6739,
628,
220,
220,
220,
15814,
62,
11201,
796,
26173,
8924,
1303,
7,
357,
5002,
62,
312,
16,
796,
352,
5002
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_excel_obsolete_func_wrap DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS guid_create
RETURNING
VALUE(rv_guid_16) TYPE zexcel_guid .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_EXCEL_OBSOLETE_FUNC_WRAP IMPLEMENTATION.
METHOD guid_create.
TRY.
rv_guid_16 = cl_system_uuid=>if_system_uuid_static~create_uuid_x16( ).
CATCH cx_uuid_error.
ENDTRY.
*--------------------------------------------------------------------*
* If you are on a release that does not yet have the class cl_system_uuid
* please use the following coding instead which is using the function
* call that was used before but which has been flagged as obsolete
* in newer SAP releases
*--------------------------------------------------------------------*
*
*Before ABAP 7.02: CALL FUNCTION 'GUID_CREATE'
*Before ABAP 7.02: IMPORTING
*Before ABAP 7.02: ev_guid_16 = rv_guid_16.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
1069,
5276,
62,
672,
23869,
62,
20786,
62,
37150,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
10103,
62,
17953,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
5162,
312,
62,
1433,
8,
41876,
1976,
1069,
5276,
62,
5162,
312,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6369,
34,
3698,
62,
46,
4462,
46,
2538,
9328,
62,
42296,
34,
62,
18564,
2969,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
10103,
62,
17953,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
374,
85,
62,
5162,
312,
62,
1433,
796,
537,
62,
10057,
62,
12303,
312,
14804,
361,
62,
10057,
62,
12303,
312,
62,
12708,
93,
17953,
62,
12303,
312,
62,
87,
1433,
7,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
12303,
312,
62,
18224,
13,
198,
220,
220,
220,
23578,
40405,
13,
198,
198,
9,
10097,
650,
9,
198,
9,
1002,
345,
389,
319,
257,
2650,
326,
857,
407,
1865,
423,
262,
1398,
537,
62,
10057,
62,
12303,
312,
198,
9,
3387,
779,
262,
1708,
19617,
2427,
543,
318,
1262,
262,
2163,
198,
9,
869,
326,
373,
973,
878,
475,
543,
468,
587,
34060,
355,
26533,
198,
9,
287,
15064,
48323,
10050,
198,
9,
10097,
650,
9,
198,
9,
198,
9,
8421,
9564,
2969,
767,
13,
2999,
25,
220,
42815,
29397,
4177,
2849,
705,
38,
27586,
62,
43387,
6158,
6,
198,
9,
8421,
9564,
2969,
767,
13,
2999,
25,
220,
220,
220,
30023,
9863,
2751,
198,
9,
8421,
9564,
2969,
767,
13,
2999,
25,
220,
220,
220,
220,
220,
819,
62,
5162,
312,
62,
1433,
796,
374,
85,
62,
5162,
312,
62,
1433,
13,
628,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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