content
stringlengths 4
1.04M
| input_ids
sequencelengths 2
1.02k
| attention_mask
sequencelengths 2
1.02k
|
---|---|---|
CLASS zcl_regex_golf_controller DEFINITION
PUBLIC
INHERITING FROM zcl_regex_golf_abs_controller
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
TYPES: ty_regex_string TYPE c LENGTH 60.
ALIASES:
add_level FOR zif_regex_golf_controller~add_level,
delete_level FOR zif_regex_golf_controller~delete_level,
get_current_level FOR zif_regex_golf_controller~get_current_level,
get_match_html FOR zif_regex_golf_controller~get_match_html,
get_non_match_html FOR zif_regex_golf_controller~get_non_match_html,
get_top_html FOR zif_regex_golf_controller~get_top_html,
pick_level FOR zif_regex_golf_controller~pick_level,
random_level FOR zif_regex_golf_controller~random_level,
validate FOR zif_regex_golf_controller~validate.
METHODS:
constructor
IMPORTING
i_regex_input TYPE REF TO ty_regex_string
RAISING
zcx_regex_golf_error,
zif_regex_golf_controller~delete_level REDEFINITION,
zif_regex_golf_controller~get_current_level REDEFINITION,
zif_regex_golf_controller~get_match_html REDEFINITION,
zif_regex_golf_controller~get_non_match_html REDEFINITION,
zif_regex_golf_controller~get_top_html REDEFINITION,
zif_regex_golf_controller~pick_level REDEFINITION,
zif_regex_golf_controller~random_level REDEFINITION,
zif_regex_golf_controller~validate REDEFINITION.
PRIVATE SECTION.
DATA: mo_validator TYPE REF TO zcl_regex_golf_validator,
mt_result_matches TYPE zcl_regex_golf_validator=>tty_result,
mt_result_non_matches TYPE zcl_regex_golf_validator=>tty_result,
mr_regex_input TYPE REF TO ty_regex_string.
METHODS:
_get_html
IMPORTING
!it_result TYPE zcl_regex_golf_validator=>tty_result
!i_match TYPE abap_bool
RETURNING
VALUE(rt_html) TYPE w3htmltab,
_get_html_for_token
IMPORTING
!i_result TYPE zcl_regex_golf_validator=>ty_result
!i_match TYPE abap_bool
RETURNING
VALUE(r_result) TYPE string,
_validate
IMPORTING
!i_regex TYPE csequence
!it_tokens TYPE stringtab
RETURNING
VALUE(rt_result) TYPE zcl_regex_golf_validator=>tty_result
RAISING
zcx_regex_golf_error,
_level_solved
RETURNING
VALUE(r_level_solved) TYPE abap_bool,
_initialize
RAISING
zcx_regex_golf_error.
ENDCLASS.
CLASS zcl_regex_golf_controller IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
IF lines( mo_level->mt_levels ) = 0.
RAISE EXCEPTION TYPE zcx_regex_golf_no_levels.
ENDIF.
mr_regex_input = i_regex_input.
_initialize( ).
ENDMETHOD.
METHOD zif_regex_golf_controller~delete_level.
DATA: level_to_delete TYPE i.
cl_demo_input=>request(
EXPORTING
text = |Level to Delete 1 - { mo_level->get_level_count( ) }|
CHANGING
field = level_to_delete ).
mo_level->delete_level( level_to_delete ).
mo_level->random_level( ).
ENDMETHOD.
METHOD zif_regex_golf_controller~get_current_level.
r_current_level = mo_level->get_current_level( ).
ENDMETHOD.
METHOD zif_regex_golf_controller~get_match_html.
rt_html = _get_html( it_result = mt_result_matches
i_match = abap_true ).
ENDMETHOD.
METHOD zif_regex_golf_controller~get_non_match_html.
rt_html = _get_html( it_result = mt_result_non_matches
i_match = abap_false ).
ENDMETHOD.
METHOD zif_regex_golf_controller~get_top_html.
DATA(html) = `<html><head><style type="text/css">`
&& `body {`
&& ` overflow: hidden;`
&& ` font-family: arial;`
&& ` }`
&& `.success {`
&& ` color: green;`
&& ` font-size: 24px;`
&& ` width: 30%;`
&& ` margin: auto;`
&& `}`
&& `</style></head><body>`
&& COND #( WHEN _level_solved( ) = abap_true THEN `<div class="success">Level solved!</div>` )
&& `</body><html>` ##NO_TEXT.
cl_bizc_xml_services=>convert_string_to_table(
EXPORTING
ip_string = html
IMPORTING
et_table = rt_html ).
ENDMETHOD.
METHOD zif_regex_golf_controller~pick_level.
DATA: new_level_id TYPE zcl_regex_golf_level=>ty_level_id,
level_count TYPE i.
LOOP AT mo_level->mt_levels ASSIGNING FIELD-SYMBOL(<level>).
level_count = level_count + 1.
cl_demo_input=>add_text( |{ level_count } { <level>-description } | ).
ENDLOOP.
cl_demo_input=>request(
EXPORTING
text = |Choose Level 1 - { mo_level->get_level_count( ) }|
CHANGING
field = new_level_id ).
IF new_level_id IS INITIAL.
RETURN.
ENDIF.
mo_level->set_level( new_level_id ).
CLEAR mr_regex_input->*.
_initialize( ).
ENDMETHOD.
METHOD zif_regex_golf_controller~random_level.
mo_level->random_level( ).
CLEAR mr_regex_input->*.
_initialize( ).
ENDMETHOD.
METHOD zif_regex_golf_controller~validate.
mt_result_matches = _validate( i_regex = i_regex
it_tokens = mo_level->get_matches( ) ).
mt_result_non_matches = _validate( i_regex = i_regex
it_tokens = mo_level->get_non_matches( ) ).
ENDMETHOD.
METHOD _get_html.
CONSTANTS: co_max_lines_for_one_page TYPE i VALUE 22.
DATA(html) = `<html><head><style type="text/css">` ##NO_TEXT
&& `.inline {`
&& ` display: inline;`
&& `}`
&& `.match {`
&& ` font-weight: bold;`
&& `}`
&& `.wrong-match {`
&& ` color: red;`
&& `}`
&& `.right-match {`
&& ` color: green;`
&& `}`
&& `.grayed {`
&& ` color: #e6e6e6;`
&& `}`
&& `body {`
&& COND #( WHEN lines( it_result ) < co_max_lines_for_one_page THEN ` overflow: hidden;` )
&& ` font-family: arial;`
&& ` }`
&& `</style></head><body>`
&& REDUCE string( INIT result = ||
FOR <result> IN it_result
NEXT result = result && _get_html_for_token( i_result = <result>
i_match = i_match ) )
&& `</body><html>`.
cl_bizc_xml_services=>convert_string_to_table(
EXPORTING
ip_string = html
IMPORTING
et_table = rt_html ).
ENDMETHOD.
METHOD _get_html_for_token.
CONSTANTS:
BEGIN OF html_sign,
cross TYPE string VALUE '✗' ##NO_TEXT,
check_mark TYPE string VALUE '✓' ##NO_TEXT,
END OF html_sign.
r_result = `<p>`
&& `<div class="inline">`
&& COND string( WHEN i_match = abap_true AND i_result-matched = abap_true
THEN |<div class="inline right-match">{ html_sign-check_mark }</div>|
WHEN i_match = abap_false AND i_result-matched = abap_true
THEN |<div class="inline wrong-match">{ html_sign-cross }</div>|
WHEN i_match = abap_true AND i_result-matched = abap_false
THEN |<div class="inline grayed">{ html_sign-check_mark }</div>|
WHEN i_match = abap_false AND i_result-matched = abap_false
THEN |<div class="inline grayed">{ html_sign-cross }</div>| )
&& i_result-pre_match
&& `<div class="match inline">`
&& i_result-match
&& `</div>`
&& i_result-post_match
&& `</div>`
&& `</p>`.
ENDMETHOD.
METHOD _initialize.
mo_validator = NEW zcl_regex_golf_validator( ).
validate( mr_regex_input->* ).
ENDMETHOD.
METHOD _level_solved.
DATA(success_matches) = FILTER zcl_regex_golf_validator=>tty_result( mt_result_matches USING KEY matched_key
WHERE matched = abap_true ).
DATA(success_non_matches) = FILTER zcl_regex_golf_validator=>tty_result( mt_result_non_matches USING KEY matched_key
WHERE matched = abap_true ).
r_level_solved = boolc( lines( success_matches ) = lines( mt_result_matches )
AND lines( success_non_matches ) = 0 ).
ENDMETHOD.
METHOD _validate.
mo_validator->validate(
EXPORTING
i_regex = i_regex
it_tokens = it_tokens
RECEIVING
rt_result = rt_result ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
260,
25636,
62,
70,
4024,
62,
36500,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
260,
25636,
62,
70,
4024,
62,
8937,
62,
36500,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
1259,
62,
260,
25636,
62,
8841,
41876,
269,
406,
49494,
3126,
13,
628,
220,
220,
220,
8355,
43429,
1546,
25,
198,
220,
220,
220,
220,
220,
751,
62,
5715,
220,
197,
197,
197,
197,
7473,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
2860,
62,
5715,
11,
198,
220,
220,
220,
220,
220,
12233,
62,
5715,
197,
197,
197,
7473,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
33678,
62,
5715,
11,
198,
220,
220,
220,
220,
220,
651,
62,
14421,
62,
5715,
220,
7473,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
1136,
62,
14421,
62,
5715,
11,
198,
220,
220,
220,
220,
220,
651,
62,
15699,
62,
6494,
197,
197,
7473,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
1136,
62,
15699,
62,
6494,
11,
198,
220,
220,
220,
220,
220,
651,
62,
13159,
62,
15699,
62,
6494,
7473,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
1136,
62,
13159,
62,
15699,
62,
6494,
11,
198,
220,
220,
220,
220,
220,
651,
62,
4852,
62,
6494,
197,
197,
197,
7473,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
1136,
62,
4852,
62,
6494,
11,
198,
220,
220,
220,
220,
220,
2298,
62,
5715,
197,
197,
197,
197,
7473,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
27729,
62,
5715,
11,
198,
220,
220,
220,
220,
220,
4738,
62,
5715,
197,
197,
197,
7473,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
25120,
62,
5715,
11,
198,
220,
220,
220,
220,
220,
26571,
197,
197,
197,
197,
197,
7473,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
12102,
378,
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,
1312,
62,
260,
25636,
62,
15414,
41876,
4526,
37,
5390,
1259,
62,
260,
25636,
62,
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,
260,
25636,
62,
70,
4024,
62,
18224,
11,
628,
220,
220,
220,
220,
220,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
33678,
62,
5715,
197,
197,
197,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
1136,
62,
14421,
62,
5715,
220,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
1136,
62,
15699,
62,
6494,
197,
197,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
1136,
62,
13159,
62,
15699,
62,
6494,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
1136,
62,
4852,
62,
6494,
197,
197,
197,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
27729,
62,
5715,
197,
197,
197,
197,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
25120,
62,
5715,
197,
197,
197,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
260,
25636,
62,
70,
4024,
62,
36500,
93,
12102,
378,
197,
197,
197,
197,
197,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42865,
25,
6941,
62,
12102,
1352,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
260,
25636,
62,
70,
4024,
62,
12102,
1352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45079,
62,
20274,
62,
6759,
2052,
220,
220,
220,
220,
41876,
1976,
565,
62,
260,
25636,
62,
70,
4024,
62,
12102,
1352,
14804,
42852,
62,
20274,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45079,
62,
20274,
62,
13159,
62,
6759,
2052,
41876,
1976,
565,
62,
260,
25636,
62,
70,
4024,
62,
12102,
1352,
14804,
42852,
62,
20274,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
81,
62,
260,
25636,
62,
15414,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1259,
62,
260,
25636,
62,
8841,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
4808,
1136,
62,
6494,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
20274,
220,
220,
220,
220,
41876,
1976,
565,
62,
260,
25636,
62,
70,
4024,
62,
12102,
1352,
14804,
42852,
62,
20274,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
15699,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
6494,
8,
41876,
266,
18,
19211,
2528,
397,
11,
628,
220,
220,
220,
220,
220,
4808,
1136,
62,
6494,
62,
1640,
62,
30001,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
20274,
220,
220,
220,
220,
220,
220,
41876,
1976,
565,
62,
260,
25636,
62,
70,
4024,
62,
12102,
1352,
14804,
774,
62,
20274,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
15699,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
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,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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
] |
"! Represents a part of an object, including all the versions of that part that
"! exist in the system.
CLASS zcl_timem_part DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
"! Object name
DATA name TYPE string READ-ONLY .
"! Part type
DATA vrsd_type TYPE versobjtyp READ-ONLY .
"! Part name
DATA vrsd_name TYPE versobjnam READ-ONLY .
"! Constructs a new part
"! @parameter name | Object name
"! @parameter vrsd_type | Part type
"! @parameter vrsd_name | Part object
METHODS constructor
IMPORTING
!name TYPE string
!vrsd_type TYPE versobjtyp
!vrsd_name TYPE versobjnam
RAISING
zcx_timem .
METHODS get_timestamps
RETURNING
VALUE(result) TYPE ztimem_timestamp_t .
METHODS get_source
RETURNING
VALUE(result) TYPE ztimem_line_t
RAISING
zcx_timem .
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
ty_t_version TYPE STANDARD TABLE OF REF TO zcl_timem_version WITH KEY table_line .
DATA versions TYPE ty_t_version .
METHODS load_versions
IMPORTING
!vrsd_type TYPE versobjtyp
!vrsd_name TYPE versobjnam
RAISING
zcx_timem .
METHODS get_version_at_threshold
RETURNING
VALUE(result) TYPE REF TO zcl_timem_version .
METHODS get_versions_until_threshold
RETURNING
VALUE(result) TYPE ty_t_version .
"! Calculates and returns a list of the diffed source already filled with blame
"! details.
METHODS get_diffed_source_with_blame
RETURNING
VALUE(result) TYPE ztimem_line_t
RAISING
zcx_timem .
METHODS get_source_at_threshold
RETURNING
VALUE(result) TYPE ztimem_line_t
RAISING
zcx_timem .
ENDCLASS.
CLASS ZCL_TIMEM_PART IMPLEMENTATION.
METHOD constructor.
me->name = name.
me->vrsd_type = vrsd_type.
me->vrsd_name = vrsd_name.
load_versions( vrsd_type = vrsd_type
vrsd_name = vrsd_name ).
ENDMETHOD.
METHOD get_diffed_source_with_blame.
DATA(diff) = NEW zcl_timem_diff( ).
LOOP AT get_versions_until_threshold( ) INTO DATA(version).
result = diff->compute( lines_old = result
lines_new = version->get_source( ) ).
ENDLOOP.
ENDMETHOD.
METHOD get_source.
result = SWITCH #(
zcl_timem_options=>get_instance( )->mode
WHEN zif_timem_consts=>mode-blame THEN get_diffed_source_with_blame( )
WHEN zif_timem_consts=>mode-time_machine THEN get_source_at_threshold( ) ).
ENDMETHOD.
METHOD get_source_at_threshold.
DATA(version) = get_version_at_threshold( ).
IF version IS BOUND.
result = version->get_source( ).
ENDIF.
ENDMETHOD.
METHOD get_timestamps.
DATA ts LIKE LINE OF result.
LOOP AT versions INTO DATA(version).
ts = |{ version->date }{ version->time }|.
COLLECT ts INTO result.
ENDLOOP.
ENDMETHOD.
METHOD get_versions_until_threshold.
result = VALUE #(
FOR version IN versions
WHERE (
table_line->date < zcl_timem_options=>get_instance( )->date OR
( table_line->date = zcl_timem_options=>get_instance( )->date AND
table_line->time <= zcl_timem_options=>get_instance( )->time ) )
( version ) ).
ENDMETHOD.
METHOD get_version_at_threshold.
" The last one should be the one we want
LOOP AT versions INTO result WHERE
table_line->date < zcl_timem_options=>get_instance( )->date OR
( table_line->date = zcl_timem_options=>get_instance( )->date AND
table_line->time <= zcl_timem_options=>get_instance( )->time ).
ENDLOOP.
ENDMETHOD.
METHOD load_versions.
DATA(vrsd) = NEW zcl_timem_vrsd( type = vrsd_type
name = vrsd_name ).
versions = VALUE #( FOR s_vrsd IN vrsd->vrsd_list
( NEW zcl_timem_version( s_vrsd ) ) ).
ENDMETHOD.
ENDCLASS.
| [
40484,
1432,
6629,
257,
636,
286,
281,
2134,
11,
1390,
477,
262,
6300,
286,
326,
636,
326,
198,
40484,
2152,
287,
262,
1080,
13,
198,
31631,
1976,
565,
62,
16514,
368,
62,
3911,
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,
9515,
1438,
198,
220,
220,
220,
42865,
1438,
41876,
4731,
20832,
12,
1340,
11319,
764,
198,
220,
220,
220,
366,
0,
2142,
2099,
198,
220,
220,
220,
42865,
410,
3808,
67,
62,
4906,
41876,
3326,
568,
50007,
28004,
20832,
12,
1340,
11319,
764,
198,
220,
220,
220,
366,
0,
2142,
1438,
198,
220,
220,
220,
42865,
410,
3808,
67,
62,
3672,
41876,
3326,
568,
50007,
7402,
20832,
12,
1340,
11319,
764,
628,
220,
220,
220,
366,
0,
28407,
82,
257,
649,
636,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
1438,
930,
9515,
1438,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
410,
3808,
67,
62,
4906,
930,
2142,
2099,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
410,
3808,
67,
62,
3672,
930,
2142,
2134,
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,
3672,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
85,
3808,
67,
62,
4906,
41876,
3326,
568,
50007,
28004,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
85,
3808,
67,
62,
3672,
41876,
3326,
568,
50007,
7402,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
16514,
368,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
16514,
395,
9430,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
1976,
16514,
368,
62,
16514,
27823,
62,
83,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
10459,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
1976,
16514,
368,
62,
1370,
62,
83,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
16514,
368,
764,
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,
1259,
62,
83,
62,
9641,
41876,
49053,
9795,
43679,
3963,
4526,
37,
5390,
1976,
565,
62,
16514,
368,
62,
9641,
13315,
35374,
3084,
62,
1370,
764,
628,
220,
220,
220,
42865,
6300,
41876,
1259,
62,
83,
62,
9641,
764,
628,
220,
220,
220,
337,
36252,
50,
3440,
62,
47178,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
85,
3808,
67,
62,
4906,
41876,
3326,
568,
50007,
28004,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
85,
3808,
67,
62,
3672,
41876,
3326,
568,
50007,
7402,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
16514,
368,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
9641,
62,
265,
62,
400,
10126,
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,
565,
62,
16514,
368,
62,
9641,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
47178,
62,
28446,
62,
400,
10126,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
1259,
62,
83,
62,
9641,
764,
628,
220,
220,
220,
366,
0,
27131,
689,
290,
5860,
257,
1351,
286,
262,
814,
276,
2723,
1541,
5901,
351,
8138,
198,
220,
220,
220,
366,
0,
3307,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
26069,
276,
62,
10459,
62,
4480,
62,
2436,
480,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
1976,
16514,
368,
62,
1370,
62,
83,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
16514,
368,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
10459,
62,
265,
62,
400,
10126,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
1976,
16514,
368,
62,
1370,
62,
83,
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,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
51,
3955,
3620,
62,
30709,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
220,
23772,
13,
198,
220,
220,
220,
502,
3784,
3672,
796,
1438,
13,
198,
220,
220,
220,
502,
3784,
85,
3808,
67,
62,
4906,
796,
410,
3808,
67,
62,
4906,
13,
198,
220,
220,
220,
502,
3784,
85,
3808,
67,
62,
3672,
796,
410,
3808,
67,
62,
3672,
13,
198,
220,
220,
220,
3440,
62,
47178,
7,
410,
3808,
67,
62,
4906,
796,
410,
3808,
67,
62,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
3808,
67,
62,
3672,
796,
410,
3808,
67,
62,
3672,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
26069,
276,
62,
10459,
62,
4480,
62,
2436,
480,
13,
198,
220,
220,
220,
42865,
7,
26069,
8,
796,
12682,
1976,
565,
62,
16514,
368,
62,
26069,
7,
6739,
198,
220,
220,
220,
17579,
3185,
5161,
651,
62,
47178,
62,
28446,
62,
400,
10126,
7,
1267,
39319,
42865,
7,
9641,
737,
198,
220,
220,
220,
220,
220,
1255,
796,
814,
3784,
5589,
1133,
7,
3951,
62,
727,
796,
1255,
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,
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PRIVATE SECTION.
METHODS:
load
RETURNING VALUE(ri_wb_interface) TYPE REF TO if_fp_wb_interface
RAISING zcx_abapgit_exception,
interface_to_xstring
RETURNING VALUE(rv_xstr) TYPE xstring
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_SFPI IMPLEMENTATION.
METHOD interface_to_xstring.
DATA: li_fp_interface TYPE REF TO if_fp_interface,
li_wb_interface TYPE REF TO if_fp_wb_interface.
TRY.
li_wb_interface = load( ).
li_fp_interface ?= li_wb_interface->get_object( ).
rv_xstr = cl_fp_helper=>convert_interface_to_xstring( li_fp_interface ).
CATCH cx_fp_api.
zcx_abapgit_exception=>raise( 'SFPI error, interface_to_xstring' ).
ENDTRY.
ENDMETHOD.
METHOD load.
DATA: lv_name TYPE fpname.
lv_name = ms_item-obj_name.
TRY.
ri_wb_interface = cl_fp_wb_interface=>load( lv_name ).
CATCH cx_fp_api.
zcx_abapgit_exception=>raise( 'SFPI error, load' ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
SELECT SINGLE lastuser FROM fpinterface
INTO rv_user
WHERE name = ms_item-obj_name
AND state = 'A'.
IF rv_user IS INITIAL.
SELECT SINGLE firstuser FROM fpinterface
INTO rv_user
WHERE name = ms_item-obj_name
AND state = 'A'.
ENDIF.
IF rv_user IS INITIAL.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_name TYPE fpname,
lo_wb_interface TYPE REF TO cl_fp_wb_interface.
lo_wb_interface ?= load( ).
lv_name = ms_item-obj_name.
TRY.
lo_wb_interface->delete( lv_name ).
CATCH cx_fp_api.
zcx_abapgit_exception=>raise( 'SFPI error, delete' ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_xstr TYPE xstring,
lv_name TYPE fpname,
li_wb_object TYPE REF TO if_fp_wb_interface,
li_interface TYPE REF TO if_fp_interface.
lv_name = ms_item-obj_name.
lv_xstr = cl_ixml_80_20=>render_to_xstring( io_xml->get_raw( ) ).
IF zif_abapgit_object~exists( ) = abap_true.
zif_abapgit_object~delete( ).
ENDIF.
TRY.
li_interface = cl_fp_helper=>convert_xstring_to_interface( lv_xstr ).
tadir_insert( iv_package ).
li_wb_object = cl_fp_wb_interface=>create( i_name = lv_name
i_interface = li_interface ).
li_wb_object->save( ).
li_wb_object->free( ).
CATCH cx_fp_api.
zcx_abapgit_exception=>raise( 'SFPI error, deserialize' ).
ENDTRY.
zcl_abapgit_objects_activation=>add_item( ms_item ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_name TYPE fpinterface-name.
SELECT SINGLE name FROM fpinterface
INTO lv_name
WHERE name = ms_item-obj_name
AND state = 'A'.
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 = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
DATA: lv_object TYPE seqg3-garg.
lv_object = |{ ms_item-obj_name }|.
OVERLAY lv_object WITH ' '.
lv_object = lv_object && '*'.
rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'EFPINTERFACE'
iv_argument = lv_object ).
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: lv_xstr TYPE xstring,
li_document TYPE REF TO if_ixml_document.
lv_xstr = interface_to_xstring( ).
li_document = cl_ixml_80_20=>parse_to_document( stream_xstring = lv_xstr ).
zcl_abapgit_object_sfpf=>fix_oref( li_document ).
io_xml->set_raw( li_document->get_root_element( ) ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
28202,
14415,
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,
3440,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
380,
62,
39346,
62,
39994,
8,
41876,
4526,
37,
5390,
611,
62,
46428,
62,
39346,
62,
39994,
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,
7071,
62,
1462,
62,
87,
8841,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
87,
2536,
8,
41876,
2124,
8841,
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,
50,
5837,
40,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
7071,
62,
1462,
62,
87,
8841,
13,
628,
220,
220,
220,
42865,
25,
7649,
62,
46428,
62,
39994,
41876,
4526,
37,
5390,
611,
62,
46428,
62,
39994,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7649,
62,
39346,
62,
39994,
41876,
4526,
37,
5390,
611,
62,
46428,
62,
39346,
62,
39994,
13,
628,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
7649,
62,
39346,
62,
39994,
796,
3440,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
7649,
62,
46428,
62,
39994,
5633,
28,
7649,
62,
39346,
62,
39994,
3784,
1136,
62,
15252,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
374,
85,
62,
87,
2536,
796,
537,
62,
46428,
62,
2978,
525,
14804,
1102,
1851,
62,
39994,
62,
1462,
62,
87,
8841,
7,
7649,
62,
46428,
62,
39994,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
46428,
62,
15042,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
50,
5837,
40,
4049,
11,
7071,
62,
1462,
62,
87,
8841,
6,
6739,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
3440,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
3672,
41876,
277,
79,
3672,
13,
628,
198,
220,
220,
220,
300,
85,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
374,
72,
62,
39346,
62,
39994,
796,
537,
62,
46428,
62,
39346,
62,
39994,
14804,
2220,
7,
300,
85,
62,
3672,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
46428,
62,
15042,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
50,
5837,
40,
4049,
11,
3440,
6,
6739,
198,
220,
220,
220,
23578,
40405,
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,
33493,
311,
2751,
2538,
938,
7220,
16034,
277,
79,
39994,
198,
220,
220,
220,
220,
220,
39319,
374,
85,
62,
7220,
198,
220,
220,
220,
220,
220,
33411,
1438,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
5357,
1181,
796,
705,
32,
4458,
198,
220,
220,
220,
16876,
374,
85,
62,
7220,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
33493,
311,
2751,
2538,
717,
7220,
16034,
277,
79,
39994,
198,
220,
220,
220,
220,
220,
220,
220,
39319,
374,
85,
62,
7220,
198,
220,
220,
220,
220,
220,
220,
220,
33411,
1438,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
5357,
1181,
796,
705,
32,
4458,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
16876,
374,
85,
62,
7220,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
7220,
796,
269,
62,
7220,
62,
34680,
13,
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,
33678,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
277,
79,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
39346,
62,
39994,
41876,
4526,
37,
5390,
537,
62,
46428,
62,
39346,
62,
39994,
13,
628,
198,
220,
220,
220,
2376,
62,
39346,
62,
39994,
5633,
28,
3440,
7,
6739,
628,
220,
220,
220,
300,
85,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
39346,
62,
39994,
3784,
33678,
7,
300,
85,
62,
3672,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
46428,
62,
15042,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
50,
5837,
40,
4049,
11,
12233,
6,
6739,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
8906,
48499,
1096,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
87,
2536,
220,
220,
220,
220,
220,
41876,
2124,
8841,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
3672,
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,
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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
] |
class ZSAPLINK_TRANSFORMATION definition
public
inheriting from ZSAPLINK
create public .
public section.
methods CHECKEXISTS
redefinition .
methods CREATEIXMLDOCFROMOBJECT
redefinition .
methods CREATEOBJECTFROMIXMLDOC
redefinition .
protected section.
constants C_OBJECT_TYPE type STRING value 'XSLT' ##NO_TEXT.
data XSLT_NAME type CXSLTDESC .
constants C_TAG_SOURCE type STRING value 'source' ##NO_TEXT.
methods GET_XSLT
importing
!I_XSLT_NAME type CSEQUENCE optional
returning
value(RO_XSLT) type ref to CL_O2_API_XSLTDESC
raising
ZCX_SAPLINK .
methods SAVE_XSLT
importing
!IO_XSLT type ref to CL_O2_API_XSLTDESC
raising
ZCX_SAPLINK .
methods SET_XSLT_CHANGEABLE
importing
!I_CHANGEABLE type ABAP_BOOL default ABAP_TRUE
!IO_XSLT type ref to CL_O2_API_XSLTDESC
preferred parameter I_CHANGEABLE
raising
ZCX_SAPLINK .
methods SET_XSLT_NAME .
methods DELETEOBJECT
redefinition .
methods GETOBJECTTYPE
redefinition .
private section.
ENDCLASS.
CLASS ZSAPLINK_TRANSFORMATION IMPLEMENTATION.
METHOD checkexists .
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| 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. |
*\---------------------------------------------------------------------/
CONSTANTS:
lc_exists TYPE char1 VALUE '1'.
set_xslt_name( ).
IF cl_o2_api_xsltdesc=>exists( xslt_name ) EQ lc_exists.
exists = abap_true.
ENDIF.
ENDMETHOD.
METHOD createixmldocfromobject .
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| 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. |
*\---------------------------------------------------------------------/
DATA:
lo_xslt TYPE REF TO cl_o2_api_xsltdesc,
ls_attributes TYPE o2xsltattr,
lo_rootnode TYPE REF TO if_ixml_element,
lt_xslt_source TYPE o2pageline_table,
lo_node TYPE REF TO if_ixml_element,
l_source TYPE string.
* set internal object name
set_xslt_name( ).
* load XSLT transformation
lo_xslt = get_xslt( xslt_name ).
* create parent node with attributes
lo_rootnode = xmldoc->create_element( c_object_type ).
* 1. get attributes
ls_attributes = lo_xslt->get_attributes( ).
setattributesfromstructure( node = lo_rootnode structure = ls_attributes ).
* 2. get XSLT source
lt_xslt_source = lo_xslt->get_source( ).
l_source = zsaplink_transformation=>buildsourcestring( pagetable = lt_xslt_source ).
lo_node = xmldoc->create_element( c_tag_source ).
lo_node->set_value( l_source ).
lo_rootnode->append_child( lo_node ).
xmldoc->append_child( lo_rootnode ).
ixmldocument = xmldoc.
ENDMETHOD.
METHOD createobjectfromixmldoc .
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| 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. |
*\---------------------------------------------------------------------/
DATA:
lo_rootnode TYPE REF TO if_ixml_element,
lo_node TYPE REF TO if_ixml_element,
lo_filter TYPE REF TO if_ixml_node_filter,
lo_iterator TYPE REF TO if_ixml_node_iterator,
lo_xslt TYPE REF TO cl_o2_api_xsltdesc,
ls_attributes TYPE o2xsltattr,
lt_xslt_source TYPE o2pageline_table,
ls_xslt_source LIKE LINE OF lt_xslt_source,
l_source TYPE string,
lt_source TYPE table_of_strings.
* try to find a XSLT transformation in the XML tree
xmldoc = ixmldocument.
lo_rootnode = xmldoc->find_from_name( c_object_type ).
* 1. get attributes
getstructurefromattributes( EXPORTING node = lo_rootnode CHANGING structure = ls_attributes ).
* set XSLT transformation name
objname = ls_attributes-xsltdesc.
set_xslt_name( ).
* check whether object already exists and if overwriting
* is allowed
IF checkexists( ) IS NOT INITIAL.
IF overwrite IS INITIAL.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>existing.
ELSE.
* delete object for new install
deleteobject( ).
ENDIF.
ENDIF.
* 2. get XSLT source
CLEAR: lo_filter, lo_iterator, lo_node.
lo_filter = xmldoc->create_filter_name( c_tag_source ).
lo_iterator = xmldoc->create_iterator_filtered( lo_filter ).
lo_node ?= lo_iterator->get_next( ).
IF lo_node IS NOT INITIAL.
l_source = lo_node->get_value( ).
lt_source = zsaplink_transformation=>buildtablefromstring( source = l_source ).
LOOP AT lt_source INTO l_source.
CLEAR ls_xslt_source.
ls_xslt_source-line = l_source.
APPEND ls_xslt_source TO lt_xslt_source.
ENDLOOP.
ENDIF.
* create new XSLT transformation
cl_o2_api_xsltdesc=>create_new(
EXPORTING
p_source = lt_xslt_source
p_attr = ls_attributes
IMPORTING
p_obj = lo_xslt
EXCEPTIONS
object_already_existing = 1
not_authorized = 2
undefined_name = 3
OTHERS = 4 ).
IF sy-subrc NE 0.
CASE sy-subrc.
* object must not be existing already at this stage
WHEN 1.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>existing.
WHEN 2.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_authorized.
WHEN 3.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_found.
WHEN OTHERS.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>system_error.
ENDCASE.
ENDIF.
* check for valid object reference
IF lo_xslt IS NOT BOUND.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>system_error.
ENDIF.
* save XSLT transformation
save_xslt( lo_xslt ).
* reset
set_xslt_changeable( i_changeable = abap_false io_xslt = lo_xslt ).
name = objname.
ENDMETHOD.
METHOD deleteobject .
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| 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. |
*\---------------------------------------------------------------------/
DATA:
lo_xslt TYPE REF TO cl_o2_api_xsltdesc.
* set internal object name
set_xslt_name( ).
* load XSLT transformation
lo_xslt = get_xslt( xslt_name ).
* set changeable
set_xslt_changeable( i_changeable = abap_true io_xslt = lo_xslt ).
* delete XSLT transformation
lo_xslt->delete(
EXCEPTIONS
object_invalid = 1
object_not_changeable = 2
OTHERS = 3 ).
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN 1.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_found.
WHEN 2.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>locked.
WHEN OTHERS.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>system_error.
ENDCASE.
ENDIF.
* only this call really deletes the XSLT
save_xslt( lo_xslt ).
ENDMETHOD.
METHOD getobjecttype .
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| 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. |
*\---------------------------------------------------------------------/
objecttype = c_object_type. " XSLT transformation
ENDMETHOD.
METHOD get_xslt .
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| 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. |
*\---------------------------------------------------------------------/
* load XSLT transformation
cl_o2_api_xsltdesc=>load(
EXPORTING
p_xslt_desc = i_xslt_name
IMPORTING
p_obj = ro_xslt
EXCEPTIONS
not_existing = 1
permission_failure = 2
OTHERS = 5 ).
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN 1.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_found.
WHEN 2.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_authorized.
WHEN OTHERS.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>system_error.
ENDCASE.
ENDIF.
ENDMETHOD.
METHOD SAVE_XSLT .
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| 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. |
*\---------------------------------------------------------------------/
* save XSLT transformation
io_xslt->save(
EXCEPTIONS
permission_failure = 5
OTHERS = 6 ).
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN 5.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_authorized.
WHEN OTHERS.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>system_error.
ENDCASE.
ENDIF.
ENDMETHOD.
METHOD set_xslt_changeable.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| 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. |
*\---------------------------------------------------------------------/
* set changeable
io_xslt->set_changeable(
EXPORTING
p_changeable = i_changeable
EXCEPTIONS
object_already_unlocked = 4
object_already_changeable = 5
object_locked_by_other_user = 3
permission_failure = 2
OTHERS = 10 ).
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN 1.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_found.
WHEN 2.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_authorized.
WHEN 3.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>locked.
WHEN 4 OR 5. " do nothing, continue
WHEN OTHERS.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>system_error.
ENDCASE.
ENDIF.
ENDMETHOD.
METHOD set_xslt_name.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| 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. |
*\---------------------------------------------------------------------/
xslt_name = objname.
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
50,
2969,
43,
17248,
62,
5446,
15037,
35036,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
1168,
50,
2969,
43,
17248,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
5050,
5870,
25171,
6369,
1797,
4694,
198,
220,
220,
220,
34087,
17750,
764,
198,
220,
5050,
29244,
6158,
10426,
5805,
38715,
10913,
2662,
9864,
23680,
198,
220,
220,
220,
34087,
17750,
764,
198,
220,
5050,
29244,
1404,
4720,
33,
23680,
10913,
2662,
10426,
5805,
38715,
198,
220,
220,
220,
34087,
17750,
764,
198,
24326,
2665,
13,
628,
220,
38491,
327,
62,
9864,
23680,
62,
25216,
2099,
19269,
2751,
1988,
705,
55,
8634,
51,
6,
22492,
15285,
62,
32541,
13,
198,
220,
1366,
1395,
8634,
51,
62,
20608,
2099,
327,
55,
8634,
21016,
1546,
34,
764,
198,
220,
38491,
327,
62,
42197,
62,
47690,
2099,
19269,
2751,
1988,
705,
10459,
6,
22492,
15285,
62,
32541,
13,
628,
220,
5050,
17151,
62,
55,
8634,
51,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
55,
8634,
51,
62,
20608,
2099,
327,
5188,
10917,
18310,
11902,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
13252,
62,
55,
8634,
51,
8,
2099,
1006,
284,
7852,
62,
46,
17,
62,
17614,
62,
55,
8634,
21016,
1546,
34,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
1168,
34,
55,
62,
50,
2969,
43,
17248,
764,
198,
220,
5050,
14719,
6089,
62,
55,
8634,
51,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
9399,
62,
55,
8634,
51,
2099,
1006,
284,
7852,
62,
46,
17,
62,
17614,
62,
55,
8634,
21016,
1546,
34,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
1168,
34,
55,
62,
50,
2969,
43,
17248,
764,
198,
220,
5050,
25823,
62,
55,
8634,
51,
62,
3398,
27746,
17534,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
3398,
27746,
17534,
2099,
9564,
2969,
62,
8202,
3535,
4277,
9564,
2969,
62,
5446,
8924,
198,
220,
220,
220,
220,
220,
5145,
9399,
62,
55,
8634,
51,
2099,
1006,
284,
7852,
62,
46,
17,
62,
17614,
62,
55,
8634,
21016,
1546,
34,
198,
220,
220,
220,
9871,
11507,
314,
62,
3398,
27746,
17534,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
1168,
34,
55,
62,
50,
2969,
43,
17248,
764,
198,
220,
5050,
25823,
62,
55,
8634,
51,
62,
20608,
764,
628,
220,
5050,
5550,
28882,
4720,
33,
23680,
198,
220,
220,
220,
34087,
17750,
764,
198,
220,
5050,
17151,
9864,
23680,
25216,
198,
220,
220,
220,
34087,
17750,
764,
198,
19734,
2665,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
50,
2969,
43,
17248,
62,
5446,
15037,
35036,
30023,
2538,
10979,
6234,
13,
628,
198,
49273,
1125,
66,
365,
87,
1023,
764,
198,
16208,
10097,
30934,
59,
198,
9,
91,
770,
2393,
318,
636,
286,
48323,
8726,
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,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
15269,
4793,
12,
4626,
416,
40396,
376,
962,
3099,
7220,
7,
6988,
5708,
13,
69,
962,
3099,
7220,
31,
25641,
415,
13,
354,
8,
198,
9,
91,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
220,
220,
220,
220,
930,
198,
9,
91,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
220,
220,
220,
930,
198,
9,
91,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
930,
198,
9,
91,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
220,
220,
930,
198,
9,
91,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
"! API for Initializing the Transactional Buffer of the Travel API
"!
FUNCTION /DMO/FLIGHT_TRAVEL_INITIALI_11.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"----------------------------------------------------------------------
/dmo/cl_flight_legacy11=>get_instance( )->initialize( ).
ENDFUNCTION.
| [
40484,
7824,
329,
20768,
2890,
262,
3602,
529,
1538,
47017,
286,
262,
13524,
7824,
198,
40484,
198,
42296,
4177,
2849,
1220,
35,
11770,
14,
3697,
9947,
62,
51,
3861,
18697,
62,
1268,
2043,
12576,
40,
62,
1157,
13,
198,
9,
1,
10097,
23031,
198,
9,
1,
9,
1,
14565,
26491,
25,
198,
9,
1,
10097,
23031,
198,
220,
1220,
67,
5908,
14,
565,
62,
22560,
62,
1455,
1590,
1157,
14804,
1136,
62,
39098,
7,
1267,
3784,
36733,
1096,
7,
6739,
198,
1677,
8068,
4944,
4177,
2849,
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
] |
CLASS /MINDSET/ZERROR_LOG_TEST DEFINITION
PUBLIC
FINAL
CREATE PUBLIC
FOR TESTING.
PUBLIC SECTION.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS /MINDSET/ZERROR_LOG_TEST IMPLEMENTATION.
ENDCLASS.
| [
31631,
1220,
23678,
5258,
2767,
14,
57,
24908,
62,
25294,
62,
51,
6465,
220,
5550,
20032,
17941,
198,
44731,
198,
25261,
198,
29244,
6158,
44731,
198,
7473,
43001,
2751,
13,
628,
220,
44731,
44513,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
198,
198,
31631,
1220,
23678,
5258,
2767,
14,
57,
24908,
62,
25294,
62,
51,
6465,
30023,
2538,
10979,
6234,
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
] |
"! <p>
"! Default implementation of the logging API in the context of Google Drive,
"! which writes the entries to an internal table buffer.
"! </p>
"!
"! See https://developers.google.com/drive/
class zcl_googlepoc_drive_log_impl definition
public
create public
final.
public section.
interfaces zif_googlepoc_drive_log_api.
aliases mt_log
for zif_googlepoc_drive_log_api~mt_log.
aliases log
for zif_googlepoc_drive_log_api~log ##SHADOW[LOG].
endclass.
class zcl_googlepoc_drive_log_impl implementation.
method zif_googlepoc_drive_log_api~log.
append value zif_googlepoc_drive_log_api=>ys_log_entry(
date = sy-datum
time = sy-uzeit
message = iv_message
) to me->mt_log.
endmethod.
endclass.
| [
40484,
1279,
79,
29,
198,
40484,
15161,
7822,
286,
262,
18931,
7824,
287,
262,
4732,
286,
3012,
9974,
11,
198,
40484,
543,
6797,
262,
12784,
284,
281,
5387,
3084,
11876,
13,
198,
40484,
7359,
79,
29,
198,
40484,
198,
40484,
4091,
3740,
1378,
16244,
364,
13,
13297,
13,
785,
14,
19472,
14,
198,
4871,
1976,
565,
62,
13297,
79,
420,
62,
19472,
62,
6404,
62,
23928,
6770,
198,
220,
1171,
198,
220,
2251,
1171,
198,
220,
2457,
13,
628,
198,
220,
1171,
2665,
13,
628,
220,
220,
220,
20314,
1976,
361,
62,
13297,
79,
420,
62,
19472,
62,
6404,
62,
15042,
13,
628,
220,
220,
220,
47217,
45079,
62,
6404,
198,
220,
220,
220,
220,
220,
329,
1976,
361,
62,
13297,
79,
420,
62,
19472,
62,
6404,
62,
15042,
93,
16762,
62,
6404,
13,
198,
220,
220,
220,
47217,
2604,
198,
220,
220,
220,
220,
220,
329,
1976,
361,
62,
13297,
79,
420,
62,
19472,
62,
6404,
62,
15042,
93,
6404,
22492,
9693,
2885,
3913,
58,
25294,
4083,
198,
198,
437,
4871,
13,
628,
198,
4871,
1976,
565,
62,
13297,
79,
420,
62,
19472,
62,
6404,
62,
23928,
7822,
13,
628,
198,
220,
2446,
1976,
361,
62,
13297,
79,
420,
62,
19472,
62,
6404,
62,
15042,
93,
6404,
13,
198,
220,
220,
220,
24443,
1988,
1976,
361,
62,
13297,
79,
420,
62,
19472,
62,
6404,
62,
15042,
14804,
893,
62,
6404,
62,
13000,
7,
198,
220,
220,
220,
220,
220,
3128,
220,
220,
220,
796,
827,
12,
19608,
388,
198,
220,
220,
220,
220,
220,
640,
220,
220,
220,
796,
827,
12,
84,
2736,
270,
198,
220,
220,
220,
220,
220,
3275,
796,
21628,
62,
20500,
198,
220,
220,
220,
1267,
284,
502,
3784,
16762,
62,
6404,
13,
198,
220,
886,
24396,
13,
628,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 cx_parameter_invalid_range DEFINITION PUBLIC INHERITING FROM cx_dynamic_check.
ENDCLASS.
CLASS cx_parameter_invalid_range IMPLEMENTATION.
ENDCLASS. | [
31631,
43213,
62,
17143,
2357,
62,
259,
12102,
62,
9521,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
43213,
62,
67,
28995,
62,
9122,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
43213,
62,
17143,
2357,
62,
259,
12102,
62,
9521,
30023,
2538,
10979,
6234,
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
] |
CLASS zcl_abapgit_object_type 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.
CONSTANTS: c_prefix TYPE c LENGTH 3 VALUE '%_C'.
METHODS read
EXPORTING ev_ddtext TYPE ddtypet-ddtext
et_source TYPE abaptxt255_tab
RAISING zcx_abapgit_not_found.
METHODS create
IMPORTING iv_ddtext TYPE ddtypet-ddtext
it_source TYPE abaptxt255_tab
iv_devclass TYPE devclass
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_TYPE IMPLEMENTATION.
METHOD create.
DATA: lv_progname TYPE reposrc-progname,
lv_typegroup TYPE rsedd0-typegroup.
lv_typegroup = ms_item-obj_name.
CALL FUNCTION 'RS_DD_TYGR_INSERT_SOURCES'
EXPORTING
typegroupname = lv_typegroup
ddtext = iv_ddtext
corrnum = ''
devclass = iv_devclass
TABLES
source = it_source
EXCEPTIONS
already_exists = 1
not_executed = 2
permission_failure = 3
object_not_specified = 4
illegal_name = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from RS_DD_TYGR_INSERT_SOURCES' ).
ENDIF.
CONCATENATE c_prefix lv_typegroup INTO lv_progname.
UPDATE progdir SET uccheck = abap_true
WHERE name = lv_progname.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error setting uccheck' ).
ENDIF.
ENDMETHOD.
METHOD read.
DATA: lv_typdname TYPE rsedd0-typegroup,
lt_psmodisrc TYPE TABLE OF smodisrc,
lt_psmodilog TYPE TABLE OF smodilog,
lt_ptrdir TYPE TABLE OF trdir.
SELECT SINGLE ddtext FROM ddtypet
INTO ev_ddtext
WHERE typegroup = ms_item-obj_name
AND ddlanguage = mv_language.
lv_typdname = ms_item-obj_name.
CALL FUNCTION 'TYPD_GET_OBJECT'
EXPORTING
typdname = lv_typdname
TABLES
psmodisrc = lt_psmodisrc
psmodilog = lt_psmodilog
psource = et_source
ptrdir = lt_ptrdir
EXCEPTIONS
version_not_found = 1
reps_not_exist = 2
OTHERS = 3.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_abapgit_not_found.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown. " todo
ENDMETHOD.
METHOD zif_abapgit_object~delete.
IF zif_abapgit_object~exists( ) = abap_false.
RETURN.
ENDIF.
delete_ddic( 'G' ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_ddtext TYPE ddtypet-ddtext,
lt_source TYPE abaptxt255_tab,
lv_progname TYPE reposrc-progname,
lv_typegroup TYPE rsedd0-typegroup.
lv_typegroup = ms_item-obj_name.
io_xml->read( EXPORTING iv_name = 'DDTEXT'
CHANGING cg_data = lv_ddtext ).
lt_source = mo_files->read_abap( ).
IF zif_abapgit_object~exists( ) = abap_false.
create( iv_ddtext = lv_ddtext
it_source = lt_source
iv_devclass = iv_package ).
ELSE.
CONCATENATE c_prefix lv_typegroup INTO lv_progname.
INSERT REPORT lv_progname FROM lt_source STATE 'I'.
ENDIF.
zcl_abapgit_objects_activation=>add_item( ms_item ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
TRY.
read( ).
rv_bool = abap_true.
CATCH zcx_abapgit_not_found
zcx_abapgit_exception.
rv_bool = abap_false.
ENDTRY.
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.
jump_se11( iv_radio = 'RSRD1-TYMA'
iv_field = 'RSRD1-TYMA_VAL' ).
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lv_ddtext TYPE ddtypet-ddtext,
lt_source TYPE abaptxt255_tab.
TRY.
read( IMPORTING
ev_ddtext = lv_ddtext
et_source = lt_source ).
CATCH zcx_abapgit_not_found.
RETURN.
ENDTRY.
io_xml->add( iv_name = 'DDTEXT'
ig_data = lv_ddtext ).
mo_files->add_abap( lt_source ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
4906,
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,
7102,
2257,
1565,
4694,
25,
269,
62,
40290,
41876,
269,
406,
49494,
513,
26173,
8924,
705,
4,
62,
34,
4458,
628,
220,
220,
220,
337,
36252,
50,
1100,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
819,
62,
1860,
5239,
41876,
49427,
774,
6449,
12,
1860,
5239,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2123,
62,
10459,
41876,
450,
2373,
742,
13381,
62,
8658,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1662,
62,
9275,
13,
628,
220,
220,
220,
337,
36252,
50,
2251,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
1860,
5239,
220,
220,
41876,
49427,
774,
6449,
12,
1860,
5239,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
10459,
220,
220,
41876,
450,
2373,
742,
13381,
62,
8658,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
7959,
4871,
41876,
1614,
4871,
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,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
25216,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
2251,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
1676,
70,
3672,
220,
41876,
1128,
418,
6015,
12,
1676,
70,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
4906,
8094,
41876,
44608,
6048,
15,
12,
4906,
8094,
13,
628,
198,
220,
220,
220,
300,
85,
62,
4906,
8094,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
6998,
62,
16458,
62,
9936,
10761,
62,
20913,
17395,
62,
50,
2606,
7397,
1546,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
8094,
3672,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
4906,
8094,
198,
220,
220,
220,
220,
220,
220,
220,
49427,
5239,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
1860,
5239,
198,
220,
220,
220,
220,
220,
220,
220,
1162,
81,
22510,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
10148,
198,
220,
220,
220,
220,
220,
220,
220,
1614,
4871,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
7959,
4871,
198,
220,
220,
220,
220,
220,
309,
6242,
28378,
198,
220,
220,
220,
220,
220,
220,
220,
2723,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
340,
62,
10459,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
1541,
62,
1069,
1023,
220,
220,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
407,
62,
18558,
7241,
220,
220,
220,
220,
220,
220,
220,
220,
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,
2134,
62,
1662,
62,
23599,
796,
604,
198,
220,
220,
220,
220,
220,
220,
220,
5293,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
796,
642,
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,
796,
718,
13,
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,
19340,
62,
16458,
62,
9936,
10761,
62,
20913,
17395,
62,
50,
2606,
7397,
1546,
6,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
39962,
1404,
1677,
6158,
269,
62,
40290,
300,
85,
62,
4906,
8094,
39319,
300,
85,
62,
1676,
70,
3672,
13,
198,
220,
220,
220,
35717,
1172,
15908,
25823,
334,
535,
258,
694,
796,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
33411,
1438,
796,
300,
85,
62,
1676,
70,
3672,
13,
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,
4634,
334,
535,
258,
694,
6,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1100,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
28004,
67,
3672,
220,
41876,
44608,
6048,
15,
12,
4906,
8094,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
862,
4666,
271,
6015,
41876,
43679,
3963,
895,
375,
271,
6015,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
862,
4666,
346,
519,
41876,
43679,
3963,
895,
375,
346,
519,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
457,
4372,
343,
220,
220,
220,
41876,
43679,
3963,
491,
15908,
13,
628,
198,
220,
220,
220,
33493,
311,
2751,
2538,
49427,
5239,
16034,
49427,
774,
6449,
198,
220,
220,
220,
220,
220,
39319,
819,
62,
1860,
5239,
198,
220,
220,
220,
220,
220,
33411,
2099,
8094,
220,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
5357,
49427
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_uitb_gui_simple_command DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_uitb_gui_command.
ALIASES mv_function
FOR zif_uitb_gui_command~mv_function.
ALIASES mr_params
FOR zif_uitb_gui_command~mr_params.
ALIASES mv_type
FOR zif_uitb_gui_command~mv_type.
DATA mo_menu TYPE REF TO cl_ctmenu READ-ONLY.
METHODS constructor
IMPORTING
iv_function TYPE ui_func
iv_type TYPE zif_uitb_gui_command=>ty_command_type DEFAULT zif_uitb_gui_command=>c_command_type-normal
ir_params TYPE REF TO data OPTIONAL.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_uitb_gui_simple_command IMPLEMENTATION.
METHOD constructor.
mv_function = iv_function.
mv_type = iv_type.
mr_params = ir_params.
ENDMETHOD.
METHOD zif_uitb_gui_command~set_context_menu.
mo_menu = io_menu.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
5013,
65,
62,
48317,
62,
36439,
62,
21812,
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,
48317,
62,
21812,
13,
628,
220,
220,
220,
8355,
43429,
1546,
285,
85,
62,
8818,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
5013,
65,
62,
48317,
62,
21812,
93,
76,
85,
62,
8818,
13,
198,
220,
220,
220,
8355,
43429,
1546,
285,
81,
62,
37266,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
5013,
65,
62,
48317,
62,
21812,
93,
43395,
62,
37266,
13,
198,
220,
220,
220,
8355,
43429,
1546,
285,
85,
62,
4906,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
5013,
65,
62,
48317,
62,
21812,
93,
76,
85,
62,
4906,
13,
198,
220,
220,
220,
42865,
6941,
62,
26272,
41876,
4526,
37,
5390,
537,
62,
310,
26272,
20832,
12,
1340,
11319,
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,
21628,
62,
8818,
41876,
334,
72,
62,
20786,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
4906,
220,
220,
220,
220,
41876,
1976,
361,
62,
5013,
65,
62,
48317,
62,
21812,
14804,
774,
62,
21812,
62,
4906,
5550,
38865,
1976,
361,
62,
5013,
65,
62,
48317,
62,
21812,
14804,
66,
62,
21812,
62,
4906,
12,
11265,
198,
220,
220,
220,
220,
220,
220,
220,
4173,
62,
37266,
220,
220,
41876,
4526,
37,
5390,
1366,
39852,
2849,
1847,
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,
5013,
65,
62,
48317,
62,
36439,
62,
21812,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
285,
85,
62,
8818,
796,
21628,
62,
8818,
13,
198,
220,
220,
220,
285,
85,
62,
4906,
796,
21628,
62,
4906,
13,
198,
220,
220,
220,
285,
81,
62,
37266,
796,
4173,
62,
37266,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
5013,
65,
62,
48317,
62,
21812,
93,
2617,
62,
22866,
62,
26272,
13,
198,
220,
220,
220,
6941,
62,
26272,
796,
33245,
62,
26272,
13,
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,
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) TYPE REF TO zif_abapgit_tag_popups .
CLASS-METHODS get_gui_functions
RETURNING
VALUE(ri_gui_functions) TYPE REF TO zif_abapgit_gui_functions .
CLASS-METHODS get_gui
RETURNING
VALUE(ro_gui) TYPE REF TO zcl_abapgit_gui
RAISING
zcx_abapgit_exception .
CLASS-METHODS get_frontend_services
RETURNING
VALUE(ri_fe_serv) TYPE REF TO zif_abapgit_frontend_services .
PROTECTED SECTION.
PRIVATE SECTION.
CLASS-DATA gi_popups TYPE REF TO zif_abapgit_popups .
CLASS-DATA gi_tag_popups TYPE REF TO zif_abapgit_tag_popups .
CLASS-DATA gi_gui_functions TYPE REF TO zif_abapgit_gui_functions .
CLASS-DATA go_gui TYPE REF TO zcl_abapgit_gui .
CLASS-DATA gi_fe_services TYPE REF TO zif_abapgit_frontend_services .
CLASS-METHODS init_asset_manager
RETURNING
VALUE(ro_asset_man) TYPE REF TO zcl_abapgit_gui_asset_manager
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_UI_FACTORY IMPLEMENTATION.
METHOD get_frontend_services.
IF gi_fe_services IS INITIAL.
CREATE OBJECT gi_fe_services TYPE zcl_abapgit_frontend_services.
ENDIF.
ri_fe_serv = gi_fe_services.
ENDMETHOD.
METHOD get_gui.
DATA:
li_router TYPE REF TO zif_abapgit_gui_event_handler,
li_asset_man TYPE REF TO zif_abapgit_gui_asset_manager.
DATA lo_html_preprocessor TYPE REF TO zcl_abapgit_gui_html_processor.
IF go_gui IS INITIAL.
li_asset_man ?= init_asset_manager( ).
CREATE OBJECT lo_html_preprocessor EXPORTING ii_asset_man = li_asset_man.
lo_html_preprocessor->preserve_css( 'css/ag-icons.css' ).
lo_html_preprocessor->preserve_css( 'css/common.css' ).
CREATE OBJECT li_router TYPE zcl_abapgit_gui_router.
CREATE OBJECT go_gui
EXPORTING
io_component = li_router
ii_html_processor = lo_html_preprocessor
ii_asset_man = li_asset_man.
ENDIF.
ro_gui = go_gui.
ENDMETHOD.
METHOD get_gui_functions.
IF gi_gui_functions IS INITIAL.
CREATE OBJECT gi_gui_functions TYPE zcl_abapgit_gui_functions.
ENDIF.
ri_gui_functions = gi_gui_functions.
ENDMETHOD.
METHOD get_popups.
IF gi_popups IS INITIAL.
CREATE OBJECT gi_popups TYPE zcl_abapgit_popups.
ENDIF.
ri_popups = gi_popups.
ENDMETHOD.
METHOD get_tag_popups.
IF gi_tag_popups IS INITIAL.
CREATE OBJECT gi_tag_popups TYPE zcl_abapgit_tag_popups.
ENDIF.
ri_tag_popups = gi_tag_popups.
ENDMETHOD.
METHOD init_asset_manager.
" used by abapmerge
DEFINE _inline.
APPEND &1 TO lt_inline.
END-OF-DEFINITION.
DATA lt_inline TYPE string_table.
CREATE OBJECT ro_asset_man.
CLEAR lt_inline.
" @@abapmerge include zabapgit_css_common.w3mi.data.css > _inline '$$'.
ro_asset_man->register_asset(
iv_url = 'css/common.css'
iv_type = 'text/css'
iv_mime_name = 'ZABAPGIT_CSS_COMMON'
iv_inline = concat_lines_of( table = lt_inline sep = cl_abap_char_utilities=>newline ) ).
CLEAR lt_inline.
" @@abapmerge include zabapgit_css_theme_default.w3mi.data.css > _inline '$$'.
ro_asset_man->register_asset(
iv_url = 'css/theme-default.css'
iv_type = 'text/css'
iv_cachable = abap_false
iv_mime_name = 'ZABAPGIT_CSS_THEME_DEFAULT'
iv_inline = concat_lines_of( table = lt_inline sep = cl_abap_char_utilities=>newline ) ).
CLEAR lt_inline.
" @@abapmerge include zabapgit_css_theme_dark.w3mi.data.css > _inline '$$'.
ro_asset_man->register_asset(
iv_url = 'css/theme-dark.css'
iv_type = 'text/css'
iv_cachable = abap_false
iv_mime_name = 'ZABAPGIT_CSS_THEME_DARK'
iv_inline = concat_lines_of( table = lt_inline sep = cl_abap_char_utilities=>newline ) ).
CLEAR lt_inline.
" @@abapmerge include zabapgit_css_theme_belize_blue.w3mi.data.css > _inline '$$'.
ro_asset_man->register_asset(
iv_url = 'css/theme-belize-blue.css'
iv_type = 'text/css'
iv_cachable = abap_false
iv_mime_name = 'ZABAPGIT_CSS_THEME_BELIZE_BLUE'
iv_inline = concat_lines_of( table = lt_inline sep = cl_abap_char_utilities=>newline ) ).
CLEAR lt_inline.
" @@abapmerge include zabapgit_js_common.w3mi.data.js > _inline '$$'.
ro_asset_man->register_asset(
iv_url = 'js/common.js'
iv_type = 'text/javascript'
iv_mime_name = 'ZABAPGIT_JS_COMMON'
iv_inline = concat_lines_of( table = lt_inline sep = cl_abap_char_utilities=>newline ) ).
CLEAR lt_inline.
" @@abapmerge include zabapgit_icon_font_css.w3mi.data.css > _inline '$$'.
ro_asset_man->register_asset(
iv_url = 'css/ag-icons.css'
iv_type = 'text/css'
iv_mime_name = 'ZABAPGIT_ICON_FONT_CSS'
iv_inline = concat_lines_of( table = lt_inline sep = cl_abap_char_utilities=>newline ) ).
CLEAR lt_inline.
" @@abapmerge include-base64 zabapgit_icon_font.w3mi.data.woff > _inline '$$'.
ro_asset_man->register_asset(
iv_url = 'font/ag-icons.woff'
iv_type = 'font/woff'
iv_mime_name = 'ZABAPGIT_ICON_FONT'
iv_base64 = concat_lines_of( table = lt_inline ) ).
" see https://github.com/larshp/abapGit/issues/201 for source SVG
ro_asset_man->register_asset(
iv_url = 'img/logo'
iv_type = 'image/png'
iv_base64 =
'iVBORw0KGgoAAAANSUhEUgAAAKMAAAAoCAYAAACSG0qbAAAABHNCSVQICAgIfAhkiAAA'
&& 'AAlwSFlzAAAEJQAABCUBprHeCQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9y'
&& 'Z5vuPBoAAA8VSURBVHic7Zx7cJzVeYef31nJAtvYko1JjM3FYHlXimwZkLWyLEMcwIGQ'
&& 'cEkDJWmTltLStGkoDCkzwBAuCemUlksDNCkhJTTTljJpZhIuBQxxAWPvyuYiW7UkG8Il'
&& 'UByIsS1sLEu75+0fu5JXu9/etAJz0TOzM/rOec85765+37m+3yczY8w0NU3qrwv9npfa'
&& 'Hfx02pPPd469sgk+7misY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&& 'cpUAAAAASUVORK5CYII=' ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
9019,
62,
69,
9548,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
4810,
3824,
6158,
198,
220,
10188,
9864,
1847,
48167,
1677,
5258,
1976,
565,
62,
397,
499,
18300,
62,
9019,
62,
259,
752,
273,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
12924,
4739,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
12924,
4739,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
12985,
62,
12924,
4739,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
12985,
62,
12924,
4739,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
12985,
62,
12924,
4739,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
48317,
62,
12543,
2733,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
48317,
62,
12543,
2733,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
12543,
2733,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
48317,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
48317,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48317,
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,
651,
62,
8534,
437,
62,
30416,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
5036,
62,
3168,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
8534,
437,
62,
30416,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42715,
12,
26947,
308,
72,
62,
12924,
4739,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
764,
198,
220,
220,
220,
42715,
12,
26947,
308,
72,
62,
12985,
62,
12924,
4739,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
12985,
62,
12924,
4739,
764,
198,
220,
220,
220,
42715,
12,
26947,
308,
72,
62,
48317,
62,
12543,
2733,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
12543,
2733,
764,
198,
220,
220,
220,
42715,
12,
26947,
467,
62,
48317,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48317,
764,
198,
220,
220,
220,
42715,
12,
26947,
308,
72,
62,
5036,
62,
30416,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
8534,
437,
62,
30416,
764,
628,
220,
220,
220,
42715,
12,
49273,
50,
2315,
62,
562,
316,
62,
37153,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
562,
316,
62,
805,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
562,
316,
62,
37153,
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,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
10080,
62,
37,
10659,
15513,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
651,
62,
8534,
437,
62,
30416,
13,
628,
220,
220,
220,
16876,
308,
72,
62,
5036,
62,
30416,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
308,
72,
62,
5036,
62,
30416,
41876,
1976,
565,
62,
397,
499,
18300,
62,
8534,
437,
62,
30416,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
374,
72,
62,
5036,
62,
3168,
796,
308,
72,
62,
5036,
62,
30416,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
48317,
13,
628,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
7649,
62,
472,
353,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
62,
30281,
11,
198,
220,
220,
220,
220,
220,
7649,
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,
42865,
2376,
62,
6494,
62,
3866,
41341,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
6494,
62,
41341,
13,
628,
220,
220,
220,
16876,
467,
62,
48317,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
7649,
62,
562,
316,
62,
805,
5633,
28,
2315,
62,
562,
316,
62,
37153,
7,
6739,
628,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
2376,
62,
6494,
62,
3866,
41341,
7788,
15490,
2751,
21065,
62,
562,
316,
62,
805,
796,
7649,
62,
562,
316,
62,
805,
13,
198,
220,
220,
220,
220,
220,
2376,
62,
6494,
62,
3866,
41341,
3784,
18302,
3760,
62,
25471,
7,
705,
25471,
14,
363,
12,
34280,
13,
25471,
6,
6739,
198,
220,
220,
220,
220,
220,
2376,
62,
6494,
62,
3866,
41341,
3784,
18302,
3760,
62,
25471,
7,
705,
25471,
14,
11321,
13,
25471,
6,
6739,
628,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
7649,
62,
472,
353,
41876,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
472,
353,
13,
628,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
467,
62,
48317,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
42895,
220,
220,
220,
220,
220,
796,
7649,
62,
472,
353,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21065,
62,
6494,
62,
41341,
796,
2376,
62,
6494,
62,
3866,
41341,
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,
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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
] |
*"* use this source file for the definition and implementation of
*"* local helper classes, interface definitions and type
*"* declarations
CLASS lcl_abapgit_provider IMPLEMENTATION.
METHOD lif_abapgit_provider~validate_package.
zcl_abapgit_repo_srv=>get_instance( )->validate_package( iv_package = iv_package ).
ENDMETHOD.
METHOD lif_abapgit_provider~list_repositories.
rt_list = zcl_abapgit_repo_srv=>get_instance( )->list( ).
ENDMETHOD.
METHOD lif_abapgit_provider~validate_transport_request.
DATA: lv_error_message TYPE string.
SELECT SINGLE * FROM e070 INTO @DATA(ls_e070)
WHERE
trkorr = @iv_transport_request.
IF sy-subrc NE 0.
MESSAGE e003(za4c_agit_adt) WITH iv_transport_request INTO lv_error_message.
zcx_abapgit_exception=>raise_t100( ).
ELSEIF ls_e070-trstatus NE 'D'.
MESSAGE e004(za4c_agit_adt) WITH iv_transport_request INTO lv_error_message.
zcx_abapgit_exception=>raise_t100( ).
ELSEIF ls_e070-as4user NE sy-uname.
MESSAGE e005(za4c_agit_adt) WITH iv_transport_request INTO lv_error_message.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD lif_abapgit_provider~set_authentication_info.
zcl_abapgit_default_auth_info=>refresh( ).
zcl_abapgit_default_auth_info=>set_auth_info( iv_user = iv_user
iv_password = iv_password ).
ENDMETHOD.
METHOD lif_abapgit_provider~perform_import.
DATA lo_log TYPE REF TO zcl_abapgit_log.
"Set the default transport request
IF is_request_data-transportrequest IS NOT INITIAL.
zcl_abapgit_default_transport=>get_instance( )->set( CONV #( is_request_data-transportrequest ) ).
ENDIF.
"Create online repo
DATA(lo_repo) = zcl_abapgit_repo_srv=>get_instance( )->new_online(
iv_url = is_request_data-url
iv_branch_name = is_request_data-branch
iv_package = CONV devclass( is_request_data-package ) ).
"Pull objects
lo_repo->refresh( ).
DATA(ls_checks) = lo_repo->deserialize_checks( ).
"Overwrite existing objects
LOOP AT ls_checks-overwrite ASSIGNING FIELD-SYMBOL(<ls_overwrite>).
<ls_overwrite>-decision = 'Y'.
ENDLOOP.
LOOP AT ls_checks-warning_package ASSIGNING FIELD-SYMBOL(<ls_warning_package>).
<ls_warning_package>-decision = 'Y'.
ENDLOOP.
lo_log = NEW #( ).
"Import objects
ls_checks-transport-transport = is_request_data-transportrequest.
lo_repo->deserialize( is_checks = ls_checks ii_log = lo_log ).
ENDMETHOD.
METHOD lif_abapgit_provider~is_tr_check_required.
DATA: ls_tr_check_data TYPE transport_check.
rv_is_required = abap_true.
ls_tr_check_data-pgmid = 'R3TR'.
ls_tr_check_data-object = 'DEVC'.
ls_tr_check_data-objectname = iv_package.
ls_tr_check_data-operation = 'I'.
cl_cts_adt_obj_record=>check_objects( CHANGING cs_transport_check = ls_tr_check_data ).
IF ls_tr_check_data-recording = abap_false AND ls_tr_check_data-result <> 'E'.
CLEAR: rv_is_required.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
262,
6770,
290,
7822,
286,
198,
9,
1,
9,
1957,
31904,
6097,
11,
7071,
17336,
290,
2099,
198,
9,
1,
9,
31713,
198,
31631,
300,
565,
62,
397,
499,
18300,
62,
15234,
1304,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
3868,
62,
397,
499,
18300,
62,
15234,
1304,
93,
12102,
378,
62,
26495,
13,
198,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
27891,
85,
14804,
1136,
62,
39098,
7,
1267,
3784,
12102,
378,
62,
26495,
7,
21628,
62,
26495,
796,
21628,
62,
26495,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
3868,
62,
397,
499,
18300,
62,
15234,
1304,
93,
4868,
62,
260,
1930,
270,
1749,
13,
198,
220,
220,
220,
374,
83,
62,
4868,
796,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
27891,
85,
14804,
1136,
62,
39098,
7,
1267,
3784,
4868,
7,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
3868,
62,
397,
499,
18300,
62,
15234,
1304,
93,
12102,
378,
62,
7645,
634,
62,
25927,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
18224,
62,
20500,
41876,
4731,
13,
628,
220,
220,
220,
33493,
311,
2751,
2538,
1635,
16034,
304,
43509,
39319,
2488,
26947,
7,
7278,
62,
68,
43509,
8,
198,
220,
220,
220,
220,
220,
33411,
198,
220,
220,
220,
220,
220,
491,
74,
38890,
796,
2488,
452,
62,
7645,
634,
62,
25927,
13,
628,
220,
220,
220,
16876,
827,
12,
7266,
6015,
10635,
657,
13,
198,
220,
220,
220,
220,
220,
337,
1546,
4090,
8264,
304,
11245,
7,
4496,
19,
66,
62,
363,
270,
62,
324,
83,
8,
13315,
21628,
62,
7645,
634,
62,
25927,
39319,
300,
85,
62,
18224,
62,
20500,
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,
17852,
5188,
5064,
43979,
62,
68,
43509,
12,
2213,
13376,
10635,
705,
35,
4458,
198,
220,
220,
220,
220,
220,
337,
1546,
4090,
8264,
304,
22914,
7,
4496,
19,
66,
62,
363,
270,
62,
324,
83,
8,
13315,
21628,
62,
7645,
634,
62,
25927,
39319,
300,
85,
62,
18224,
62,
20500,
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,
17852,
5188,
5064,
43979,
62,
68,
43509,
12,
292,
19,
7220,
10635,
827,
12,
403,
480,
13,
198,
220,
220,
220,
220,
220,
337,
1546,
4090,
8264,
304,
22544,
7,
4496,
19,
66,
62,
363,
270,
62,
324,
83,
8,
13315,
21628,
62,
7645,
634,
62,
25927,
39319,
300,
85,
62,
18224,
62,
20500,
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,
23578,
49273,
13,
628,
220,
337,
36252,
3868,
62,
397,
499,
18300,
62,
15234,
1304,
93,
2617,
62,
41299,
3299,
62,
10951,
13,
198,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
12286,
62,
18439,
62,
10951,
14804,
5420,
3447,
7,
6739,
198,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
12286,
62,
18439,
62,
10951,
14804,
2617,
62,
18439,
62,
10951,
7,
21628,
62,
7220,
220,
220,
220,
220,
796,
21628,
62,
7220,
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,
21628,
62,
28712,
796,
21628,
62,
28712,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
3868,
62,
397,
499,
18300,
62,
15234,
1304,
93,
525,
687,
62,
11748,
13,
628,
220,
220,
220,
42865,
2376,
62,
6404,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6404,
13,
628,
220,
220,
220,
366,
7248,
262,
4277,
4839,
2581,
198,
220,
220,
220,
16876,
318,
62,
25927,
62,
7890,
12,
7645,
634,
25927,
3180,
5626,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
12286,
62,
7645,
634,
14804,
1136,
62,
39098,
7,
1267,
3784,
2617,
7,
7102,
53,
1303,
7,
318,
62,
25927,
62,
7890,
12,
7645,
634,
25927,
1267,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
366,
16447,
2691,
29924,
198,
220,
220,
220,
42865,
7,
5439,
62,
260,
7501,
8,
796,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
27891,
85,
14804,
1136,
62,
39098,
7,
1267,
3784,
3605,
62,
25119,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
6371,
220,
220,
220,
220,
220,
220,
220,
220,
796,
318,
62,
25927,
62,
7890,
12,
6371,
198,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
1671,
3702,
62,
3672,
796,
318,
62,
25927,
62,
7890,
12,
1671,
3702,
198,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
26495,
220,
220,
220,
220,
796,
7102,
53,
1614,
4871,
7,
318,
62,
25927,
62,
7890,
12,
26495,
1267,
6739,
628,
220,
220,
220,
366,
42940,
5563,
198,
220,
220,
220,
2376,
62,
260,
7501,
3784,
5420,
3447,
7,
6739,
628,
220,
220,
220,
42865,
7,
7278,
62,
42116,
8,
796,
2376,
62,
260,
7501,
3784,
8906,
48499,
1096,
62,
42116,
7,
6739,
628,
220,
220,
220,
366,
5886,
13564,
4683,
5563,
198,
220,
220,
220,
17579,
3185,
5161,
43979,
62,
42116,
12,
2502,
13564,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
7278,
62,
2502,
13564,
29,
737,
198,
220,
220,
220,
220,
220,
1279,
7278,
62,
2502,
13564,
29,
12,
12501,
1166,
796,
705,
56,
4458,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
17579,
3185,
5161,
43979,
62,
42116,
12,
43917,
62,
26495,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
7278,
62,
43917,
62,
26495,
29,
737,
198,
220,
220,
220,
220,
220,
1279,
7278,
62,
43917,
62,
26495,
29,
12
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
*&---------------------------------------------------------------------*
*& Report Z2MSE_TEST2_I_PROGRAM
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT z2mse_test2_i_program.
CALL FUNCTION 'Z2MSE_TEST2_M1_FUNCTION_A'.
z2mse_test2_m1_cl_a=>static_method_a( ).
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
1168,
17,
44,
5188,
62,
51,
6465,
17,
62,
40,
62,
4805,
7730,
24115,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
198,
9,
5,
10097,
30934,
9,
198,
2200,
15490,
1976,
17,
76,
325,
62,
9288,
17,
62,
72,
62,
23065,
13,
198,
198,
34,
7036,
29397,
4177,
2849,
705,
57,
17,
44,
5188,
62,
51,
6465,
17,
62,
44,
16,
62,
42296,
4177,
2849,
62,
32,
4458,
198,
198,
89,
17,
76,
325,
62,
9288,
17,
62,
76,
16,
62,
565,
62,
64,
14804,
12708,
62,
24396,
62,
64,
7,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_boverview DEFINITION
PUBLIC
FINAL
CREATE PUBLIC INHERITING FROM zcl_abapgit_gui_page.
PUBLIC SECTION.
METHODS:
constructor
IMPORTING io_repo TYPE REF TO zcl_abapgit_repo_online
RAISING zcx_abapgit_exception,
zif_abapgit_gui_event_handler~on_event REDEFINITION.
PROTECTED SECTION.
METHODS render_content REDEFINITION.
PRIVATE SECTION.
DATA: mo_repo TYPE REF TO zcl_abapgit_repo_online,
mv_compress TYPE abap_bool VALUE abap_false,
mt_commits TYPE zif_abapgit_definitions=>ty_commit_tt,
mi_branch_overview TYPE REF TO zif_abapgit_branch_overview.
CONSTANTS: BEGIN OF c_actions,
uncompress TYPE string VALUE 'uncompress' ##NO_TEXT,
compress TYPE string VALUE 'compress' ##NO_TEXT,
refresh TYPE string VALUE 'refresh' ##NO_TEXT,
merge TYPE string VALUE 'merge' ##NO_TEXT,
END OF c_actions.
TYPES: BEGIN OF ty_merge,
source TYPE string,
target TYPE string,
END OF ty_merge.
METHODS:
refresh
RAISING zcx_abapgit_exception,
body
RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html
RAISING zcx_abapgit_exception,
form_select
IMPORTING iv_name TYPE string
RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html,
render_merge
RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html
RAISING zcx_abapgit_exception,
decode_merge
IMPORTING it_postdata TYPE cnht_post_data_tab
RETURNING VALUE(rs_merge) TYPE ty_merge
RAISING zcx_abapgit_exception,
build_menu
RETURNING VALUE(ro_menu) TYPE REF TO zcl_abapgit_html_toolbar,
escape_branch
IMPORTING iv_string TYPE string
RETURNING VALUE(rv_string) TYPE string,
escape_message
IMPORTING iv_string TYPE string
RETURNING VALUE(rv_string) TYPE string,
render_commit_popups
RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_PAGE_BOVERVIEW IMPLEMENTATION.
METHOD body.
DATA: lv_tag TYPE string,
lv_branch_display_name TYPE string.
FIELD-SYMBOLS: <ls_commit> LIKE LINE OF mt_commits,
<ls_create> LIKE LINE OF <ls_commit>-create.
CREATE OBJECT ro_html.
ro_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top(
io_repo = mo_repo
iv_show_package = abap_false
iv_show_branch = abap_false ) ).
ro_html->add( '<br>' ).
ro_html->add( '<br>' ).
ro_html->add( render_merge( ) ).
ro_html->add( '<br>' ).
ro_html->add( build_menu( )->render( ) ).
"CSS gitGraph-scrollWrapper, gitGraph-HTopScroller and gitGraph-Wrapper
" - Used to manage the Horizonal Scroll bar on top of gitGraph Element
ro_html->add( '<div class="gitGraph-scrollWrapper" onscroll="GitGraphScroller()">' ).
"see http://stackoverflow.com/questions/6081483/maximum-size-of-a-canvas-element
ro_html->add( '<div class="gitGraph-HTopScroller"></div>' ).
ro_html->add( '</div>' ).
ro_html->add( '<div class="gitGraph-Wrapper">' ).
ro_html->add( '<canvas id="gitGraph"></canvas>' ).
ro_html->add( '</div>' ).
ro_html->add( '<script type="text/javascript" src="https://cdnjs.' &&
'cloudflare.com/ajax/libs/gitgraph.js/1.14.0/gitgraph.min.js">' &&
'</script>' ) ##NO_TEXT.
ro_html->add( '<script type="text/javascript">' ).
ro_html->add( 'var myTemplateConfig = {' ).
ro_html->add( 'colors: [ "#979797", "#008fb5", "#f1c109", "'
&& '#095256", "#087F8C", "#5AAA95", "#86A873", "#BB9F06" ],' ) ##NO_TEXT.
ro_html->add( 'branch: {' ).
ro_html->add( ' lineWidth: 8,' ).
ro_html->add( ' spacingX: 50' ).
ro_html->add( '},' ).
ro_html->add( 'commit: {' ).
ro_html->add( ' spacingY: -40,' ).
ro_html->add( ' dot: { size: 12 },' ).
ro_html->add( ' message: { font: "normal 14pt Arial" }' ).
ro_html->add( '}' ).
ro_html->add( '};' ).
ro_html->add( 'var gitgraph = new GitGraph({' ).
ro_html->add( ' template: myTemplateConfig,' ).
ro_html->add( ' orientation: "vertical-reverse"' ).
ro_html->add( '});' ).
ro_html->add( 'var gBranchOveriew = new BranchOverview();' ).
LOOP AT mt_commits ASSIGNING <ls_commit>.
IF sy-tabix = 1.
" assumption: all branches are created from master, todo
ro_html->add( |var {
escape_branch( <ls_commit>-branch ) } = gitgraph.branch("{
<ls_commit>-branch }");| ).
ENDIF.
IF <ls_commit>-branch IS INITIAL.
CONTINUE. " we skip orphaned commits
ENDIF.
IF <ls_commit>-compressed = abap_true.
ro_html->add( |{ escape_branch( <ls_commit>-branch ) }.commit(\{message: "{
escape_message( <ls_commit>-message )
}", dotColor: "black", dotSize: 15, messageHashDisplay: false, messageAuthorDisplay: false\});| ).
ELSEIF <ls_commit>-merge IS INITIAL.
" gitgraph doesn't support multiple tags per commit yet.
" Therefore we concatenate them.
" https://github.com/nicoespeon/gitgraph.js/issues/143
lv_tag = concat_lines_of( table = <ls_commit>-tags
sep = ` | ` ).
ro_html->add( |{ escape_branch( <ls_commit>-branch ) }.commit(\{message: "{
escape_message( <ls_commit>-message ) }", long: "{ escape_message( concat_lines_of( table = <ls_commit>-body
sep = ` ` ) )
}", author: "{
<ls_commit>-author }", sha1: "{
<ls_commit>-sha1(7) }", tag: "{ lv_tag
}", onClick:gBranchOveriew.onCommitClick.bind(gBranchOveriew)\});| ).
ELSE.
ro_html->add( |{ escape_branch( <ls_commit>-merge ) }.merge({
escape_branch( <ls_commit>-branch ) }, \{message: "{
escape_message( <ls_commit>-message ) }", long: "{ escape_message( concat_lines_of( table = <ls_commit>-body
sep = ` ` ) )
}", author: "{ <ls_commit>-author }", sha1: "{
<ls_commit>-sha1(7) }", onClick:gBranchOveriew.onCommitClick.bind(gBranchOveriew)\});| ).
ENDIF.
LOOP AT <ls_commit>-create ASSIGNING <ls_create>.
IF <ls_create>-name CS zcl_abapgit_branch_overview=>c_deleted_branch_name_prefix.
lv_branch_display_name = ''.
ELSE.
lv_branch_display_name = <ls_create>-name.
ENDIF.
ro_html->add( |var { escape_branch( <ls_create>-name ) } = {
escape_branch( <ls_create>-parent ) }.branch("{
lv_branch_display_name }");| ).
ENDLOOP.
ENDLOOP.
ro_html->add(
|gitGraph.addEventListener( "commit:mouseover", gBranchOveriew.showCommit.bind(gBranchOveriew) );| ).
ro_html->add(
|gitGraph.addEventListener( "commit:mouseout", gBranchOveriew.hideCommit.bind(gBranchOveriew) );| ).
ro_html->add( '</script>' ).
ro_html->add( '<script>' ).
ro_html->add( 'setGitGraphScroller();' ).
ro_html->add( '</script>' ).
ro_html->add( render_commit_popups( ) ).
ENDMETHOD.
METHOD build_menu.
CREATE OBJECT ro_menu.
IF mv_compress = abap_true.
ro_menu->add(
iv_txt = 'Uncompress Graph'
iv_act = c_actions-uncompress ) ##NO_TEXT.
ELSE.
ro_menu->add(
iv_txt = 'Compress Graph'
iv_act = c_actions-compress ) ##NO_TEXT.
ENDIF.
ro_menu->add( iv_txt = 'Refresh'
iv_act = c_actions-refresh ) ##NO_TEXT.
ENDMETHOD.
METHOD constructor.
super->constructor( ).
ms_control-page_title = 'BRANCH_OVERVIEW'.
mo_repo = io_repo.
refresh( ).
ENDMETHOD.
METHOD decode_merge.
DATA: lv_string TYPE string,
lt_fields TYPE tihttpnvp.
FIELD-SYMBOLS: <ls_field> LIKE LINE OF lt_fields.
CONCATENATE LINES OF it_postdata INTO lv_string.
lt_fields = zcl_abapgit_html_action_utils=>parse_fields( lv_string ).
READ TABLE lt_fields ASSIGNING <ls_field> WITH KEY name = 'source' ##NO_TEXT.
ASSERT sy-subrc = 0.
rs_merge-source = <ls_field>-value.
READ TABLE lt_fields ASSIGNING <ls_field> WITH KEY name = 'target' ##NO_TEXT.
ASSERT sy-subrc = 0.
rs_merge-target = <ls_field>-value.
ENDMETHOD.
METHOD escape_branch.
rv_string = iv_string.
TRANSLATE rv_string USING '-_._#_'.
rv_string = |branch_{ rv_string }|.
ENDMETHOD.
METHOD escape_message.
rv_string = iv_string.
REPLACE ALL OCCURRENCES OF '\' IN rv_string WITH '\\'.
REPLACE ALL OCCURRENCES OF '"' IN rv_string WITH '\"'.
ENDMETHOD.
METHOD form_select.
DATA: lv_name TYPE string,
lt_branches TYPE zif_abapgit_definitions=>ty_git_branch_list_tt.
FIELD-SYMBOLS: <ls_branch> LIKE LINE OF lt_branches.
CREATE OBJECT ro_html.
lt_branches = mi_branch_overview->get_branches( ).
ro_html->add( |<select name="{ iv_name }">| ).
LOOP AT lt_branches ASSIGNING <ls_branch>.
lv_name = <ls_branch>-name+11.
ro_html->add( |<option value="{ lv_name }">{ lv_name }</option>| ).
ENDLOOP.
ro_html->add( '</select>' ).
ENDMETHOD.
METHOD refresh.
mi_branch_overview = zcl_abapgit_factory=>get_branch_overview( mo_repo ).
mt_commits = mi_branch_overview->get_commits( ).
IF mv_compress = abap_true.
mt_commits = mi_branch_overview->compress( mt_commits ).
ENDIF.
ENDMETHOD.
METHOD render_commit_popups.
DATA: lv_time TYPE c LENGTH 10,
lv_date TYPE sy-datum,
lv_content TYPE string.
FIELD-SYMBOLS: <ls_commit> LIKE LINE OF mt_commits.
CREATE OBJECT ro_html.
LOOP AT mt_commits ASSIGNING <ls_commit>.
CLEAR: lv_time, lv_date.
PERFORM p6_to_date_time_tz IN PROGRAM rstr0400
USING <ls_commit>-time
lv_time
lv_date.
lv_content = |<table class="commit">|
&& | <tr>|
&& | <td class="title">Author</td>|
&& | <td>{ <ls_commit>-author }</td>|
&& | </tr>|
&& | <tr>|
&& | <td class="title">SHA1</td>|
&& | <td>{ <ls_commit>-sha1 }</td>|
&& | </tr>|
&& | <tr>|
&& | <td class="title">Date/Time</td>|
&& | <td>{ lv_date DATE = USER }</td>|
&& | </tr>|
&& | <tr>|
&& | <td class="title">Message</td>|
&& | <td>{ <ls_commit>-message }</td>|
&& | </tr>|
&& | <tr>|.
IF <ls_commit>-body IS NOT INITIAL.
lv_content = lv_content
&& |<td class="title">Body</td>|
&& |<td>{ concat_lines_of( table = <ls_commit>-body
sep = |<br/>| ) }</td>|.
ENDIF.
lv_content = lv_content
&& | </tr>|
&& |</table>|.
ro_html->add( zcl_abapgit_gui_chunk_lib=>render_commit_popup( iv_id = <ls_commit>-sha1(7)
iv_content = lv_content ) ).
ENDLOOP.
ENDMETHOD.
METHOD render_content.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->add( '<div id="toc">' ).
ri_html->add( body( ) ).
ri_html->add( '</div>' ).
ENDMETHOD.
METHOD render_merge.
CREATE OBJECT ro_html.
ro_html->add( '<form id="commit_form" method="post" action="sapevent:merge">' ).
ro_html->add( 'Merge' ) ##NO_TEXT.
ro_html->add( form_select( 'source' ) ) ##NO_TEXT.
ro_html->add( 'into' ) ##NO_TEXT.
ro_html->add( form_select( 'target' ) ) ##NO_TEXT.
ro_html->add( '<input type="submit" value="Submit">' ).
ro_html->add( '</form>' ).
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
DATA: ls_merge TYPE ty_merge,
lo_merge TYPE REF TO zcl_abapgit_gui_page_merge.
CASE iv_action.
WHEN c_actions-refresh.
refresh( ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN c_actions-uncompress.
mv_compress = abap_false.
refresh( ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN c_actions-compress.
mv_compress = abap_true.
refresh( ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN c_actions-merge.
ls_merge = decode_merge( it_postdata ).
CREATE OBJECT lo_merge
EXPORTING
io_repo = mo_repo
iv_source = ls_merge-source
iv_target = ls_merge-target.
ei_page = lo_merge.
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_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,
2127,
332,
1177,
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,
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,
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,
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,
8543,
62,
11299,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
6941,
62,
260,
7501,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
85,
62,
5589,
601,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
26173,
8924,
450,
499,
62,
9562,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45079,
62,
9503,
896,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
41509,
62,
926,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21504,
62,
1671,
3702,
62,
2502,
1177,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
1671,
3702,
62,
2502,
1177,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
347,
43312,
3963,
269,
62,
4658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34318,
601,
41876,
4731,
26173,
8924,
705,
403,
5589,
601,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27413,
220,
220,
41876,
4731,
26173,
8924,
705,
5589,
601,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14976,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
5420,
3447,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20121,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
647,
469,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
4658,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
647,
469,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2723,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2496,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
647,
469,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
14976,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
1767,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
305,
62,
6494,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
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,
1296,
62,
19738,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
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,
647,
469,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
305,
62,
6494,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
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,
36899,
62,
647,
469,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
340,
62,
7353,
7890,
220,
220,
220,
220,
41876,
269,
77,
4352,
62,
7353,
62,
7890,
62,
8658,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
647,
469,
8,
41876,
1259,
62,
647,
469,
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,
1382,
62,
26272,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
305,
62,
26272,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
25981,
5657,
11,
198,
220,
220,
220,
220,
220,
6654,
62,
1671,
3702,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
8841,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
8841,
8,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
6654,
62,
20500,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
8841,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
8841,
8,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_serialize DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor
IMPORTING
!iv_serialize_master_lang_only TYPE abap_bool DEFAULT abap_false
!it_translation_langs TYPE zif_abapgit_definitions=>ty_languages OPTIONAL.
METHODS on_end_of_task
IMPORTING
!p_task TYPE clike .
METHODS serialize
IMPORTING
!it_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
!iv_language TYPE langu DEFAULT sy-langu
!ii_log TYPE REF TO zif_abapgit_log OPTIONAL
!iv_force_sequential TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(rt_files) TYPE zif_abapgit_definitions=>ty_files_item_tt
RAISING
zcx_abapgit_exception .
METHODS files_local
IMPORTING
!iv_package TYPE devclass
!io_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit
!is_local_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings
!ii_log TYPE REF TO zif_abapgit_log
!it_filter TYPE zif_abapgit_definitions=>ty_tadir_tt OPTIONAL
!ii_data_config TYPE REF TO zif_abapgit_data_config OPTIONAL
RETURNING
VALUE(rt_files) TYPE zif_abapgit_definitions=>ty_files_item_tt
RAISING
zcx_abapgit_exception .
PROTECTED SECTION.
TYPES:
BEGIN OF ty_unsupported_count,
obj_type TYPE tadir-object,
obj_name TYPE tadir-obj_name,
count TYPE i,
END OF ty_unsupported_count .
TYPES:
ty_unsupported_count_tt TYPE HASHED TABLE OF ty_unsupported_count WITH UNIQUE KEY obj_type .
TYPES:
ty_char32 TYPE c LENGTH 32 .
CLASS-DATA gv_max_threads TYPE i .
DATA mt_files TYPE zif_abapgit_definitions=>ty_files_item_tt .
DATA mv_free TYPE i .
DATA mi_log TYPE REF TO zif_abapgit_log .
DATA mv_group TYPE rzlli_apcl .
DATA mv_serialize_master_lang_only TYPE abap_bool .
DATA mt_translation_langs TYPE zif_abapgit_definitions=>ty_languages .
METHODS add_apack
IMPORTING
!iv_package TYPE devclass
CHANGING
!ct_files TYPE zif_abapgit_definitions=>ty_files_item_tt
RAISING
zcx_abapgit_exception .
METHODS add_data
IMPORTING
!ii_data_config TYPE REF TO zif_abapgit_data_config
!io_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit
CHANGING
!ct_files TYPE zif_abapgit_definitions=>ty_files_item_tt
RAISING
zcx_abapgit_exception .
METHODS add_dot_abapgit
IMPORTING
!io_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit
CHANGING
!ct_files TYPE zif_abapgit_definitions=>ty_files_item_tt
RAISING
zcx_abapgit_exception .
METHODS add_to_return
IMPORTING
!iv_path TYPE string
!is_file_item TYPE zif_abapgit_objects=>ty_serialization .
METHODS run_parallel
IMPORTING
!is_tadir TYPE zif_abapgit_definitions=>ty_tadir
!iv_language TYPE langu
!iv_task TYPE ty_char32
RAISING
zcx_abapgit_exception .
METHODS run_sequential
IMPORTING
!is_tadir TYPE zif_abapgit_definitions=>ty_tadir
!iv_language TYPE langu
RAISING
zcx_abapgit_exception .
METHODS add_objects
IMPORTING
!iv_package TYPE devclass
!io_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit
!is_local_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings
!ii_log TYPE REF TO zif_abapgit_log
!it_filter TYPE zif_abapgit_definitions=>ty_tadir_tt OPTIONAL
CHANGING
VALUE(ct_files) TYPE zif_abapgit_definitions=>ty_files_item_tt
RAISING
zcx_abapgit_exception .
METHODS determine_max_threads
IMPORTING
!iv_force_sequential TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(rv_threads) TYPE i
RAISING
zcx_abapgit_exception .
METHODS filter_unsupported_objects
CHANGING
!ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt .
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_abapgit_serialize IMPLEMENTATION.
METHOD add_apack.
DATA ls_apack_file TYPE zif_abapgit_definitions=>ty_file.
FIELD-SYMBOLS <ls_file> LIKE LINE OF ct_files.
ls_apack_file = zcl_abapgit_apack_helper=>to_file( iv_package ).
IF ls_apack_file IS NOT INITIAL.
APPEND INITIAL LINE TO ct_files ASSIGNING <ls_file>.
<ls_file>-file = ls_apack_file.
ENDIF.
ENDMETHOD.
METHOD add_data.
DATA lt_files TYPE zif_abapgit_definitions=>ty_files_tt.
DATA ls_file LIKE LINE OF lt_files.
FIELD-SYMBOLS <ls_return> LIKE LINE OF ct_files.
IF ii_data_config IS INITIAL.
RETURN.
ENDIF.
lt_files = ii_data_config->to_json( ).
LOOP AT lt_files INTO ls_file.
APPEND INITIAL LINE TO ct_files ASSIGNING <ls_return>.
<ls_return>-file = ls_file.
" Derive object from config filename (namespace + escaping)
zcl_abapgit_filename_logic=>file_to_object(
EXPORTING
iv_filename = <ls_return>-file-filename
iv_path = <ls_return>-file-path
io_dot = io_dot_abapgit
IMPORTING
es_item = <ls_return>-item ).
<ls_return>-item-obj_type = 'TABU'.
ENDLOOP.
lt_files = zcl_abapgit_data_factory=>get_serializer( )->serialize( ii_data_config ).
LOOP AT lt_files INTO ls_file.
APPEND INITIAL LINE TO ct_files ASSIGNING <ls_return>.
<ls_return>-file = ls_file.
" Derive object from data filename (namespace + escaping)
zcl_abapgit_filename_logic=>file_to_object(
EXPORTING
iv_filename = <ls_return>-file-filename
iv_path = <ls_return>-file-path
io_dot = io_dot_abapgit
IMPORTING
es_item = <ls_return>-item ).
ENDLOOP.
ENDMETHOD.
METHOD add_dot_abapgit.
FIELD-SYMBOLS: <ls_file> LIKE LINE OF ct_files.
APPEND INITIAL LINE TO ct_files ASSIGNING <ls_file>.
<ls_file>-file = io_dot_abapgit->to_file( ).
ENDMETHOD.
METHOD add_objects.
DATA: lo_filter TYPE REF TO zcl_abapgit_repo_filter,
lv_force TYPE abap_bool,
lt_found LIKE ct_files,
lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt.
lt_tadir = zcl_abapgit_factory=>get_tadir( )->read(
iv_package = iv_package
iv_ignore_subpackages = is_local_settings-ignore_subpackages
iv_only_local_objects = is_local_settings-only_local_objects
io_dot = io_dot_abapgit
ii_log = ii_log ).
CREATE OBJECT lo_filter.
lo_filter->apply( EXPORTING it_filter = it_filter
CHANGING ct_tadir = lt_tadir ).
* if there are less than 10 objects run in single thread
* this helps a lot when debugging, plus performance gain
* with low number of objects does not matter much
lv_force = boolc( lines( lt_tadir ) < 10 ).
lt_found = serialize(
it_tadir = lt_tadir
iv_language = io_dot_abapgit->get_main_language( )
ii_log = ii_log
iv_force_sequential = lv_force ).
APPEND LINES OF lt_found TO ct_files.
ENDMETHOD.
METHOD add_to_return.
FIELD-SYMBOLS: <ls_file> LIKE LINE OF is_file_item-files,
<ls_return> LIKE LINE OF mt_files.
LOOP AT is_file_item-files ASSIGNING <ls_file>.
APPEND INITIAL LINE TO mt_files ASSIGNING <ls_return>.
<ls_return>-file = <ls_file>.
<ls_return>-file-path = iv_path.
<ls_return>-item = is_file_item-item.
ENDLOOP.
ENDMETHOD.
METHOD constructor.
DATA lo_settings TYPE REF TO zcl_abapgit_settings.
lo_settings = zcl_abapgit_persist_settings=>get_instance( )->read( ).
IF zcl_abapgit_factory=>get_environment( )->is_merged( ) = abap_true
OR lo_settings->get_parallel_proc_disabled( ) = abap_true.
gv_max_threads = 1.
ENDIF.
mv_group = 'parallel_generators'.
mv_serialize_master_lang_only = iv_serialize_master_lang_only.
mt_translation_langs = it_translation_langs.
ENDMETHOD.
METHOD determine_max_threads.
IF iv_force_sequential = abap_true.
rv_threads = 1.
RETURN.
ENDIF.
IF gv_max_threads >= 1.
* SPBT_INITIALIZE gives error PBT_ENV_ALREADY_INITIALIZED if called
* multiple times in same session
rv_threads = gv_max_threads.
RETURN.
ENDIF.
CALL FUNCTION 'FUNCTION_EXISTS'
EXPORTING
funcname = 'Z_ABAPGIT_SERIALIZE_PARALLEL'
EXCEPTIONS
function_not_exist = 1
OTHERS = 2.
IF sy-subrc <> 0.
gv_max_threads = 1.
ELSE.
* todo, add possibility to set group name in user exit
CALL FUNCTION 'SPBT_INITIALIZE'
EXPORTING
group_name = mv_group
IMPORTING
free_pbt_wps = gv_max_threads
EXCEPTIONS
invalid_group_name = 1
internal_error = 2
pbt_env_already_initialized = 3
currently_no_resources_avail = 4
no_pbt_resources_found = 5
cant_init_different_pbt_groups = 6
OTHERS = 7.
IF sy-subrc <> 0.
* fallback to running sequentially. If SPBT_INITIALIZE fails, check transactions
* RZ12, SM50, SM21, SARFC
gv_max_threads = 1.
ENDIF.
ENDIF.
IF gv_max_threads > 1.
gv_max_threads = gv_max_threads - 1.
ENDIF.
ASSERT gv_max_threads >= 1.
IF gv_max_threads > 32.
* https://en.wikipedia.org/wiki/Amdahl%27s_law
gv_max_threads = 32.
ENDIF.
rv_threads = gv_max_threads.
ENDMETHOD.
METHOD files_local.
* serializes objects, including .abapgit.xml, apack, and takes into account local settings
add_dot_abapgit(
EXPORTING
io_dot_abapgit = io_dot_abapgit
CHANGING
ct_files = rt_files ).
add_apack(
EXPORTING
iv_package = iv_package
CHANGING
ct_files = rt_files ).
add_data(
EXPORTING
ii_data_config = ii_data_config
io_dot_abapgit = io_dot_abapgit
CHANGING
ct_files = rt_files ).
add_objects(
EXPORTING
iv_package = iv_package
io_dot_abapgit = io_dot_abapgit
is_local_settings = is_local_settings
ii_log = ii_log
it_filter = it_filter
CHANGING
ct_files = rt_files ).
ENDMETHOD.
METHOD filter_unsupported_objects.
DATA: ls_unsupported_count TYPE ty_unsupported_count,
lt_supported_types TYPE zcl_abapgit_objects=>ty_types_tt,
lt_unsupported_count TYPE ty_unsupported_count_tt.
FIELD-SYMBOLS: <ls_tadir> LIKE LINE OF ct_tadir,
<ls_unsupported_count> TYPE ty_unsupported_count.
lt_supported_types = zcl_abapgit_objects=>supported_list( ).
LOOP AT ct_tadir ASSIGNING <ls_tadir>.
CLEAR: ls_unsupported_count.
READ TABLE lt_supported_types WITH KEY table_line = <ls_tadir>-object TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
CONTINUE.
ENDIF.
READ TABLE lt_unsupported_count ASSIGNING <ls_unsupported_count>
WITH TABLE KEY obj_type = <ls_tadir>-object.
IF sy-subrc <> 0.
ls_unsupported_count-obj_type = <ls_tadir>-object.
ls_unsupported_count-count = 1.
ls_unsupported_count-obj_name = <ls_tadir>-obj_name.
INSERT ls_unsupported_count INTO TABLE lt_unsupported_count ASSIGNING <ls_unsupported_count>.
ELSE.
CLEAR: <ls_unsupported_count>-obj_name.
<ls_unsupported_count>-count = <ls_unsupported_count>-count + 1.
ENDIF.
CLEAR: <ls_tadir>-object.
ENDLOOP.
IF lt_unsupported_count IS INITIAL.
RETURN.
ENDIF.
DELETE ct_tadir WHERE object IS INITIAL.
IF mi_log IS BOUND.
LOOP AT lt_unsupported_count ASSIGNING <ls_unsupported_count>.
IF <ls_unsupported_count>-count = 1.
mi_log->add_error( iv_msg = |Object type { <ls_unsupported_count>-obj_type } not supported, {
<ls_unsupported_count>-obj_name } ignored| ).
ELSE.
mi_log->add_error( iv_msg = |Object type { <ls_unsupported_count>-obj_type } not supported, {
<ls_unsupported_count>-count } objects ignored| ).
ENDIF.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD on_end_of_task.
* this method will be called from the parallel processing, thus it must be public
DATA: lv_result TYPE xstring,
lv_path TYPE string,
lv_mess TYPE c LENGTH 200,
ls_file_item TYPE zif_abapgit_objects=>ty_serialization.
RECEIVE RESULTS FROM FUNCTION 'Z_ABAPGIT_SERIALIZE_PARALLEL'
IMPORTING
ev_result = lv_result
ev_path = lv_path
EXCEPTIONS
error = 1
system_failure = 2 MESSAGE lv_mess
communication_failure = 3 MESSAGE lv_mess
OTHERS = 4.
IF sy-subrc <> 0.
IF NOT mi_log IS INITIAL.
IF NOT lv_mess IS INITIAL.
mi_log->add_error( lv_mess ).
ELSE.
mi_log->add_error( |{ sy-msgv1 }{ sy-msgv2 }{ sy-msgv3 }{ sy-msgv3 }, { sy-subrc }| ).
ENDIF.
ENDIF.
ELSE.
IMPORT data = ls_file_item FROM DATA BUFFER lv_result. "#EC CI_SUBRC
ASSERT sy-subrc = 0.
add_to_return( is_file_item = ls_file_item
iv_path = lv_path ).
ENDIF.
mv_free = mv_free + 1.
ENDMETHOD.
METHOD run_parallel.
DATA: lv_msg TYPE c LENGTH 100,
lv_free LIKE mv_free.
ASSERT mv_free > 0.
DO.
CALL FUNCTION 'Z_ABAPGIT_SERIALIZE_PARALLEL'
STARTING NEW TASK iv_task
DESTINATION IN GROUP mv_group
CALLING on_end_of_task ON END OF TASK
EXPORTING
iv_obj_type = is_tadir-object
iv_obj_name = is_tadir-obj_name
iv_devclass = is_tadir-devclass
iv_language = iv_language
iv_path = is_tadir-path
iv_serialize_master_lang_only = mv_serialize_master_lang_only
EXCEPTIONS
system_failure = 1 MESSAGE lv_msg
communication_failure = 2 MESSAGE lv_msg
resource_failure = 3
OTHERS = 4.
IF sy-subrc = 3.
lv_free = mv_free.
WAIT UNTIL mv_free <> lv_free UP TO 1 SECONDS.
CONTINUE.
ELSEIF sy-subrc <> 0.
ASSERT lv_msg = '' AND 0 = 1.
ENDIF.
EXIT.
ENDDO.
mv_free = mv_free - 1.
ENDMETHOD.
METHOD run_sequential.
DATA: lx_error TYPE REF TO zcx_abapgit_exception,
ls_file_item TYPE zif_abapgit_objects=>ty_serialization.
ls_file_item-item-obj_type = is_tadir-object.
ls_file_item-item-obj_name = is_tadir-obj_name.
ls_file_item-item-devclass = is_tadir-devclass.
TRY.
ls_file_item = zcl_abapgit_objects=>serialize(
is_item = ls_file_item-item
iv_serialize_master_lang_only = mv_serialize_master_lang_only
it_translation_langs = mt_translation_langs
iv_language = iv_language ).
add_to_return( is_file_item = ls_file_item
iv_path = is_tadir-path ).
CATCH zcx_abapgit_exception INTO lx_error.
IF NOT mi_log IS INITIAL.
mi_log->add_exception(
ix_exc = lx_error
is_item = ls_file_item-item ).
ENDIF.
ENDTRY.
ENDMETHOD.
METHOD serialize.
* serializes only objects
DATA: lv_max TYPE i,
li_progress TYPE REF TO zif_abapgit_progress,
lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt.
FIELD-SYMBOLS: <ls_tadir> LIKE LINE OF it_tadir.
CLEAR mt_files.
lv_max = determine_max_threads( iv_force_sequential ).
mv_free = lv_max.
mi_log = ii_log.
lt_tadir = it_tadir.
filter_unsupported_objects( CHANGING ct_tadir = lt_tadir ).
li_progress = zcl_abapgit_progress=>get_instance( lines( lt_tadir ) ).
LOOP AT lt_tadir ASSIGNING <ls_tadir>.
li_progress->show(
iv_current = sy-tabix
iv_text = |Serialize { <ls_tadir>-obj_name }, { lv_max } threads| ).
IF lv_max = 1.
run_sequential(
is_tadir = <ls_tadir>
iv_language = iv_language ).
ELSE.
run_parallel(
is_tadir = <ls_tadir>
iv_task = |{ sy-tabix }|
iv_language = iv_language ).
WAIT UNTIL mv_free > 0 UP TO 120 SECONDS.
ENDIF.
ENDLOOP.
WAIT UNTIL mv_free = lv_max UP TO 120 SECONDS.
rt_files = mt_files.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
46911,
1096,
5550,
20032,
17941,
198,
220,
44731,
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,
5145,
452,
62,
46911,
1096,
62,
9866,
62,
17204,
62,
8807,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
41519,
62,
17204,
82,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
75,
33213,
39852,
2849,
1847,
13,
198,
220,
220,
220,
337,
36252,
50,
319,
62,
437,
62,
1659,
62,
35943,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
79,
62,
35943,
41876,
537,
522,
764,
198,
220,
220,
220,
337,
36252,
50,
11389,
1096,
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,
220,
220,
220,
220,
220,
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,
452,
62,
16129,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
2786,
5550,
38865,
827,
12,
75,
2303,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
6404,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3174,
62,
3107,
1843,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
16624,
8,
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,
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,
3696,
62,
12001,
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,
220,
220,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
26518,
62,
397,
499,
18300,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
12001,
62,
33692,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
12001,
62,
33692,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
6404,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
24455,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
83,
324,
343,
62,
926,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
7890,
62,
11250,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
7890,
62,
11250,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
16624,
8,
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,
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,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
403,
15999,
62,
9127,
11,
198,
220,
220,
220,
220,
220,
220,
220,
26181,
62,
4906,
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,
220,
220,
954,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
403,
15999,
62,
9127,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
403,
15999,
62,
9127,
62,
926,
41876,
367,
11211,
1961,
43679,
3963,
1259,
62,
403,
15999,
62,
9127,
13315,
4725,
33866,
8924,
35374,
26181,
62,
4906,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
10641,
2624,
41876,
269,
406,
49494,
3933,
764,
628,
220,
220,
220,
42715,
12,
26947,
308,
85,
62,
9806,
62,
16663,
82,
41876,
1312,
764,
198,
220,
220,
220,
42865,
45079,
62,
16624,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
62,
9186,
62,
926,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
5787,
41876,
1312,
764,
198,
220,
220,
220,
42865,
21504,
62,
6404,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
8094,
41876,
374,
89,
15516,
62,
499,
565,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
46911,
1096,
62,
9866,
62,
17204,
62,
8807,
41876,
450,
499,
62,
30388,
764,
198,
220,
220,
220,
42865,
45079,
62,
41519,
62,
17204,
82,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
75,
33213,
764,
628,
220,
220,
220,
337,
36252,
50,
751,
62,
499,
441,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
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
] |
INTERFACE ZIF_UITB_view_callback
PUBLIC .
EVENTS before_output
EXPORTING
VALUE(er_callback) TYPE REF TO ZIF_UITB_pbo_callback.
EVENTS user_command
EXPORTING
VALUE(ev_function_id) TYPE sy-ucomm
VALUE(er_callback) TYPE REF TO ZIF_UITB_pai_callback.
EVENTS exit
EXPORTING
VALUE(er_callback) TYPE REF TO ZIF_UITB_exit_callback.
ENDINTERFACE.
| [
41358,
49836,
1168,
5064,
62,
52,
2043,
33,
62,
1177,
62,
47423,
198,
220,
44731,
764,
198,
220,
22399,
878,
62,
22915,
198,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
263,
62,
47423,
8,
41876,
4526,
37,
5390,
1168,
5064,
62,
52,
2043,
33,
62,
79,
2127,
62,
47423,
13,
198,
220,
22399,
2836,
62,
21812,
198,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
1990,
62,
8818,
62,
312,
8,
41876,
827,
12,
84,
9503,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
263,
62,
47423,
8,
41876,
4526,
37,
5390,
1168,
5064,
62,
52,
2043,
33,
62,
49712,
62,
47423,
13,
198,
220,
22399,
8420,
198,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
263,
62,
47423,
8,
41876,
4526,
37,
5390,
1168,
5064,
62,
52,
2043,
33,
62,
37023,
62,
47423,
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
] |
CLASS zcl_abapgit_object_tabl DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_objects_super
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_object .
ALIASES mo_files
FOR zif_abapgit_object~mo_files .
PROTECTED SECTION.
TYPES: BEGIN OF ty_segment_definition,
segmentheader TYPE edisegmhd,
segmentdefinition TYPE edisegmdef,
segmentstructures TYPE STANDARD TABLE OF edisegstru WITH DEFAULT KEY,
END OF ty_segment_definition.
TYPES: ty_segment_definitions TYPE STANDARD TABLE OF ty_segment_definition WITH DEFAULT KEY.
TYPES: BEGIN OF ty_tabl_extras,
tddat TYPE tddat,
END OF ty_tabl_extras.
"! get additional data like table authorization group
"! @parameter iv_tabname | name of the table
METHODS read_extras IMPORTING iv_tabname TYPE ddobjname
RETURNING VALUE(rs_tabl_extras) TYPE ty_tabl_extras.
"! Update additional data
"! @parameter iv_tabname | name of the table
"! @parameter is_tabl_extras | additional table data
METHODS update_extras IMPORTING iv_tabname TYPE ddobjname
is_tabl_extras TYPE ty_tabl_extras.
"! Delete additional data
"! @parameter iv_tabname | name of the table
METHODS delete_extras IMPORTING iv_tabname TYPE ddobjname.
"! Serialize IDoc Segment type/definition if exits
"! @parameter io_xml | XML writer
"! @raising zcx_abapgit_exception | Exceptions
METHODS serialize_idoc_segment IMPORTING io_xml TYPE REF TO zif_abapgit_xml_output
RAISING zcx_abapgit_exception.
"! Deserialize IDoc Segment type/definition if exits
"! @parameter io_xml | XML writer
"! @parameter iv_package | Target package
"! @parameter rv_deserialized | It's a segment and was desserialized
"! @raising zcx_abapgit_exception | Exceptions
METHODS deserialize_idoc_segment IMPORTING io_xml TYPE REF TO zif_abapgit_xml_input
iv_package TYPE devclass
RETURNING VALUE(rv_deserialized) TYPE abap_bool
RAISING zcx_abapgit_exception.
"! Delete the IDoc Segment type if exists
"! @parameter rv_deleted | It's a segment and was deleted
"! @raising zcx_abapgit_exception | Exceptions
METHODS delete_idoc_segment RETURNING VALUE(rv_deleted) TYPE abap_bool
RAISING zcx_abapgit_exception.
PRIVATE SECTION.
TYPES:
ty_dd03p_tt TYPE STANDARD TABLE OF dd03p .
TYPES:
BEGIN OF ty_dd02_text,
ddlanguage TYPE dd02t-ddlanguage,
ddtext TYPE dd02t-ddtext,
END OF ty_dd02_text .
TYPES:
ty_dd02_texts TYPE STANDARD TABLE OF ty_dd02_text .
CONSTANTS c_longtext_id_tabl TYPE dokil-id VALUE 'TB' ##NO_TEXT.
CONSTANTS:
BEGIN OF c_s_dataname,
segment_definition TYPE string VALUE 'SEGMENT_DEFINITION',
tabl_extras TYPE string VALUE 'TABL_EXTRAS',
END OF c_s_dataname .
METHODS deserialize_indexes
IMPORTING
!io_xml TYPE REF TO zif_abapgit_xml_input
RAISING
zcx_abapgit_exception .
METHODS clear_dd03p_fields
CHANGING
!ct_dd03p TYPE ty_dd03p_tt .
"! Check if structure is an IDoc segment
"! @parameter rv_is_idoc_segment | It's an IDoc segment or not
METHODS is_idoc_segment
RETURNING
VALUE(rv_is_idoc_segment) TYPE abap_bool .
METHODS clear_dd03p_fields_common
CHANGING
!cs_dd03p TYPE dd03p .
METHODS clear_dd03p_fields_dataelement
CHANGING
!cs_dd03p TYPE dd03p .
METHODS serialize_texts
IMPORTING
!io_xml TYPE REF TO zif_abapgit_xml_output
RAISING
zcx_abapgit_exception .
METHODS deserialize_texts
IMPORTING
!io_xml TYPE REF TO zif_abapgit_xml_input
!is_dd02v TYPE dd02v
RAISING
zcx_abapgit_exception .
METHODS is_db_table_category
IMPORTING
!iv_tabclass TYPE dd02l-tabclass
RETURNING
VALUE(rv_is_db_table_type) TYPE dd02l-tabclass .
ENDCLASS.
CLASS zcl_abapgit_object_tabl IMPLEMENTATION.
METHOD clear_dd03p_fields.
CONSTANTS lc_comptype_dataelement TYPE comptype VALUE 'E'.
DATA: lv_masklen TYPE c LENGTH 4.
FIELD-SYMBOLS: <ls_dd03p> TYPE dd03p.
* remove nested structures
DELETE ct_dd03p WHERE depth <> '00'.
* remove fields from .INCLUDEs
DELETE ct_dd03p WHERE adminfield <> '0'.
LOOP AT ct_dd03p ASSIGNING <ls_dd03p> WHERE NOT rollname IS INITIAL.
clear_dd03p_fields_common( CHANGING cs_dd03p = <ls_dd03p> ).
lv_masklen = <ls_dd03p>-masklen.
IF lv_masklen = '' OR NOT lv_masklen CO '0123456789'.
* make sure the field contains valid data, or the XML will dump
CLEAR <ls_dd03p>-masklen.
ENDIF.
IF <ls_dd03p>-comptype = lc_comptype_dataelement.
clear_dd03p_fields_dataelement( CHANGING cs_dd03p = <ls_dd03p> ).
ENDIF.
IF <ls_dd03p>-shlporigin = 'D'.
* search help from domain
CLEAR: <ls_dd03p>-shlpfield,
<ls_dd03p>-shlpname.
ENDIF.
* XML output assumes correct field content
IF <ls_dd03p>-routputlen = ' '.
CLEAR <ls_dd03p>-routputlen.
ENDIF.
ENDLOOP.
" Clear position to avoid issues with include structures that contain different number of fields
LOOP AT ct_dd03p ASSIGNING <ls_dd03p>.
CLEAR: <ls_dd03p>-position, <ls_dd03p>-tabname, <ls_dd03p>-ddlanguage.
ENDLOOP.
ENDMETHOD.
METHOD clear_dd03p_fields_common.
CLEAR: cs_dd03p-ddlanguage,
cs_dd03p-dtelmaster,
cs_dd03p-logflag,
cs_dd03p-ddtext,
cs_dd03p-reservedte,
cs_dd03p-reptext,
cs_dd03p-scrtext_s,
cs_dd03p-scrtext_m,
cs_dd03p-scrtext_l.
ENDMETHOD.
METHOD clear_dd03p_fields_dataelement.
* type specified via data element
CLEAR: cs_dd03p-domname,
cs_dd03p-inttype,
cs_dd03p-intlen,
cs_dd03p-mask,
cs_dd03p-memoryid,
cs_dd03p-headlen,
cs_dd03p-scrlen1,
cs_dd03p-scrlen2,
cs_dd03p-scrlen3,
cs_dd03p-datatype,
cs_dd03p-leng,
cs_dd03p-outputlen,
cs_dd03p-deffdname,
cs_dd03p-convexit,
cs_dd03p-entitytab,
cs_dd03p-dommaster,
cs_dd03p-domname3l,
cs_dd03p-decimals,
cs_dd03p-lowercase,
cs_dd03p-signflag.
ENDMETHOD.
METHOD delete_extras.
DELETE FROM tddat WHERE tabname = iv_tabname.
ENDMETHOD.
METHOD delete_idoc_segment.
DATA lv_segment_type TYPE edilsegtyp.
DATA lv_result LIKE sy-subrc.
IF is_idoc_segment( ) = abap_false.
rv_deleted = abap_false.
RETURN. "previous XML version or no IDoc segment
ENDIF.
rv_deleted = abap_true.
lv_segment_type = ms_item-obj_name.
CALL FUNCTION 'SEGMENT_DELETE'
EXPORTING
segmenttyp = lv_segment_type
IMPORTING
result = lv_result
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0 OR lv_result <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD deserialize_idoc_segment.
DATA lv_result LIKE sy-subrc.
DATA lt_segment_definitions TYPE ty_segment_definitions.
DATA lv_package TYPE devclass.
DATA lv_uname TYPE sy-uname.
FIELD-SYMBOLS <ls_segment_definition> TYPE ty_segment_definition.
rv_deserialized = abap_false.
TRY.
io_xml->read( EXPORTING iv_name = c_s_dataname-segment_definition
CHANGING cg_data = lt_segment_definitions ).
CATCH zcx_abapgit_exception.
RETURN. "previous XML version or no IDoc segment
ENDTRY.
IF lines( lt_segment_definitions ) = 0.
RETURN. "no IDoc segment
ENDIF.
rv_deserialized = abap_true.
lv_package = iv_package.
LOOP AT lt_segment_definitions ASSIGNING <ls_segment_definition>.
<ls_segment_definition>-segmentheader-presp =
<ls_segment_definition>-segmentheader-pwork = cl_abap_syst=>get_user_name( ).
CALL FUNCTION 'SEGMENT_READ'
EXPORTING
segmenttyp = <ls_segment_definition>-segmentheader-segtyp
IMPORTING
result = lv_result
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0 OR lv_result <> 0.
CALL FUNCTION 'SEGMENT_CREATE'
IMPORTING
segmentdefinition = <ls_segment_definition>-segmentdefinition
TABLES
segmentstructure = <ls_segment_definition>-segmentstructures
CHANGING
segmentheader = <ls_segment_definition>-segmentheader
devclass = lv_package
EXCEPTIONS
OTHERS = 1.
ELSE.
CALL FUNCTION 'SEGMENT_MODIFY'
CHANGING
segmentheader = <ls_segment_definition>-segmentheader
devclass = lv_package
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
CALL FUNCTION 'SEGMENTDEFINITION_MODIFY'
TABLES
segmentstructure = <ls_segment_definition>-segmentstructures
CHANGING
segmentdefinition = <ls_segment_definition>-segmentdefinition
EXCEPTIONS
OTHERS = 1.
ENDIF.
ENDIF.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDLOOP.
lv_uname = cl_abap_syst=>get_user_name( ).
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 = lv_uname
wi_tadir_devclass = iv_package
wi_tadir_masterlang = mv_language
iv_set_edtflag = abap_true
iv_delflag = abap_false
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD deserialize_indexes.
DATA:
lv_tname TYPE trobj_name,
lt_dd12v TYPE dd12vtab,
ls_dd12v LIKE LINE OF lt_dd12v,
lt_dd17v TYPE dd17vtab,
ls_dd17v LIKE LINE OF lt_dd17v,
lt_secondary LIKE lt_dd17v.
io_xml->read( EXPORTING iv_name = 'DD12V'
CHANGING cg_data = lt_dd12v ).
io_xml->read( EXPORTING iv_name = 'DD17V'
CHANGING cg_data = lt_dd17v ).
LOOP AT lt_dd12v INTO ls_dd12v.
* todo, call corr_insert?
CLEAR lt_secondary.
LOOP AT lt_dd17v INTO ls_dd17v
WHERE sqltab = ls_dd12v-sqltab AND indexname = ls_dd12v-indexname.
APPEND ls_dd17v TO lt_secondary.
ENDLOOP.
CALL FUNCTION 'DDIF_INDX_PUT'
EXPORTING
name = ls_dd12v-sqltab
id = ls_dd12v-indexname
dd12v_wa = ls_dd12v
TABLES
dd17v_tab = lt_secondary
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_t100( ).
ENDIF.
CALL FUNCTION 'DD_DD_TO_E071'
EXPORTING
type = 'INDX'
name = ls_dd12v-sqltab
id = ls_dd12v-indexname
IMPORTING
obj_name = lv_tname.
zcl_abapgit_objects_activation=>add( iv_type = 'INDX'
iv_name = lv_tname ).
ENDLOOP.
ENDMETHOD.
METHOD deserialize_texts.
DATA: lv_name TYPE ddobjname,
ls_dd02v_tmp TYPE dd02v,
lt_i18n_langs TYPE TABLE OF langu,
lt_dd02_texts TYPE ty_dd02_texts.
FIELD-SYMBOLS: <lv_lang> LIKE LINE OF lt_i18n_langs,
<ls_dd02_text> LIKE LINE OF lt_dd02_texts.
lv_name = ms_item-obj_name.
io_xml->read( EXPORTING iv_name = 'I18N_LANGS'
CHANGING cg_data = lt_i18n_langs ).
io_xml->read( EXPORTING iv_name = 'DD02_TEXTS'
CHANGING cg_data = lt_dd02_texts ).
SORT lt_i18n_langs.
SORT lt_dd02_texts BY ddlanguage. " Optimization
LOOP AT lt_i18n_langs ASSIGNING <lv_lang>.
" Table description
ls_dd02v_tmp = is_dd02v.
READ TABLE lt_dd02_texts ASSIGNING <ls_dd02_text> WITH KEY ddlanguage = <lv_lang>.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |DD02_TEXTS cannot find lang { <lv_lang> } in XML| ).
ENDIF.
MOVE-CORRESPONDING <ls_dd02_text> TO ls_dd02v_tmp.
CALL FUNCTION 'DDIF_TABL_PUT'
EXPORTING
name = lv_name
dd02v_wa = ls_dd02v_tmp
EXCEPTIONS
tabl_not_found = 1
name_inconsistent = 2
tabl_inconsistent = 3
put_failure = 4
put_refused = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD is_db_table_category.
" values from domain TABCLASS
rv_is_db_table_type = boolc( iv_tabclass = 'TRANSP'
OR iv_tabclass = 'CLUSTER'
OR iv_tabclass = 'POOL' ).
ENDMETHOD.
METHOD is_idoc_segment.
DATA lv_segment_type TYPE edilsegtyp.
lv_segment_type = ms_item-obj_name.
SELECT SINGLE segtyp
FROM edisegment
INTO lv_segment_type
WHERE segtyp = lv_segment_type.
rv_is_idoc_segment = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD read_extras.
SELECT SINGLE * FROM tddat INTO rs_tabl_extras-tddat WHERE tabname = iv_tabname.
ENDMETHOD.
METHOD serialize_idoc_segment.
DATA lv_segment_type TYPE edilsegtyp.
DATA lv_result LIKE sy-subrc.
DATA lv_devclass TYPE devclass.
DATA lt_segmentdefinitions TYPE STANDARD TABLE OF edisegmdef.
DATA ls_segment_definition TYPE ty_segment_definition.
DATA lt_segment_definitions TYPE ty_segment_definitions.
FIELD-SYMBOLS: <ls_segemtndefinition> TYPE edisegmdef.
IF is_idoc_segment( ) = abap_false.
RETURN.
ENDIF.
lv_segment_type = ms_item-obj_name.
CALL FUNCTION 'SEGMENT_READ'
EXPORTING
segmenttyp = lv_segment_type
IMPORTING
result = lv_result
TABLES
segmentdefinition = lt_segmentdefinitions
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0 OR lv_result <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
LOOP AT lt_segmentdefinitions ASSIGNING <ls_segemtndefinition>.
CLEAR ls_segment_definition.
CALL FUNCTION 'SEGMENTDEFINITION_READ'
EXPORTING
segmenttyp = <ls_segemtndefinition>-segtyp
IMPORTING
result = lv_result
devclass = lv_devclass
segmentheader = ls_segment_definition-segmentheader
segmentdefinition = ls_segment_definition-segmentdefinition
TABLES
segmentstructure = ls_segment_definition-segmentstructures
CHANGING
version = <ls_segemtndefinition>-version
EXCEPTIONS
no_authority = 1
segment_not_existing = 2
OTHERS = 3.
IF sy-subrc <> 0 OR lv_result <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
zcl_abapgit_object_idoc=>clear_idoc_segement_fields(
CHANGING cg_structure = ls_segment_definition-segmentdefinition ).
zcl_abapgit_object_idoc=>clear_idoc_segement_fields(
CHANGING cg_structure = ls_segment_definition-segmentheader ).
APPEND ls_segment_definition TO lt_segment_definitions.
ENDLOOP.
io_xml->add( iv_name = c_s_dataname-segment_definition
ig_data = lt_segment_definitions ).
ENDMETHOD.
METHOD serialize_texts.
DATA: lv_name TYPE ddobjname,
lv_index TYPE i,
ls_dd02v TYPE dd02v,
lt_dd02_texts TYPE ty_dd02_texts,
lt_i18n_langs TYPE TABLE OF langu.
FIELD-SYMBOLS: <lv_lang> LIKE LINE OF lt_i18n_langs,
<ls_dd02_text> LIKE LINE OF lt_dd02_texts.
IF io_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 dd02v
WHERE tabname = lv_name
AND ddlanguage <> mv_language. "#EC CI_SUBRC
LOOP AT lt_i18n_langs ASSIGNING <lv_lang>.
lv_index = sy-tabix.
CALL FUNCTION 'DDIF_TABL_GET'
EXPORTING
name = lv_name
langu = <lv_lang>
IMPORTING
dd02v_wa = ls_dd02v
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc <> 0 OR ls_dd02v-ddlanguage IS INITIAL.
DELETE lt_i18n_langs INDEX lv_index. " Don't save this lang
CONTINUE.
ENDIF.
APPEND INITIAL LINE TO lt_dd02_texts ASSIGNING <ls_dd02_text>.
MOVE-CORRESPONDING ls_dd02v TO <ls_dd02_text>.
ENDLOOP.
SORT lt_i18n_langs ASCENDING.
SORT lt_dd02_texts BY ddlanguage ASCENDING.
IF lines( lt_i18n_langs ) > 0.
io_xml->add( iv_name = 'I18N_LANGS'
ig_data = lt_i18n_langs ).
io_xml->add( iv_name = 'DD02_TEXTS'
ig_data = lt_dd02_texts ).
ENDIF.
ENDMETHOD.
METHOD update_extras.
IF is_tabl_extras-tddat IS INITIAL.
delete_extras( iv_tabname ).
ELSE.
MODIFY tddat FROM is_tabl_extras-tddat.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
TYPES: BEGIN OF ty_data,
as4user TYPE dd02l-as4user,
as4date TYPE dd02l-as4date,
as4time TYPE dd02l-as4time,
END OF ty_data.
DATA: lt_data TYPE STANDARD TABLE OF ty_data WITH DEFAULT KEY,
ls_data LIKE LINE OF lt_data.
SELECT as4user as4date as4time
FROM dd02l INTO TABLE lt_data
WHERE tabname = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
SELECT as4user as4date as4time
APPENDING TABLE lt_data
FROM dd09l
WHERE tabname = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
SELECT as4user as4date as4time
APPENDING TABLE lt_data
FROM dd12l
WHERE sqltab = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
SORT lt_data BY as4date DESCENDING as4time DESCENDING.
READ TABLE lt_data INDEX 1 INTO ls_data.
IF sy-subrc = 0.
rv_user = ls_data-as4user.
ELSE.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_objname TYPE rsedd0-ddobjname,
lv_no_ask TYPE abap_bool,
lv_subrc TYPE sy-subrc,
BEGIN OF ls_dd02l,
tabname TYPE dd02l-tabname,
tabclass TYPE dd02l-tabclass,
sqltab TYPE dd02l-sqltab,
END OF ls_dd02l.
IF zif_abapgit_object~exists( ) = abap_false.
" Proxies e.g. delete on its own, nothing todo here then.
RETURN.
ENDIF.
lv_objname = ms_item-obj_name.
IF delete_idoc_segment( ) = abap_false.
lv_no_ask = abap_true.
SELECT SINGLE tabname tabclass sqltab FROM dd02l
INTO CORRESPONDING FIELDS OF ls_dd02l
WHERE tabname = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
IF sy-subrc = 0 AND is_db_table_category( ls_dd02l-tabclass ) = abap_true.
CALL FUNCTION 'DD_EXISTS_DATA'
EXPORTING
reftab = ls_dd02l-sqltab
tabclass = ls_dd02l-tabclass
tabname = ls_dd02l-tabname
IMPORTING
subrc = lv_subrc
EXCEPTIONS
missing_reftab = 1
sql_error = 2
buffer_overflow = 3
unknown_error = 4
OTHERS = 5.
IF sy-subrc = 0 AND lv_subrc = 0.
lv_no_ask = abap_false.
ENDIF.
ENDIF.
delete_ddic( iv_objtype = 'T'
iv_no_ask = lv_no_ask ).
delete_longtexts( c_longtext_id_tabl ).
delete_extras( lv_objname ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_name TYPE ddobjname,
ls_dd02v TYPE dd02v,
ls_dd09l TYPE dd09l,
lt_dd03p TYPE TABLE OF dd03p,
lt_dd05m TYPE TABLE OF dd05m,
lt_dd08v TYPE TABLE OF dd08v,
lt_dd35v TYPE TABLE OF dd35v,
lt_dd36m TYPE dd36mttyp,
lv_refs TYPE abap_bool,
ls_extras TYPE ty_tabl_extras.
FIELD-SYMBOLS: <ls_dd03p> TYPE dd03p,
<ls_dd05m> TYPE dd05m,
<ls_dd08v> TYPE dd08v,
<ls_dd35v> TYPE dd35v,
<ls_dd36m> TYPE dd36m,
<lg_roworcolst> TYPE any.
lv_name = ms_item-obj_name. " type conversion
IF deserialize_idoc_segment( io_xml = io_xml
iv_package = iv_package ) = abap_false.
io_xml->read( EXPORTING iv_name = 'DD02V'
CHANGING cg_data = ls_dd02v ).
io_xml->read( EXPORTING iv_name = 'DD09L'
CHANGING cg_data = ls_dd09l ).
io_xml->read( EXPORTING iv_name = 'DD03P_TABLE'
CHANGING cg_data = lt_dd03p ).
ASSIGN COMPONENT 'ROWORCOLST' OF STRUCTURE ls_dd09l TO <lg_roworcolst>.
IF sy-subrc = 0 AND <lg_roworcolst> IS INITIAL.
<lg_roworcolst> = 'C'. "Reverse fix from serialize
ENDIF.
" DDIC Step: Replace REF TO class/interface with generic reference to avoid cyclic dependency
LOOP AT lt_dd03p ASSIGNING <ls_dd03p> WHERE datatype = 'REF'.
IF iv_step = zif_abapgit_object=>gc_step_id-ddic.
<ls_dd03p>-rollname = 'OBJECT'.
ELSE.
lv_refs = abap_true.
ENDIF.
ENDLOOP.
" Number fields sequentially and fill table name
LOOP AT lt_dd03p ASSIGNING <ls_dd03p>.
<ls_dd03p>-position = sy-tabix.
<ls_dd03p>-tabname = lv_name.
<ls_dd03p>-ddlanguage = mv_language.
ENDLOOP.
io_xml->read( EXPORTING iv_name = 'DD05M_TABLE'
CHANGING cg_data = lt_dd05m ).
io_xml->read( EXPORTING iv_name = 'DD08V_TABLE'
CHANGING cg_data = lt_dd08v ).
io_xml->read( EXPORTING iv_name = 'DD35V_TALE'
CHANGING cg_data = lt_dd35v ).
io_xml->read( EXPORTING iv_name = 'DD36M'
CHANGING cg_data = lt_dd36m ).
LOOP AT lt_dd05m ASSIGNING <ls_dd05m>.
<ls_dd05m>-tabname = lv_name.
ENDLOOP.
LOOP AT lt_dd08v ASSIGNING <ls_dd08v>.
<ls_dd08v>-tabname = lv_name.
<ls_dd08v>-ddlanguage = mv_language.
ENDLOOP.
LOOP AT lt_dd35v ASSIGNING <ls_dd35v>.
<ls_dd35v>-tabname = lv_name.
ENDLOOP.
LOOP AT lt_dd36m ASSIGNING <ls_dd36m>.
<ls_dd36m>-tabname = lv_name.
ENDLOOP.
" DDIC Step: Remove references to search helps and foreign keys
IF iv_step = zif_abapgit_object=>gc_step_id-ddic.
CLEAR: lt_dd08v, lt_dd35v, lt_dd36m.
ENDIF.
IF iv_step = zif_abapgit_object=>gc_step_id-late AND lv_refs = abap_false
AND lines( lt_dd35v ) = 0 AND lines( lt_dd08v ) = 0.
RETURN. " already active
ENDIF.
corr_insert( iv_package = iv_package
ig_object_class = 'DICT' ).
CALL FUNCTION 'DDIF_TABL_PUT'
EXPORTING
name = lv_name
dd02v_wa = ls_dd02v
dd09l_wa = ls_dd09l
TABLES
dd03p_tab = lt_dd03p
dd05m_tab = lt_dd05m
dd08v_tab = lt_dd08v
dd35v_tab = lt_dd35v
dd36m_tab = lt_dd36m
EXCEPTIONS
tabl_not_found = 1
name_inconsistent = 2
tabl_inconsistent = 3
put_failure = 4
put_refused = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
zcl_abapgit_objects_activation=>add_item( ms_item ).
deserialize_indexes( io_xml ).
deserialize_texts( io_xml = io_xml
is_dd02v = ls_dd02v ).
deserialize_longtexts( io_xml ).
io_xml->read( EXPORTING iv_name = c_s_dataname-tabl_extras
CHANGING cg_data = ls_extras ).
update_extras( iv_tabname = lv_name
is_tabl_extras = ls_extras ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_tabname TYPE dd02l-tabname.
lv_tabname = ms_item-obj_name.
" Check nametab because it's fast
CALL FUNCTION 'DD_GET_NAMETAB_HEADER'
EXPORTING
tabname = lv_tabname
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
" Check for new, inactive, or modified versions that might not be in nametab
SELECT SINGLE tabname FROM dd02l INTO lv_tabname
WHERE tabname = lv_tabname.
ENDIF.
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
DATA: li_local_version_output TYPE REF TO zif_abapgit_xml_output,
li_local_version_input TYPE REF TO zif_abapgit_xml_input.
CREATE OBJECT li_local_version_output TYPE zcl_abapgit_xml_output.
zif_abapgit_object~serialize( li_local_version_output ).
CREATE OBJECT li_local_version_input
TYPE zcl_abapgit_xml_input
EXPORTING
iv_xml = li_local_version_output->render( ).
CREATE OBJECT ri_comparator TYPE zcl_abapgit_object_tabl_compar
EXPORTING
ii_local = li_local_version_input.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-ddic TO rt_steps.
APPEND zif_abapgit_object=>gc_step_id-late 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_dd02v TYPE dd02v,
ls_dd09l TYPE dd09l,
lt_dd03p TYPE ty_dd03p_tt,
lt_dd05m TYPE TABLE OF dd05m,
lt_dd08v TYPE TABLE OF dd08v,
lt_dd12v TYPE dd12vtab,
lt_dd17v TYPE dd17vtab,
lt_dd35v TYPE TABLE OF dd35v,
lv_index LIKE sy-index,
lt_dd36m TYPE dd36mttyp,
ls_extras TYPE ty_tabl_extras.
FIELD-SYMBOLS: <ls_dd12v> LIKE LINE OF lt_dd12v,
<ls_dd05m> LIKE LINE OF lt_dd05m,
<ls_dd08v> LIKE LINE OF lt_dd08v,
<ls_dd35v> LIKE LINE OF lt_dd35v,
<ls_dd36m> LIKE LINE OF lt_dd36m,
<lg_roworcolst> TYPE any.
lv_name = ms_item-obj_name.
CALL FUNCTION 'DDIF_TABL_GET'
EXPORTING
name = lv_name
langu = mv_language
IMPORTING
dd02v_wa = ls_dd02v
dd09l_wa = ls_dd09l
TABLES
dd03p_tab = lt_dd03p
dd05m_tab = lt_dd05m
dd08v_tab = lt_dd08v
dd12v_tab = lt_dd12v
dd17v_tab = lt_dd17v
dd35v_tab = lt_dd35v
dd36m_tab = lt_dd36m
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from DDIF_TABL_GET' ).
ENDIF.
IF ls_dd02v IS INITIAL.
zcx_abapgit_exception=>raise( |No active version found for { ms_item-obj_type } { ms_item-obj_name }| ).
ENDIF.
CLEAR: ls_dd02v-as4user,
ls_dd02v-as4date,
ls_dd02v-as4time.
* reset numeric field, so XML does not crash
IF ls_dd02v-prozpuff = ''.
CLEAR ls_dd02v-prozpuff.
ENDIF.
IF ls_dd02v-datmin = ''.
CLEAR ls_dd02v-datmin.
ENDIF.
IF ls_dd02v-datmax = ''.
CLEAR ls_dd02v-datmax.
ENDIF.
IF ls_dd02v-datavg = ''.
CLEAR ls_dd02v-datavg.
ENDIF.
CLEAR: ls_dd09l-as4user,
ls_dd09l-as4date,
ls_dd09l-as4time.
ASSIGN COMPONENT 'ROWORCOLST' OF STRUCTURE ls_dd09l TO <lg_roworcolst>.
IF sy-subrc = 0 AND <lg_roworcolst> = 'C'.
CLEAR <lg_roworcolst>. "To avoid diff errors. This field doesn't exists in all releases
ENDIF.
LOOP AT lt_dd12v ASSIGNING <ls_dd12v>.
CLEAR: <ls_dd12v>-as4user,
<ls_dd12v>-as4date,
<ls_dd12v>-as4time.
ENDLOOP.
clear_dd03p_fields( CHANGING ct_dd03p = lt_dd03p ).
* remove foreign keys inherited from .INCLUDEs
DELETE lt_dd08v WHERE noinherit = 'N'.
LOOP AT lt_dd05m ASSIGNING <ls_dd05m>.
CLEAR <ls_dd05m>-tabname.
lv_index = sy-tabix.
READ TABLE lt_dd08v WITH KEY fieldname = <ls_dd05m>-fieldname TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
DELETE lt_dd05m INDEX lv_index.
ENDIF.
ENDLOOP.
LOOP AT lt_dd08v ASSIGNING <ls_dd08v>.
CLEAR: <ls_dd08v>-tabname, <ls_dd08v>-ddlanguage.
ENDLOOP.
LOOP AT lt_dd35v ASSIGNING <ls_dd35v>.
CLEAR <ls_dd35v>-tabname.
ENDLOOP.
* remove inherited search helps
DELETE lt_dd35v WHERE shlpinher = abap_true.
LOOP AT lt_dd36m ASSIGNING <ls_dd36m>.
CLEAR <ls_dd36m>-tabname.
lv_index = sy-tabix.
READ TABLE lt_dd35v WITH KEY fieldname = <ls_dd36m>-fieldname TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
DELETE lt_dd36m INDEX lv_index.
ENDIF.
ENDLOOP.
io_xml->add( iv_name = 'DD02V'
ig_data = ls_dd02v ).
IF NOT ls_dd09l IS INITIAL.
io_xml->add( iv_name = 'DD09L'
ig_data = ls_dd09l ).
ENDIF.
io_xml->add( iv_name = 'DD03P_TABLE'
ig_data = lt_dd03p ).
io_xml->add( iv_name = 'DD05M_TABLE'
ig_data = lt_dd05m ).
io_xml->add( iv_name = 'DD08V_TABLE'
ig_data = lt_dd08v ).
io_xml->add( iv_name = 'DD12V'
ig_data = lt_dd12v ).
io_xml->add( iv_name = 'DD17V'
ig_data = lt_dd17v ).
io_xml->add( iv_name = 'DD35V_TALE'
ig_data = lt_dd35v ).
io_xml->add( iv_name = 'DD36M'
ig_data = lt_dd36m ).
serialize_texts( io_xml ).
serialize_longtexts( ii_xml = io_xml
iv_longtext_id = c_longtext_id_tabl ).
serialize_idoc_segment( io_xml ).
ls_extras = read_extras( lv_name ).
io_xml->add( iv_name = c_s_dataname-tabl_extras
ig_data = ls_extras ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
8658,
75,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
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,
397,
499,
18300,
62,
15252,
764,
628,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
325,
5154,
62,
46758,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10618,
25677,
220,
220,
220,
220,
41876,
1225,
786,
39870,
31298,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10618,
46758,
41876,
1225,
786,
39870,
4299,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10618,
7249,
942,
41876,
49053,
9795,
43679,
3963,
1225,
786,
70,
19554,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
325,
5154,
62,
46758,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
1259,
62,
325,
5154,
62,
4299,
50101,
41876,
49053,
9795,
43679,
3963,
1259,
62,
325,
5154,
62,
46758,
13315,
5550,
38865,
35374,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
8658,
75,
62,
2302,
8847,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
1860,
265,
41876,
256,
1860,
265,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
8658,
75,
62,
2302,
8847,
13,
628,
220,
220,
220,
366,
0,
651,
3224,
1366,
588,
3084,
19601,
1448,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
8658,
3672,
930,
1438,
286,
262,
3084,
198,
220,
220,
220,
337,
36252,
50,
1100,
62,
2302,
8847,
30023,
9863,
2751,
21628,
62,
8658,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
49427,
26801,
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,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
8658,
75,
62,
2302,
8847,
8,
41876,
1259,
62,
8658,
75,
62,
2302,
8847,
13,
628,
220,
220,
220,
366,
0,
10133,
3224,
1366,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
8658,
3672,
930,
1438,
286,
262,
3084,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
318,
62,
8658,
75,
62,
2302,
8847,
930,
3224,
3084,
1366,
198,
220,
220,
220,
337,
36252,
50,
4296,
62,
2302,
8847,
30023,
9863,
2751,
21628,
62,
8658,
3672,
220,
220,
220,
220,
41876,
49427,
26801,
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,
220,
220,
220,
220,
220,
318,
62,
8658,
75,
62,
2302,
8847,
41876,
1259,
62,
8658,
75,
62,
2302,
8847,
13,
628,
220,
220,
220,
366,
0,
23520,
3224,
1366,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
8658,
3672,
930,
1438,
286,
262,
3084,
198,
220,
220,
220,
337,
36252,
50,
12233,
62,
2302,
8847,
30023,
9863,
2751,
21628,
62,
8658,
3672,
41876,
49427,
26801,
3672,
13,
628,
220,
220,
220,
366,
0,
23283,
1096,
4522,
420,
1001,
5154,
2099,
14,
46758,
611,
30151,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
33245,
62,
19875,
930,
23735,
6260,
198,
220,
220,
220,
366,
0,
2488,
32741,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
930,
1475,
11755,
198,
220,
220,
220,
337,
36252,
50,
11389,
1096,
62,
312,
420,
62,
325,
5154,
30023,
9863,
2751,
33245,
62,
19875,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19875,
62,
22915,
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,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
366,
0,
2935,
48499,
1096,
4522,
420,
1001,
5154,
2099,
14,
46758,
611,
30151,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
33245,
62,
19875,
930,
23735,
6260,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
26495,
930,
12744,
5301,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
374,
85,
62,
8906,
48499,
1143,
930,
632,
338,
257,
10618,
290,
373,
288,
408,
48499,
1143,
198,
220,
220,
220,
366,
0,
2488,
32741,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
930,
1475,
11755,
198,
220,
220,
220,
337,
36252,
50,
748,
48499,
1096,
62,
312,
420,
62,
325,
5154,
30023,
9863,
2751,
33245,
62,
19875,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
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,
26495,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1614,
4871,
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,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
8906,
48499,
1143,
8,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
220,
220,
220,
220,
220,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
class ZCL_IPSUMNIZER_TEST definition
public
create public .
public section.
types:
BEGIN OF ts_belegnummer,
vbeln TYPE vbeln,
submi TYPE submi,
erdat TYPE erdat,
ernam TYPE ernam,
END OF ts_belegnummer .
types:
tt_belegtabelle TYPE SORTED TABLE OF ts_belegnummer WITH UNIQUE KEY vbeln .
constants C_AUART_TA type AUART value 'TA' ##NO_TEXT.
constants C_AUART_TAS type AUART value 'TAS' ##NO_TEXT.
methods READ_DATA .
methods GET_VORGANG
returning
value(RV_SUBMI) type SUBMI .
methods SET_BELEGNUMMER
importing
!IV_PARAM type FLAG optional
!IV_VBELN type VBELN .
methods CHECK_CUSTOMER .
protected section.
private section.
data BELEGNUMMER type VBELN .
data VORGANG type SUBMI .
data BELEGE type TT_BELEGTABELLE .
ENDCLASS.
CLASS ZCL_IPSUMNIZER_TEST IMPLEMENTATION.
method CHECK_CUSTOMER.
endmethod.
METHOD get_vorgang.
rv_submi = me->vorgang.
ENDMETHOD.
METHOD read_data.
ENDMETHOD.
METHOD set_belegnummer.
IF iv_param IS INITIAL AND belegnummer IS INITIAL.
belegnummer = iv_vbeln.
ELSEIF iv_param IS NOT INITIAL.
belegnummer = iv_vbeln.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
5097,
62,
47643,
5883,
45,
14887,
1137,
62,
51,
6465,
6770,
198,
220,
1171,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
3858,
25,
198,
220,
220,
220,
347,
43312,
3963,
40379,
62,
1350,
1455,
22510,
647,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
6667,
77,
41876,
410,
6667,
77,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
850,
11632,
41876,
850,
11632,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1931,
19608,
41876,
1931,
19608,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1142,
321,
41876,
220,
1142,
321,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
40379,
62,
1350,
1455,
22510,
647,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
256,
83,
62,
1350,
1455,
8658,
13485,
41876,
311,
9863,
1961,
43679,
3963,
40379,
62,
1350,
1455,
22510,
647,
13315,
4725,
33866,
8924,
35374,
410,
6667,
77,
764,
628,
220,
38491,
327,
62,
26830,
7227,
62,
5603,
2099,
27548,
7227,
1988,
705,
5603,
6,
22492,
15285,
62,
32541,
13,
198,
220,
38491,
327,
62,
26830,
7227,
62,
51,
1921,
2099,
27548,
7227,
1988,
705,
51,
1921,
6,
22492,
15285,
62,
32541,
13,
628,
220,
5050,
20832,
62,
26947,
764,
198,
220,
5050,
17151,
62,
53,
1581,
38,
15567,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
50,
10526,
8895,
8,
2099,
28932,
8895,
764,
198,
220,
5050,
25823,
62,
12473,
2538,
16630,
5883,
29296,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
27082,
2390,
2099,
9977,
4760,
11902,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
44526,
3698,
45,
2099,
569,
33,
3698,
45,
764,
198,
220,
5050,
5870,
25171,
62,
34,
7759,
2662,
1137,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
628,
220,
1366,
9348,
2538,
16630,
5883,
29296,
2099,
569,
33,
3698,
45,
764,
198,
220,
1366,
569,
1581,
38,
15567,
2099,
28932,
8895,
764,
198,
220,
1366,
9348,
2538,
8264,
2099,
26653,
62,
12473,
2538,
38,
5603,
33,
3698,
2538,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
47643,
5883,
45,
14887,
1137,
62,
51,
6465,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
2446,
5870,
25171,
62,
34,
7759,
2662,
1137,
13,
198,
220,
886,
24396,
13,
628,
198,
220,
337,
36252,
651,
62,
85,
2398,
648,
13,
198,
220,
220,
220,
374,
85,
62,
7266,
11632,
796,
502,
3784,
85,
2398,
648,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1100,
62,
7890,
13,
628,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
900,
62,
1350,
1455,
22510,
647,
13,
628,
220,
220,
220,
16876,
21628,
62,
17143,
3180,
3268,
2043,
12576,
5357,
307,
1455,
22510,
647,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
307,
1455,
22510,
647,
796,
21628,
62,
85,
6667,
77,
13,
198,
220,
220,
220,
17852,
5188,
5064,
21628,
62,
17143,
3180,
5626,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
307,
1455,
22510,
647,
796,
21628,
62,
85,
6667,
77,
13,
198,
220,
220,
220,
23578,
5064,
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,
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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
] |
CLASS y_unit_test_coverage DEFINITION PUBLIC CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS get IMPORTING program_name TYPE programm
object TYPE cl_aucv_task=>ty_object_directory_element
coverage_type TYPE REF TO ce_scv_coverage_type
RETURNING VALUE(result) TYPE REF TO if_scv_coverage
RAISING cx_scv_execution_error.
CLASS-METHODS get_for_list IMPORTING objects TYPE cl_aucv_task=>ty_object_directory_elements
RETURNING VALUE(result) TYPE REF TO if_scv_measurement
RAISING cx_scv_execution_error.
PRIVATE SECTION.
TYPES: BEGIN OF buffer_entry,
object TYPE cl_aucv_task=>ty_object_directory_element,
coverages TYPE if_scv_coverage=>tab,
END OF buffer_entry.
CLASS-DATA buffer TYPE TABLE OF buffer_entry WITH KEY object.
CLASS-METHODS get_coverage IMPORTING object TYPE cl_aucv_task=>ty_object_directory_element
coverage_type TYPE REF TO ce_scv_coverage_type
RETURNING VALUE(result) TYPE REF TO if_scv_coverage.
ENDCLASS.
CLASS y_unit_test_coverage IMPLEMENTATION.
METHOD get.
IF line_exists( buffer[ object = object ] ).
result = get_coverage( object = object
coverage_type = coverage_type ).
RETURN.
ENDIF.
DATA(aunit) = cl_aucv_task=>create( i_measure_coverage = abap_true ).
aunit->add_associated_unit_tests( VALUE #( ( object ) ) ).
aunit->run( if_aunit_task=>c_run_mode-catch_short_dump ).
TRY.
DATA(coverages) = aunit->get_coverage_measurement( )->build_program_result( program_name )->get_coverages( ).
CATCH cx_scv_call_error.
" Object not supported (e.g global test class)
RAISE EXCEPTION TYPE cx_scv_execution_error.
ENDTRY.
buffer = VALUE #( BASE buffer
( object = object coverages = coverages ) ).
result = get_coverage( object = object
coverage_type = coverage_type ).
ENDMETHOD.
METHOD get_coverage.
DATA(entry) = buffer[ object = object ].
result = entry-coverages[ table_line->type = coverage_type ].
ENDMETHOD.
METHOD get_for_list.
DATA(aunit) = cl_aucv_task=>create( i_measure_coverage = abap_true ).
aunit->add_associated_unit_tests( objects ).
aunit->run( if_aunit_task=>c_run_mode-catch_short_dump ).
result = aunit->get_coverage_measurement( ).
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
62,
20850,
62,
9288,
62,
1073,
1857,
5550,
20032,
17941,
44731,
29244,
6158,
44731,
764,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
651,
30023,
9863,
2751,
1430,
62,
3672,
220,
41876,
1430,
76,
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,
2134,
220,
220,
220,
220,
220,
220,
220,
41876,
537,
62,
14272,
85,
62,
35943,
14804,
774,
62,
15252,
62,
34945,
62,
30854,
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,
5197,
62,
4906,
41876,
4526,
37,
5390,
2906,
62,
1416,
85,
62,
1073,
1857,
62,
4906,
198,
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,
4526,
37,
5390,
611,
62,
1416,
85,
62,
1073,
1857,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
43213,
62,
1416,
85,
62,
18558,
1009,
62,
18224,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
1640,
62,
4868,
30023,
9863,
2751,
5563,
220,
220,
220,
220,
220,
220,
41876,
537,
62,
14272,
85,
62,
35943,
14804,
774,
62,
15252,
62,
34945,
62,
68,
3639,
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,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
4526,
37,
5390,
611,
62,
1416,
85,
62,
1326,
5015,
434,
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,
17926,
1797,
2751,
220,
220,
43213,
62,
1416,
85,
62,
18558,
1009,
62,
18224,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
11876,
62,
13000,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2134,
220,
220,
220,
41876,
537,
62,
14272,
85,
62,
35943,
14804,
774,
62,
15252,
62,
34945,
62,
30854,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3002,
1095,
41876,
611,
62,
1416,
85,
62,
1073,
1857,
14804,
8658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
11876,
62,
13000,
13,
628,
220,
220,
220,
42715,
12,
26947,
11876,
41876,
43679,
3963,
11876,
62,
13000,
13315,
35374,
2134,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
1073,
1857,
30023,
9863,
2751,
2134,
220,
220,
220,
220,
220,
220,
220,
41876,
537,
62,
14272,
85,
62,
35943,
14804,
774,
62,
15252,
62,
34945,
62,
30854,
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,
5197,
62,
4906,
41876,
4526,
37,
5390,
2906,
62,
1416,
85,
62,
1073,
1857,
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,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
4526,
37,
5390,
611,
62,
1416,
85,
62,
1073,
1857,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
331,
62,
20850,
62,
9288,
62,
1073,
1857,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
651,
13,
628,
220,
220,
220,
16876,
1627,
62,
1069,
1023,
7,
11876,
58,
2134,
796,
2134,
2361,
6739,
198,
220,
220,
220,
220,
220,
1255,
796,
651,
62,
1073,
1857,
7,
2134,
796,
2134,
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,
5197,
62,
4906,
796,
5197,
62,
4906,
6739,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
42865,
7,
1942,
270,
8,
796,
537,
62,
14272,
85,
62,
35943,
14804,
17953,
7,
1312,
62,
1326,
5015,
62,
1073,
1857,
796,
450,
499,
62,
7942,
6739,
628,
220,
220,
220,
257,
20850,
3784,
2860,
62,
32852,
62,
20850,
62,
41989,
7,
26173,
8924,
1303,
7,
357,
2134,
1267,
1267,
6739,
628,
220,
220,
220,
257,
20850,
3784,
5143,
7,
611,
62,
1942,
270,
62,
35943,
14804,
66,
62,
5143,
62,
14171,
12,
40198,
62,
19509,
62,
39455,
6739,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
9631,
1095,
8,
796,
257,
20850,
3784,
1136,
62,
1073,
1857,
62,
1326,
5015,
434,
7,
1267,
3784,
11249,
62,
23065,
62,
20274,
7,
1430,
62,
3672,
1267,
3784,
1136,
62,
9631,
1095,
7,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
1416,
85,
62,
13345,
62,
18224,
13,
198,
220,
220,
220,
220,
220,
220,
220,
366,
9515,
407,
4855,
357,
68,
13,
70,
3298,
1332,
1398,
8,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
24352,
7788,
42006,
2849,
41876,
43213,
62,
1416,
85,
62,
18558,
1009,
62,
18224,
13,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
220,
220,
11876,
796,
26173,
8924,
1303,
7,
49688,
11876,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
2134,
796,
2134,
3002,
1095,
796,
3002,
1095,
1267,
6739,
628,
220,
220,
220,
1255,
796,
651,
62,
1073,
1857,
7,
2134,
796,
2134,
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,
5197
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS lcl_mapping_fields IMPLEMENTATION.
METHOD constructor.
DATA ls_mapping_field LIKE LINE OF mt_mapping_fields.
LOOP AT it_mapping_fields INTO ls_mapping_field.
ls_mapping_field-abap = to_upper( ls_mapping_field-abap ).
INSERT ls_mapping_field INTO TABLE mt_mapping_fields.
ENDLOOP.
ENDMETHOD.
METHOD zif_abapgit_ajson_mapping~to_abap.
DATA ls_mapping_field LIKE LINE OF mt_mapping_fields.
READ TABLE mt_mapping_fields INTO ls_mapping_field
WITH KEY json COMPONENTS json = iv_name.
IF sy-subrc = 0.
rv_result = ls_mapping_field-abap.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_ajson_mapping~to_json.
DATA lv_field TYPE string.
DATA ls_mapping_field LIKE LINE OF mt_mapping_fields.
lv_field = to_upper( iv_name ).
READ TABLE mt_mapping_fields INTO ls_mapping_field
WITH KEY abap COMPONENTS abap = lv_field.
IF sy-subrc = 0.
rv_result = ls_mapping_field-json.
ENDIF.
ENDMETHOD.
ENDCLASS.
CLASS lcl_mapping_to_upper IMPLEMENTATION.
METHOD constructor.
mi_mapping_fields = zcl_abapgit_ajson_mapping=>create_field_mapping( it_mapping_fields ).
ENDMETHOD.
METHOD zif_abapgit_ajson_mapping~to_abap.
rv_result = mi_mapping_fields->to_abap( iv_path = iv_path
iv_name = iv_name ).
ENDMETHOD.
METHOD zif_abapgit_ajson_mapping~to_json.
rv_result = mi_mapping_fields->to_json( iv_path = iv_path
iv_name = iv_name ).
IF rv_result IS NOT INITIAL. " Mapping found
RETURN.
ENDIF.
rv_result = to_upper( iv_name ).
ENDMETHOD.
ENDCLASS.
CLASS lcl_mapping_to_lower IMPLEMENTATION.
METHOD constructor.
mi_mapping_fields = zcl_abapgit_ajson_mapping=>create_field_mapping( it_mapping_fields ).
ENDMETHOD.
METHOD zif_abapgit_ajson_mapping~to_abap.
rv_result = mi_mapping_fields->to_abap( iv_path = iv_path
iv_name = iv_name ).
ENDMETHOD.
METHOD zif_abapgit_ajson_mapping~to_json.
rv_result = mi_mapping_fields->to_json( iv_path = iv_path
iv_name = iv_name ).
IF rv_result IS NOT INITIAL. " Mapping found
RETURN.
ENDIF.
rv_result = to_lower( iv_name ).
ENDMETHOD.
ENDCLASS.
CLASS lcl_mapping_camel IMPLEMENTATION.
METHOD constructor.
mi_mapping_fields = zcl_abapgit_ajson_mapping=>create_field_mapping( it_mapping_fields ).
mv_first_json_upper = iv_first_json_upper.
ENDMETHOD.
METHOD zif_abapgit_ajson_mapping~to_abap.
rv_result = mi_mapping_fields->to_abap( iv_path = iv_path
iv_name = iv_name ).
IF rv_result IS NOT INITIAL. " Mapping found
RETURN.
ENDIF.
rv_result = iv_name.
REPLACE ALL OCCURRENCES OF REGEX `([a-z])([A-Z])` IN rv_result WITH `$1_$2`.
ENDMETHOD.
METHOD zif_abapgit_ajson_mapping~to_json.
TYPES ty_token TYPE c LENGTH 255.
DATA lt_tokens TYPE STANDARD TABLE OF ty_token.
DATA lv_from TYPE i.
FIELD-SYMBOLS <token> LIKE LINE OF lt_tokens.
rv_result = mi_mapping_fields->to_json( iv_path = iv_path
iv_name = iv_name ).
IF rv_result IS NOT INITIAL. " Mapping found
RETURN.
ENDIF.
rv_result = iv_name.
REPLACE ALL OCCURRENCES OF `__` IN rv_result WITH `*`.
TRANSLATE rv_result TO LOWER CASE.
TRANSLATE rv_result USING `/_:_~_`.
IF mv_first_json_upper = abap_true.
lv_from = 1.
ELSE.
lv_from = 2.
ENDIF.
SPLIT rv_result AT `_` INTO TABLE lt_tokens.
LOOP AT lt_tokens ASSIGNING <token> FROM lv_from.
TRANSLATE <token>(1) TO UPPER CASE.
ENDLOOP.
CONCATENATE LINES OF lt_tokens INTO rv_result.
REPLACE ALL OCCURRENCES OF `*` IN rv_result WITH `_`.
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
565,
62,
76,
5912,
62,
25747,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
42865,
43979,
62,
76,
5912,
62,
3245,
34178,
48920,
3963,
45079,
62,
76,
5912,
62,
25747,
13,
628,
220,
220,
220,
17579,
3185,
5161,
340,
62,
76,
5912,
62,
25747,
39319,
43979,
62,
76,
5912,
62,
3245,
13,
198,
220,
220,
220,
220,
220,
43979,
62,
76,
5912,
62,
3245,
12,
397,
499,
796,
284,
62,
45828,
7,
43979,
62,
76,
5912,
62,
3245,
12,
397,
499,
6739,
198,
220,
220,
220,
220,
220,
29194,
17395,
43979,
62,
76,
5912,
62,
3245,
39319,
43679,
45079,
62,
76,
5912,
62,
25747,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
93,
1462,
62,
397,
499,
13,
628,
220,
220,
220,
42865,
43979,
62,
76,
5912,
62,
3245,
34178,
48920,
3963,
45079,
62,
76,
5912,
62,
25747,
13,
628,
220,
220,
220,
20832,
43679,
45079,
62,
76,
5912,
62,
25747,
39319,
43979,
62,
76,
5912,
62,
3245,
198,
220,
220,
220,
220,
220,
13315,
35374,
33918,
24301,
1340,
15365,
33918,
796,
21628,
62,
3672,
13,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
20274,
796,
43979,
62,
76,
5912,
62,
3245,
12,
397,
499,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
93,
1462,
62,
17752,
13,
628,
220,
220,
220,
42865,
300,
85,
62,
3245,
41876,
4731,
13,
198,
220,
220,
220,
42865,
43979,
62,
76,
5912,
62,
3245,
34178,
48920,
3963,
45079,
62,
76,
5912,
62,
25747,
13,
628,
220,
220,
220,
300,
85,
62,
3245,
796,
284,
62,
45828,
7,
21628,
62,
3672,
6739,
628,
220,
220,
220,
20832,
43679,
45079,
62,
76,
5912,
62,
25747,
39319,
43979,
62,
76,
5912,
62,
3245,
198,
220,
220,
220,
220,
220,
13315,
35374,
450,
499,
24301,
1340,
15365,
450,
499,
796,
300,
85,
62,
3245,
13,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
20274,
796,
43979,
62,
76,
5912,
62,
3245,
12,
17752,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
10619,
31631,
13,
628,
198,
31631,
300,
565,
62,
76,
5912,
62,
1462,
62,
45828,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
21504,
62,
76,
5912,
62,
25747,
796,
1976,
565,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
14804,
17953,
62,
3245,
62,
76,
5912,
7,
340,
62,
76,
5912,
62,
25747,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
93,
1462,
62,
397,
499,
13,
628,
220,
220,
220,
374,
85,
62,
20274,
796,
21504,
62,
76,
5912,
62,
25747,
3784,
1462,
62,
397,
499,
7,
21628,
62,
6978,
796,
21628,
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,
21628,
62,
3672,
796,
21628,
62,
3672,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
93,
1462,
62,
17752,
13,
628,
220,
220,
220,
374,
85,
62,
20274,
796,
21504,
62,
76,
5912,
62,
25747,
3784,
1462,
62,
17752,
7,
21628,
62,
6978,
796,
21628,
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,
21628,
62,
3672,
796,
21628,
62,
3672,
6739,
628,
220,
220,
220,
16876,
374,
85,
62,
20274,
3180,
5626,
3268,
2043,
12576,
13,
366,
337,
5912,
1043,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
374,
85,
62,
20274,
796,
284,
62,
45828,
7,
21628,
62,
3672,
6739,
628,
220,
23578,
49273,
13,
628,
198,
10619,
31631,
13,
628,
198,
31631,
300,
565,
62,
76,
5912,
62,
1462,
62,
21037,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
21504,
62,
76,
5912,
62,
25747,
796,
1976,
565,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
14804,
17953,
62,
3245,
62,
76,
5912,
7,
340,
62,
76,
5912,
62,
25747,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
93,
1462,
62,
397,
499,
13,
628,
220,
220,
220,
374,
85,
62,
20274,
796,
21504,
62,
76,
5912,
62,
25747,
3784,
1462,
62,
397,
499,
7,
21628,
62,
6978,
796,
21628,
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,
21628,
62,
3672,
796,
21628,
62,
3672,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
93,
1462,
62,
17752,
13,
628,
220,
220,
220,
374,
85,
62,
20274,
796,
21504,
62,
76,
5912,
62,
25747,
3784,
1462,
62,
17752,
7,
21628,
62,
6978,
796,
21628,
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,
21628,
62,
3672
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
1
] |
REPORT zabapgit_api_create_and_pull.
PARAMETERS:
p_url TYPE text100 DEFAULT 'https://github.com/abapGit-tests/VIEW.git' OBLIGATORY,
p_branch TYPE text100 DEFAULT 'refs/heads/master' OBLIGATORY,
p_devc TYPE devclass DEFAULT '$VIEW' OBLIGATORY.
START-OF-SELECTION.
PERFORM run.
FORM run.
TRY.
DATA(lo_repo) = zcl_abapgit_repo_srv=>get_instance( )->new_online(
iv_url = CONV #( p_url )
iv_branch_name = CONV #( p_branch )
iv_package = p_devc ).
DATA(ls_checks) = lo_repo->deserialize_checks( ).
* if there are conflicts or other stuff, this has to be filled in LS_CHECKS
lo_repo->deserialize( ls_checks ).
CATCH zcx_abapgit_exception INTO DATA(lx_error).
WRITE: / 'Error,', lx_error->get_text( ).
ENDTRY.
ENDFORM.
| [
2200,
15490,
1976,
397,
499,
18300,
62,
15042,
62,
17953,
62,
392,
62,
31216,
13,
198,
198,
27082,
2390,
2767,
4877,
25,
198,
220,
279,
62,
6371,
220,
220,
220,
41876,
2420,
3064,
5550,
38865,
705,
5450,
1378,
12567,
13,
785,
14,
397,
499,
38,
270,
12,
41989,
14,
28206,
13,
18300,
6,
440,
9148,
3528,
1404,
15513,
11,
198,
220,
279,
62,
1671,
3702,
41876,
2420,
3064,
5550,
38865,
705,
5420,
82,
14,
16600,
14,
9866,
6,
440,
9148,
3528,
1404,
15513,
11,
198,
220,
279,
62,
7959,
66,
220,
220,
41876,
1614,
4871,
5550,
38865,
705,
3,
28206,
6,
440,
9148,
3528,
1404,
15513,
13,
198,
198,
2257,
7227,
12,
19238,
12,
46506,
2849,
13,
198,
220,
19878,
21389,
1057,
13,
198,
198,
21389,
1057,
13,
628,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
42865,
7,
5439,
62,
260,
7501,
8,
796,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
27891,
85,
14804,
1136,
62,
39098,
7,
1267,
3784,
3605,
62,
25119,
7,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
6371,
220,
220,
220,
220,
220,
220,
220,
220,
796,
7102,
53,
1303,
7,
279,
62,
6371,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
1671,
3702,
62,
3672,
796,
7102,
53,
1303,
7,
279,
62,
1671,
3702,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
26495,
220,
220,
220,
220,
796,
279,
62,
7959,
66,
6739,
628,
220,
220,
220,
220,
220,
42865,
7,
7278,
62,
42116,
8,
796,
2376,
62,
260,
7501,
3784,
8906,
48499,
1096,
62,
42116,
7,
6739,
198,
198,
9,
611,
612,
389,
12333,
393,
584,
3404,
11,
428,
468,
284,
307,
5901,
287,
30948,
62,
50084,
50,
628,
220,
220,
220,
220,
220,
2376,
62,
260,
7501,
3784,
8906,
48499,
1096,
7,
43979,
62,
42116,
6739,
628,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
39319,
42865,
7,
75,
87,
62,
18224,
737,
198,
220,
220,
220,
220,
220,
44423,
25,
1220,
705,
12331,
11,
3256,
300,
87,
62,
18224,
3784,
1136,
62,
5239,
7,
6739,
198,
220,
23578,
40405,
13,
198,
198,
1677,
8068,
1581,
44,
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
] |
CLASS zcl_abapgit_oo_interface DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_oo_base
CREATE PUBLIC .
PUBLIC SECTION.
METHODS zif_abapgit_oo_object_fnc~create
REDEFINITION .
METHODS zif_abapgit_oo_object_fnc~delete
REDEFINITION .
METHODS zif_abapgit_oo_object_fnc~get_includes
REDEFINITION .
METHODS zif_abapgit_oo_object_fnc~get_interface_properties
REDEFINITION .
METHODS zif_abapgit_oo_object_fnc~deserialize_source
REDEFINITION .
METHODS zif_abapgit_oo_object_fnc~exists
REDEFINITION .
PROTECTED SECTION.
PRIVATE SECTION.
CLASS-METHODS update_report
IMPORTING
!iv_program TYPE programm
!it_source TYPE string_table
RETURNING
VALUE(rv_updated) TYPE abap_bool
RAISING
zcx_abapgit_exception .
CLASS-METHODS update_meta
IMPORTING
!iv_name TYPE seoclsname
!it_source TYPE rswsourcet
RAISING
zcx_abapgit_exception .
CLASS-METHODS init_scanner
IMPORTING
!it_source TYPE zif_abapgit_definitions=>ty_string_tt
!iv_name TYPE seoclsname
RETURNING
VALUE(ro_scanner) TYPE REF TO cl_oo_source_scanner_interface
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS zcl_abapgit_oo_interface IMPLEMENTATION.
METHOD init_scanner.
DATA: lx_exc TYPE REF TO cx_root,
lv_message TYPE string,
lv_classname TYPE abap_abstypename.
FIELD-SYMBOLS: <lv_line> TYPE i.
TRY.
ro_scanner = cl_oo_source_scanner_interface=>create_interface_scanner(
clif_name = iv_name
source = it_source ).
ro_scanner->scan( ).
CATCH cx_clif_scan_error.
zcx_abapgit_exception=>raise( 'error initializing INTF scanner' ).
CATCH cx_root INTO lx_exc.
lv_classname = cl_abap_classdescr=>get_class_name( lx_exc ).
IF lv_classname = '\CLASS=CX_OO_CLIF_SCAN_ERROR_DETAIL'.
ASSIGN lx_exc->('SOURCE_POSITION-LINE') TO <lv_line>.
ASSERT sy-subrc = 0.
lv_message = |{ lx_exc->get_text( ) }, line { <lv_line> }|.
ELSE.
lv_message = lx_exc->get_text( ).
ENDIF.
zcx_abapgit_exception=>raise( lv_message ).
ENDTRY.
ENDMETHOD.
METHOD update_meta.
DATA: lo_update TYPE REF TO cl_oo_interface_section_source,
ls_clskey TYPE seoclskey,
lv_scan_error TYPE abap_bool.
ls_clskey-clsname = iv_name.
TRY.
CALL FUNCTION 'SEO_BUFFER_REFRESH'
EXPORTING
cifkey = ls_clskey
version = seoc_version_active.
CREATE OBJECT lo_update TYPE ('CL_OO_INTERFACE_SECTION_SOURCE')
EXPORTING
intkey = ls_clskey
state = 'A'
source = it_source
EXCEPTIONS
interface_not_existing = 1
read_source_error = 2
OTHERS = 3 ##SUBRC_OK.
CATCH cx_sy_dyn_call_param_not_found.
* downport to 702, see https://github.com/abapGit/abapGit/issues/933
* this will READ REPORT instead of using it_source, which should be okay
CREATE OBJECT lo_update TYPE cl_oo_interface_section_source
EXPORTING
intkey = ls_clskey
state = 'A'
EXCEPTIONS
interface_not_existing = 1
read_source_error = 2
OTHERS = 3.
ENDTRY.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
lo_update->set_dark_mode( abap_true ).
lo_update->scan_section_source(
RECEIVING
scan_error = lv_scan_error
EXCEPTIONS
scan_abap_source_error = 1
OTHERS = 2 ).
IF sy-subrc <> 0 OR lv_scan_error = abap_true.
zcx_abapgit_exception=>raise( |INTF, error while scanning source. Subrc = { sy-subrc }| ).
ENDIF.
* this will update the SEO* database tables
lo_update->revert_scan_result( ).
ENDMETHOD.
METHOD update_report.
DATA: lt_old TYPE string_table.
READ REPORT iv_program INTO lt_old.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Fatal error. Include { iv_program } should have been created previously!| ).
ENDIF.
IF lt_old <> it_source.
INSERT REPORT iv_program FROM it_source.
ASSERT sy-subrc = 0.
rv_updated = abap_true.
ELSE.
rv_updated = abap_false.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~create.
DATA: lt_vseoattrib TYPE seoo_attributes_r.
FIELD-SYMBOLS: <lv_clsname> TYPE seoclsname.
ASSIGN COMPONENT 'CLSNAME' OF STRUCTURE cg_properties TO <lv_clsname>.
ASSERT sy-subrc = 0.
lt_vseoattrib = convert_attrib_to_vseoattrib(
iv_clsname = <lv_clsname>
it_attributes = it_attributes ).
TRY.
CALL FUNCTION 'SEO_INTERFACE_CREATE_COMPLETE'
EXPORTING
devclass = iv_package
overwrite = iv_overwrite
version = seoc_version_active
suppress_dialog = abap_true " Parameter missing in 702
CHANGING
interface = cg_properties
attributes = lt_vseoattrib
EXCEPTIONS
existing = 1
is_class = 2
db_error = 3
component_error = 4
no_access = 5
other = 6
OTHERS = 7.
CATCH cx_sy_dyn_call_param_not_found.
CALL FUNCTION 'SEO_INTERFACE_CREATE_COMPLETE'
EXPORTING
devclass = iv_package
overwrite = iv_overwrite
version = seoc_version_active
CHANGING
interface = cg_properties
attributes = lt_vseoattrib
EXCEPTIONS
existing = 1
is_class = 2
db_error = 3
component_error = 4
no_access = 5
other = 6
OTHERS = 7.
ENDTRY.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~delete.
CALL FUNCTION 'SEO_INTERFACE_DELETE_COMPLETE'
EXPORTING
intkey = is_deletion_key
EXCEPTIONS
not_existing = 1
is_class = 2
db_error = 3
no_access = 4
other = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~deserialize_source.
DATA: lv_updated TYPE abap_bool,
lv_program TYPE program,
lo_scanner TYPE REF TO cl_oo_source_scanner_interface,
lt_public TYPE seop_source_string.
"Buffer needs to be refreshed,
"otherwise standard SAP CLIF_SOURCE reorder methods alphabetically
CALL FUNCTION 'SEO_BUFFER_INIT'.
CALL FUNCTION 'SEO_BUFFER_REFRESH'
EXPORTING
cifkey = is_key
version = seoc_version_inactive.
lo_scanner = init_scanner(
it_source = it_source
iv_name = is_key-clsname ).
lt_public = lo_scanner->get_interface_section_source( ).
IF lt_public IS NOT INITIAL.
lv_program = cl_oo_classname_service=>get_intfsec_name( is_key-clsname ).
lv_updated = update_report( iv_program = lv_program
it_source = lt_public ).
IF lv_updated = abap_true.
update_meta( iv_name = is_key-clsname
it_source = lt_public ).
ENDIF.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~exists.
CALL FUNCTION 'SEO_INTERFACE_EXISTENCE_CHECK'
EXPORTING
intkey = is_object_name
EXCEPTIONS
not_specified = 1
not_existing = 2
is_class = 3
no_text = 4
inconsistent = 5
OTHERS = 6.
rv_exists = boolc( sy-subrc = 0 OR sy-subrc = 4 ).
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~get_includes.
DATA lv_interface_name TYPE seoclsname.
lv_interface_name = iv_object_name.
APPEND cl_oo_classname_service=>get_interfacepool_name( lv_interface_name ) TO rt_includes.
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~get_interface_properties.
CALL FUNCTION 'SEO_CLIF_GET'
EXPORTING
cifkey = is_interface_key
version = seoc_version_active
IMPORTING
interface = rs_interface_properties
EXCEPTIONS
not_existing = 1
deleted = 2
model_only = 3
OTHERS = 4.
IF sy-subrc = 1.
RETURN. " in case only inactive version exists
ELSEIF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
2238,
62,
39994,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
2238,
62,
8692,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
17953,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
33678,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
1136,
62,
42813,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
1136,
62,
39994,
62,
48310,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
8906,
48499,
1096,
62,
10459,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
1069,
1023,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
4296,
62,
13116,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
23065,
220,
220,
220,
220,
220,
220,
41876,
1430,
76,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
10459,
220,
220,
220,
220,
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,
81,
85,
62,
43162,
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,
42715,
12,
49273,
50,
4296,
62,
28961,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
220,
220,
41876,
384,
420,
7278,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
10459,
41876,
374,
2032,
82,
454,
66,
316,
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,
2315,
62,
35836,
1008,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
10459,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
8841,
62,
926,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
384,
420,
7278,
3672,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
35836,
1008,
8,
41876,
4526,
37,
5390,
537,
62,
2238,
62,
10459,
62,
35836,
1008,
62,
39994,
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,
2238,
62,
39994,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
2315,
62,
35836,
1008,
13,
628,
220,
220,
220,
42865,
25,
300,
87,
62,
41194,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
43213,
62,
15763,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
20500,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
4871,
3672,
41876,
450,
499,
62,
397,
34365,
3617,
480,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
6780,
62,
1370,
29,
41876,
1312,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
686,
62,
35836,
1008,
796,
537,
62,
2238,
62,
10459,
62,
35836,
1008,
62,
39994,
14804,
17953,
62,
39994,
62,
35836,
1008,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
537,
361,
62,
3672,
796,
21628,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2723,
220,
220,
220,
796,
340,
62,
10459,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
686,
62,
35836,
1008,
3784,
35836,
7,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
565,
361,
62,
35836,
62,
18224,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
18224,
4238,
2890,
3268,
10234,
27474,
6,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
15763,
39319,
300,
87,
62,
41194,
13,
198,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
4871,
3672,
796,
537,
62,
397,
499,
62,
4871,
20147,
81,
14804,
1136,
62,
4871,
62,
3672,
7,
300,
87,
62,
41194,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
16876,
300,
85,
62,
4871,
3672,
796,
705,
59,
31631,
28,
34,
55,
62,
6684,
62,
5097,
5064,
62,
6173,
1565,
62,
24908,
62,
35,
20892,
4146,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24994,
16284,
300,
87,
62,
41194,
3784,
10786,
47690,
62,
37997,
17941,
12,
24027,
11537,
5390,
1279,
6780,
62,
1370,
28401,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24994
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
*"* use this source file for your ABAP unit test classes
CLASS lcl_abap_unit DEFINITION FINAL FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
DATA mr_cut TYPE REF TO zcl_sat_adt_cds_parser.
METHODS:
"! <p class="shorttext synchronized" lang="en">Simple parser test</p>
test_parse1 FOR TESTING RAISING cx_static_check,
"! <p class="shorttext synchronized" lang="en">Test association retrieval</p>
test_parse2 FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS lcl_abap_unit IMPLEMENTATION.
METHOD test_parse1.
mr_cut = NEW #( 'I_PRODUCT' ).
mr_cut->parse_cds( ).
DATA(ls_parser_info) = mr_cut->ms_select_element_info.
cl_abap_unit_assert=>assert_not_initial( ls_parser_info-children ).
ENDMETHOD.
METHOD test_parse2.
FIELD-SYMBOLS: <lt_elements> TYPE zsat_adt_element_info_t.
mr_cut = NEW #( 'I_PRODUCT' ).
mr_cut->parse_cds( if_associations = abap_true ).
DATA(ls_parser_info) = mr_cut->ms_select_element_info.
cl_abap_unit_assert=>assert_not_initial( ls_parser_info-children ).
ASSIGN ls_parser_info-children->* TO <lt_elements>.
cl_abap_unit_assert=>assert_equals( act = sy-subrc exp = 0 ).
DATA(ls_associations_entry) = VALUE #( <lt_elements>[ name = zcl_sat_adt_cds_parser=>c_node_type-associations ] OPTIONAL ).
cl_abap_unit_assert=>assert_not_initial( act = ls_associations_entry ).
ENDMETHOD.
ENDCLASS.
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
534,
9564,
2969,
4326,
1332,
6097,
198,
31631,
300,
565,
62,
397,
499,
62,
20850,
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,
285,
81,
62,
8968,
41876,
4526,
37,
5390,
1976,
565,
62,
49720,
62,
324,
83,
62,
66,
9310,
62,
48610,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
26437,
30751,
1332,
3556,
79,
29,
198,
220,
220,
220,
220,
220,
1332,
62,
29572,
16,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
14402,
8112,
45069,
3556,
79,
29,
198,
220,
220,
220,
220,
220,
1332,
62,
29572,
17,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
10619,
31631,
13,
628,
198,
31631,
300,
565,
62,
397,
499,
62,
20850,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
1332,
62,
29572,
16,
13,
198,
220,
220,
220,
285,
81,
62,
8968,
796,
12682,
1303,
7,
705,
40,
62,
4805,
28644,
6,
6739,
198,
220,
220,
220,
285,
81,
62,
8968,
3784,
29572,
62,
66,
9310,
7,
6739,
628,
220,
220,
220,
42865,
7,
7278,
62,
48610,
62,
10951,
8,
796,
285,
81,
62,
8968,
3784,
907,
62,
19738,
62,
30854,
62,
10951,
13,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
1662,
62,
36733,
7,
43979,
62,
48610,
62,
10951,
12,
17197,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
62,
29572,
17,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
2528,
62,
68,
3639,
29,
41876,
1976,
49720,
62,
324,
83,
62,
30854,
62,
10951,
62,
83,
13,
628,
220,
220,
220,
285,
81,
62,
8968,
796,
12682,
1303,
7,
705,
40,
62,
4805,
28644,
6,
6739,
198,
220,
220,
220,
285,
81,
62,
8968,
3784,
29572,
62,
66,
9310,
7,
611,
62,
562,
1733,
602,
796,
450,
499,
62,
7942,
6739,
628,
220,
220,
220,
42865,
7,
7278,
62,
48610,
62,
10951,
8,
796,
285,
81,
62,
8968,
3784,
907,
62,
19738,
62,
30854,
62,
10951,
13,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
1662,
62,
36733,
7,
43979,
62,
48610,
62,
10951,
12,
17197,
6739,
628,
220,
220,
220,
24994,
16284,
43979,
62,
48610,
62,
10951,
12,
17197,
3784,
9,
5390,
1279,
2528,
62,
68,
3639,
28401,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
719,
796,
827,
12,
7266,
6015,
1033,
796,
657,
6739,
628,
220,
220,
220,
42865,
7,
7278,
62,
562,
1733,
602,
62,
13000,
8,
796,
26173,
8924,
1303,
7,
1279,
2528,
62,
68,
3639,
36937,
1438,
796,
1976,
565,
62,
49720,
62,
324,
83,
62,
66,
9310,
62,
48610,
14804,
66,
62,
17440,
62,
4906,
12,
562,
1733,
602,
2361,
39852,
2849,
1847,
6739,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
1662,
62,
36733,
7,
719,
796,
43979,
62,
562,
1733,
602,
62,
13000,
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,
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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
] |
CLASS zcl_abapgit_object_wdyn 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.
DATA:
mt_components TYPE TABLE OF wdy_ctlr_compo_vrs,
mt_sources TYPE TABLE OF wdy_ctlr_compo_source_vrs.
METHODS:
get_limu_objects
RETURNING VALUE(rt_objects) TYPE wdy_md_transport_keys,
read
RETURNING VALUE(rs_component) TYPE wdy_component_metadata
RAISING zcx_abapgit_exception,
read_controller
IMPORTING is_key TYPE wdy_md_controller_key
RETURNING VALUE(rs_controller) TYPE wdy_md_controller_meta_data
RAISING zcx_abapgit_exception,
read_definition
IMPORTING is_key TYPE wdy_md_component_key
RETURNING VALUE(rs_definition) TYPE wdy_md_component_meta_data
RAISING zcx_abapgit_exception,
read_view
IMPORTING is_key TYPE wdy_md_view_key
RETURNING VALUE(rs_view) TYPE wdy_md_view_meta_data
RAISING zcx_abapgit_exception,
recover_controller
IMPORTING is_controller TYPE wdy_md_controller_meta_data
RAISING zcx_abapgit_exception,
recover_definition
IMPORTING is_definition TYPE wdy_md_component_meta_data
iv_package TYPE devclass
RAISING zcx_abapgit_exception,
recover_view
IMPORTING is_view TYPE wdy_md_view_meta_data
RAISING zcx_abapgit_exception,
delta_controller
IMPORTING is_controller TYPE wdy_md_controller_meta_data
RETURNING VALUE(rs_delta) TYPE svrs2_xversionable_object
RAISING zcx_abapgit_exception,
delta_definition
IMPORTING is_definition TYPE wdy_md_component_meta_data
VALUE(iv_package) TYPE devclass
RETURNING VALUE(rs_delta) TYPE svrs2_xversionable_object
RAISING zcx_abapgit_exception,
delta_view
IMPORTING is_view TYPE wdy_md_view_meta_data
RETURNING VALUE(rs_delta) TYPE svrs2_xversionable_object
RAISING zcx_abapgit_exception,
add_fm_param_exporting
IMPORTING iv_name TYPE string
ig_value TYPE any
CHANGING ct_param TYPE abap_func_parmbind_tab,
add_fm_param_tables
IMPORTING iv_name TYPE string
CHANGING ct_value TYPE ANY TABLE
ct_param TYPE abap_func_parmbind_tab,
add_fm_exception
IMPORTING iv_name TYPE string
iv_value TYPE i
CHANGING ct_exception TYPE abap_func_excpbind_tab.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_WDYN IMPLEMENTATION.
METHOD add_fm_exception.
DATA: ls_exception LIKE LINE OF ct_exception.
ls_exception-name = iv_name.
ls_exception-value = iv_value.
INSERT ls_exception INTO TABLE ct_exception.
ENDMETHOD.
METHOD add_fm_param_exporting.
DATA: ls_param LIKE LINE OF ct_param.
ls_param-kind = abap_func_exporting.
ls_param-name = iv_name.
GET REFERENCE OF ig_value INTO ls_param-value.
INSERT ls_param INTO TABLE ct_param.
ENDMETHOD.
METHOD add_fm_param_tables.
DATA: ls_param LIKE LINE OF ct_param.
ls_param-kind = abap_func_tables.
ls_param-name = iv_name.
GET REFERENCE OF ct_value INTO ls_param-value.
INSERT ls_param INTO TABLE ct_param.
ENDMETHOD.
METHOD delta_controller.
DATA: li_controller TYPE REF TO if_wdy_md_controller,
lv_found TYPE abap_bool,
ls_key TYPE wdy_md_controller_key,
ls_obj_new TYPE svrs2_versionable_object,
ls_obj_old TYPE svrs2_versionable_object.
FIELD-SYMBOLS: <ls_component> LIKE LINE OF mt_components,
<ls_source> LIKE LINE OF mt_sources,
<lt_ctrl_exceptions> TYPE ANY TABLE,
<lt_ctrl_exception_texts> TYPE ANY TABLE,
<lt_excp> TYPE ANY TABLE,
<lt_excpt> TYPE ANY TABLE.
ls_key-component_name = is_controller-definition-component_name.
ls_key-controller_name = is_controller-definition-controller_name.
lv_found = cl_wdy_md_controller=>check_existency(
component_name = ls_key-component_name
controller_name = ls_key-controller_name ).
IF lv_found = abap_false.
TRY.
li_controller ?= cl_wdy_md_controller=>create_complete(
component_name = ls_key-component_name
controller_name = ls_key-controller_name
controller_type = is_controller-definition-controller_type ).
li_controller->save_to_database( ).
li_controller->unlock( ).
CATCH cx_wdy_md_exception.
zcx_abapgit_exception=>raise( 'error creating dummy controller' ).
ENDTRY.
ENDIF.
ls_obj_new-objtype = wdyn_limu_component_controller.
ls_obj_new-objname = ls_key.
ls_obj_old-objtype = wdyn_limu_component_controller.
ls_obj_old-objname = ls_key.
APPEND is_controller-definition TO ls_obj_old-wdyc-defin.
LOOP AT mt_components ASSIGNING <ls_component>
WHERE component_name = ls_key-component_name
AND controller_name = ls_key-controller_name.
APPEND <ls_component> TO ls_obj_old-wdyc-ccomp.
ENDLOOP.
LOOP AT mt_sources ASSIGNING <ls_source>
WHERE component_name = ls_key-component_name
AND controller_name = ls_key-controller_name.
APPEND <ls_source> TO ls_obj_old-wdyc-ccoms.
ENDLOOP.
ls_obj_old-wdyc-descr = is_controller-descriptions.
ls_obj_old-wdyc-cusag = is_controller-controller_usages.
ls_obj_old-wdyc-ccomt = is_controller-controller_component_texts.
ls_obj_old-wdyc-cpara = is_controller-controller_parameters.
ls_obj_old-wdyc-cpart = is_controller-controller_parameter_texts.
ls_obj_old-wdyc-cnode = is_controller-context_nodes.
ls_obj_old-wdyc-cattr = is_controller-context_attributes.
ls_obj_old-wdyc-cmapp = is_controller-context_mappings.
* Version 702 doesn't have these two attributes so we
* use them dynamically for downward compatibility
ASSIGN COMPONENT 'CONTROLLER_EXCEPTIONS' OF STRUCTURE is_controller
TO <lt_ctrl_exceptions>.
IF sy-subrc = 0.
ASSIGN COMPONENT 'EXCP' OF STRUCTURE ls_obj_old-wdyc TO <lt_excp>.
IF sy-subrc = 0.
<lt_excp> = <lt_ctrl_exceptions>.
ENDIF.
ENDIF.
ASSIGN COMPONENT 'CONTROLLER_EXCEPTIONS_TEXTS' OF STRUCTURE is_controller
TO <lt_ctrl_exception_texts>.
IF sy-subrc = 0.
ASSIGN COMPONENT 'EXCPT' OF STRUCTURE ls_obj_old-wdyc TO <lt_excpt>.
IF sy-subrc = 0.
<lt_excpt> = <lt_ctrl_exception_texts>.
ENDIF.
ENDIF.
ls_obj_old-wdyc-fgrps = is_controller-fieldgroups.
CALL FUNCTION 'SVRS_MAKE_OBJECT_DELTA'
EXPORTING
obj_old = ls_obj_new
obj_new = ls_obj_old
CHANGING
delta = rs_delta
EXCEPTIONS
inconsistent_objects = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SVRS_MAKE_OBJECT_DELTA' ).
ENDIF.
ENDMETHOD.
METHOD delta_definition.
DATA: ls_key TYPE wdy_md_component_key,
lv_found TYPE abap_bool,
ls_obj_new TYPE svrs2_versionable_object,
li_component TYPE REF TO if_wdy_md_component,
ls_obj_old TYPE svrs2_versionable_object.
ls_key-component_name = is_definition-definition-component_name.
lv_found = cl_wdy_md_component=>check_existency( ls_key-component_name ).
IF lv_found = abap_false.
TRY.
cl_wdy_md_component=>create_complete(
EXPORTING
name = ls_key-component_name
IMPORTING
component = li_component
CHANGING
devclass = iv_package ).
li_component->save_to_database( ).
li_component->unlock( ).
CATCH cx_wdy_md_exception.
zcx_abapgit_exception=>raise( 'error creating dummy component' ).
ENDTRY.
ENDIF.
ls_obj_new-objtype = wdyn_limu_component_definition.
ls_obj_new-objname = ls_key-component_name.
ls_obj_old-objtype = wdyn_limu_component_definition.
ls_obj_old-objname = ls_key-component_name.
APPEND is_definition-definition TO ls_obj_old-wdyd-defin.
ls_obj_old-wdyd-descr = is_definition-descriptions.
ls_obj_old-wdyd-cusag = is_definition-component_usages.
ls_obj_old-wdyd-intrf = is_definition-interface_implementings.
ls_obj_old-wdyd-libra = is_definition-library_usages.
ls_obj_old-wdyd-ctuse = is_definition-ext_ctlr_usages.
ls_obj_old-wdyd-ctmap = is_definition-ext_ctx_mappings.
CALL FUNCTION 'SVRS_MAKE_OBJECT_DELTA'
EXPORTING
obj_old = ls_obj_new
obj_new = ls_obj_old
CHANGING
delta = rs_delta
EXCEPTIONS
inconsistent_objects = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SVRS_MAKE_OBJECT_DELTA' ).
ENDIF.
ENDMETHOD.
METHOD delta_view.
DATA: ls_key TYPE wdy_md_view_key,
ls_obj_new TYPE svrs2_versionable_object,
ls_obj_old TYPE svrs2_versionable_object,
lv_found TYPE abap_bool,
li_view TYPE REF TO if_wdy_md_abstract_view.
FIELD-SYMBOLS: <ls_def> LIKE LINE OF ls_obj_old-wdyv-defin.
ls_key-component_name = is_view-definition-component_name.
ls_key-view_name = is_view-definition-view_name.
lv_found = cl_wdy_md_abstract_view=>check_existency(
component_name = ls_key-component_name
name = ls_key-view_name ).
IF lv_found = abap_false.
TRY.
li_view = cl_wdy_md_abstract_view=>create(
component_name = is_view-definition-component_name
view_name = is_view-definition-view_name
type = is_view-definition-type ).
li_view->save_to_database( ).
li_view->unlock( ).
CATCH cx_wdy_md_exception.
zcx_abapgit_exception=>raise( 'error creating dummy view' ).
ENDTRY.
ENDIF.
ls_obj_new-objtype = wdyn_limu_component_view.
ls_obj_new-objname = ls_key.
ls_obj_old-objtype = wdyn_limu_component_view.
ls_obj_old-objname = ls_key.
APPEND INITIAL LINE TO ls_obj_old-wdyv-defin ASSIGNING <ls_def>.
MOVE-CORRESPONDING is_view-definition TO <ls_def>.
ls_obj_old-wdyv-descr = is_view-descriptions.
ls_obj_old-wdyv-vcont = is_view-view_containers.
ls_obj_old-wdyv-vcntt = is_view-view_container_texts.
ls_obj_old-wdyv-ibplg = is_view-iobound_plugs.
ls_obj_old-wdyv-ibplt = is_view-iobound_plug_texts.
ls_obj_old-wdyv-plpar = is_view-plug_parameters.
ls_obj_old-wdyv-plprt = is_view-plug_parameter_texts.
ls_obj_old-wdyv-uiele = is_view-ui_elements.
ls_obj_old-wdyv-uicon = is_view-ui_context_bindings.
ls_obj_old-wdyv-uievt = is_view-ui_event_bindings.
ls_obj_old-wdyv-uiddc = is_view-ui_ddic_bindings.
ls_obj_old-wdyv-uiprp = is_view-ui_properties.
ls_obj_old-wdyv-navil = is_view-navigation_links.
ls_obj_old-wdyv-navit = is_view-navigation_target_refs.
ls_obj_old-wdyv-vshno = is_view-vsh_nodes.
ls_obj_old-wdyv-vshpl = is_view-vsh_placeholders.
ls_obj_old-wdyv-views = is_view-viewset_properties.
CALL FUNCTION 'SVRS_MAKE_OBJECT_DELTA'
EXPORTING
obj_old = ls_obj_new
obj_new = ls_obj_old
CHANGING
delta = rs_delta
EXCEPTIONS
inconsistent_objects = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SVRS_MAKE_OBJECT_DELTA' ).
ENDIF.
ENDMETHOD.
METHOD get_limu_objects.
DATA: lv_name TYPE wdy_component_name.
lv_name = ms_item-obj_name.
CALL FUNCTION 'WDYN_GET_LIMU_OBJECTS'
EXPORTING
component_name = lv_name
IMPORTING
limu_objects = rt_objects.
ENDMETHOD.
METHOD read.
DATA: lt_objects TYPE wdy_md_transport_keys,
ls_controller_key TYPE wdy_md_controller_key,
ls_component_key TYPE wdy_md_component_key,
ls_view_key TYPE wdy_md_view_key.
FIELD-SYMBOLS: <ls_object> LIKE LINE OF lt_objects,
<ls_meta> LIKE LINE OF rs_component-ctlr_metadata,
<lt_ctrl_exceptions> TYPE ANY TABLE,
<lt_ctrl_exception_texts> TYPE ANY TABLE.
CLEAR mt_components.
CLEAR mt_sources.
lt_objects = get_limu_objects( ).
LOOP AT lt_objects ASSIGNING <ls_object>.
CASE <ls_object>-sub_type.
WHEN wdyn_limu_component_controller.
ls_controller_key = <ls_object>-sub_name.
APPEND read_controller( ls_controller_key ) TO rs_component-ctlr_metadata.
WHEN wdyn_limu_component_definition.
ls_component_key = <ls_object>-sub_name.
rs_component-comp_metadata = read_definition( ls_component_key ).
WHEN wdyn_limu_component_view.
ls_view_key = <ls_object>-sub_name.
APPEND read_view( ls_view_key ) TO rs_component-view_metadata.
WHEN OTHERS.
ASSERT 0 = 1.
ENDCASE.
ENDLOOP.
SORT rs_component-ctlr_metadata BY
definition-component_name ASCENDING
definition-controller_name ASCENDING.
LOOP AT rs_component-ctlr_metadata ASSIGNING <ls_meta>.
SORT <ls_meta>-descriptions.
SORT <ls_meta>-controller_usages.
SORT <ls_meta>-controller_components.
SORT <ls_meta>-controller_component_texts.
SORT <ls_meta>-controller_parameters.
SORT <ls_meta>-controller_parameter_texts.
SORT <ls_meta>-context_nodes.
SORT <ls_meta>-context_attributes.
SORT <ls_meta>-context_mappings.
SORT <ls_meta>-fieldgroups.
* Version 702 doesn't have these two attributes so we
* use them dynamically for downward compatibility
ASSIGN COMPONENT 'CONTROLLER_EXCEPTIONS' OF STRUCTURE <ls_meta> TO <lt_ctrl_exceptions>.
IF sy-subrc = 0.
SORT <lt_ctrl_exceptions>.
ENDIF.
ASSIGN COMPONENT 'CONTROLLER_EXCEPTION_TEXTS' OF STRUCTURE <ls_meta> TO <lt_ctrl_exception_texts>.
IF sy-subrc = 0.
SORT <lt_ctrl_exception_texts>.
ENDIF.
ENDLOOP.
SORT mt_components BY
component_name ASCENDING
controller_name ASCENDING
cmpname ASCENDING.
SORT mt_sources BY
component_name ASCENDING
controller_name ASCENDING
cmpname ASCENDING
line_number ASCENDING.
ENDMETHOD.
METHOD read_controller.
DATA: lt_components TYPE TABLE OF wdy_ctlr_compo_vrs,
lt_sources TYPE TABLE OF wdy_ctlr_compo_source_vrs,
lt_definition TYPE TABLE OF wdy_controller,
lt_psmodilog TYPE TABLE OF smodilog,
lt_psmodisrc TYPE TABLE OF smodisrc,
lt_fm_param TYPE abap_func_parmbind_tab,
lt_fm_exception TYPE abap_func_excpbind_tab.
FIELD-SYMBOLS: <lt_ctrl_exceptions> TYPE ANY TABLE,
<lt_ctrl_exception_texts> TYPE ANY TABLE.
* Calling FM dynamically because version 702 has less parameters
* FM parameters
add_fm_param_exporting( EXPORTING iv_name = 'CONTROLLER_KEY'
ig_value = is_key
CHANGING ct_param = lt_fm_param ).
add_fm_param_exporting( EXPORTING iv_name = 'GET_ALL_TRANSLATIONS'
ig_value = abap_false
CHANGING ct_param = lt_fm_param ).
add_fm_param_tables( EXPORTING iv_name = 'DEFINITION'
CHANGING ct_value = lt_definition
ct_param = lt_fm_param ).
add_fm_param_tables( EXPORTING iv_name = 'DESCRIPTIONS'
CHANGING ct_value = rs_controller-descriptions
ct_param = lt_fm_param ).
add_fm_param_tables( EXPORTING iv_name = 'CONTROLLER_USAGES'
CHANGING ct_value = rs_controller-controller_usages
ct_param = lt_fm_param ).
add_fm_param_tables( EXPORTING iv_name = 'CONTROLLER_COMPONENTS'
CHANGING ct_value = lt_components
ct_param = lt_fm_param ).
add_fm_param_tables( EXPORTING iv_name = 'CONTROLLER_COMPONENT_SOURCES'
CHANGING ct_value = lt_sources
ct_param = lt_fm_param ).
add_fm_param_tables( EXPORTING iv_name = 'CONTROLLER_COMPONENT_TEXTS'
CHANGING ct_value = rs_controller-controller_component_texts
ct_param = lt_fm_param ).
add_fm_param_tables( EXPORTING iv_name = 'CONTROLLER_PARAMETERS'
CHANGING ct_value = rs_controller-controller_parameters
ct_param = lt_fm_param ).
add_fm_param_tables( EXPORTING iv_name = 'CONTROLLER_PARAMETER_TEXTS'
CHANGING ct_value = rs_controller-controller_parameter_texts
ct_param = lt_fm_param ).
add_fm_param_tables( EXPORTING iv_name = 'CONTEXT_NODES'
CHANGING ct_value = rs_controller-context_nodes
ct_param = lt_fm_param ).
add_fm_param_tables( EXPORTING iv_name = 'CONTEXT_ATTRIBUTES'
CHANGING ct_value = rs_controller-context_attributes
ct_param = lt_fm_param ).
add_fm_param_tables( EXPORTING iv_name = 'CONTEXT_MAPPINGS'
CHANGING ct_value = rs_controller-context_mappings
ct_param = lt_fm_param ).
add_fm_param_tables( EXPORTING iv_name = 'FIELDGROUPS'
CHANGING ct_value = rs_controller-fieldgroups
ct_param = lt_fm_param ).
* Version 702 doesn't have these two attributes so we
* use them dynamically for downward compatibility
ASSIGN COMPONENT 'CONTROLLER_EXCEPTIONS' OF STRUCTURE rs_controller TO <lt_ctrl_exceptions>.
IF sy-subrc = 0.
add_fm_param_tables( EXPORTING iv_name = 'CONTROLLER_EXCEPTIONS'
CHANGING ct_value = <lt_ctrl_exceptions>
ct_param = lt_fm_param ).
ENDIF.
ASSIGN COMPONENT 'CONTROLLER_EXCEPTION_TEXTS' OF STRUCTURE rs_controller TO <lt_ctrl_exception_texts>.
IF sy-subrc = 0.
add_fm_param_tables( EXPORTING iv_name = 'CONTROLLER_EXCEPTION_TEXTS'
CHANGING ct_value = <lt_ctrl_exception_texts>
ct_param = lt_fm_param ).
ENDIF.
add_fm_param_tables( EXPORTING iv_name = 'PSMODILOG'
CHANGING ct_value = lt_psmodilog
ct_param = lt_fm_param ).
add_fm_param_tables( EXPORTING iv_name = 'PSMODISRC'
CHANGING ct_value = lt_psmodisrc
ct_param = lt_fm_param ).
* FM exceptions
add_fm_exception( EXPORTING iv_name = 'NOT_EXISTING'
iv_value = 1
CHANGING ct_exception = lt_fm_exception ).
add_fm_exception( EXPORTING iv_name = 'OTHERS'
iv_value = 2
CHANGING ct_exception = lt_fm_exception ).
CALL FUNCTION 'WDYC_GET_OBJECT'
PARAMETER-TABLE
lt_fm_param
EXCEPTION-TABLE
lt_fm_exception.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from WDYC_GET_OBJECT' ).
ENDIF.
APPEND LINES OF lt_components TO mt_components.
APPEND LINES OF lt_sources TO mt_sources.
READ TABLE lt_definition INDEX 1 INTO rs_controller-definition.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'WDYC, definition not found' ).
ENDIF.
CLEAR: rs_controller-definition-author,
rs_controller-definition-createdon,
rs_controller-definition-changedby,
rs_controller-definition-changedon.
ENDMETHOD.
METHOD read_definition.
DATA: lt_definition TYPE TABLE OF wdy_component,
lt_psmodilog TYPE TABLE OF smodilog,
lt_psmodisrc TYPE TABLE OF smodisrc.
CALL FUNCTION 'WDYD_GET_OBJECT'
EXPORTING
component_key = is_key
get_all_translations = abap_false
TABLES
definition = lt_definition
descriptions = rs_definition-descriptions
component_usages = rs_definition-component_usages
interface_implementings = rs_definition-interface_implementings
library_usages = rs_definition-library_usages
ext_ctlr_usages = rs_definition-ext_ctlr_usages
ext_ctx_mappings = rs_definition-ext_ctx_mappings
psmodilog = lt_psmodilog " not optional in all versions
psmodisrc = lt_psmodisrc " not optional in all versions
EXCEPTIONS
not_existing = 1
OTHERS = 2.
IF sy-subrc = 1.
RETURN.
ELSEIF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from WDYD_GET_OBJECT' ).
ENDIF.
READ TABLE lt_definition INDEX 1 INTO rs_definition-definition.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'WDYD, definition not found' ).
ENDIF.
CLEAR: rs_definition-definition-author,
rs_definition-definition-createdon,
rs_definition-definition-changedby,
rs_definition-definition-changedon,
rs_definition-definition-gendate,
rs_definition-definition-gentime.
ENDMETHOD.
METHOD read_view.
DATA: lt_definition TYPE TABLE OF wdy_view_vrs,
lt_psmodilog TYPE TABLE OF smodilog,
lt_psmodisrc TYPE TABLE OF smodisrc.
FIELD-SYMBOLS: <ls_definition> LIKE LINE OF lt_definition.
CALL FUNCTION 'WDYV_GET_OBJECT'
EXPORTING
view_key = is_key
get_all_translations = abap_false
TABLES
definition = lt_definition
descriptions = rs_view-descriptions
view_containers = rs_view-view_containers
view_container_texts = rs_view-view_container_texts
iobound_plugs = rs_view-iobound_plugs
iobound_plug_texts = rs_view-iobound_plug_texts
plug_parameters = rs_view-plug_parameters
plug_parameter_texts = rs_view-plug_parameter_texts
ui_elements = rs_view-ui_elements
ui_context_bindings = rs_view-ui_context_bindings
ui_event_bindings = rs_view-ui_event_bindings
ui_ddic_bindings = rs_view-ui_ddic_bindings
ui_properties = rs_view-ui_properties
navigation_links = rs_view-navigation_links
navigation_target_refs = rs_view-navigation_target_refs
vsh_nodes = rs_view-vsh_nodes
vsh_placeholders = rs_view-vsh_placeholders
viewset_properties = rs_view-viewset_properties
psmodilog = lt_psmodilog
psmodisrc = lt_psmodisrc
EXCEPTIONS
not_existing = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from WDYV_GET_OBJECT' ).
ENDIF.
READ TABLE lt_definition INDEX 1 ASSIGNING <ls_definition>.
ASSERT sy-subrc = 0.
MOVE-CORRESPONDING <ls_definition> TO rs_view-definition.
CLEAR: rs_view-definition-author,
rs_view-definition-createdon,
rs_view-definition-changedby,
rs_view-definition-changedon.
ENDMETHOD.
METHOD recover_controller.
DATA: ls_key TYPE wdy_controller_key,
lv_corrnr TYPE trkorr,
ls_delta TYPE svrs2_xversionable_object.
ls_delta = delta_controller( is_controller ).
ls_key-component_name = is_controller-definition-component_name.
ls_key-controller_name = is_controller-definition-controller_name.
cl_wdy_md_controller=>recover_version(
EXPORTING
controller_key = ls_key
delta = ls_delta-wdyc
CHANGING
corrnr = lv_corrnr ).
ENDMETHOD.
METHOD recover_definition.
DATA: ls_key TYPE wdy_md_component_key,
lv_corrnr TYPE trkorr,
ls_delta TYPE svrs2_xversionable_object.
ls_delta = delta_definition(
is_definition = is_definition
iv_package = iv_package ).
ls_key-component_name = is_definition-definition-component_name.
cl_wdy_md_component=>recover_version(
EXPORTING
component_key = ls_key
delta = ls_delta-wdyd
CHANGING
corrnr = lv_corrnr ).
ENDMETHOD.
METHOD recover_view.
DATA: ls_key TYPE wdy_md_view_key,
lv_corrnr TYPE trkorr,
ls_delta TYPE svrs2_xversionable_object.
ls_delta = delta_view( is_view ).
ls_key-component_name = is_view-definition-component_name.
ls_key-view_name = is_view-definition-view_name.
cl_wdy_md_abstract_view=>recover_version(
EXPORTING
view_key = ls_key
delta = ls_delta-wdyv
CHANGING
corrnr = lv_corrnr ).
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown. " todo
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lo_component TYPE REF TO cl_wdy_wb_component,
lo_request TYPE REF TO cl_wb_request,
li_state TYPE REF TO if_wb_program_state,
lv_object_name TYPE seu_objkey.
CREATE OBJECT lo_component.
lv_object_name = ms_item-obj_name.
CREATE OBJECT lo_request
EXPORTING
p_object_type = 'YC'
p_object_name = lv_object_name
p_operation = swbm_c_op_delete_no_dialog.
lo_component->if_wb_program~process_wb_request(
p_wb_request = lo_request
p_wb_program_state = li_state ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_component TYPE wdy_component_metadata.
FIELD-SYMBOLS: <ls_view> LIKE LINE OF ls_component-view_metadata,
<ls_controller> LIKE LINE OF ls_component-ctlr_metadata.
io_xml->read( EXPORTING iv_name = 'COMPONENT'
CHANGING cg_data = ls_component ).
io_xml->read( EXPORTING iv_name = 'COMPONENTS'
CHANGING cg_data = mt_components ).
io_xml->read( EXPORTING iv_name = 'SOURCES'
CHANGING cg_data = mt_sources ).
ls_component-comp_metadata-definition-author = sy-uname.
ls_component-comp_metadata-definition-createdon = sy-datum.
recover_definition( is_definition = ls_component-comp_metadata
iv_package = iv_package ).
LOOP AT ls_component-ctlr_metadata ASSIGNING <ls_controller>.
<ls_controller>-definition-author = sy-uname.
<ls_controller>-definition-createdon = sy-datum.
recover_controller( <ls_controller> ).
ENDLOOP.
LOOP AT ls_component-view_metadata ASSIGNING <ls_view>.
<ls_view>-definition-author = sy-uname.
<ls_view>-definition-createdon = sy-datum.
recover_view( <ls_view> ).
ENDLOOP.
zcl_abapgit_objects_activation=>add_item( ms_item ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_component_name TYPE wdy_component-component_name.
SELECT SINGLE component_name FROM wdy_component
INTO lv_component_name
WHERE component_name = ms_item-obj_name
AND version = 'A'. "#EC CI_GENBUFF
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
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
in_new_window = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_component TYPE wdy_component_metadata.
ls_component = read( ).
io_xml->add( iv_name = 'COMPONENT'
ig_data = ls_component ).
io_xml->add( ig_data = mt_components
iv_name = 'COMPONENTS' ).
io_xml->add( ig_data = mt_sources
iv_name = 'SOURCES' ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
16993,
2047,
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,
42865,
25,
198,
220,
220,
220,
220,
220,
45079,
62,
5589,
3906,
41876,
43679,
3963,
266,
9892,
62,
310,
14050,
62,
5589,
78,
62,
85,
3808,
11,
198,
220,
220,
220,
220,
220,
45079,
62,
82,
2203,
220,
220,
220,
41876,
43679,
3963,
266,
9892,
62,
310,
14050,
62,
5589,
78,
62,
10459,
62,
85,
3808,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
651,
62,
2475,
84,
62,
48205,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
48205,
8,
41876,
266,
9892,
62,
9132,
62,
7645,
634,
62,
13083,
11,
198,
220,
220,
220,
220,
220,
1100,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
42895,
8,
41876,
266,
9892,
62,
42895,
62,
38993,
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,
1100,
62,
36500,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
318,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
266,
9892,
62,
9132,
62,
36500,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
36500,
8,
41876,
266,
9892,
62,
9132,
62,
36500,
62,
28961,
62,
7890,
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,
1100,
62,
46758,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
318,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
266,
9892,
62,
9132,
62,
42895,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
46758,
8,
41876,
266,
9892,
62,
9132,
62,
42895,
62,
28961,
62,
7890,
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,
1100,
62,
1177,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
318,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
266,
9892,
62,
9132,
62,
1177,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
1177,
8,
41876,
266,
9892,
62,
9132,
62,
1177,
62,
28961,
62,
7890,
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,
8551,
62,
36500,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
318,
62,
36500,
41876,
266,
9892,
62,
9132,
62,
36500,
62,
28961,
62,
7890,
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,
8551,
62,
46758,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
318,
62,
46758,
41876,
266,
9892,
62,
9132,
62,
42895,
62,
28961,
62,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
26495,
220,
220,
220,
41876,
1614,
4871,
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,
8551,
62,
1177,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
318,
62,
1177,
41876,
266,
9892,
62,
9132,
62,
1177,
62,
28961,
62,
7890,
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,
25979,
62,
36500,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
318,
62,
36500,
220,
220,
41876,
266,
9892,
62,
9132,
62,
36500,
62,
28961,
62,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
67,
12514,
8,
41876,
38487,
3808,
17,
62,
87,
9641,
540,
62,
15252,
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,
25979,
62,
46758,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
318,
62,
46758,
220,
220,
220,
220,
41876,
266,
9892,
62,
9132,
62,
42895,
62,
28961,
62,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
452,
62,
26495,
8,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
67,
12514,
8,
220,
220,
41876,
38487,
3808,
17,
62,
87,
9641,
540,
62,
15252,
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,
25979,
62,
1177,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
318,
62,
1177,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
266,
9892,
62,
9132,
62,
1177,
62,
28961,
62,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
67,
12514,
8,
41876,
38487
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_gui_router DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_gui_event_handler.
PROTECTED SECTION.
PRIVATE SECTION.
METHODS general_page_routing
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RETURNING
VALUE(rs_handled) TYPE zif_abapgit_gui_event_handler=>ty_handling_result
RAISING
zcx_abapgit_exception.
METHODS abapgit_services_actions
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RETURNING
VALUE(rs_handled) TYPE zif_abapgit_gui_event_handler=>ty_handling_result
RAISING
zcx_abapgit_exception.
METHODS db_actions
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RETURNING
VALUE(rs_handled) TYPE zif_abapgit_gui_event_handler=>ty_handling_result
RAISING
zcx_abapgit_exception.
CLASS-METHODS file_download
IMPORTING
!iv_package TYPE devclass
!iv_xstr TYPE xstring
RAISING
zcx_abapgit_exception .
METHODS git_services
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RETURNING
VALUE(rs_handled) TYPE zif_abapgit_gui_event_handler=>ty_handling_result
RAISING
zcx_abapgit_exception.
METHODS remote_origin_manipulations
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RETURNING
VALUE(rs_handled) TYPE zif_abapgit_gui_event_handler=>ty_handling_result
RAISING
zcx_abapgit_exception.
METHODS sap_gui_actions
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RETURNING
VALUE(rs_handled) TYPE zif_abapgit_gui_event_handler=>ty_handling_result
RAISING
zcx_abapgit_exception.
METHODS other_utilities
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RETURNING
VALUE(rs_handled) TYPE zif_abapgit_gui_event_handler=>ty_handling_result
RAISING
zcx_abapgit_exception.
METHODS zip_services
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RETURNING
VALUE(rs_handled) TYPE zif_abapgit_gui_event_handler=>ty_handling_result
RAISING
zcx_abapgit_exception.
METHODS repository_services
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RETURNING
VALUE(rs_handled) TYPE zif_abapgit_gui_event_handler=>ty_handling_result
RAISING
zcx_abapgit_exception.
METHODS get_page_diff
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RETURNING
VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable
RAISING
zcx_abapgit_exception .
METHODS get_page_branch_overview
IMPORTING
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
RETURNING
VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable
RAISING
zcx_abapgit_exception .
METHODS get_page_stage
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RETURNING
VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable
RAISING
zcx_abapgit_exception .
METHODS get_page_background
IMPORTING
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
RETURNING
VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable
RAISING
zcx_abapgit_exception .
CLASS-METHODS jump_display_transport
IMPORTING
!iv_transport TYPE trkorr
RAISING
zcx_abapgit_exception.
METHODS call_browser
IMPORTING
iv_url TYPE csequence
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_ROUTER IMPLEMENTATION.
METHOD abapgit_services_actions.
DATA: li_main_page TYPE REF TO zcl_abapgit_gui_page_main.
CASE ii_event->mv_action.
WHEN zif_abapgit_definitions=>c_action-abapgit_home.
CREATE OBJECT li_main_page.
rs_handled-page = li_main_page.
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-abapgit_install. " Install abapGit
zcl_abapgit_services_abapgit=>install_abapgit( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
ENDCASE.
ENDMETHOD.
METHOD call_browser.
cl_gui_frontend_services=>execute(
EXPORTING
document = |{ iv_url }|
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
synchronous_failed = 8
not_supported_by_gui = 9
OTHERS = 10 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD db_actions.
DATA ls_db_key TYPE zif_abapgit_persistence=>ty_content.
DATA lo_query TYPE REF TO zcl_abapgit_string_map.
lo_query = ii_event->query( ).
CASE ii_event->mv_action.
WHEN zif_abapgit_definitions=>c_action-db_edit.
lo_query->to_abap( CHANGING cs_container = ls_db_key ).
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_db_edit
EXPORTING
is_key = ls_db_key.
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
IF ii_event->mi_gui_services->get_current_page_name( ) = 'ZCL_ABAPGIT_GUI_PAGE_DB_DIS'. " TODO refactor
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page_replacing.
ENDIF.
WHEN zif_abapgit_definitions=>c_action-db_display.
lo_query->to_abap( CHANGING cs_container = ls_db_key ).
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_db_dis
EXPORTING
is_key = ls_db_key.
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
ENDCASE.
ENDMETHOD.
METHOD file_download.
DATA:
lv_path TYPE string,
lv_default TYPE string,
li_fe_serv TYPE REF TO zif_abapgit_frontend_services,
lv_package TYPE devclass.
lv_package = iv_package.
TRANSLATE lv_package USING '/#'.
CONCATENATE lv_package '_' sy-datlo '_' sy-timlo INTO lv_default.
li_fe_serv = zcl_abapgit_ui_factory=>get_frontend_services( ).
lv_path = li_fe_serv->show_file_save_dialog(
iv_title = 'Export ZIP'
iv_extension = 'zip'
iv_default_filename = lv_default ).
li_fe_serv->file_download(
iv_path = lv_path
iv_xstr = iv_xstr ).
ENDMETHOD.
METHOD general_page_routing.
DATA: lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
lv_last_repo_key TYPE zif_abapgit_persistence=>ty_repo-key,
lt_repo_list TYPE zif_abapgit_definitions=>ty_repo_ref_tt.
lv_key = ii_event->query( )->get( 'KEY' ).
CASE ii_event->mv_action.
WHEN zcl_abapgit_gui=>c_action-go_home.
lv_last_repo_key = zcl_abapgit_persistence_user=>get_instance( )->get_repo_show( ).
lt_repo_list = zcl_abapgit_repo_srv=>get_instance( )->list( ).
IF lv_last_repo_key IS NOT INITIAL.
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_view_repo
EXPORTING
iv_key = lv_last_repo_key.
ELSEIF lt_repo_list IS NOT INITIAL.
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_main.
ELSE.
rs_handled-page = zcl_abapgit_gui_page_tutorial=>create( ).
ENDIF.
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_db. " Go DB util page
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_db.
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_debuginfo.
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_debuginfo.
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_settings.
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_settings.
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_background_run. " Go background run page
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_bkg_run.
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_background. " Go Background page
rs_handled-page = get_page_background( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_diff. " Go Diff page
rs_handled-page = get_page_diff( ii_event ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page_w_bookmark.
WHEN zif_abapgit_definitions=>c_action-go_stage. " Go Staging page
rs_handled-page = get_page_stage( ii_event ).
IF ii_event->mi_gui_services->get_current_page_name( ) = 'ZCL_ABAPGIT_GUI_PAGE_DIFF'. " TODO refactor
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
ELSE.
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page_w_bookmark.
ENDIF.
WHEN zif_abapgit_definitions=>c_action-go_branch_overview. " Go repo branch overview
rs_handled-page = get_page_branch_overview( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_tutorial. " Go to tutorial
rs_handled-page = zcl_abapgit_gui_page_tutorial=>create( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-documentation. " abapGit docs
zcl_abapgit_services_abapgit=>open_abapgit_wikipage( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-go_explore. " dotabap
zcl_abapgit_services_abapgit=>open_dotabap_homepage( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-changelog. " abapGit full changelog
zcl_abapgit_services_abapgit=>open_abapgit_changelog( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
ENDCASE.
ENDMETHOD.
METHOD get_page_background.
CREATE OBJECT ri_page TYPE zcl_abapgit_gui_page_bkg
EXPORTING
iv_key = iv_key.
ENDMETHOD.
METHOD get_page_branch_overview.
DATA: lo_repo TYPE REF TO zcl_abapgit_repo_online,
lo_page TYPE REF TO zcl_abapgit_gui_page_boverview.
lo_repo ?= zcl_abapgit_repo_srv=>get_instance( )->get( iv_key ).
CREATE OBJECT lo_page
EXPORTING
io_repo = lo_repo.
ri_page = lo_page.
ENDMETHOD.
METHOD get_page_diff.
DATA: ls_file TYPE zif_abapgit_definitions=>ty_file,
ls_object TYPE zif_abapgit_definitions=>ty_item,
lo_page TYPE REF TO zcl_abapgit_gui_page_diff,
lv_key TYPE zif_abapgit_persistence=>ty_repo-key.
lv_key = ii_event->query( )->get( 'KEY' ).
ls_file-path = ii_event->query( )->get( 'PATH' ).
ls_file-filename = ii_event->query( )->get( 'FILENAME' ). " unescape ?
ls_object-obj_type = ii_event->query( )->get( 'OBJ_TYPE' ).
ls_object-obj_name = ii_event->query( )->get( 'OBJ_NAME' ). " unescape ?
CREATE OBJECT lo_page
EXPORTING
iv_key = lv_key
is_file = ls_file
is_object = ls_object.
ri_page = lo_page.
ENDMETHOD.
METHOD get_page_stage.
DATA: lo_repo TYPE REF TO zcl_abapgit_repo_online,
lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
lv_seed TYPE string,
lo_stage_page TYPE REF TO zcl_abapgit_gui_page_stage,
lo_code_inspector_page TYPE REF TO zcl_abapgit_gui_page_code_insp.
lv_key = ii_event->query( )->get( 'KEY' ).
lv_seed = ii_event->query( )->get( 'SEED' ).
lo_repo ?= zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
IF lo_repo->get_local_settings( )-code_inspector_check_variant IS NOT INITIAL.
CREATE OBJECT lo_code_inspector_page
EXPORTING
io_repo = lo_repo.
ri_page = lo_code_inspector_page.
ELSE.
" force refresh on stage, to make sure the latest local and remote files are used
lo_repo->refresh( ).
CREATE OBJECT lo_stage_page
EXPORTING
io_repo = lo_repo
iv_seed = lv_seed.
ri_page = lo_stage_page.
ENDIF.
ENDMETHOD.
METHOD git_services.
DATA lv_key TYPE zif_abapgit_persistence=>ty_repo-key.
lv_key = ii_event->query( )->get( 'KEY' ).
CASE ii_event->mv_action.
WHEN zif_abapgit_definitions=>c_action-git_pull. " GIT Pull
zcl_abapgit_services_git=>pull( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_reset. " GIT Reset
zcl_abapgit_services_git=>reset( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_branch_create. " GIT Create new branch
zcl_abapgit_services_git=>create_branch( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_branch_delete. " GIT Delete remote branch
zcl_abapgit_services_git=>delete_branch( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_branch_switch. " GIT Switch branch
zcl_abapgit_services_git=>switch_branch( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-go_tag_overview. " GIT Tag overview
zcl_abapgit_services_git=>tag_overview( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_tag_create. " GIT Tag create
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_tag
EXPORTING
io_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-git_tag_delete. " GIT Tag create
zcl_abapgit_services_git=>delete_tag( lv_key ).
zcl_abapgit_services_repo=>refresh( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_tag_switch. " GIT Switch Tag
zcl_abapgit_services_git=>switch_tag( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
ENDCASE.
ENDMETHOD.
METHOD jump_display_transport.
DATA:
lv_transport_adt_uri TYPE string,
lv_adt_link TYPE string,
lv_adt_jump_enabled TYPE abap_bool.
lv_adt_jump_enabled = zcl_abapgit_persist_settings=>get_instance( )->read( )->get_adt_jump_enabled( ).
IF lv_adt_jump_enabled = abap_true.
TRY.
CALL METHOD ('CL_CTS_ADT_TM_URI_BUILDER')=>('CREATE_ADT_URI')
EXPORTING
trnumber = iv_transport
RECEIVING
result = lv_transport_adt_uri.
lv_adt_link = |adt://{ sy-sysid }{ lv_transport_adt_uri }|.
cl_gui_frontend_services=>execute( EXPORTING document = lv_adt_link
EXCEPTIONS OTHERS = 1 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'ADT Jump Error' ).
ENDIF.
CATCH cx_root.
CALL FUNCTION 'TR_DISPLAY_REQUEST'
EXPORTING
i_trkorr = iv_transport.
ENDTRY.
ELSE.
CALL FUNCTION 'TR_DISPLAY_REQUEST'
EXPORTING
i_trkorr = iv_transport.
ENDIF.
ENDMETHOD.
METHOD other_utilities.
CASE ii_event->mv_action.
WHEN zif_abapgit_definitions=>c_action-changed_by.
zcl_abapgit_services_basis=>test_changed_by( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-performance_test.
zcl_abapgit_services_basis=>run_performance_test( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-ie_devtools.
zcl_abapgit_services_basis=>open_ie_devtools( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
ENDCASE.
ENDMETHOD.
METHOD remote_origin_manipulations.
DATA lv_key TYPE zif_abapgit_persistence=>ty_repo-key.
lv_key = ii_event->query( )->get( 'KEY' ).
CASE ii_event->mv_action.
WHEN zif_abapgit_definitions=>c_action-repo_remote_attach. " Remote attach
zcl_abapgit_services_repo=>remote_attach( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_remote_detach. " Remote detach
zcl_abapgit_services_repo=>remote_detach( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_remote_change. " Remote change
zcl_abapgit_services_repo=>remote_change( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
ENDCASE.
ENDMETHOD.
METHOD repository_services.
DATA:
lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
li_log TYPE REF TO zif_abapgit_log.
lv_key = ii_event->query( )->get( 'KEY' ).
CASE ii_event->mv_action.
WHEN zif_abapgit_definitions=>c_action-repo_newoffline. " New offline repo
rs_handled-page = zcl_abapgit_gui_page_addofflin=>create( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-repo_add_all_obj_to_trans_req.
zcl_abapgit_transport=>add_all_objects_to_trans_req( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_refresh. " Repo refresh
zcl_abapgit_services_repo=>refresh( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_syntax_check.
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_syntax
EXPORTING
io_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-repo_code_inspector.
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_code_insp
EXPORTING
io_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-repo_purge. " Repo remove & purge all objects
zcl_abapgit_services_repo=>purge( lv_key ).
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_main.
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page_replacing.
WHEN zif_abapgit_definitions=>c_action-repo_remove. " Repo remove
zcl_abapgit_services_repo=>remove( lv_key ).
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_main.
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page_replacing.
WHEN zif_abapgit_definitions=>c_action-repo_newonline.
rs_handled-page = zcl_abapgit_gui_page_addonline=>create( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-repo_refresh_checksums. " Rebuild local checksums
zcl_abapgit_services_repo=>refresh_local_checksums( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_toggle_fav. " Toggle repo as favorite
zcl_abapgit_services_repo=>toggle_favorite( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_transport_to_branch.
zcl_abapgit_services_repo=>transport_to_branch( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_settings.
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_repo_sett
EXPORTING
io_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-repo_log.
li_log = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key )->get_log( ).
zcl_abapgit_log_viewer=>show_log( ii_log = li_log
iv_header_text = li_log->get_title( ) ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
ENDCASE.
ENDMETHOD.
METHOD sap_gui_actions.
DATA: ls_item TYPE zif_abapgit_definitions=>ty_item.
CASE ii_event->mv_action.
WHEN zif_abapgit_definitions=>c_action-jump. " Open object editor
ls_item-obj_type = ii_event->query( )->get( 'TYPE' ).
ls_item-obj_name = ii_event->query( )->get( 'NAME' ).
zcl_abapgit_objects=>jump( ls_item ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-jump_transport.
jump_display_transport( |{ ii_event->query( )->get( 'TRANSPORT' ) }| ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-url.
call_browser( ii_event->query( )->get( 'URL' ) ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
ENDCASE.
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
rs_handled = general_page_routing( ii_event ).
IF rs_handled-state IS INITIAL.
rs_handled = repository_services( ii_event ).
ENDIF.
IF rs_handled-state IS INITIAL.
rs_handled = git_services( ii_event ).
ENDIF.
IF rs_handled-state IS INITIAL.
rs_handled = zip_services( ii_event ).
ENDIF.
IF rs_handled-state IS INITIAL.
rs_handled = db_actions( ii_event ).
ENDIF.
IF rs_handled-state IS INITIAL.
rs_handled = abapgit_services_actions( ii_event ).
ENDIF.
IF rs_handled-state IS INITIAL.
rs_handled = remote_origin_manipulations( ii_event ).
ENDIF.
IF rs_handled-state IS INITIAL.
rs_handled = sap_gui_actions( ii_event ).
ENDIF.
IF rs_handled-state IS INITIAL.
rs_handled = other_utilities( ii_event ).
ENDIF.
IF rs_handled-state IS INITIAL.
rs_handled-state = zcl_abapgit_gui=>c_event_state-not_handled.
ENDIF.
ENDMETHOD.
METHOD zip_services.
DATA: lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
lo_repo TYPE REF TO zcl_abapgit_repo,
lv_package TYPE devclass,
lv_path TYPE string,
lv_xstr TYPE xstring.
" TODO refactor
CONSTANTS:
BEGIN OF lc_page,
main_view TYPE string VALUE 'ZCL_ABAPGIT_GUI_PAGE_MAIN',
repo_view TYPE string VALUE 'ZCL_ABAPGIT_GUI_PAGE_VIEW_REPO',
END OF lc_page.
lv_key = ii_event->query( )->get( 'KEY' ).
CASE ii_event->mv_action.
WHEN zif_abapgit_definitions=>c_action-zip_import. " Import repo from ZIP
lo_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
lv_path = zcl_abapgit_ui_factory=>get_frontend_services( )->show_file_open_dialog(
iv_title = 'Import ZIP'
iv_extension = 'zip'
iv_default_filename = '*.zip' ).
lv_xstr = zcl_abapgit_ui_factory=>get_frontend_services( )->file_upload( lv_path ).
lo_repo->set_files_remote( zcl_abapgit_zip=>load( lv_xstr ) ).
zcl_abapgit_services_repo=>refresh( lv_key ).
" TODO refactor how current page name is determined
CASE ii_event->mi_gui_services->get_current_page_name( ).
WHEN lc_page-repo_view.
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN lc_page-main_view.
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_view_repo
EXPORTING
iv_key = lo_repo->get_key( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN OTHERS.
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
ENDCASE.
WHEN zif_abapgit_definitions=>c_action-zip_export. " Export repo as ZIP
lo_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
lv_xstr = zcl_abapgit_zip=>export( lo_repo ).
file_download( iv_package = lo_repo->get_package( )
iv_xstr = lv_xstr ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-zip_package. " Export package as ZIP
zcl_abapgit_zip=>export_package( IMPORTING
ev_xstr = lv_xstr
ev_package = lv_package ).
file_download( iv_package = lv_package
iv_xstr = lv_xstr ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-zip_transport. " Export transports as ZIP
zcl_abapgit_transport_mass=>run( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-zip_object. " Export object as ZIP
zcl_abapgit_zip=>export_object( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
ENDCASE.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
472,
353,
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,
397,
499,
18300,
62,
48317,
62,
15596,
62,
30281,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
2276,
62,
7700,
62,
81,
13660,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
15596,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
38788,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
62,
30281,
14804,
774,
62,
4993,
1359,
62,
20274,
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,
220,
220,
220,
337,
36252,
50,
450,
499,
18300,
62,
30416,
62,
4658,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
15596,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
38788,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
62,
30281,
14804,
774,
62,
4993,
1359,
62,
20274,
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,
220,
220,
220,
337,
36252,
50,
20613,
62,
4658,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
15596,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
38788,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
62,
30281,
14804,
774,
62,
4993,
1359,
62,
20274,
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,
220,
220,
220,
42715,
12,
49273,
50,
2393,
62,
15002,
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,
220,
220,
5145,
452,
62,
87,
2536,
220,
220,
220,
41876,
2124,
8841,
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,
17606,
62,
30416,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
15596,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
38788,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
62,
30281,
14804,
774,
62,
4993,
1359,
62,
20274,
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,
220,
220,
220,
337,
36252,
50,
6569,
62,
47103,
62,
805,
541,
5768,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
15596,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
38788,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
62,
30281,
14804,
774,
62,
4993,
1359,
62,
20274,
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,
220,
220,
220,
337,
36252,
50,
31841,
62,
48317,
62,
4658,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
15596,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
38788,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
62,
30281,
14804,
774,
62,
4993,
1359,
62,
20274,
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,
220,
220,
220,
337,
36252,
50,
584,
62,
315,
2410,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
15596,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
38788,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
62,
30281,
14804,
774,
62,
4993,
1359,
62,
20274,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
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,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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
] |
"! <p>
"! BAdI implementation of the OAuth 2.0 Google configuration extension.
"! </p>
"!
"! <p>
"! See https://developers.google.com/drive/
"! </p>
"!
"! <p>
"! Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved.
"! <br>
"! This file is licensed under the SAP SAMPLE CODE LICENSE AGREEMENT except as noted otherwise in
"! the LICENSE FILE
"! (https://github.com/SAP-samples/abap-alv-google-upload-sheet/blob/master/LICENSES/Apache-2.0.txt).
"! <br>
"! <br>
"! Note that the sample code includes calls to the Google Drive APIs which calls are licensed under
"! the Creative Commons Attribution 3.0 License (https://creativecommons.org/licenses/by/3.0/) in
"! accordance with Google's Developer Site Policies
"! (https://developers.google.com/terms/site-policies). Furthermore, the use of the Google Drive
"! service is subject to applicable agreements with Google Inc.
"! </p>
class zcl_oa2c_ce_zgoogle definition
public
create public
final.
public section.
interfaces if_badi_interface.
interfaces if_oa2c_config_extension.
endclass.
class zcl_oa2c_ce_zgoogle implementation.
method if_oa2c_config_extension~get_ac_auth_requ_params.
clear et_additional_params.
et_additional_params = value #( ( name = `access_type`
value = `offline` )
( name = `approval_prompt`
value = `force` ) ) ##NO_TEXT.
endmethod.
method if_oa2c_config_extension~get_saml20_at_requ_params ##NEEDED.
"Nothing to do in here.
endmethod.
endclass.
| [
40484,
1279,
79,
29,
198,
40484,
347,
2782,
40,
7822,
286,
262,
440,
30515,
362,
13,
15,
3012,
8398,
7552,
13,
198,
40484,
7359,
79,
29,
198,
40484,
198,
40484,
1279,
79,
29,
198,
40484,
4091,
3740,
1378,
16244,
364,
13,
13297,
13,
785,
14,
19472,
14,
198,
40484,
7359,
79,
29,
198,
40484,
198,
40484,
1279,
79,
29,
198,
40484,
15069,
357,
66,
8,
33448,
48323,
7946,
393,
281,
48323,
17375,
1664,
13,
1439,
2489,
10395,
13,
198,
40484,
1279,
1671,
29,
198,
40484,
770,
2393,
318,
11971,
739,
262,
48323,
28844,
16437,
42714,
38559,
24290,
13077,
2200,
12529,
2845,
355,
4367,
4306,
287,
198,
40484,
262,
38559,
24290,
45811,
198,
40484,
357,
5450,
1378,
12567,
13,
785,
14,
50,
2969,
12,
82,
12629,
14,
397,
499,
12,
282,
85,
12,
13297,
12,
25850,
12,
21760,
14,
2436,
672,
14,
9866,
14,
43,
2149,
16938,
1546,
14,
25189,
4891,
12,
17,
13,
15,
13,
14116,
737,
198,
40484,
1279,
1671,
29,
198,
40484,
1279,
1671,
29,
198,
40484,
5740,
326,
262,
6291,
2438,
3407,
3848,
284,
262,
3012,
9974,
23113,
543,
3848,
389,
11971,
739,
198,
40484,
262,
17404,
13815,
45336,
513,
13,
15,
13789,
357,
5450,
1378,
20123,
425,
9503,
684,
13,
2398,
14,
677,
4541,
14,
1525,
14,
18,
13,
15,
34729,
287,
198,
40484,
10213,
351,
3012,
338,
23836,
14413,
42283,
198,
40484,
357,
5450,
1378,
16244,
364,
13,
13297,
13,
785,
14,
38707,
14,
15654,
12,
79,
4160,
444,
737,
11399,
11,
262,
779,
286,
262,
3012,
9974,
198,
40484,
2139,
318,
2426,
284,
9723,
11704,
351,
3012,
3457,
13,
198,
40484,
7359,
79,
29,
198,
4871,
1976,
565,
62,
12162,
17,
66,
62,
344,
62,
89,
13297,
6770,
198,
220,
1171,
198,
220,
2251,
1171,
198,
220,
2457,
13,
628,
198,
220,
1171,
2665,
13,
628,
220,
220,
220,
20314,
611,
62,
65,
9189,
62,
39994,
13,
198,
220,
220,
220,
20314,
611,
62,
12162,
17,
66,
62,
11250,
62,
2302,
3004,
13,
628,
198,
437,
4871,
13,
628,
198,
4871,
1976,
565,
62,
12162,
17,
66,
62,
344,
62,
89,
13297,
7822,
13,
628,
198,
220,
2446,
611,
62,
12162,
17,
66,
62,
11250,
62,
2302,
3004,
93,
1136,
62,
330,
62,
18439,
62,
8897,
62,
37266,
13,
198,
220,
220,
220,
1598,
2123,
62,
2860,
1859,
62,
37266,
13,
198,
220,
220,
220,
2123,
62,
2860,
1859,
62,
37266,
796,
1988,
1303,
7,
357,
1438,
220,
796,
4600,
15526,
62,
4906,
63,
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,
1988,
796,
4600,
2364,
1370,
63,
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,
357,
1438,
220,
796,
4600,
21064,
2100,
62,
16963,
457,
63,
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,
1988,
796,
4600,
3174,
63,
1267,
1267,
22492,
15285,
62,
32541,
13,
198,
220,
886,
24396,
13,
628,
198,
220,
2446,
611,
62,
12162,
17,
66,
62,
11250,
62,
2302,
3004,
93,
1136,
62,
37687,
75,
1238,
62,
265,
62,
8897,
62,
37266,
22492,
12161,
1961,
1961,
13,
198,
220,
220,
220,
366,
18465,
284,
466,
287,
994,
13,
198,
220,
886,
24396,
13,
628,
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,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_exception_viewer DEFINITION
PUBLIC
CREATE PUBLIC.
PUBLIC SECTION.
METHODS:
constructor
IMPORTING
ix_error TYPE REF TO zcx_abapgit_exception,
goto_source
RAISING
zcx_abapgit_exception,
goto_message
RAISING
zcx_abapgit_exception,
show_callstack
RAISING
zcx_abapgit_exception.
PROTECTED SECTION.
PRIVATE SECTION.
DATA:
mx_error TYPE REF TO zcx_abapgit_exception,
mt_callstack TYPE abap_callstack.
METHODS:
build_top_of_list
IMPORTING
is_top_of_stack TYPE abap_callstack_line
RETURNING
VALUE(ro_form) TYPE REF TO cl_salv_form_element,
add_row
IMPORTING
io_grid TYPE REF TO cl_salv_form_layout_grid
iv_col_1 TYPE csequence
iv_col_2 TYPE csequence,
on_double_click FOR EVENT double_click OF cl_salv_events_table
IMPORTING
row column,
set_text
IMPORTING
io_columns TYPE REF TO cl_salv_columns_table
iv_column TYPE lvc_fname
iv_text TYPE string
RAISING
cx_static_check,
goto_source_code
IMPORTING
is_callstack TYPE abap_callstack_line
RAISING
zcx_abapgit_exception,
extract_classname
IMPORTING
iv_mainprogram TYPE abap_callstack_line-mainprogram
RETURNING
VALUE(rv_classname) TYPE tadir-obj_name,
get_top_of_callstack
RETURNING
VALUE(rs_top_of_callstack) TYPE abap_callstack_line
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_EXCEPTION_VIEWER IMPLEMENTATION.
METHOD add_row.
DATA: lo_row TYPE REF TO cl_salv_form_layout_flow.
lo_row = io_grid->add_row( ).
lo_row->create_label( position = 1
text = iv_col_1 ).
lo_row->create_label( position = 2
text = iv_col_2 ).
ENDMETHOD.
METHOD build_top_of_list.
DATA: lo_grid TYPE REF TO cl_salv_form_layout_grid.
CREATE OBJECT lo_grid
EXPORTING
columns = 2.
add_row( io_grid = lo_grid
iv_col_1 = 'Main program:'
iv_col_2 = is_top_of_stack-mainprogram ).
add_row( io_grid = lo_grid
iv_col_1 = 'Include name:'
iv_col_2 = is_top_of_stack-include ).
add_row( io_grid = lo_grid
iv_col_1 = 'Source line'
iv_col_2 = |{ is_top_of_stack-line }| ).
ro_form = lo_grid.
ENDMETHOD.
METHOD constructor.
mx_error = ix_error.
mt_callstack = mx_error->mt_callstack.
ENDMETHOD.
METHOD extract_classname.
rv_classname = substring_before( val = iv_mainprogram
regex = '=*CP$' ).
ENDMETHOD.
METHOD get_top_of_callstack.
READ TABLE mt_callstack INDEX 1
INTO rs_top_of_callstack.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Callstack is empty| ).
ENDIF.
ENDMETHOD.
METHOD goto_message.
DATA: lt_bdcdata TYPE STANDARD TABLE OF bdcdata,
ls_bdcdata LIKE LINE OF lt_bdcdata.
ls_bdcdata-program = 'SAPLWBMESSAGES'.
ls_bdcdata-dynpro = '0100'.
ls_bdcdata-dynbegin = abap_true.
INSERT ls_bdcdata INTO TABLE lt_bdcdata.
CLEAR: ls_bdcdata.
ls_bdcdata-fnam = 'RSDAG-ARBGB'.
ls_bdcdata-fval = mx_error->if_t100_message~t100key-msgid.
INSERT ls_bdcdata INTO TABLE lt_bdcdata.
CLEAR: ls_bdcdata.
ls_bdcdata-fnam = 'MSG_NUMMER'.
ls_bdcdata-fval = mx_error->if_t100_message~t100key-msgno.
INSERT ls_bdcdata INTO TABLE lt_bdcdata.
CLEAR: ls_bdcdata.
ls_bdcdata-fnam = 'RSDAG-MSGFLAG'.
ls_bdcdata-fval = 'X'.
INSERT ls_bdcdata INTO TABLE lt_bdcdata.
CLEAR: ls_bdcdata.
ls_bdcdata-fnam = 'BDC_OKCODE'.
ls_bdcdata-fval = '=WB_DISPLAY'.
INSERT ls_bdcdata INTO TABLE lt_bdcdata.
CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
STARTING NEW TASK 'GIT'
EXPORTING
tcode = 'SE91'
mode_val = 'E'
TABLES
using_tab = lt_bdcdata
EXCEPTIONS
call_transaction_denied = 1
tcode_invalid = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD goto_source.
goto_source_code( get_top_of_callstack( ) ).
ENDMETHOD.
METHOD goto_source_code.
CONSTANTS:
BEGIN OF lc_obj_type,
class TYPE trobjtype VALUE `CLAS`,
program TYPE trobjtype VALUE `PROG`,
END OF lc_obj_type.
DATA:
ls_item TYPE zif_abapgit_definitions=>ty_item,
lv_classname LIKE ls_item-obj_name.
" you should remember that we distinct two cases
" 1) we navigate to a global class
" 2) we navigate to a program
" the latter one is the default case
lv_classname = extract_classname( is_callstack-mainprogram ).
IF lv_classname IS NOT INITIAL.
ls_item-obj_name = lv_classname.
ls_item-obj_type = lc_obj_type-class.
ELSE.
ls_item-obj_name = is_callstack-mainprogram.
ls_item-obj_type = lc_obj_type-program.
ENDIF.
zcl_abapgit_objects=>jump(
is_item = ls_item
iv_line_number = is_callstack-line
iv_sub_obj_name = is_callstack-include
iv_sub_obj_type = lc_obj_type-program ).
ENDMETHOD.
METHOD on_double_click.
DATA: lx_error TYPE REF TO zcx_abapgit_exception.
FIELD-SYMBOLS: <ls_callstack> TYPE abap_callstack_line.
READ TABLE mt_callstack ASSIGNING <ls_callstack>
INDEX row.
IF sy-subrc <> 0.
RETURN.
ENDIF.
TRY.
goto_source_code( <ls_callstack> ).
CATCH zcx_abapgit_exception INTO lx_error.
MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'.
ENDTRY.
ENDMETHOD.
METHOD set_text.
DATA: lo_column TYPE REF TO cl_salv_column,
lv_short_text TYPE scrtext_s,
lv_medium_text TYPE scrtext_m,
lv_long_text TYPE scrtext_l.
lo_column = io_columns->get_column( iv_column ).
lv_short_text = iv_text.
lv_medium_text = iv_text.
lv_long_text = iv_text.
lo_column->set_short_text( lv_short_text ).
lo_column->set_medium_text( lv_medium_text ).
lo_column->set_long_text( lv_long_text ).
ENDMETHOD.
METHOD show_callstack.
DATA: lx_error TYPE REF TO cx_static_check,
lo_event TYPE REF TO cl_salv_events_table,
lo_columns TYPE REF TO cl_salv_columns_table,
lo_alv TYPE REF TO cl_salv_table.
TRY.
cl_salv_table=>factory(
IMPORTING
r_salv_table = lo_alv
CHANGING
t_table = mt_callstack ).
lo_alv->get_columns( )->set_optimize( ).
lo_alv->set_top_of_list( build_top_of_list( get_top_of_callstack( ) ) ).
lo_alv->set_screen_popup( start_column = 10
end_column = 180
start_line = 3
end_line = 30 ).
lo_event = lo_alv->get_event( ).
lo_columns = lo_alv->get_columns( ).
set_text( io_columns = lo_columns
iv_column = |LINE|
iv_text = |Line| ).
set_text( io_columns = lo_columns
iv_column = |LINE|
iv_text = |Line| ).
set_text( io_columns = lo_columns
iv_column = |BLOCKTYPE|
iv_text = |Event Type| ).
set_text( io_columns = lo_columns
iv_column = |BLOCKNAME|
iv_text = |Event| ).
set_text( io_columns = lo_columns
iv_column = |FLAG_SYSTEM|
iv_text = |System| ).
SET HANDLER on_double_click FOR lo_event.
lo_alv->display( ).
CATCH cx_static_check INTO lx_error.
MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'.
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
1069,
4516,
62,
1177,
263,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
13,
628,
198,
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,
220,
844,
62,
18224,
41876,
4526,
37,
5390,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
628,
220,
220,
220,
220,
220,
43197,
62,
10459,
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,
43197,
62,
20500,
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,
905,
62,
13345,
25558,
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,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
285,
87,
62,
18224,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
45079,
62,
13345,
25558,
41876,
450,
499,
62,
13345,
25558,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
1382,
62,
4852,
62,
1659,
62,
4868,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
4852,
62,
1659,
62,
25558,
41876,
450,
499,
62,
13345,
25558,
62,
1370,
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,
687,
8,
220,
41876,
4526,
37,
5390,
537,
62,
21680,
85,
62,
687,
62,
30854,
11,
628,
220,
220,
220,
220,
220,
751,
62,
808,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
25928,
220,
41876,
4526,
37,
5390,
537,
62,
21680,
85,
62,
687,
62,
39786,
62,
25928,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
4033,
62,
16,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
4033,
62,
17,
41876,
269,
43167,
11,
628,
220,
220,
220,
220,
220,
319,
62,
23352,
62,
12976,
7473,
49261,
4274,
62,
12976,
3963,
537,
62,
21680,
85,
62,
31534,
62,
11487,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5752,
5721,
11,
628,
220,
220,
220,
220,
220,
900,
62,
5239,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
28665,
82,
41876,
4526,
37,
5390,
537,
62,
21680,
85,
62,
28665,
82,
62,
11487,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
28665,
220,
41876,
300,
28435,
62,
69,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
5239,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
12708,
62,
9122,
11,
628,
220,
220,
220,
220,
220,
43197,
62,
10459,
62,
8189,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
13345,
25558,
41876,
450,
499,
62,
13345,
25558,
62,
1370,
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,
7925,
62,
4871,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
12417,
23065,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
13345,
25558,
62,
1370,
12,
12417,
23065,
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,
4871,
3672,
8,
41876,
36264,
343,
12,
26801,
62,
3672,
11,
628,
220,
220,
220,
220,
220,
651,
62,
4852,
62,
1659,
62,
13345,
25558,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
4852,
62,
1659,
62,
13345,
25558,
8,
41876,
450,
499,
62,
13345,
25558,
62,
1370,
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,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
6369,
42006,
2849,
62,
28206,
1137,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
751,
62,
808,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
808,
41876,
4526,
37,
5390,
537,
62,
21680,
85,
62,
687,
62,
39786,
62,
11125,
13,
628,
220,
220,
220,
2376,
62,
808,
796,
33245,
62,
25928,
3784,
2860,
62,
808,
7,
6739,
628,
220,
220,
220,
2376,
62,
808,
3784,
17953,
62,
18242,
7,
2292,
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,
2420,
220,
220,
220,
220,
796,
21628,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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
] |
CLASS lhc_travel DEFINITION INHERITING FROM cl_abap_behavior_handler.
PRIVATE SECTION.
METHODS calculate_total_supplm_price FOR DETERMINATION booksuppl~calculateTotalSupplmPrice IMPORTING keys FOR booksuppl.
METHODS get_features FOR FEATURES IMPORTING keys REQUEST requested_features FOR booksuppl RESULT result.
ENDCLASS.
CLASS lhc_travel IMPLEMENTATION.
********************************************************************************
*
* Calculates total supplement price
*
********************************************************************************
METHOD calculate_total_supplm_price.
IF keys IS NOT INITIAL.
/dmo/cl_travel_auxiliary_m=>calculate_price(
it_travel_id = VALUE #( FOR GROUPS <booking_suppl> OF booksuppl_key IN keys
GROUP BY booksuppl_key-travel_id WITHOUT MEMBERS
( <booking_suppl> ) ) ).
ENDIF.
ENDMETHOD.
********************************************************************************
*
* Implements the dynamic feature handling for booking suppl. instances
*
********************************************************************************
METHOD get_features.
READ ENTITY /dmo/i_booksuppl_m FROM VALUE #( FOR keyval IN keys
( %key = keyval-%key
%control-booking_supplement_id = if_abap_behv=>mk-on
) )
RESULT DATA(lt_booksupppl_result).
result = VALUE #( FOR ls_travel IN lt_booksupppl_result
( %key = ls_travel-%key
%field-booking_supplement_id = if_abap_behv=>fc-f-read_only
"%features-%delete = if_abap_behv=>fc-o-disabled " Workaround for missing determinations on delete
) ).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
71,
66,
62,
35927,
5550,
20032,
17941,
3268,
16879,
2043,
2751,
16034,
537,
62,
397,
499,
62,
46571,
62,
30281,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
15284,
62,
23350,
62,
18608,
75,
76,
62,
20888,
7473,
38267,
1137,
23678,
6234,
1492,
18608,
75,
93,
9948,
3129,
378,
14957,
15979,
75,
76,
18124,
30023,
9863,
2751,
8251,
7473,
1492,
18608,
75,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
40890,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
18630,
47471,
30023,
9863,
2751,
8251,
4526,
35780,
9167,
62,
40890,
7473,
1492,
18608,
75,
15731,
16724,
1255,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
300,
71,
66,
62,
35927,
30023,
2538,
10979,
6234,
13,
198,
198,
17174,
17174,
8412,
198,
9,
198,
9,
27131,
689,
2472,
10327,
2756,
198,
9,
198,
17174,
17174,
8412,
198,
220,
337,
36252,
15284,
62,
23350,
62,
18608,
75,
76,
62,
20888,
13,
628,
220,
220,
220,
16876,
8251,
3180,
5626,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
1220,
67,
5908,
14,
565,
62,
35927,
62,
14644,
28129,
62,
76,
14804,
9948,
3129,
378,
62,
20888,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
35927,
62,
312,
796,
26173,
8924,
1303,
7,
220,
7473,
10863,
2606,
3705,
1279,
2070,
278,
62,
18608,
75,
29,
3963,
1492,
18608,
75,
62,
2539,
3268,
8251,
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,
44441,
11050,
1492,
18608,
75,
62,
2539,
12,
35927,
62,
312,
42881,
35153,
33,
4877,
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,
357,
1279,
2070,
278,
62,
18608,
75,
29,
1267,
1267,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
198,
198,
17174,
17174,
8412,
198,
9,
198,
9,
1846,
1154,
902,
262,
8925,
3895,
9041,
329,
25452,
6019,
13,
10245,
198,
9,
198,
17174,
17174,
8412,
198,
220,
337,
36252,
651,
62,
40890,
13,
628,
220,
220,
220,
220,
220,
20832,
47353,
9050,
1220,
67,
5908,
14,
72,
62,
2070,
18608,
75,
62,
76,
16034,
26173,
8924,
1303,
7,
7473,
1994,
2100,
3268,
8251,
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,
357,
220,
4064,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
1994,
2100,
12,
4,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4064,
13716,
12,
2070,
278,
62,
18608,
1732,
62,
312,
796,
611,
62,
397,
499,
62,
20709,
85,
14804,
28015,
12,
261,
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,
1267,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15731,
16724,
220,
42865,
7,
2528,
62,
2070,
18608,
489,
62,
20274,
737,
628,
198,
220,
220,
220,
1255,
796,
26173,
8924,
1303,
7,
7473,
43979,
62,
35927,
3268,
300,
83,
62,
2070,
18608,
489,
62,
20274,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
4064,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
43979,
62,
35927,
12,
4,
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,
4064,
3245,
12,
2070,
278,
62,
18608,
1732,
62,
312,
796,
611,
62,
397,
499,
62,
20709,
85,
14804,
16072,
12,
69,
12,
961,
62,
8807,
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,
36521,
40890,
12,
4,
33678,
796,
611,
62,
397,
499,
62,
20709,
85,
14804,
16072,
12,
78,
12,
47730,
220,
366,
5521,
14145,
329,
4814,
3416,
602,
319,
12233,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
6739,
628,
220,
23578,
49273,
13,
628,
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,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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
] |
CLASS zcl_abapgit_object_clas DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_objects_program
CREATE PUBLIC .
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.
DATA: mi_object_oriented_object_fct TYPE REF TO zif_abapgit_oo_object_fnc,
mv_skip_testclass TYPE abap_bool,
mv_classpool_name TYPE progname.
METHODS:
deserialize_abap
IMPORTING ii_xml TYPE REF TO zif_abapgit_xml_input
iv_package TYPE devclass
RAISING zcx_abapgit_exception,
deserialize_docu
IMPORTING ii_xml TYPE REF TO zif_abapgit_xml_input
RAISING zcx_abapgit_exception,
deserialize_tpool
IMPORTING ii_xml TYPE REF TO zif_abapgit_xml_input
RAISING zcx_abapgit_exception,
deserialize_sotr
IMPORTING ii_ml TYPE REF TO zif_abapgit_xml_input
iv_package TYPE devclass
RAISING zcx_abapgit_exception,
serialize_xml
IMPORTING ii_xml TYPE REF TO zif_abapgit_xml_output
RAISING zcx_abapgit_exception,
serialize_attr
IMPORTING
!ii_xml TYPE REF TO zif_abapgit_xml_output
!iv_clsname TYPE seoclsname
RAISING
zcx_abapgit_exception,
serialize_descr
IMPORTING
!ii_xml TYPE REF TO zif_abapgit_xml_output
!iv_clsname TYPE seoclsname
RAISING
zcx_abapgit_exception,
serialize_docu
IMPORTING
!ii_xml TYPE REF TO zif_abapgit_xml_output
!it_langu_additional TYPE zif_abapgit_lang_definitions=>ty_langus OPTIONAL
!iv_clsname TYPE seoclsname
RAISING
zcx_abapgit_exception,
serialize_tpool
IMPORTING
!ii_xml TYPE REF TO zif_abapgit_xml_output
!it_langu_additional TYPE zif_abapgit_lang_definitions=>ty_langus OPTIONAL
!iv_clsname TYPE seoclsname
RAISING
zcx_abapgit_exception,
serialize_sotr
IMPORTING
!ii_xml TYPE REF TO zif_abapgit_xml_output
RAISING
zcx_abapgit_exception,
source_apack_replacement
CHANGING
!ct_source TYPE seop_source_string
RAISING
zcx_abapgit_exception,
repo_apack_replacement
CHANGING
!ct_source TYPE seop_source_string
RAISING
zcx_abapgit_exception.
PRIVATE SECTION.
METHODS:
is_class_locked
RETURNING VALUE(rv_is_class_locked) TYPE abap_bool
RAISING zcx_abapgit_exception.
METHODS interface_replacement
IMPORTING
!iv_from_interface TYPE seoclsname
!iv_to_interface TYPE seoclsname
CHANGING
!ct_source TYPE seop_source_string .
ENDCLASS.
CLASS zcl_abapgit_object_clas IMPLEMENTATION.
METHOD constructor.
super->constructor( is_item = is_item
iv_language = iv_language ).
mi_object_oriented_object_fct = NEW zcl_abapgit_oo_class( ).
mv_classpool_name = cl_oo_classname_service=>get_classpool_name( |{ is_item-obj_name }| ).
ENDMETHOD.
METHOD deserialize_abap.
DATA: ls_vseoclass TYPE vseoclass,
lt_source TYPE seop_source_string,
lt_local_definitions TYPE seop_source_string,
lt_local_implementations TYPE seop_source_string,
lt_local_macros TYPE seop_source_string,
lt_test_classes TYPE seop_source_string,
lt_descriptions TYPE zif_abapgit_oo_object_fnc=>ty_seocompotx_tt,
ls_class_key TYPE seoclskey,
lt_attributes TYPE zif_abapgit_definitions=>ty_obj_attribute_tt.
lt_source = mo_files->read_abap( ).
lt_local_definitions = mo_files->read_abap( iv_extra = zif_abapgit_oo_object_fnc=>c_parts-locals_def
iv_error = abap_false ).
lt_local_implementations = mo_files->read_abap( iv_extra = zif_abapgit_oo_object_fnc=>c_parts-locals_imp
iv_error = abap_false ).
lt_local_macros = mo_files->read_abap( iv_extra = zif_abapgit_oo_object_fnc=>c_parts-macros
iv_error = abap_false ).
lt_test_classes = mo_files->read_abap( iv_extra = zif_abapgit_oo_object_fnc=>c_parts-testclasses
iv_error = abap_false ).
ls_class_key-clsname = ms_item-obj_name.
ii_xml->read( EXPORTING iv_name = 'VSEOCLASS'
CHANGING cg_data = ls_vseoclass ).
ii_xml->read( EXPORTING iv_name = 'ATTRIBUTES'
CHANGING cg_data = lt_attributes ).
" Remove code for test classes if they have been deleted
IF ls_vseoclass-with_unit_tests = abap_false.
CLEAR lt_test_classes.
ENDIF.
mi_object_oriented_object_fct->create(
EXPORTING
iv_package = iv_package
it_attributes = lt_attributes
CHANGING
cg_properties = ls_vseoclass ).
mi_object_oriented_object_fct->generate_locals(
is_key = ls_class_key
it_local_definitions = lt_local_definitions
it_local_implementations = lt_local_implementations
it_local_macros = lt_local_macros
it_local_test_classes = lt_test_classes ).
repo_apack_replacement( CHANGING ct_source = lt_source ).
mi_object_oriented_object_fct->deserialize_source(
is_key = ls_class_key
it_source = lt_source ).
ii_xml->read( EXPORTING iv_name = 'DESCRIPTIONS'
CHANGING cg_data = lt_descriptions ).
mi_object_oriented_object_fct->update_descriptions(
is_key = ls_class_key
it_descriptions = lt_descriptions ).
mi_object_oriented_object_fct->add_to_activation_list( ms_item ).
ENDMETHOD.
METHOD deserialize_docu.
DATA: lt_lines TYPE tlinetab,
lv_object TYPE dokhl-object,
lt_i18n_lines TYPE zif_abapgit_lang_definitions=>ty_i18n_lines,
ls_i18n_lines TYPE zif_abapgit_lang_definitions=>ty_i18n_line.
ii_xml->read( EXPORTING iv_name = 'LINES'
CHANGING cg_data = lt_lines ).
lv_object = ms_item-obj_name.
IF lines( lt_lines ) = 0.
mi_object_oriented_object_fct->delete_documentation(
iv_object_name = lv_object
iv_language = mv_language ).
RETURN.
ENDIF.
mi_object_oriented_object_fct->create_documentation(
it_lines = lt_lines
iv_object_name = lv_object
iv_language = mv_language ).
ii_xml->read( EXPORTING iv_name = 'I18N_LINES'
CHANGING cg_data = lt_i18n_lines ).
LOOP AT lt_i18n_lines INTO ls_i18n_lines.
mi_object_oriented_object_fct->create_documentation(
it_lines = ls_i18n_lines-lines
iv_object_name = lv_object
iv_language = ls_i18n_lines-language
iv_no_masterlang = abap_true ).
ENDLOOP.
ENDMETHOD.
METHOD deserialize_sotr.
"OTR stands for Online Text Repository
mi_object_oriented_object_fct->create_sotr(
iv_object_name = ms_item-obj_name
iv_package = iv_package
ii_xml = ii_ml ).
ENDMETHOD.
METHOD deserialize_tpool.
DATA: lv_clsname TYPE seoclsname,
lt_tpool_ext TYPE zif_abapgit_definitions=>ty_tpool_tt,
lt_tpool TYPE textpool_table,
lt_i18n_tpool TYPE zif_abapgit_lang_definitions=>ty_i18n_tpools,
ls_i18n_tpool TYPE zif_abapgit_lang_definitions=>ty_i18n_tpool.
ii_xml->read( EXPORTING iv_name = 'TPOOL'
CHANGING cg_data = lt_tpool_ext ).
lt_tpool = read_tpool( lt_tpool_ext ).
IF lines( lt_tpool ) = 0.
RETURN.
ENDIF.
lv_clsname = ms_item-obj_name.
mi_object_oriented_object_fct->insert_text_pool(
iv_class_name = lv_clsname
it_text_pool = lt_tpool
iv_language = mv_language ).
ii_xml->read( EXPORTING iv_name = 'I18N_TPOOL'
CHANGING cg_data = lt_i18n_tpool ).
LOOP AT lt_i18n_tpool INTO ls_i18n_tpool.
lt_tpool = read_tpool( ls_i18n_tpool-textpool ).
mi_object_oriented_object_fct->insert_text_pool(
iv_class_name = lv_clsname
it_text_pool = lt_tpool
iv_language = ls_i18n_tpool-language
iv_state = 'A' ).
ENDLOOP.
ENDMETHOD.
METHOD interface_replacement.
DATA lv_tabix TYPE sy-tabix.
FIELD-SYMBOLS <lv_source> LIKE LINE OF ct_source.
FIND REGEX '^\s*INTERFACES(:| )\s*' && iv_from_interface && '\s*.' IN TABLE ct_source MATCH LINE lv_tabix.
IF sy-subrc = 0.
READ TABLE ct_source ASSIGNING <lv_source> INDEX lv_tabix.
ASSERT sy-subrc = 0.
REPLACE FIRST OCCURRENCE OF iv_from_interface IN <lv_source>
WITH iv_to_interface IGNORING CASE.
REPLACE ALL OCCURRENCES OF iv_from_interface && '~descriptor' IN TABLE ct_source
WITH iv_to_interface && '~descriptor' IGNORING CASE.
REPLACE ALL OCCURRENCES OF iv_from_interface && '=>' IN TABLE ct_source
WITH iv_to_interface && '=>' IGNORING CASE.
REPLACE ALL OCCURRENCES OF iv_from_interface && '->' IN TABLE ct_source
WITH iv_to_interface && '->' IGNORING CASE.
ENDIF.
ENDMETHOD.
METHOD is_class_locked.
DATA: lv_argument TYPE seqg3-garg.
lv_argument = ms_item-obj_name.
OVERLAY lv_argument WITH '=============================='.
lv_argument = lv_argument && '*'.
rv_is_class_locked = exists_a_lock_entry_for( iv_lock_object = 'ESEOCLASS'
iv_argument = lv_argument ).
ENDMETHOD.
METHOD repo_apack_replacement.
DATA lv_apack TYPE seoclsname.
" Check if SAP-version of APACK manifest exists
SELECT SINGLE clsname INTO lv_apack
FROM seoclass
WHERE clsname = zif_abapgit_apack_definitions=>c_apack_interface_sap.
IF sy-subrc = 0.
RETURN.
ENDIF.
" If not, replace with abapGit version
interface_replacement(
EXPORTING
iv_from_interface = to_lower( zif_abapgit_apack_definitions=>c_apack_interface_sap )
iv_to_interface = to_lower( zif_abapgit_apack_definitions=>c_apack_interface_cust )
CHANGING
ct_source = ct_source ).
ENDMETHOD.
METHOD serialize_attr.
DATA: lt_attributes TYPE zif_abapgit_definitions=>ty_obj_attribute_tt.
lt_attributes = mi_object_oriented_object_fct->read_attributes( iv_clsname ).
IF lines( lt_attributes ) = 0.
RETURN.
ENDIF.
ii_xml->add( iv_name = 'ATTRIBUTES'
ig_data = lt_attributes ).
ENDMETHOD.
METHOD serialize_descr.
DATA: lt_descriptions TYPE zif_abapgit_oo_object_fnc=>ty_seocompotx_tt,
lv_language TYPE spras.
IF ii_xml->i18n_params( )-main_language_only = abap_true.
lv_language = mv_language.
ENDIF.
lt_descriptions = mi_object_oriented_object_fct->read_descriptions(
iv_obejct_name = iv_clsname
iv_language = lv_language ).
IF lines( lt_descriptions ) = 0.
RETURN.
ENDIF.
ii_xml->add( iv_name = 'DESCRIPTIONS'
ig_data = lt_descriptions ).
ENDMETHOD.
METHOD serialize_docu.
DATA: lt_lines TYPE tlinetab,
lv_langu TYPE sy-langu,
lt_i18n_lines TYPE zif_abapgit_lang_definitions=>ty_i18n_lines,
ls_i18n_lines TYPE zif_abapgit_lang_definitions=>ty_i18n_line.
lt_lines = mi_object_oriented_object_fct->read_documentation(
iv_class_name = iv_clsname
iv_language = mv_language ).
IF lines( lt_lines ) > 0.
ii_xml->add( iv_name = 'LINES'
ig_data = lt_lines ).
ENDIF.
IF ii_xml->i18n_params( )-main_language_only = abap_true.
RETURN.
ENDIF.
LOOP AT it_langu_additional INTO lv_langu.
lt_lines = mi_object_oriented_object_fct->read_documentation(
iv_class_name = iv_clsname
iv_language = lv_langu ).
IF lines( lt_lines ) > 0.
CLEAR ls_i18n_lines.
ls_i18n_lines-language = lv_langu.
ls_i18n_lines-lines = lt_lines.
INSERT ls_i18n_lines INTO TABLE lt_i18n_lines.
ENDIF.
ENDLOOP.
IF lines( lt_i18n_lines ) > 0.
ii_xml->add( iv_name = 'I18N_LINES'
ig_data = lt_i18n_lines ).
ENDIF.
ENDMETHOD.
METHOD serialize_sotr.
mi_object_oriented_object_fct->read_sotr(
iv_object_name = ms_item-obj_name
ii_xml = ii_xml ).
ENDMETHOD.
METHOD serialize_tpool.
DATA: lt_tpool TYPE textpool_table,
lv_index TYPE i,
lv_langu TYPE sy-langu,
lt_i18n_tpool TYPE zif_abapgit_lang_definitions=>ty_i18n_tpools,
ls_i18n_tpool TYPE zif_abapgit_lang_definitions=>ty_i18n_tpool.
FIELD-SYMBOLS <ls_tpool> LIKE LINE OF lt_tpool.
DATA lt_tpool_main LIKE SORTED TABLE OF <ls_tpool> WITH UNIQUE KEY id key.
lt_tpool = mi_object_oriented_object_fct->read_text_pool(
iv_class_name = iv_clsname
iv_language = mv_language ).
ii_xml->add( iv_name = 'TPOOL'
ig_data = add_tpool( lt_tpool ) ).
IF ii_xml->i18n_params( )-main_language_only = abap_true OR lines( lt_tpool ) = 0.
RETURN.
ENDIF.
lt_tpool_main = lt_tpool.
LOOP AT it_langu_additional INTO lv_langu.
lt_tpool = mi_object_oriented_object_fct->read_text_pool(
iv_class_name = iv_clsname
iv_language = lv_langu ).
LOOP AT lt_tpool ASSIGNING <ls_tpool>.
lv_index = sy-tabix.
READ TABLE lt_tpool_main WITH KEY id = <ls_tpool>-id key = <ls_tpool>-key
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
DELETE lt_tpool INDEX lv_index.
ENDIF.
ENDLOOP.
IF lines( lt_tpool ) > 0.
CLEAR ls_i18n_tpool.
ls_i18n_tpool-language = lv_langu.
ls_i18n_tpool-textpool = add_tpool( lt_tpool ).
INSERT ls_i18n_tpool INTO TABLE lt_i18n_tpool.
ENDIF.
ENDLOOP.
IF lines( lt_i18n_tpool ) > 0.
ii_xml->add( iv_name = 'I18N_TPOOL'
ig_data = lt_i18n_tpool ).
ENDIF.
ENDMETHOD.
METHOD serialize_xml.
DATA: ls_vseoclass TYPE vseoclass,
ls_clskey TYPE seoclskey,
lt_langu_additional TYPE zif_abapgit_lang_definitions=>ty_langus.
ls_clskey-clsname = ms_item-obj_name.
"If class was deserialized with a previous versions of abapGit and current language was different
"from main language at this time, this call would return SY-LANGU as main language. To fix
"these objects, set SY-LANGU to main language temporarily.
zcl_abapgit_language=>set_current_language( mv_language ).
TRY.
ls_vseoclass = mi_object_oriented_object_fct->get_class_properties( ls_clskey ).
CLEANUP.
zcl_abapgit_language=>restore_login_language( ).
ENDTRY.
zcl_abapgit_language=>restore_login_language( ).
CLEAR: ls_vseoclass-uuid,
ls_vseoclass-author,
ls_vseoclass-createdon,
ls_vseoclass-changedby,
ls_vseoclass-changedon,
ls_vseoclass-r3release,
ls_vseoclass-chgdanyby,
ls_vseoclass-chgdanyon,
ls_vseoclass-clsfinal,
ls_vseoclass-clsabstrct,
ls_vseoclass-exposure,
ls_vseoclass-version.
IF mv_skip_testclass = abap_true.
CLEAR ls_vseoclass-with_unit_tests.
ENDIF.
" Table d010tinf stores info. on languages in which program is maintained
" Select all active translations of program texts
" Skip main language - it was already serialized
SELECT DISTINCT language
INTO TABLE lt_langu_additional
FROM d010tinf
WHERE r3state = 'A'
AND prog = mv_classpool_name
AND language <> mv_language.
ii_xml->add( iv_name = 'VSEOCLASS'
ig_data = ls_vseoclass ).
serialize_tpool( ii_xml = ii_xml
iv_clsname = ls_clskey-clsname
it_langu_additional = lt_langu_additional ).
IF ls_vseoclass-category = seoc_category_exception.
serialize_sotr( ii_xml ).
ENDIF.
serialize_docu( ii_xml = ii_xml
iv_clsname = ls_clskey-clsname
it_langu_additional = lt_langu_additional ).
serialize_descr( ii_xml = ii_xml
iv_clsname = ls_clskey-clsname ).
serialize_attr( ii_xml = ii_xml
iv_clsname = ls_clskey-clsname ).
ENDMETHOD.
METHOD source_apack_replacement.
DATA lv_clsname TYPE seoclsname.
" Check if abapGit version of APACK manifest is used
SELECT SINGLE clsname INTO lv_clsname
FROM seometarel
WHERE clsname = ms_item-obj_name
AND refclsname = zif_abapgit_apack_definitions=>c_apack_interface_cust
AND version = '1'.
IF sy-subrc <> 0.
RETURN.
ENDIF.
" If yes, replace with SAP-version
interface_replacement(
EXPORTING
iv_from_interface = to_lower( zif_abapgit_apack_definitions=>c_apack_interface_cust )
iv_to_interface = to_lower( zif_abapgit_apack_definitions=>c_apack_interface_sap )
CHANGING
ct_source = ct_source ).
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
TYPES: BEGIN OF ty_includes,
programm TYPE programm,
END OF ty_includes.
TYPES: BEGIN OF ty_reposrc,
unam TYPE reposrc-unam,
udat TYPE reposrc-udat,
utime TYPE reposrc-utime,
END OF ty_reposrc.
DATA: lt_reposrc TYPE STANDARD TABLE OF ty_reposrc,
ls_reposrc LIKE LINE OF lt_reposrc,
lt_includes TYPE STANDARD TABLE OF ty_includes.
lt_includes = mi_object_oriented_object_fct->get_includes( ms_item-obj_name ).
ASSERT lines( lt_includes ) > 0.
SELECT unam udat utime FROM reposrc
INTO TABLE lt_reposrc
FOR ALL ENTRIES IN lt_includes
WHERE progname = lt_includes-programm
AND r3state = 'A'.
IF sy-subrc <> 0.
rv_user = c_user_unknown.
ELSE.
SORT lt_reposrc BY udat DESCENDING utime DESCENDING.
READ TABLE lt_reposrc INDEX 1 INTO ls_reposrc.
ASSERT sy-subrc = 0.
rv_user = ls_reposrc-unam.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: ls_clskey TYPE seoclskey.
ls_clskey-clsname = ms_item-obj_name.
mi_object_oriented_object_fct->delete( ls_clskey ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
deserialize_abap( ii_xml = io_xml
iv_package = iv_package ).
deserialize_tpool( io_xml ).
deserialize_sotr( ii_ml = io_xml
iv_package = iv_package ).
deserialize_docu( io_xml ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: ls_class_key TYPE seoclskey.
ls_class_key-clsname = ms_item-obj_name.
rv_bool = mi_object_oriented_object_fct->exists( ls_class_key ).
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.
IF is_class_locked( ) = abap_true OR is_text_locked( mv_classpool_name ) = abap_true.
rv_is_locked = abap_true.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
" Covered by ZCL_ABAPGIT_OBJECTS=>JUMP
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lt_source TYPE seop_source_string,
ls_class_key TYPE seoclskey.
ls_class_key-clsname = ms_item-obj_name.
IF zif_abapgit_object~exists( ) = abap_false.
RETURN.
ENDIF.
CALL FUNCTION 'SEO_BUFFER_REFRESH'
EXPORTING
version = seoc_version_active
force = abap_true.
CALL FUNCTION 'SEO_BUFFER_REFRESH'
EXPORTING
version = seoc_version_inactive
force = abap_true.
lt_source = mi_object_oriented_object_fct->serialize_abap( ls_class_key ).
source_apack_replacement( CHANGING ct_source = lt_source ).
mo_files->add_abap( lt_source ).
lt_source = mi_object_oriented_object_fct->serialize_abap(
is_class_key = ls_class_key
iv_type = seop_ext_class_locals_def ).
IF lines( lt_source ) > 0.
mo_files->add_abap( iv_extra = zif_abapgit_oo_object_fnc=>c_parts-locals_def
it_abap = lt_source ).
ENDIF.
lt_source = mi_object_oriented_object_fct->serialize_abap(
is_class_key = ls_class_key
iv_type = seop_ext_class_locals_imp ).
IF lines( lt_source ) > 0.
mo_files->add_abap( iv_extra = zif_abapgit_oo_object_fnc=>c_parts-locals_imp
it_abap = lt_source ).
ENDIF.
lt_source = mi_object_oriented_object_fct->serialize_abap(
is_class_key = ls_class_key
iv_type = seop_ext_class_testclasses ).
mv_skip_testclass = mi_object_oriented_object_fct->get_skip_test_classes( ).
IF lines( lt_source ) > 0 AND mv_skip_testclass = abap_false.
mo_files->add_abap( iv_extra = zif_abapgit_oo_object_fnc=>c_parts-testclasses
it_abap = lt_source ).
ENDIF.
lt_source = mi_object_oriented_object_fct->serialize_abap(
is_class_key = ls_class_key
iv_type = seop_ext_class_macros ).
IF lines( lt_source ) > 0.
mo_files->add_abap( iv_extra = zif_abapgit_oo_object_fnc=>c_parts-macros
it_abap = lt_source ).
ENDIF.
serialize_xml( io_xml ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
565,
292,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
23065,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
764,
628,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
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,
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,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
42865,
25,
21504,
62,
15252,
62,
17107,
62,
15252,
62,
69,
310,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
85,
62,
48267,
62,
9288,
4871,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
85,
62,
4871,
7742,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1172,
3672,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
748,
48499,
1096,
62,
397,
499,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21065,
62,
19875,
220,
220,
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,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
26495,
41876,
1614,
4871,
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,
748,
48499,
1096,
62,
15390,
84,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21065,
62,
19875,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19875,
62,
15414,
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,
748,
48499,
1096,
62,
83,
7742,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21065,
62,
19875,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19875,
62,
15414,
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,
748,
48499,
1096,
62,
82,
313,
81,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21065,
62,
4029,
220,
220,
220,
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,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
26495,
41876,
1614,
4871,
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,
11389,
1096,
62,
19875,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21065,
62,
19875,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19875,
62,
22915,
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,
11389,
1096,
62,
35226,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
19875,
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,
220,
220,
5145,
452,
62,
565,
82,
3672,
41876,
384,
420,
7278,
3672,
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,
11389,
1096,
62,
20147,
81,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
19875,
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,
220,
220,
5145,
452,
62,
565,
82,
3672,
41876,
384,
420,
7278,
3672,
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,
11389,
1096,
62,
15390,
84,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
19875,
220,
220,
220,
220,
220,
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,
220,
220,
5145,
270,
62,
75,
2303,
62,
2860,
1859,
41876,
1976,
361,
62,
397,
499,
18300,
62,
17204,
62,
4299,
50101,
14804,
774,
62,
17204,
385,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
565,
82,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
384,
420,
7278,
3672,
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
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zbp_i_rap_travel_mipo DEFINITION PUBLIC ABSTRACT FINAL FOR BEHAVIOR OF zi_rap_travel_mipo.
ENDCLASS.
CLASS ZBP_I_RAP_TRAVEL_MIPO IMPLEMENTATION.
ENDCLASS.
| [
31631,
1976,
46583,
62,
72,
62,
2416,
62,
35927,
62,
76,
541,
78,
5550,
20032,
17941,
44731,
9564,
18601,
10659,
25261,
7473,
9348,
7801,
12861,
1581,
3963,
1976,
72,
62,
2416,
62,
35927,
62,
76,
541,
78,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
20866,
62,
40,
62,
49,
2969,
62,
51,
3861,
18697,
62,
44,
4061,
46,
30023,
2538,
10979,
6234,
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
] |
class ZCL_AU_CDS_SEGW_MONSTERS_HEADE definition
public
inheriting from /BOBF/CL_LIB_AUTH_DRAFT_ACTIVE
final
create public .
public section.
methods /BOBF/IF_LIB_AUTH_DRAFT_ACTIVE~CHECK_INSTANCE_AUTHORITY
redefinition .
methods /BOBF/IF_LIB_AUTH_DRAFT_ACTIVE~CHECK_STATIC_AUTHORITY
redefinition .
protected section.
private section.
ENDCLASS.
CLASS ZCL_AU_CDS_SEGW_MONSTERS_HEADE IMPLEMENTATION.
method /BOBF/IF_LIB_AUTH_DRAFT_ACTIVE~CHECK_INSTANCE_AUTHORITY.
endmethod.
method /BOBF/IF_LIB_AUTH_DRAFT_ACTIVE~CHECK_STATIC_AUTHORITY.
endmethod.
ENDCLASS.
| [
4871,
1168,
5097,
62,
26830,
62,
34,
5258,
62,
5188,
33191,
62,
27857,
2257,
4877,
62,
13909,
19266,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
1220,
8202,
29499,
14,
5097,
62,
40347,
62,
32,
24318,
62,
35,
44700,
62,
10659,
9306,
198,
220,
2457,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
5050,
1220,
8202,
29499,
14,
5064,
62,
40347,
62,
32,
24318,
62,
35,
44700,
62,
10659,
9306,
93,
50084,
62,
38604,
19240,
62,
32,
24318,
1581,
9050,
198,
220,
220,
220,
34087,
17750,
764,
198,
220,
5050,
1220,
8202,
29499,
14,
5064,
62,
40347,
62,
32,
24318,
62,
35,
44700,
62,
10659,
9306,
93,
50084,
62,
35744,
2149,
62,
32,
24318,
1581,
9050,
198,
220,
220,
220,
34087,
17750,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
26830,
62,
34,
5258,
62,
5188,
33191,
62,
27857,
2257,
4877,
62,
13909,
19266,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
2446,
1220,
8202,
29499,
14,
5064,
62,
40347,
62,
32,
24318,
62,
35,
44700,
62,
10659,
9306,
93,
50084,
62,
38604,
19240,
62,
32,
24318,
1581,
9050,
13,
198,
220,
886,
24396,
13,
628,
198,
220,
2446,
1220,
8202,
29499,
14,
5064,
62,
40347,
62,
32,
24318,
62,
35,
44700,
62,
10659,
9306,
93,
50084,
62,
35744,
2149,
62,
32,
24318,
1581,
9050,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 /gal/jm_clean_preconditions.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(RFC_ROUTE_INFO) TYPE /GAL/RFC_ROUTE_INFO OPTIONAL
*" REFERENCE(LATEST_MOD_TIMESTAMP) TYPE TIMESTAMP OPTIONAL
*" EXCEPTIONS
*" RFC_EXCEPTION
*"----------------------------------------------------------------------
DATA:
l_precond_id TYPE /gal/precondition_id,
l_precond_type TYPE /gal/precondition_type,
l_latest_mod_ts TYPE timestamp.
* Follow RFC route
cfw_follow_rfc_route rfc_route_info.
cfw_pass_exception rfc_exception.
cfw_remote_coding.
IF latest_mod_timestamp IS INITIAL.
GET TIME STAMP FIELD l_latest_mod_ts.
ELSE.
l_latest_mod_ts = latest_mod_timestamp.
ENDIF.
* First delete preconditions of jobs that are finished or obsolete
SELECT j02~id j02~type FROM /gal/jobdata01 AS j01 INNER JOIN /gal/jobdata02 AS j02 ON j02~job_id = j01~id
INTO (l_precond_id, l_precond_type) WHERE ( j01~status = 'O' OR j01~status = 'F' ) AND j01~mod_timestamp < l_latest_mod_ts.
CASE l_precond_type.
WHEN 'T'.
DELETE FROM /gal/jobdata02t WHERE id = l_precond_id. "#EC CI_SUBRC
WHEN 'J'.
DELETE FROM /gal/jobdata02j WHERE id = l_precond_id. "#EC CI_SUBRC
WHEN 'R'.
DELETE FROM /gal/jobdata02r WHERE id = l_precond_id. "#EC CI_SUBRC
WHEN 'U'.
DELETE FROM /gal/jobdata02u WHERE id = l_precond_id. "#EC CI_SUBRC
WHEN OTHERS.
CONTINUE.
ENDCASE.
DELETE FROM /gal/jobdata02 WHERE id = l_precond_id. "#EC CI_SUBRC
ENDSELECT. "#EC CI_SUBRC
* Now delete preconditions that do not have a job anymore
SELECT j02~id j02~type FROM /gal/jobdata02 AS j02 INTO (l_precond_id, l_precond_type)
WHERE NOT EXISTS ( SELECT * FROM /gal/jobdata01 WHERE id = j02~job_id ). "#EC CI_NOFIELD
CASE l_precond_type.
WHEN 'T'.
DELETE FROM /gal/jobdata02t WHERE id = l_precond_id. "#EC CI_SUBRC
WHEN 'J'.
DELETE FROM /gal/jobdata02j WHERE id = l_precond_id. "#EC CI_SUBRC
WHEN 'R'.
DELETE FROM /gal/jobdata02r WHERE id = l_precond_id. "#EC CI_SUBRC
WHEN 'U'.
DELETE FROM /gal/jobdata02u WHERE id = l_precond_id. "#EC CI_SUBRC
WHEN OTHERS.
CONTINUE.
ENDCASE.
DELETE FROM /gal/jobdata02 WHERE id = l_precond_id. "#EC CI_SUBRC
ENDSELECT. "#EC CI_SUBRC
COMMIT WORK.
ENDFUNCTION.
| [
42296,
4177,
2849,
1220,
13528,
14,
73,
76,
62,
27773,
62,
3866,
17561,
1756,
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,
41150,
62,
49,
2606,
9328,
62,
10778,
8,
41876,
220,
1220,
38,
1847,
14,
41150,
62,
49,
2606,
9328,
62,
10778,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
43,
1404,
6465,
62,
33365,
62,
51,
3955,
6465,
23518,
8,
41876,
220,
31742,
6465,
23518,
39852,
2849,
1847,
198,
9,
1,
220,
7788,
42006,
11053,
198,
9,
1,
220,
220,
220,
220,
220,
30978,
62,
6369,
42006,
2849,
198,
9,
1,
10097,
23031,
628,
220,
42865,
25,
198,
220,
220,
220,
300,
62,
3866,
17561,
62,
312,
220,
220,
220,
41876,
1220,
13528,
14,
3866,
31448,
62,
312,
11,
198,
220,
220,
220,
300,
62,
3866,
17561,
62,
4906,
220,
41876,
1220,
13528,
14,
3866,
31448,
62,
4906,
11,
198,
220,
220,
220,
300,
62,
42861,
62,
4666,
62,
912,
41876,
41033,
13,
628,
198,
9,
7281,
30978,
6339,
198,
220,
30218,
86,
62,
27780,
62,
81,
16072,
62,
38629,
374,
16072,
62,
38629,
62,
10951,
13,
198,
220,
30218,
86,
62,
6603,
62,
1069,
4516,
374,
16072,
62,
1069,
4516,
13,
198,
220,
30218,
86,
62,
47960,
62,
66,
7656,
13,
628,
198,
220,
16876,
3452,
62,
4666,
62,
16514,
27823,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
17151,
20460,
3563,
23518,
18930,
24639,
300,
62,
42861,
62,
4666,
62,
912,
13,
198,
220,
17852,
5188,
13,
198,
220,
220,
220,
300,
62,
42861,
62,
4666,
62,
912,
796,
3452,
62,
4666,
62,
16514,
27823,
13,
198,
220,
23578,
5064,
13,
198,
198,
9,
3274,
12233,
3718,
623,
1756,
286,
3946,
326,
389,
5201,
393,
26533,
198,
220,
33493,
474,
2999,
93,
312,
474,
2999,
93,
4906,
16034,
1220,
13528,
14,
21858,
7890,
486,
7054,
474,
486,
3268,
21479,
32357,
1268,
1220,
13528,
14,
21858,
7890,
2999,
7054,
474,
2999,
6177,
474,
2999,
93,
21858,
62,
312,
796,
474,
486,
93,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
39319,
357,
75,
62,
3866,
17561,
62,
312,
11,
300,
62,
3866,
17561,
62,
4906,
8,
33411,
357,
474,
486,
93,
13376,
796,
705,
46,
6,
6375,
474,
486,
93,
13376,
796,
705,
37,
6,
1267,
5357,
474,
486,
93,
4666,
62,
16514,
27823,
1279,
300,
62,
42861,
62,
4666,
62,
912,
13,
198,
220,
220,
220,
42001,
300,
62,
3866,
17561,
62,
4906,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
51,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
5550,
2538,
9328,
16034,
1220,
13528,
14,
21858,
7890,
2999,
83,
33411,
4686,
796,
300,
62,
3866,
17561,
62,
312,
13,
25113,
2943,
14514,
62,
50,
10526,
7397,
198,
220,
220,
220,
220,
220,
42099,
705,
41,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
5550,
2538,
9328,
16034,
1220,
13528,
14,
21858,
7890,
2999,
73,
33411,
4686,
796,
300,
62,
3866,
17561,
62,
312,
13,
25113,
2943,
14514,
62,
50,
10526,
7397,
198,
220,
220,
220,
220,
220,
42099,
705,
49,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
5550,
2538,
9328,
16034,
1220,
13528,
14,
21858,
7890,
2999,
81,
33411,
4686,
796,
300,
62,
3866,
17561,
62,
312,
13,
25113,
2943,
14514,
62,
50,
10526,
7397,
198,
220,
220,
220,
220,
220,
42099,
705,
52,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
5550,
2538,
9328,
16034,
1220,
13528,
14,
21858,
7890,
2999,
84,
33411,
4686,
796,
300,
62,
3866,
17561,
62,
312,
13,
25113,
2943,
14514,
62,
50,
10526,
7397,
198,
220,
220,
220,
220,
220,
42099,
440,
4221,
4877,
13,
198,
220,
220,
220,
220,
220,
220,
220,
43659,
8924,
13,
198,
220,
220,
220,
23578,
34,
11159,
13,
198,
220,
220,
220,
5550,
2538,
9328,
16034,
1220,
13528,
14,
21858,
7890,
2999,
33411,
4686,
796,
300,
62,
3866,
17561,
62,
312,
13,
220,
220,
25113,
2943,
14514,
62,
50,
10526,
7397,
198,
220,
23578,
46506,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
14514,
62,
50,
10526,
7397,
198,
9,
2735,
12233,
3718,
623,
1756,
326,
466,
407,
423,
257,
1693,
7471,
198,
220,
33493,
474,
2999,
93,
312,
474,
2999,
93,
4906,
16034,
1220,
13528,
14,
21858,
7890,
2999,
7054,
474,
2999,
39319,
357,
75,
62,
3866,
17561,
62,
312,
11,
300,
62,
3866,
17561,
62,
4906,
8,
198,
220,
220,
220,
33411,
5626,
7788,
1797,
4694,
357,
33493,
1635,
16034,
1220,
13528,
14,
21858,
7890,
486,
33411,
4686,
796,
474,
2999,
93,
21858,
62,
312,
6739,
25113,
2943,
14514,
62,
15285,
44603,
198,
220,
220,
220,
42001,
300,
62,
3866,
17561,
62,
4906,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
51,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
5550,
2538,
9328,
16034,
1220,
13528,
14,
21858,
7890,
2999,
83,
33411,
4686,
796,
300,
62,
3866,
17561,
62,
312,
13,
25113,
2943,
14514,
62,
50,
10526,
7397,
198,
220,
220,
220,
220,
220,
42099,
705,
41,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
5550,
2538,
9328,
16034,
1220,
13528,
14,
21858,
7890,
2999,
73,
33411,
4686,
796,
300,
62,
3866,
17561,
62,
312,
13,
25113,
2943,
14514,
62,
50,
10526,
7397,
198,
220,
220,
220,
220,
220,
42099,
705,
49,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
5550,
2538,
9328,
16034,
1220,
13528,
14,
21858,
7890,
2999,
81,
33411,
4686,
796,
300,
62,
3866,
17561,
62,
312,
13,
25113,
2943,
14514,
62,
50,
10526,
7397,
198,
220,
220,
220,
220,
220,
42099,
705,
52,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
5550,
2538,
9328,
16034,
1220,
13528,
14,
21858,
7890,
2999,
84,
33411,
4686,
796,
300,
62,
3866,
17561,
62,
312,
13,
25113,
2943,
14514,
62,
50,
10526,
7397,
198,
220,
220,
220,
220,
220,
42099
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_gui_page_syntax DEFINITION PUBLIC FINAL CREATE PUBLIC
INHERITING FROM zcl_abapgit_gui_page_codi_base.
PUBLIC SECTION.
INTERFACES: zif_abapgit_gui_page_hotkey.
METHODS:
constructor
IMPORTING
io_repo TYPE REF TO zcl_abapgit_repo
RAISING
zcx_abapgit_exception,
zif_abapgit_gui_event_handler~on_event
REDEFINITION,
zif_abapgit_gui_renderable~render
REDEFINITION.
PROTECTED SECTION.
METHODS:
render_content REDEFINITION.
PRIVATE SECTION.
CONSTANTS:
BEGIN OF c_actions,
rerun TYPE string VALUE 'rerun' ##NO_TEXT,
END OF c_actions.
METHODS:
build_menu
RETURNING
VALUE(ro_menu) TYPE REF TO zcl_abapgit_html_toolbar
RAISING
zcx_abapgit_exception,
run_syntax_check
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_PAGE_SYNTAX IMPLEMENTATION.
METHOD build_menu.
CREATE OBJECT ro_menu.
ro_menu->add( iv_txt = 'Re-Run'
iv_act = c_actions-rerun
iv_cur = abap_false ) ##NO_TEXT.
ENDMETHOD.
METHOD constructor.
super->constructor( ).
ms_control-page_title = 'SYNTAX CHECK'.
mo_repo = io_repo.
run_syntax_check( ).
ENDMETHOD.
METHOD render_content.
CREATE OBJECT ro_html.
ro_html->add( '<div class="toc">' ).
IF lines( mt_result ) = 0.
ro_html->add( '<div class="dummydiv success">' ).
ro_html->add( zcl_abapgit_html=>icon( 'check' ) ).
ro_html->add( 'No syntax errors' ).
ELSE.
render_result( io_html = ro_html
it_result = mt_result ).
ENDIF.
ro_html->add( '</div>' ).
ENDMETHOD.
METHOD run_syntax_check.
DATA: li_syntax_check TYPE REF TO zif_abapgit_code_inspector.
li_syntax_check = zcl_abapgit_factory=>get_code_inspector( mo_repo->get_package( ) ).
mt_result = li_syntax_check->run( 'SYNTAX_CHECK' ).
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
CASE iv_action.
WHEN c_actions-rerun.
run_syntax_check( ).
ei_page = me.
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.
METHOD zif_abapgit_gui_page_hotkey~get_hotkey_actions.
ENDMETHOD.
METHOD zif_abapgit_gui_renderable~render.
ms_control-page_menu = build_menu( ).
ri_html = super->zif_abapgit_gui_renderable~render( ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
1837,
41641,
5550,
20032,
17941,
44731,
25261,
29244,
6158,
44731,
198,
220,
220,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
19815,
72,
62,
8692,
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,
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,
33245,
62,
260,
7501,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
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,
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,
11,
628,
220,
220,
220,
220,
220,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
13287,
540,
93,
13287,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
8543,
62,
11299,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
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,
302,
5143,
41876,
4731,
26173,
8924,
705,
260,
5143,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
4658,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
1382,
62,
26272,
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,
26272,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
25981,
5657,
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,
1057,
62,
1837,
41641,
62,
9122,
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,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
40156,
62,
4537,
8264,
62,
23060,
45,
5603,
55,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1382,
62,
26272,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
686,
62,
26272,
13,
628,
220,
220,
220,
686,
62,
26272,
3784,
2860,
7,
21628,
62,
14116,
796,
705,
3041,
12,
10987,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
529,
796,
269,
62,
4658,
12,
260,
5143,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
22019,
796,
450,
499,
62,
9562,
1267,
22492,
15285,
62,
32541,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
6739,
198,
220,
220,
220,
13845,
62,
13716,
12,
7700,
62,
7839,
796,
705,
23060,
45,
5603,
55,
5870,
25171,
4458,
198,
220,
220,
220,
6941,
62,
260,
7501,
796,
33245,
62,
260,
7501,
13,
198,
220,
220,
220,
1057,
62,
1837,
41641,
62,
9122,
7,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
8543,
62,
11299,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
686,
62,
6494,
13,
198,
220,
220,
220,
686,
62,
6494,
3784,
2860,
7,
705,
27,
7146,
1398,
2625,
40301,
5320,
6,
6739,
628,
220,
220,
220,
16876,
3951,
7,
45079,
62,
20274,
1267,
796,
657,
13,
198,
220,
220,
220,
220,
220,
686,
62,
6494,
3784,
2860,
7,
705,
27,
7146,
1398,
2625,
67,
13513,
7146,
1943,
5320,
6,
6739,
198,
220,
220,
220,
220,
220,
686,
62,
6494,
3784,
2860,
7,
1976,
565,
62,
397,
499,
18300,
62,
6494,
14804,
4749,
7,
705,
9122,
6,
1267,
6739,
198,
220,
220,
220,
220,
220,
686,
62,
6494,
3784,
2860,
7,
705,
2949,
15582,
8563,
6,
6739,
198,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
8543,
62,
20274,
7,
33245,
62,
6494,
220,
220,
796,
686,
62,
6494,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
20274,
796,
45079,
62,
20274,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
686,
62,
6494,
3784,
2860,
7,
705,
3556,
7146,
29,
6,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1057,
62,
1837,
41641,
62,
9122,
13,
628,
220,
220,
220,
42865,
25,
7649,
62,
1837,
41641,
62,
9122,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
8189,
62,
1040,
806,
273,
13,
628,
220,
220,
220,
7649,
62,
1837,
41641,
62,
9122,
796,
1976,
565,
62,
397,
499,
18300,
62,
69,
9548,
14804,
1136,
62,
8189,
62,
1040,
806,
273,
7,
6941,
62,
260,
7501,
3784,
1136,
62,
26495,
7,
1267,
6739,
198,
220,
220,
220,
45079,
62,
20274,
796,
7649,
62,
1837,
41641,
62,
9122,
3784,
5143,
7,
705,
23060,
45,
5603,
55,
62,
50084,
6,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
62,
30281,
93,
261,
62,
15596,
13,
628,
220,
220,
220,
42001,
21628,
62,
2673,
13,
198,
220,
220,
220,
220,
220,
42099,
269,
62,
4658,
12,
260,
5143,
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,
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
] |
CLASS zcl_advent2019_day02_hvam DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_advent2019_hvam .
TYPES: integer_table TYPE STANDARD TABLE OF i WITH DEFAULT KEY.
METHODS input
IMPORTING
!string TYPE string
RETURNING
VALUE(integers) TYPE integer_table .
METHODS output
IMPORTING
!integers TYPE integer_table
RETURNING
VALUE(string) TYPE string .
METHODS execute
IMPORTING
integers TYPE integer_table
RETURNING
VALUE(result) TYPE integer_table.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_advent2019_day02_hvam IMPLEMENTATION.
METHOD execute.
DATA index TYPE i VALUE 1.
DATA position1 TYPE i.
DATA position2 TYPE i.
DATA position3 TYPE i.
DATA value1 TYPE i.
DATA value2 TYPE i.
DATA target TYPE i.
DATA opcode TYPE i.
result = integers.
DO.
READ TABLE result INDEX index INTO opcode.
ASSERT sy-subrc = 0.
CASE opcode.
WHEN 1 OR 2.
READ TABLE result INDEX index + 1 INTO position1.
ASSERT sy-subrc = 0.
position1 = position1 + 1.
READ TABLE result INDEX index + 2 INTO position2.
ASSERT sy-subrc = 0.
position2 = position2 + 1.
READ TABLE result INDEX index + 3 INTO position3.
ASSERT sy-subrc = 0.
position3 = position3 + 1.
READ TABLE result INDEX position1 INTO value1.
ASSERT sy-subrc = 0.
READ TABLE result INDEX position2 INTO value2.
ASSERT sy-subrc = 0.
IF opcode = 1.
value1 = value1 + value2.
ELSE.
value1 = value1 * value2.
ENDIF.
MODIFY result INDEX position3 FROM value1.
WHEN 99.
EXIT. " current loop
WHEN OTHERS.
ASSERT 0 = 1.
ENDCASE.
index = index + 4.
ENDDO.
ENDMETHOD.
METHOD input.
DATA strings TYPE STANDARD TABLE OF string WITH DEFAULT KEY.
DATA int TYPE i.
SPLIT string AT ',' INTO TABLE strings.
LOOP AT strings INTO int.
APPEND int TO integers.
ENDLOOP.
ENDMETHOD.
METHOD output.
LOOP AT integers INTO DATA(int).
IF string IS INITIAL.
string = int.
string = condense( string ).
ELSE.
string = |{ string },{ int }|.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD zif_advent2019_hvam~solve.
DATA noun TYPE i.
DATA verb TYPE i.
DATA(integers) = input( input ).
" PART 1
" MODIFY integers INDEX 2 FROM 12.
" MODIFY integers INDEX 3 FROM 2.
" DATA(result) = execute( integers ).
" READ TABLE result INDEX 1 INTO DATA(int).
" output = int.
" PART 2
DO 100 TIMES.
noun = sy-index + 10.
MODIFY integers INDEX 2 FROM noun.
DO 100 TIMES.
verb = sy-index + 10.
MODIFY integers INDEX 3 FROM verb.
DATA(result) = execute( integers ).
READ TABLE result INDEX 1 INTO DATA(int).
ASSERT sy-subrc = 0.
IF int = 19690720.
output = ( 100 * noun ) + verb.
RETURN.
ENDIF.
ENDDO.
ENDDO.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
324,
1151,
23344,
62,
820,
2999,
62,
71,
85,
321,
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,
23344,
62,
71,
85,
321,
764,
628,
220,
220,
220,
24412,
47,
1546,
25,
18253,
62,
11487,
41876,
49053,
9795,
43679,
3963,
1312,
13315,
5550,
38865,
35374,
13,
628,
220,
220,
220,
337,
36252,
50,
5128,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
8841,
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,
18908,
364,
8,
41876,
18253,
62,
11487,
764,
628,
220,
220,
220,
337,
36252,
50,
5072,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
18908,
364,
220,
220,
220,
220,
41876,
18253,
62,
11487,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
8841,
8,
41876,
4731,
764,
628,
220,
220,
220,
337,
36252,
50,
12260,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
37014,
220,
220,
220,
220,
220,
41876,
18253,
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,
18253,
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,
324,
1151,
23344,
62,
820,
2999,
62,
71,
85,
321,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
12260,
13,
628,
220,
220,
220,
42865,
6376,
41876,
1312,
26173,
8924,
352,
13,
628,
220,
220,
220,
42865,
2292,
16,
41876,
1312,
13,
198,
220,
220,
220,
42865,
2292,
17,
41876,
1312,
13,
198,
220,
220,
220,
42865,
2292,
18,
41876,
1312,
13,
628,
220,
220,
220,
42865,
1988,
16,
41876,
1312,
13,
198,
220,
220,
220,
42865,
1988,
17,
41876,
1312,
13,
628,
220,
220,
220,
42865,
2496,
41876,
1312,
13,
198,
220,
220,
220,
42865,
1034,
8189,
41876,
1312,
13,
628,
220,
220,
220,
1255,
796,
37014,
13,
628,
220,
220,
220,
8410,
13,
198,
220,
220,
220,
220,
220,
20832,
43679,
1255,
24413,
6369,
6376,
39319,
1034,
8189,
13,
198,
220,
220,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
628,
220,
220,
220,
220,
220,
42001,
1034,
8189,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42099,
352,
6375,
362,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20832,
43679,
1255,
24413,
6369,
6376,
1343,
352,
39319,
2292,
16,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2292,
16,
796,
2292,
16,
1343,
352,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20832,
43679,
1255,
24413,
6369,
6376,
1343,
362,
39319,
2292,
17,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2292,
17,
796,
2292,
17,
1343,
352,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20832,
43679,
1255,
24413,
6369,
6376,
1343,
513,
39319,
2292,
18,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2292,
18,
796,
2292,
18,
1343,
352,
13,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20832,
43679,
1255,
24413,
6369,
2292,
16,
39319,
1988,
16,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20832,
43679,
1255,
24413,
6369,
2292,
17,
39319,
1988,
17,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16876,
1034,
8189,
796,
352,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1988,
16,
796,
1988,
16,
1343,
1988,
17,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1988,
16,
796,
1988,
16,
1635,
1988,
17,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19164,
5064,
56,
1255,
24413,
6369,
2292,
18,
16034,
1988,
16,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42099,
7388,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
2043,
13,
366,
1459,
9052,
198,
220,
220,
220,
220,
220,
220,
220,
42099,
440,
4221,
4877,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24994,
17395,
657,
796,
352,
13,
198,
220,
220,
220,
220,
220,
23578,
34,
11159,
13,
628,
220,
220,
220,
220,
220,
6376,
796,
6376,
1343,
604,
13,
198,
220,
220,
220,
23578,
18227,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
5128,
13,
628,
220,
220,
220,
42865,
13042,
41876,
49053,
9795,
43679,
3963,
4731,
13315,
5550,
38865,
35374,
13,
198,
220,
220,
220,
42865,
493,
41876,
1312,
13,
628,
220,
220,
220,
46341,
2043,
4731,
5161,
705,
4032,
39319,
43679,
13042,
13,
198,
220,
220,
220,
17579,
3185,
5161,
13042,
39319,
493,
13,
198,
220,
220,
220,
220,
220,
43504,
10619,
493,
5390,
37014,
13,
198,
220,
220,
220,
23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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
] |
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_texts,
ddlanguage TYPE dd01v-ddlanguage,
ddtext TYPE dd01v-ddtext,
END OF ty_dd01_texts,
BEGIN OF ty_dd07_texts,
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_texts,
tt_dd01_texts TYPE STANDARD TABLE OF ty_dd01_texts,
tt_dd07_texts TYPE STANDARD TABLE OF ty_dd07_texts.
CONSTANTS: c_longtext_id_doma TYPE dokil-id VALUE 'DO'.
METHODS:
serialize_texts
IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_output
RAISING zcx_abapgit_exception,
deserialize_texts
IMPORTING io_xml TYPE REF TO zcl_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,
ls_dd01v_tmp TYPE dd01v,
lt_dd07v_tmp TYPE TABLE OF dd07v,
lt_i18n_langs TYPE TABLE OF langu,
lt_dd01_texts TYPE tt_dd01_texts,
lt_dd07_texts TYPE tt_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.
io_xml->read( EXPORTING iv_name = 'I18N_LANGS'
CHANGING cg_data = lt_i18n_langs ).
io_xml->read( EXPORTING iv_name = 'DD01_TEXTS'
CHANGING cg_data = lt_dd01_texts ).
io_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>.
READ TABLE lt_dd07_texts ASSIGNING <ls_dd07_text>
WITH KEY ddlanguage = <lv_lang> valpos = <ls_dd07v>-valpos.
CHECK sy-subrc = 0. " ! no translation -> master translation remain (maybe not OK)
MOVE-CORRESPONDING <ls_dd07_text> TO <ls_dd07v>.
DELETE lt_dd07_texts INDEX sy-tabix. " Optimization
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( 'error from DDIF_DOMA_PUT @TEXTS' ).
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 tt_dd01_texts,
lt_dd07_texts TYPE tt_dd07_texts.
FIELD-SYMBOLS: <lv_lang> LIKE LINE OF lt_i18n_langs,
<ls_dd07v> LIKE LINE OF lt_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.
" Collect additional languages, skip master 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>.
LOOP AT lt_dd07v ASSIGNING <ls_dd07v> WHERE NOT ddlanguage IS INITIAL.
APPEND INITIAL LINE TO lt_dd07_texts ASSIGNING <ls_dd07_text>.
MOVE-CORRESPONDING <ls_dd07v> TO <ls_dd07_text>.
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.
io_xml->add( iv_name = 'I18N_LANGS'
ig_data = lt_i18n_langs ).
io_xml->add( iv_name = 'DD01_TEXTS'
ig_data = lt_dd01_texts ).
io_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.
* see class CL_WB_DDIC
DATA: lv_objname TYPE rsedd0-ddobjname.
lv_objname = ms_item-obj_name.
TRY.
CALL FUNCTION 'RS_DD_DELETE_OBJ'
EXPORTING
no_ask = abap_true
objname = lv_objname
objtype = 'D'
no_ask_delete_append = abap_true
EXCEPTIONS
not_executed = 1
object_not_found = 2
object_not_specified = 3
permission_failure = 4.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from RS_DD_DELETE_OBJ, DOMA' ).
ENDIF.
CATCH cx_sy_dyn_call_param_not_found.
CALL FUNCTION 'RS_DD_DELETE_OBJ'
EXPORTING
no_ask = abap_true
objname = lv_objname
objtype = 'D'
* no_ask_delete_append = abap_true parameter not available in lower NW versions
EXCEPTIONS
not_executed = 1
object_not_found = 2
object_not_specified = 3
permission_failure = 4.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from RS_DD_DELETE_OBJ, DOMA' ).
ENDIF.
ENDTRY.
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.
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 iv_object_class = 'DICT' ).
lv_name = ms_item-obj_name. " type conversion
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( 'error from DDIF_DOMA_PUT' ).
ENDIF.
deserialize_texts( io_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
AND as4local = 'A'
AND as4vers = '0000'.
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( iv_radio = 'RSRD1-DOMA'
iv_field = 'RSRD1-DOMA_VAL' ).
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 OR ls_dd01v IS INITIAL.
zcx_abapgit_exception=>raise( 'error from DDIF_DOMA_GET' ).
ENDIF.
CLEAR: ls_dd01v-as4user,
ls_dd01v-as4date,
ls_dd01v-as4time.
* 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.
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( io_xml ).
serialize_longtexts( io_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,
347,
43312,
3963,
1259,
62,
1860,
486,
62,
5239,
82,
11,
198,
220,
220,
220,
220,
220,
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,
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,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
1860,
486,
62,
5239,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
1860,
2998,
62,
5239,
82,
11,
198,
220,
220,
220,
220,
220,
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,
220,
220,
220,
220,
220,
49427,
16129,
41876,
49427,
2998,
85,
12,
1860,
16129,
11,
198,
220,
220,
220,
220,
220,
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,
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,
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,
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,
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,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
1860,
2998,
62,
5239,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
83,
62,
1860,
486,
62,
5239,
82,
41876,
49053,
9795,
43679,
3963,
1259,
62,
1860,
486,
62,
5239,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
83,
62,
1860,
2998,
62,
5239,
82,
41876,
49053,
9795,
43679,
3963,
1259,
62,
1860,
2998,
62,
5239,
82,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
269,
62,
6511,
5239,
62,
312,
62,
3438,
64,
41876,
466,
34553,
12,
312,
26173,
8924,
705,
18227,
4458,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
11389,
1096,
62,
5239,
82,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
33245,
62,
19875,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
19875,
62,
22915,
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,
748,
48499,
1096,
62,
5239,
82,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
33245,
62,
19875,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
19875,
62,
15414,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
1860,
486,
85,
41876,
49427,
486,
85,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
1860,
2998,
85,
41876,
49427,
2998,
85,
62,
8658,
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,
39170,
32,
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,
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,
256,
83,
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,
256,
83,
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
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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it_cts_api~get_current_transport_for_obj.
DATA: lv_object_lockable TYPE abap_bool,
lv_locked TYPE abap_bool,
lv_transport_request TYPE trkorr,
lv_task TYPE trkorr,
lv_tr_object_name TYPE trobj_name.
lv_tr_object_name = iv_object_name.
CALL FUNCTION 'TR_CHECK_OBJECT_LOCK'
EXPORTING
wi_pgmid = iv_program_id
wi_object = iv_object_type
wi_objname = lv_tr_object_name
IMPORTING
we_lockable_object = lv_object_lockable
we_locked = lv_locked
we_lock_order = lv_transport_request
we_lock_task = lv_task
EXCEPTIONS
empty_key = 1
no_systemname = 2
no_systemtype = 3
unallowed_lock_order = 4
OTHERS = 5.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
IF lv_locked = abap_false.
zcx_abapgit_exception=>raise( |Object { iv_program_id }-{ iv_object_type }-{ iv_object_name } is not locked| ).
ENDIF.
IF lv_object_lockable = abap_false.
zcx_abapgit_exception=>raise( |Object type { iv_program_id }-{ iv_object_type } not lockable| ).
ENDIF.
IF lv_task IS NOT INITIAL AND lv_task <> lv_transport_request AND iv_resolve_task_to_request = abap_false.
rv_transport = lv_task.
ELSE.
rv_transport = lv_transport_request.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_cts_api~is_object_locked_in_transport.
DATA: ls_object_key TYPE e071,
lv_type_check_result TYPE c LENGTH 1,
ls_lock_key TYPE tlock_int,
lv_lock_flag TYPE c LENGTH 1.
ls_object_key-pgmid = iv_program_id.
ls_object_key-object = iv_object_type.
ls_object_key-obj_name = iv_object_name.
CALL FUNCTION 'TR_CHECK_TYPE'
EXPORTING
wi_e071 = ls_object_key
IMPORTING
pe_result = lv_type_check_result
we_lock_key = ls_lock_key.
IF lv_type_check_result <> 'L'.
zcx_abapgit_exception=>raise( |Object type { iv_program_id }-{ iv_object_type } not lockable| ).
ENDIF.
CALL FUNCTION 'TRINT_CHECK_LOCKS'
EXPORTING
wi_lock_key = ls_lock_key
IMPORTING
we_lockflag = lv_lock_flag
EXCEPTIONS
empty_key = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |TRINT_CHECK_LOCKS: { sy-subrc }| ).
ENDIF.
rv_locked = boolc( lv_lock_flag <> space ).
ENDMETHOD.
METHOD zif_abapgit_cts_api~is_object_type_lockable.
DATA: ls_object_key TYPE e071,
lv_type_check_result TYPE c LENGTH 1.
ls_object_key-pgmid = iv_program_id.
ls_object_key-object = iv_object_type.
ls_object_key-obj_name = '*'.
CALL FUNCTION 'TR_CHECK_TYPE'
EXPORTING
wi_e071 = ls_object_key
IMPORTING
pe_result = lv_type_check_result.
rv_lockable = boolc( lv_type_check_result = 'L' ).
ENDMETHOD.
METHOD zif_abapgit_cts_api~is_chrec_possible_for_package.
rv_possible = zcl_abapgit_factory=>get_sap_package( iv_package )->are_changes_recorded_in_tr_req( ).
ENDMETHOD.
ENDCLASS.
| [
40484,
9794,
4839,
1080,
7824,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
310,
82,
62,
15042,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
4810,
3824,
6158,
198,
220,
10188,
9864,
1847,
48167,
1677,
5258,
1976,
565,
62,
397,
499,
18300,
62,
69,
9548,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
397,
499,
18300,
62,
310,
82,
62,
15042,
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,
397,
499,
18300,
62,
310,
82,
62,
15042,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
310,
82,
62,
15042,
93,
1136,
62,
14421,
62,
7645,
634,
62,
1640,
62,
26801,
13,
198,
220,
220,
220,
42865,
25,
300,
85,
62,
15252,
62,
5354,
540,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
24162,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
7645,
634,
62,
25927,
41876,
491,
74,
38890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
35943,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
491,
74,
38890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
2213,
62,
15252,
62,
3672,
220,
220,
220,
41876,
4161,
50007,
62,
3672,
13,
628,
220,
220,
220,
300,
85,
62,
2213,
62,
15252,
62,
3672,
796,
21628,
62,
15252,
62,
3672,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
5446,
62,
50084,
62,
9864,
23680,
62,
36840,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
45967,
62,
6024,
13602,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
23065,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
45967,
62,
15252,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
15252,
62,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
45967,
62,
26801,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
2213,
62,
15252,
62,
3672,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
356,
62,
5354,
540,
62,
15252,
220,
220,
796,
300,
85,
62,
15252,
62,
5354,
540,
198,
220,
220,
220,
220,
220,
220,
220,
356,
62,
24162,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
24162,
198,
220,
220,
220,
220,
220,
220,
220,
356,
62,
5354,
62,
2875,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
7645,
634,
62,
25927,
198,
220,
220,
220,
220,
220,
220,
220,
356,
62,
5354,
62,
35943,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
35943,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
6565,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
645,
62,
10057,
3672,
220,
220,
220,
220,
220,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
645,
62,
10057,
4906,
220,
220,
220,
220,
220,
220,
220,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
555,
40845,
62,
5354,
62,
2875,
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,
796,
642,
13,
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,
62,
83,
3064,
7,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
16876,
300,
85,
62,
24162,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
930,
10267,
1391,
21628,
62,
23065,
62,
312,
1782,
12,
90,
21628,
62,
15252,
62,
4906,
1782,
12,
90,
21628,
62,
15252,
62,
3672,
1782,
318,
407,
8970,
91,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
16876,
300,
85,
62,
15252,
62,
5354,
540,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
930,
10267,
2099,
1391,
21628,
62,
23065,
62,
312,
1782,
12,
90,
21628,
62,
15252,
62,
4906,
1782,
407,
5793,
540,
91,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
16876,
300,
85,
62,
35943,
3180,
5626,
3268,
2043,
12576,
5357,
300,
85,
62,
35943,
1279,
29,
300,
85,
62,
7645,
634,
62,
25927,
5357,
21628,
62,
411,
6442,
62,
35943,
62,
1462,
62,
25927,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
7645,
634,
796,
300,
85,
62,
35943,
13,
198,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
7645,
634,
796,
300,
85,
62,
7645,
634,
62,
25927,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
310,
82,
62,
15042,
93,
271,
62,
15252,
62,
24162,
62,
259,
62,
7645,
634,
13,
198,
220,
220,
220,
42865,
25,
43979,
62,
15252,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
41876,
304,
2998,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
4906,
62,
9122,
62,
20274,
41876,
269,
406,
49494,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
5354,
62,
2539,
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,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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
] |
CLASS zcl_yy_apack_manifest DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES: if_apack_manifest.
METHODS: constructor.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_yy_apack_manifest IMPLEMENTATION.
METHOD constructor.
if_apack_manifest~descriptor-group_id = 'sap.com'.
if_apack_manifest~descriptor-artifact_id = 'abap-platform-yy'.
if_apack_manifest~descriptor-version = '0.2'.
if_apack_manifest~descriptor-git_url = 'https://github.com/SAP/abap-platform-yy.git'.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
22556,
62,
499,
441,
62,
805,
8409,
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,
25,
611,
62,
499,
441,
62,
805,
8409,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
23772,
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,
22556,
62,
499,
441,
62,
805,
8409,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
611,
62,
499,
441,
62,
805,
8409,
93,
20147,
1968,
273,
12,
8094,
62,
312,
796,
705,
82,
499,
13,
785,
4458,
198,
220,
220,
220,
611,
62,
499,
441,
62,
805,
8409,
93,
20147,
1968,
273,
12,
433,
29660,
62,
312,
796,
705,
397,
499,
12,
24254,
12,
22556,
4458,
198,
220,
220,
220,
611,
62,
499,
441,
62,
805,
8409,
93,
20147,
1968,
273,
12,
9641,
796,
705,
15,
13,
17,
4458,
198,
220,
220,
220,
611,
62,
499,
441,
62,
805,
8409,
93,
20147,
1968,
273,
12,
18300,
62,
6371,
796,
705,
5450,
1378,
12567,
13,
785,
14,
50,
2969,
14,
397,
499,
12,
24254,
12,
22556,
13,
18300,
4458,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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">OO Tutorial #5 Tester</p>
CLASS ZCL_OO_TUTORIAL_5_TESTER DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES IF_OO_ADT_CLASSRUN.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_OO_TUTORIAL_5_TESTER IMPLEMENTATION.
METHOD IF_OO_ADT_CLASSRUN~MAIN.
TRY.
DATA(AA_0017) = NEW ZCL_OO_TUTORIAL_5(
CARRIER_ID = `AA`
CONNECTION_ID = `0017`
FLIGHT_DATE = `20190530` ).
DATA(FLIGHT_GOOD) = AA_0017->CALCULATE_FLIGHT_PRICE( ).
OUT->WRITE( |Flight Price for AA-0017 on { CONV /DMO/FLIGHT_DATE( `20190530` ) DATE = ENVIRONMENT }: | &&
|{ FLIGHT_GOOD-PRICE CURRENCY = FLIGHT_GOOD-CURRENCY } { FLIGHT_GOOD-CURRENCY }| ).
OUT->WRITE( AA_0017->GET_FLIGHT_DETAILS( ) ).
OUT->WRITE( ` `).
DATA(UA_0017) = NEW ZCL_OO_TUTORIAL_5(
CARRIER_ID = `UA`
CONNECTION_ID = `0017`
FLIGHT_DATE = `20190530` ).
DATA(FLIGHT_BAD) = UA_0017->CALCULATE_FLIGHT_PRICE( ).
OUT->WRITE( |Flight Price for UA-0017 on { CONV /DMO/FLIGHT_DATE( `20190530` ) DATE = ENVIRONMENT }: | &&
|{ FLIGHT_BAD-PRICE CURRENCY = FLIGHT_BAD-CURRENCY } { FLIGHT_BAD-CURRENCY }| ).
OUT->WRITE( UA_0017->GET_FLIGHT_DETAILS( ) ).
CATCH ZCX_OO_TUTORIAL INTO DATA(CX_FLIGHT).
OUT->WRITE( CX_FLIGHT->GET_TEXT( ) ).
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
6684,
36361,
1303,
20,
309,
7834,
3556,
79,
29,
198,
31631,
1168,
5097,
62,
6684,
62,
51,
3843,
1581,
12576,
62,
20,
62,
51,
1546,
5781,
5550,
20032,
17941,
198,
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,
20,
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,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
3838,
62,
405,
1558,
8,
796,
12682,
1168,
5097,
62,
6684,
62,
51,
3843,
1581,
12576,
62,
20,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17368,
7112,
1137,
62,
2389,
220,
220,
220,
796,
4600,
3838,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7102,
45,
24565,
62,
2389,
796,
4600,
405,
1558,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9977,
9947,
62,
35,
6158,
220,
220,
796,
4600,
23344,
2713,
1270,
63,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
3697,
9947,
62,
11230,
3727,
8,
796,
15923,
62,
405,
1558,
3784,
34,
1847,
34,
6239,
6158,
62,
3697,
9947,
62,
4805,
8476,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
16289,
3784,
18564,
12709,
7,
930,
43069,
7886,
329,
15923,
12,
405,
1558,
319,
1391,
220,
7102,
53,
1220,
35,
11770,
14,
3697,
9947,
62,
35,
6158,
7,
4600,
23344,
2713,
1270,
63,
1267,
360,
6158,
796,
12964,
53,
4663,
1340,
10979,
1782,
25,
930,
11405,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
90,
9977,
9947,
62,
11230,
3727,
12,
4805,
8476,
327,
31302,
45155,
796,
9977,
9947,
62,
11230,
3727,
12,
34,
31302,
45155,
1782,
1391,
9977,
9947,
62,
11230,
3727,
12,
34,
31302,
45155,
1782,
91,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
16289,
3784,
18564,
12709,
7,
15923,
62,
405,
1558,
3784,
18851,
62,
3697,
9947,
62,
35,
20892,
45484,
7,
1267,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
16289,
3784,
18564,
12709,
7,
4600,
4600,
737,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
34970,
62,
405,
1558,
8,
796,
12682,
1168,
5097,
62,
6684,
62,
51,
3843,
1581,
12576,
62,
20,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17368,
7112,
1137,
62,
2389,
220,
220,
220,
796,
4600,
34970,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7102,
45,
24565,
62,
2389,
796,
4600,
405,
1558,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9977,
9947,
62,
35,
6158,
220,
220,
796,
4600,
23344,
2713,
1270,
63,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
3697,
9947,
62,
33,
2885,
8,
796,
46164,
62,
405,
1558,
3784,
34,
1847,
34,
6239,
6158,
62,
3697,
9947,
62,
4805,
8476,
7,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
16289,
3784,
18564,
12709,
7,
930,
43069,
7886,
329,
46164,
12,
405,
1558,
319,
1391,
220,
7102,
53,
1220,
35,
11770,
14,
3697,
9947,
62,
35,
6158,
7,
4600,
23344,
2713,
1270,
63,
1267,
360,
6158,
796,
12964,
53,
4663,
1340,
10979,
1782,
25,
930,
11405,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
90,
9977,
9947,
62,
33,
2885,
12,
4805,
8476,
327,
31302,
45155,
796,
9977,
9947,
62,
33,
2885,
12,
34,
31302,
45155,
1782,
1391,
9977,
9947,
62,
33,
2885,
12,
34,
31302,
45155,
1782,
91,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
16289,
3784,
18564,
12709,
7,
46164,
62,
405,
1558,
3784,
18851,
62,
3697,
9947,
62,
35,
20892,
45484,
7,
1267,
6739,
628,
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,
16289,
3784,
18564,
12709,
7,
220,
327,
55,
62,
3697,
9947,
3784,
18851,
62,
32541,
7,
220,
1267,
6739,
198,
220,
220,
220,
23578,
40405,
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,
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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
] |
*---------------------------------------------------------------------*
* program for: VIEWFRAME_ZFLIFMV_LAYOUT
* generation date: 2021.07.15 at 23:39:10
* view maintenance generator version: #001407#
*---------------------------------------------------------------------*
FUNCTION VIEWFRAME_ZFLIFMV_LAYOUT .
DATA: ENQUEUE_PROCESSED TYPE C. "flag: view enqueued by VIEWFRAME_...
*-<<<-------------------------------------------------------------->>>>*
* Entrypoint after changing maintenance mode (show <--> update) *
*-<<<-------------------------------------------------------------->>>>*
DO.
*----------------------------------------------------------------------*
* Select data from database *
*----------------------------------------------------------------------*
CALL FUNCTION 'VIEWPROC_ZFLIFMV_LAYOUT'
EXPORTING
FCODE = READ
VIEW_ACTION = VIEW_ACTION
VIEW_NAME = VIEW_NAME
TABLES
EXCL_CUA_FUNCT = EXCL_CUA_FUNCT
EXTRACT = ZFLIFMV_LAYOUT_EXTRACT
TOTAL = ZFLIFMV_LAYOUT_TOTAL
X_HEADER = X_HEADER
X_NAMTAB = X_NAMTAB
DBA_SELLIST = DBA_SELLIST
DPL_SELLIST = DPL_SELLIST
CORR_KEYTAB = E071K_TAB
EXCEPTIONS
MISSING_CORR_NUMBER = 1
NO_VALUE_FOR_SUBSET_IDENT = 2.
CASE SY-SUBRC.
WHEN 1.
RAISE MISSING_CORR_NUMBER.
WHEN 2.
RAISE NO_VALUE_FOR_SUBSET_IDENT.
ENDCASE.
*-<<<-------------------------------------------------------------->>>>*
* Entrypoint after saving data into database *
* Entrypoint after refreshing selected entries from database *
*-<<<-------------------------------------------------------------->>>>*
DO.
*----------------------------------------------------------------------*
* Edit data *
*----------------------------------------------------------------------*
DO.
CALL FUNCTION 'VIEWPROC_ZFLIFMV_LAYOUT'
EXPORTING
FCODE = EDIT
VIEW_ACTION = MAINT_MODE
VIEW_NAME = VIEW_NAME
CORR_NUMBER = CORR_NUMBER
IMPORTING
UCOMM = FUNCTION
UPDATE_REQUIRED = STATUS_ZFLIFMV_LAYOUT-UPD_FLAG
TABLES
EXCL_CUA_FUNCT = EXCL_CUA_FUNCT
EXTRACT = ZFLIFMV_LAYOUT_EXTRACT
TOTAL = ZFLIFMV_LAYOUT_TOTAL
X_HEADER = X_HEADER
X_NAMTAB = X_NAMTAB
DBA_SELLIST = DBA_SELLIST
DPL_SELLIST = DPL_SELLIST
CORR_KEYTAB = E071K_TAB
EXCEPTIONS
MISSING_CORR_NUMBER = 1
NO_VALUE_FOR_SUBSET_IDENT = 2.
CASE SY-SUBRC.
WHEN 1.
IF MAINT_MODE EQ TRANSPORTIEREN AND VIEW_ACTION EQ AENDERN.
MOVE VIEW_ACTION TO MAINT_MODE.
ELSE.
PERFORM BEFORE_LEAVING_FRAME_FUNCTION
USING X_HEADER-FRM_BF_END.
RAISE MISSING_CORR_NUMBER.
ENDIF.
WHEN 2.
RAISE NO_VALUE_FOR_SUBSET_IDENT.
WHEN OTHERS.
EXIT.
ENDCASE.
ENDDO.
*----------------------------------------------------------------------*
* Handle usercommands... *
* ...at first handle commands which could cause loss of data *
*----------------------------------------------------------------------*
IF FUNCTION EQ BACK. FUNCTION = END. ENDIF.
IF ( FUNCTION EQ SWITCH_TO_SHOW_MODE OR
FUNCTION EQ GET_ANOTHER_VIEW OR
FUNCTION EQ SWITCH_TRANSP_TO_UPD_MODE OR
FUNCTION EQ END ) AND
STATUS_ZFLIFMV_LAYOUT-UPD_FLAG NE SPACE.
PERFORM BEENDEN.
CASE SY-SUBRC.
WHEN 0.
CALL FUNCTION 'VIEWPROC_ZFLIFMV_LAYOUT'
EXPORTING
FCODE = SAVE
VIEW_ACTION = MAINT_MODE
VIEW_NAME = VIEW_NAME
CORR_NUMBER = CORR_NUMBER
IMPORTING
UPDATE_REQUIRED = STATUS_ZFLIFMV_LAYOUT-UPD_FLAG
TABLES
EXCL_CUA_FUNCT = EXCL_CUA_FUNCT
EXTRACT = ZFLIFMV_LAYOUT_EXTRACT
TOTAL = ZFLIFMV_LAYOUT_TOTAL
X_HEADER = X_HEADER
X_NAMTAB = X_NAMTAB
DBA_SELLIST = DBA_SELLIST
DPL_SELLIST = DPL_SELLIST
CORR_KEYTAB = E071K_TAB
EXCEPTIONS
MISSING_CORR_NUMBER = 1
NO_VALUE_FOR_SUBSET_IDENT = 2
SAVING_CORRECTION_FAILED = 3.
CASE SY-SUBRC.
WHEN 0.
IF STATUS_ZFLIFMV_LAYOUT-UPD_FLAG EQ SPACE. EXIT. ENDIF.
WHEN 1. RAISE MISSING_CORR_NUMBER.
WHEN 2. RAISE NO_VALUE_FOR_SUBSET_IDENT.
WHEN 3.
ENDCASE.
WHEN 8. EXIT.
WHEN 12.
ENDCASE.
*----------------------------------------------------------------------*
* ...2nd: transport request *
*----------------------------------------------------------------------*
ELSEIF FUNCTION EQ TRANSPORT.
IF STATUS_ZFLIFMV_LAYOUT-UPD_FLAG NE SPACE.
PERFORM TRANSPORTIEREN.
CASE SY-SUBRC.
WHEN 0.
CALL FUNCTION 'VIEWPROC_ZFLIFMV_LAYOUT'
EXPORTING
FCODE = SAVE
VIEW_ACTION = MAINT_MODE
VIEW_NAME = VIEW_NAME
CORR_NUMBER = CORR_NUMBER
IMPORTING
UPDATE_REQUIRED =
STATUS_ZFLIFMV_LAYOUT-UPD_FLAG
TABLES
EXCL_CUA_FUNCT = EXCL_CUA_FUNCT
EXTRACT = ZFLIFMV_LAYOUT_EXTRACT
TOTAL = ZFLIFMV_LAYOUT_TOTAL
X_HEADER = X_HEADER
X_NAMTAB = X_NAMTAB
DBA_SELLIST = DBA_SELLIST
DPL_SELLIST = DPL_SELLIST
CORR_KEYTAB = E071K_TAB
EXCEPTIONS
MISSING_CORR_NUMBER = 1
NO_VALUE_FOR_SUBSET_IDENT = 2
SAVING_CORRECTION_FAILED = 3.
CASE SY-SUBRC.
WHEN 0. MAINT_MODE = TRANSPORTIEREN.
WHEN 1. RAISE MISSING_CORR_NUMBER.
WHEN 2. RAISE NO_VALUE_FOR_SUBSET_IDENT.
WHEN 3.
ENDCASE.
WHEN 8.
EXIT.
WHEN 12.
ENDCASE.
ELSE.
MAINT_MODE = TRANSPORTIEREN.
ENDIF.
*----------------------------------------------------------------------*
* ...now reset or save requests *
*----------------------------------------------------------------------*
ELSEIF FUNCTION EQ RESET_LIST OR
FUNCTION EQ RESET_ENTRY OR
FUNCTION EQ SAVE.
*----------------------------------------------------------------------*
* Refresh selected entries from database or save data into database *
*----------------------------------------------------------------------*
CALL FUNCTION 'VIEWPROC_ZFLIFMV_LAYOUT'
EXPORTING
FCODE = FUNCTION
VIEW_ACTION = MAINT_MODE
VIEW_NAME = VIEW_NAME
CORR_NUMBER = CORR_NUMBER
IMPORTING
UPDATE_REQUIRED = STATUS_ZFLIFMV_LAYOUT-UPD_FLAG
TABLES
EXCL_CUA_FUNCT = EXCL_CUA_FUNCT
EXTRACT = ZFLIFMV_LAYOUT_EXTRACT
TOTAL = ZFLIFMV_LAYOUT_TOTAL
X_HEADER = X_HEADER
X_NAMTAB = X_NAMTAB
DBA_SELLIST = DBA_SELLIST
DPL_SELLIST = DPL_SELLIST
CORR_KEYTAB = E071K_TAB
EXCEPTIONS
MISSING_CORR_NUMBER = 1
NO_VALUE_FOR_SUBSET_IDENT = 2
SAVING_CORRECTION_FAILED = 3.
CASE SY-SUBRC.
WHEN 1. RAISE MISSING_CORR_NUMBER.
WHEN 2. RAISE NO_VALUE_FOR_SUBSET_IDENT.
WHEN 3.
ENDCASE.
ELSE.
EXIT.
ENDIF.
ENDDO.
*----------------------------------------------------------------------*
* ...now other commands... *
*----------------------------------------------------------------------*
CASE FUNCTION.
WHEN SWITCH_TO_SHOW_MODE.
* change maintenance mode from update to show
PERFORM ENQUEUE USING 'D' X_HEADER-FRM_AF_ENQ. "dequeue view
CLEAR ENQUEUE_PROCESSED.
VIEW_ACTION = ANZEIGEN.
WHEN SWITCH_TO_UPDATE_MODE.
* change maintenance mode from show to update
PERFORM ENQUEUE USING 'E' X_HEADER-FRM_AF_ENQ. "enqueue view
IF SY-SUBRC EQ 0.
MOVE 'X' TO ENQUEUE_PROCESSED.
VIEW_ACTION = AENDERN.
ENDIF.
WHEN SWITCH_TRANSP_TO_UPD_MODE.
* change maintenance mode from transport to update
VIEW_ACTION = AENDERN.
WHEN TRANSPORT.
* change maintenance mode from update to transport
VIEW_ACTION = TRANSPORTIEREN.
WHEN OTHERS.
IF ENQUEUE_PROCESSED NE SPACE.
PERFORM ENQUEUE USING 'D' X_HEADER-FRM_AF_ENQ. "dequeue view
ENDIF.
PERFORM BEFORE_LEAVING_FRAME_FUNCTION USING X_HEADER-FRM_BF_END.
EXIT.
ENDCASE.
ENDDO.
ENDFUNCTION.
| [
9,
10097,
30934,
9,
198,
9,
220,
220,
220,
1430,
329,
25,
220,
220,
49880,
10913,
10067,
62,
57,
3697,
5064,
44,
53,
62,
43,
4792,
12425,
198,
9,
220,
220,
5270,
3128,
25,
33448,
13,
2998,
13,
1314,
379,
2242,
25,
2670,
25,
940,
198,
9,
220,
220,
1570,
9262,
17301,
2196,
25,
1303,
405,
1415,
2998,
2,
198,
9,
10097,
30934,
9,
198,
42296,
4177,
2849,
49880,
10913,
10067,
62,
57,
3697,
5064,
44,
53,
62,
43,
4792,
12425,
220,
220,
220,
220,
220,
764,
628,
220,
42865,
25,
12964,
48,
8924,
8924,
62,
4805,
4503,
7597,
1961,
41876,
327,
13,
366,
32109,
25,
1570,
551,
4188,
1739,
416,
49880,
10913,
10067,
62,
986,
198,
198,
9,
12,
16791,
27,
47232,
26171,
16471,
9,
198,
9,
21617,
4122,
706,
5609,
9262,
4235,
357,
12860,
1279,
46904,
4296,
8,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
12,
16791,
27,
47232,
26171,
16471,
9,
198,
220,
8410,
13,
198,
9,
10097,
23031,
9,
198,
9,
9683,
1366,
422,
6831,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
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,
9,
10097,
23031,
9,
198,
34,
7036,
29397,
4177,
2849,
705,
28206,
4805,
4503,
62,
57,
3697,
5064,
44,
53,
62,
43,
4792,
12425,
6,
198,
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,
10029,
16820,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
20832,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49880,
62,
44710,
220,
220,
220,
796,
49880,
62,
44710,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49880,
62,
20608,
220,
220,
220,
220,
220,
796,
49880,
62,
20608,
198,
220,
220,
220,
220,
220,
220,
220,
220,
309,
6242,
28378,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
5097,
62,
34,
34970,
62,
42296,
4177,
796,
7788,
5097,
62,
34,
34970,
62,
42296,
4177,
198,
6369,
5446,
10659,
796,
1168,
3697,
5064,
44,
53,
62,
43,
4792,
12425,
62,
6369,
5446,
10659,
198,
51,
27510,
796,
1168,
3697,
5064,
44,
53,
62,
43,
4792,
12425,
62,
51,
27510,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1395,
62,
37682,
1137,
220,
220,
220,
220,
220,
220,
796,
1395,
62,
37682,
1137,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1395,
62,
45,
2390,
5603,
33,
220,
220,
220,
220,
220,
220,
796,
1395,
62,
45,
2390,
5603,
33,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
360,
4339,
62,
5188,
3069,
8808,
220,
220,
220,
796,
360,
4339,
62,
5188,
3069,
8808,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
360,
6489,
62,
5188,
3069,
8808,
220,
220,
220,
796,
360,
6489,
62,
5188,
3069,
8808,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23929,
49,
62,
20373,
5603,
33,
220,
220,
220,
796,
412,
2998,
16,
42,
62,
5603,
33,
198,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49684,
2751,
62,
44879,
49,
62,
41359,
13246,
220,
220,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8005,
62,
39488,
62,
13775,
62,
12564,
4462,
2767,
62,
25256,
796,
362,
13,
198,
220,
220,
220,
42001,
19704,
12,
50,
10526,
7397,
13,
198,
220,
220,
220,
220,
220,
42099,
352,
13,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
24352,
49684,
2751,
62,
44879,
49,
62,
41359,
13246,
13,
198,
220,
220,
220,
220,
220,
42099,
362,
13,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
24352,
8005,
62,
39488,
62,
13775,
62,
12564,
4462,
2767,
62,
25256,
13,
198,
220,
220,
220,
23578,
34,
11159,
13,
198,
9,
12,
16791,
27,
47232,
26171,
16471,
9,
198,
9,
21617,
4122,
706,
8914,
1366,
656,
6831,
220,
220,
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,
9,
21617,
4122,
706,
23056,
6163,
12784,
422,
6831,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
12,
16791,
27,
47232,
26171,
16471,
9,
198,
220,
220,
220,
8410,
13,
198,
9,
10097,
23031,
9,
198,
9,
5312,
1366,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
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,
9,
10097,
23031,
9,
198,
220,
220,
220,
220,
220,
8410,
13,
198,
34,
7036,
29397,
4177,
2849,
705,
28206,
4805,
4503,
62,
57,
3697,
5064,
44,
53,
62,
43,
4792,
12425,
6,
198,
220,
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,
220,
220,
220,
220,
10029,
16820,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
48483,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49880,
62,
44710,
220,
220,
220,
220,
796,
8779,
12394,
62,
49058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49880,
62,
20608,
220,
220,
220,
220,
220,
220,
796,
49880,
62,
20608,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23929,
49,
62,
41359
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS kernel_ixml_xml_to_data DEFINITION PUBLIC.
PUBLIC SECTION.
CLASS-METHODS build
IMPORTING
iv_name TYPE string
iv_ref TYPE REF TO data
ii_doc TYPE REF TO if_ixml_document.
PRIVATE SECTION.
CLASS-METHODS traverse
IMPORTING
ii_node TYPE REF TO if_ixml_node
iv_ref TYPE REF TO data.
ENDCLASS.
CLASS kernel_ixml_xml_to_data IMPLEMENTATION.
METHOD build.
DATA li_first TYPE REF TO if_ixml_element.
DATA li_node TYPE REF TO if_ixml_node.
DATA lv_name TYPE string.
DATA li_iterator TYPE REF TO if_ixml_node_iterator.
li_first ?= ii_doc->get_root( )->get_first_child( ).
li_node = li_first->find_from_name_ns(
name = iv_name
depth = 0
namespace = '' ).
IF li_node IS NOT INITIAL.
* WRITE '@KERNEL console.dir("found");'.
traverse( ii_node = li_node
iv_ref = iv_ref ).
* ELSE.
* WRITE '@KERNEL console.dir("nah");'.
ENDIF.
ENDMETHOD.
METHOD traverse.
DATA lo_type TYPE REF TO cl_abap_typedescr.
DATA li_child TYPE REF TO if_ixml_node.
DATA lv_name TYPE string.
DATA li_iterator TYPE REF TO if_ixml_node_iterator.
DATA lv_ref TYPE REF TO data.
FIELD-SYMBOLS <any> TYPE any.
FIELD-SYMBOLS <field> TYPE any.
FIELD-SYMBOLS <tab> TYPE ANY TABLE.
lo_type = cl_abap_typedescr=>describe_by_data( iv_ref->* ).
CASE lo_type->kind.
WHEN cl_abap_typedescr=>kind_struct.
ASSIGN iv_ref->* TO <any>.
li_iterator = ii_node->get_children( )->create_iterator( ).
DO.
li_child = li_iterator->get_next( ).
IF li_child IS INITIAL.
EXIT. " current loop
ENDIF.
lv_name = li_child->get_name( ).
ASSIGN COMPONENT lv_name OF STRUCTURE <any> TO <field>.
IF sy-subrc = 0.
GET REFERENCE OF <field> INTO lv_ref.
traverse( ii_node = li_child
iv_ref = lv_ref ).
ENDIF.
ENDDO.
WHEN cl_abap_typedescr=>kind_elem.
li_child = ii_node->get_first_child( ).
ASSIGN iv_ref->* TO <any>.
<any> = li_child->get_value( ).
WHEN cl_abap_typedescr=>kind_table.
ASSIGN iv_ref->* TO <tab>.
li_iterator = ii_node->get_children( )->create_iterator( ).
DO.
li_child = li_iterator->get_next( ).
IF li_child IS INITIAL.
EXIT. " current loop
ENDIF.
CREATE DATA lv_ref LIKE LINE OF <tab>.
ASSIGN lv_ref->* TO <any>.
traverse( ii_node = li_child
iv_ref = lv_ref ).
INSERT <any> INTO TABLE <tab>.
ENDDO.
WHEN OTHERS.
WRITE '@KERNEL console.dir(lo_type.get().kind.get());'.
ENDCASE.
ENDMETHOD.
ENDCLASS. | [
31631,
9720,
62,
844,
4029,
62,
19875,
62,
1462,
62,
7890,
5550,
20032,
17941,
44731,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
1382,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
220,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3672,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
5420,
220,
41876,
4526,
37,
5390,
1366,
198,
220,
220,
220,
220,
220,
220,
220,
21065,
62,
15390,
220,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
22897,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
38138,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
220,
198,
220,
220,
220,
220,
220,
220,
220,
21065,
62,
17440,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
17440,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
5420,
220,
41876,
4526,
37,
5390,
1366,
13,
198,
10619,
31631,
13,
198,
198,
31631,
9720,
62,
844,
4029,
62,
19875,
62,
1462,
62,
7890,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
1382,
13,
628,
220,
220,
220,
42865,
7649,
62,
11085,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
13,
198,
220,
220,
220,
42865,
7649,
62,
17440,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
17440,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
3672,
41876,
4731,
13,
198,
220,
220,
220,
42865,
7649,
62,
48727,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
17440,
62,
48727,
13,
198,
220,
220,
220,
220,
198,
220,
220,
220,
7649,
62,
11085,
5633,
28,
21065,
62,
15390,
3784,
1136,
62,
15763,
7,
1267,
3784,
1136,
62,
11085,
62,
9410,
7,
6739,
198,
220,
198,
220,
220,
220,
7649,
62,
17440,
796,
7649,
62,
11085,
3784,
19796,
62,
6738,
62,
3672,
62,
5907,
7,
198,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
796,
21628,
62,
3672,
198,
220,
220,
220,
220,
220,
6795,
220,
220,
220,
220,
796,
657,
198,
220,
220,
220,
220,
220,
25745,
796,
10148,
6739,
198,
220,
220,
220,
16876,
7649,
62,
17440,
3180,
5626,
3268,
2043,
12576,
13,
198,
9,
220,
220,
220,
220,
220,
44423,
705,
31,
42,
28778,
3698,
8624,
13,
15908,
7203,
9275,
15341,
4458,
198,
220,
220,
220,
220,
220,
38138,
7,
21065,
62,
17440,
796,
7649,
62,
17440,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
5420,
220,
796,
21628,
62,
5420,
6739,
198,
9,
220,
220,
220,
17852,
5188,
13,
198,
9,
220,
220,
220,
220,
220,
44423,
705,
31,
42,
28778,
3698,
8624,
13,
15908,
7203,
40909,
15341,
4458,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
38138,
13,
628,
220,
220,
220,
42865,
2376,
62,
4906,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
774,
9124,
3798,
81,
13,
198,
220,
220,
220,
42865,
7649,
62,
9410,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
17440,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
3672,
41876,
4731,
13,
198,
220,
220,
220,
42865,
7649,
62,
48727,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
17440,
62,
48727,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
5420,
41876,
4526,
37,
5390,
1366,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
1279,
1092,
29,
41876,
597,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
1279,
3245,
29,
41876,
597,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
1279,
8658,
29,
41876,
15529,
43679,
13,
198,
220,
220,
220,
220,
198,
220,
220,
220,
2376,
62,
4906,
796,
537,
62,
397,
499,
62,
774,
9124,
3798,
81,
14804,
20147,
4892,
62,
1525,
62,
7890,
7,
21628,
62,
5420,
3784,
9,
6739,
198,
220,
220,
220,
42001,
2376,
62,
4906,
3784,
11031,
13,
198,
220,
220,
220,
220,
220,
42099,
537,
62,
397,
499,
62,
774,
9124,
3798,
81,
14804,
11031,
62,
7249,
13,
198,
220,
220,
220,
220,
220,
220,
220,
24994,
16284,
21628,
62,
5420,
3784,
9,
5390,
1279,
1092,
28401,
198,
220,
220,
220,
220,
220,
220,
220,
7649,
62,
48727,
796,
21065,
62,
17440,
3784,
1136,
62,
17197,
7,
1267,
3784,
17953,
62,
48727,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
8410,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7649,
62,
9410,
796,
7649,
62,
48727,
3784,
1136,
62,
19545,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16876,
7649,
62,
9410,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
2043,
13,
366,
1459,
9052,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
3672,
796,
7649,
62,
9410,
3784,
1136,
62,
3672,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24994,
16284,
24301,
1340,
3525,
300,
85,
62,
3672,
3963,
19269,
18415,
11335,
1279,
1092,
29,
5390,
1279,
3245,
28401,
198,
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,
17151,
4526,
24302,
18310,
3963,
1279,
3245,
29,
39319,
300,
85,
62,
5420,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
38138,
7,
21065,
62,
17440,
796,
7649,
62,
9410,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
5420,
220,
796,
300,
85,
62,
5420,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
220,
220,
220,
220,
23578,
18227,
13,
198,
220,
220,
220,
220,
220,
42099,
537,
62,
397,
499,
62,
774,
9124,
3798,
81,
14804,
11031,
62,
68,
10671,
13,
198,
220,
220,
220,
220,
220,
220,
220,
7649,
62,
9410,
796,
21065,
62,
17440,
3784,
1136,
62,
11085,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_object_char DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_objects_super
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_object .
PRIVATE SECTION.
TYPES:
BEGIN OF ty_char,
cls_attribute TYPE cls_attribute,
cls_attributet TYPE STANDARD TABLE OF cls_attributet WITH DEFAULT KEY,
cls_attr_value TYPE STANDARD TABLE OF cls_attr_value WITH DEFAULT KEY,
cls_attr_valuet TYPE STANDARD TABLE OF cls_attr_valuet WITH DEFAULT KEY,
END OF ty_char .
METHODS instantiate_char
IMPORTING
!iv_type_group TYPE cls_object_type_group
RETURNING
VALUE(ro_char) TYPE REF TO cl_cls_attribute
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_CHAR IMPLEMENTATION.
METHOD instantiate_char.
DATA: lv_new TYPE abap_bool,
lv_name TYPE cls_attribute_name.
SELECT SINGLE name FROM cls_attribute INTO lv_name WHERE name = ms_item-obj_name.
lv_new = boolc( sy-subrc <> 0 ).
lv_name = ms_item-obj_name.
TRY.
CREATE OBJECT ro_char
EXPORTING
im_name = lv_name
im_type_group = iv_type_group
im_new = lv_new.
CATCH cx_pak_invalid_data
cx_pak_not_authorized
cx_pak_invalid_state
cx_pak_wb_object_locked.
zcx_abapgit_exception=>raise( 'Error while instantiating CL_CLS_ATTRIBUTE' ).
ENDTRY.
IF lv_new = abap_false.
TRY.
ro_char->if_pak_wb_object~lock_and_refresh( ).
CATCH cx_pak_invalid_data
cx_pak_not_authorized
cx_pak_invalid_state
cx_pak_wb_object_locked.
zcx_abapgit_exception=>raise( |Could not aquire lock, CHAR { lv_name }| ).
ENDTRY.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
SELECT SINGLE changed_by FROM cls_attribute INTO rv_user
WHERE name = ms_item-obj_name
AND activation_state = 'A'.
IF rv_user IS INITIAL.
SELECT SINGLE created_by FROM cls_attribute INTO rv_user
WHERE name = ms_item-obj_name
AND activation_state = 'A'.
ENDIF.
IF rv_user IS INITIAL.
rv_user = c_user_unknown.
ENDIF.
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: lo_char TYPE REF TO cl_cls_attribute,
lv_type_group TYPE cls_attribute-type_group,
lx_pak_error TYPE REF TO cx_root,
lv_text TYPE string.
SELECT SINGLE type_group FROM cls_attribute INTO lv_type_group
WHERE name = ms_item-obj_name
AND activation_state = 'A'.
lo_char = instantiate_char( lv_type_group ).
TRY.
lo_char->if_pak_wb_object~delete( ).
lo_char->if_pak_wb_object~save( ).
lo_char->if_pak_wb_object_internal~unlock( ).
CATCH cx_pak_invalid_state cx_pak_invalid_data cx_pak_not_authorized INTO lx_pak_error.
lv_text = lx_pak_error->get_text( ).
zcx_abapgit_exception=>raise( lv_text ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_char TYPE ty_char,
ls_description LIKE LINE OF ls_char-cls_attributet,
lo_char TYPE REF TO cl_cls_attribute,
lx_pak_error TYPE REF TO cx_root,
lv_text TYPE string.
FIELD-SYMBOLS: <ls_value> LIKE LINE OF ls_char-cls_attr_value,
<ls_valuet> LIKE LINE OF ls_char-cls_attr_valuet.
io_xml->read( EXPORTING iv_name = 'CHAR'
CHANGING cg_data = ls_char ).
tadir_insert( iv_package ).
lo_char = instantiate_char( ls_char-cls_attribute-type_group ).
TRY.
lo_char->if_cls_attribute~set_kind( ls_char-cls_attribute-kind ).
lo_char->if_cls_attribute~set_single_valued( ls_char-cls_attribute-is_single_valued ).
lo_char->if_cls_attribute~set_aspect(
im_aspect_for = ls_char-cls_attribute-is_aspect_for
im_aspect_value = ls_char-cls_attribute-aspect_value ).
lo_char->if_cls_attribute~set_default_flag( ls_char-cls_attribute-default_flag ).
lo_char->if_cls_attribute~set_default_value( ls_char-cls_attribute-default_value ).
lo_char->if_cls_attribute~set_sub_object_treatment( ls_char-cls_attribute-sub_obj_treatm ).
lo_char->if_cls_attribute~set_automatic_changes_allowed( ls_char-cls_attribute-automatic_change ).
lo_char->if_cls_attribute~set_manual_changes_allowed( ls_char-cls_attribute-manu_chag_allow ).
lo_char->if_cls_attribute~set_implicit_changes_allowed( ls_char-cls_attribute-implicit_change ).
lo_char->if_cls_attribute~set_expl_values_dominate_links( ls_char-cls_attribute-weak_links ).
lo_char->if_cls_attribute~set_assignment_package_rule( ls_char-cls_attribute-assignment_devc ).
lo_char->if_cls_attribute~set_hide_remark( ls_char-cls_attribute-hide_remark ).
lo_char->if_cls_attribute~set_visible_in_customer_system( ls_char-cls_attribute-visible_for_cust ).
lo_char->if_cls_attribute~set_value_table( ls_char-cls_attribute-value_table ).
lo_char->if_cls_attribute~set_vtable_field( ls_char-cls_attribute-vtable_field ).
lo_char->if_cls_attribute~set_vtable_icon_f( ls_char-cls_attribute-vtable_icon_f ).
lo_char->if_cls_attribute~set_vtext_langu_f( ls_char-cls_attribute-vtext_langu_f ).
lo_char->if_cls_attribute~set_vtext_table( ls_char-cls_attribute-vtext_table ).
lo_char->if_cls_attribute~set_vtext_text_f( ls_char-cls_attribute-vtext_text_f ).
lo_char->if_cls_attribute~set_vtext_value_f( ls_char-cls_attribute-vtext_value_f ).
lo_char->if_cls_attribute~set_existing_objects_only( ls_char-cls_attribute-existing_objects ).
lo_char->if_cls_attribute~set_objs_of_typegr( ls_char-cls_attribute-objs_of_typegr ).
lo_char->if_cls_attribute~set_obj_values_have_subtypes( ls_char-cls_attribute-objs_w_subtype ).
lo_char->if_cls_attribute~set_arbtry_val_type( ls_char-cls_attribute-arbtry_val_type ).
READ TABLE ls_char-cls_attributet INTO ls_description WITH KEY langu = sy-langu.
IF sy-subrc <> 0.
READ TABLE ls_char-cls_attributet INTO ls_description INDEX 1.
ENDIF.
lo_char->if_cls_attribute~set_description( ls_description-text ).
LOOP AT ls_char-cls_attr_value ASSIGNING <ls_value>.
<ls_value>-activation_state = 'I'.
ENDLOOP.
LOOP AT ls_char-cls_attr_valuet ASSIGNING <ls_valuet>.
<ls_valuet>-activation_state = 'I'.
ENDLOOP.
lo_char->if_cls_attribute~set_values(
im_values = ls_char-cls_attr_value
im_values_t = ls_char-cls_attr_valuet ).
set_default_package( iv_package ).
lo_char->if_pak_wb_object~save( ).
lo_char->if_pak_wb_object~activate( ).
lo_char->if_pak_wb_object_internal~unlock( ).
CATCH cx_pak_invalid_state cx_pak_invalid_data cx_pak_not_authorized INTO lx_pak_error.
lv_text = lx_pak_error->get_text( ).
zcx_abapgit_exception=>raise( lv_text ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
rv_bool = cl_cls_attribute=>exists_object_attribute( ms_item-obj_name ).
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_locked.
rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'ECLS_ATTRIBUTE'
iv_argument = |{ ms_item-obj_name }*| ).
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
EXCEPTIONS
not_executed = 1
invalid_object_type = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from RS_TOOL_ACCESS, CHAR| ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_char TYPE ty_char.
CONSTANTS: lc_active TYPE c LENGTH 1 VALUE 'A'.
SELECT SINGLE * FROM cls_attribute INTO ls_char-cls_attribute
WHERE name = ms_item-obj_name
AND activation_state = lc_active.
* todo, ASSIGNMENT_DEVC?
CLEAR: ls_char-cls_attribute-created_by,
ls_char-cls_attribute-created_on,
ls_char-cls_attribute-changed_by,
ls_char-cls_attribute-changed_on.
SELECT * FROM cls_attributet INTO TABLE ls_char-cls_attributet
WHERE name = ms_item-obj_name
AND activation_state = lc_active.
SELECT * FROM cls_attr_value INTO TABLE ls_char-cls_attr_value
WHERE name = ms_item-obj_name
AND activation_state = lc_active.
SELECT * FROM cls_attr_valuet INTO TABLE ls_char-cls_attr_valuet
WHERE name = ms_item-obj_name
AND activation_state = lc_active.
io_xml->add( iv_name = 'CHAR'
ig_data = ls_char ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
10641,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
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,
397,
499,
18300,
62,
15252,
764,
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,
10641,
11,
198,
220,
220,
220,
220,
220,
220,
220,
537,
82,
62,
42348,
220,
220,
41876,
537,
82,
62,
42348,
11,
198,
220,
220,
220,
220,
220,
220,
220,
537,
82,
62,
1078,
2455,
316,
220,
41876,
49053,
9795,
43679,
3963,
537,
82,
62,
1078,
2455,
316,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
537,
82,
62,
35226,
62,
8367,
220,
41876,
49053,
9795,
43679,
3963,
537,
82,
62,
35226,
62,
8367,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
537,
82,
62,
35226,
62,
2100,
84,
316,
41876,
49053,
9795,
43679,
3963,
537,
82,
62,
35226,
62,
2100,
84,
316,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
10641,
764,
628,
220,
220,
220,
337,
36252,
50,
9113,
9386,
62,
10641,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
4906,
62,
8094,
41876,
537,
82,
62,
15252,
62,
4906,
62,
8094,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
10641,
8,
41876,
4526,
37,
5390,
537,
62,
565,
82,
62,
42348,
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,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
38019,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
9113,
9386,
62,
10641,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
3605,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
3672,
41876,
537,
82,
62,
42348,
62,
3672,
13,
628,
198,
220,
220,
220,
33493,
311,
2751,
2538,
1438,
16034,
537,
82,
62,
42348,
39319,
300,
85,
62,
3672,
33411,
1438,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
198,
220,
220,
220,
300,
85,
62,
3605,
796,
20512,
66,
7,
827,
12,
7266,
6015,
1279,
29,
657,
6739,
198,
220,
220,
220,
300,
85,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
686,
62,
10641,
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,
3672,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
545,
62,
4906,
62,
8094,
796,
21628,
62,
4906,
62,
8094,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
545,
62,
3605,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
3605,
13,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
41091,
62,
259,
12102,
62,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
41091,
62,
1662,
62,
19721,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
41091,
62,
259,
12102,
62,
5219,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
41091,
62,
39346,
62,
15252,
62,
24162,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
12331,
981,
9113,
26336,
7852,
62,
5097,
50,
62,
1404,
5446,
9865,
37780,
6,
6739,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
220,
220,
16876,
300,
85,
62,
3605,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
686,
62,
10641,
3784,
361,
62,
41091,
62,
39346,
62,
15252,
93,
5354,
62,
392,
62,
5420,
3447,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
41091,
62,
259,
12102,
62,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
41091,
62,
1662,
62,
19721,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
41091,
62,
259,
12102,
62,
5219,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
41091,
62,
39346,
62,
15252,
62,
24162,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
930,
23722,
407,
14839,
557,
5793,
11,
28521,
1391,
300,
85,
62,
3672,
1782,
91,
6739,
198,
220,
220,
220,
220,
220,
23578,
40405,
13,
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,
33493,
311,
2751,
2538,
3421,
62,
1525,
16034,
537,
82,
62,
42348,
39319,
374,
85,
62,
7220,
198,
220,
220,
220,
220,
220,
33411,
1438,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
5357,
14916,
62,
5219,
796,
705,
32,
4458,
628,
220,
220,
220,
16876,
374,
85,
62,
7220,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
33493,
311,
2751,
2538,
2727,
62,
1525,
16034,
537,
82,
62,
42348,
39319,
374,
85,
62,
7220,
198,
220,
220,
220,
220,
220,
220,
220,
33411,
1438,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
5357,
14916,
62,
5219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,
1
] |
CLASS zcl_abapgit_repo DEFINITION
PUBLIC
ABSTRACT
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_repo.
ALIASES ms_data FOR zif_abapgit_repo~ms_data.
ALIASES:
get_key FOR zif_abapgit_repo~get_key,
get_name FOR zif_abapgit_repo~get_name,
is_offline FOR zif_abapgit_repo~is_offline,
get_package FOR zif_abapgit_repo~get_package,
get_files_local FOR zif_abapgit_repo~get_files_local,
get_files_remote FOR zif_abapgit_repo~get_files_remote,
get_local_settings FOR zif_abapgit_repo~get_local_settings,
refresh FOR zif_abapgit_repo~refresh,
get_dot_abapgit FOR zif_abapgit_repo~get_dot_abapgit,
set_dot_abapgit FOR zif_abapgit_repo~set_dot_abapgit,
deserialize FOR zif_abapgit_repo~deserialize,
deserialize_checks FOR zif_abapgit_repo~deserialize_checks.
METHODS constructor
IMPORTING
!is_data TYPE zif_abapgit_persistence=>ty_repo .
METHODS bind_listener
IMPORTING
!ii_listener TYPE REF TO zif_abapgit_repo_listener .
METHODS delete_checks
RETURNING
VALUE(rs_checks) TYPE zif_abapgit_definitions=>ty_delete_checks
RAISING
zcx_abapgit_exception .
METHODS get_dot_apack
RETURNING
VALUE(ro_dot_apack) TYPE REF TO zcl_abapgit_apack_reader .
METHODS get_data_config
RETURNING
VALUE(ri_config) TYPE REF TO zif_abapgit_data_config
RAISING
zcx_abapgit_exception .
METHODS find_remote_dot_abapgit
RETURNING
VALUE(ro_dot) TYPE REF TO zcl_abapgit_dot_abapgit
RAISING
zcx_abapgit_exception .
METHODS set_files_remote
IMPORTING
!it_files TYPE zif_abapgit_definitions=>ty_files_tt .
METHODS set_local_settings
IMPORTING
!is_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings
RAISING
zcx_abapgit_exception .
METHODS has_remote_source
ABSTRACT
RETURNING
VALUE(rv_yes) TYPE abap_bool .
METHODS status
IMPORTING
!ii_log TYPE REF TO zif_abapgit_log OPTIONAL
RETURNING
VALUE(rt_results) TYPE zif_abapgit_definitions=>ty_results_tt
RAISING
zcx_abapgit_exception .
METHODS switch_repo_type
IMPORTING
!iv_offline TYPE abap_bool
RAISING
zcx_abapgit_exception .
METHODS create_new_log
IMPORTING
!iv_title TYPE string OPTIONAL
RETURNING
VALUE(ri_log) TYPE REF TO zif_abapgit_log .
METHODS get_log
RETURNING
VALUE(ri_log) TYPE REF TO zif_abapgit_log .
METHODS refresh_local_object
IMPORTING
!iv_obj_type TYPE tadir-object
!iv_obj_name TYPE tadir-obj_name
RAISING
zcx_abapgit_exception .
METHODS refresh_local_objects
RAISING
zcx_abapgit_exception .
METHODS reset_status .
METHODS get_unsupported_objects_local
RETURNING
VALUE(rt_objects) TYPE zif_abapgit_definitions=>ty_items_tt
RAISING
zcx_abapgit_exception .
METHODS remove_ignored_files
CHANGING
ct_files TYPE zif_abapgit_definitions=>ty_files_tt
RAISING
zcx_abapgit_exception .
PROTECTED SECTION.
DATA mt_local TYPE zif_abapgit_definitions=>ty_files_item_tt .
DATA mt_remote TYPE zif_abapgit_definitions=>ty_files_tt .
DATA mv_request_local_refresh TYPE abap_bool .
DATA mv_request_remote_refresh TYPE abap_bool .
DATA mt_status TYPE zif_abapgit_definitions=>ty_results_tt .
DATA mi_log TYPE REF TO zif_abapgit_log .
DATA mi_listener TYPE REF TO zif_abapgit_repo_listener .
DATA mo_apack_reader TYPE REF TO zcl_abapgit_apack_reader .
DATA mi_data_config TYPE REF TO zif_abapgit_data_config .
METHODS find_remote_dot_apack
RETURNING
VALUE(ro_dot) TYPE REF TO zcl_abapgit_apack_reader
RAISING
zcx_abapgit_exception .
METHODS set_dot_apack
IMPORTING
!io_dot_apack TYPE REF TO zcl_abapgit_apack_reader
RAISING
zcx_abapgit_exception .
METHODS set
IMPORTING
!iv_url TYPE zif_abapgit_persistence=>ty_repo-url OPTIONAL
!iv_branch_name TYPE zif_abapgit_persistence=>ty_repo-branch_name OPTIONAL
!iv_selected_commit TYPE zif_abapgit_persistence=>ty_repo-selected_commit OPTIONAL
!iv_head_branch TYPE zif_abapgit_persistence=>ty_repo-head_branch OPTIONAL
!iv_offline TYPE zif_abapgit_persistence=>ty_repo-offline OPTIONAL
!is_dot_abapgit TYPE zif_abapgit_persistence=>ty_repo-dot_abapgit OPTIONAL
!is_local_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings OPTIONAL
!iv_deserialized_at TYPE zif_abapgit_persistence=>ty_repo-deserialized_at OPTIONAL
!iv_deserialized_by TYPE zif_abapgit_persistence=>ty_repo-deserialized_by OPTIONAL
!iv_switched_origin TYPE zif_abapgit_persistence=>ty_repo-switched_origin OPTIONAL
RAISING
zcx_abapgit_exception .
METHODS reset_remote .
PRIVATE SECTION.
METHODS notify_listener
IMPORTING
!is_change_mask TYPE zif_abapgit_persistence=>ty_repo_meta_mask
RAISING
zcx_abapgit_exception .
METHODS update_last_deserialize
RAISING
zcx_abapgit_exception .
METHODS check_for_restart .
METHODS check_write_protect
RAISING
zcx_abapgit_exception .
METHODS check_language
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS ZCL_ABAPGIT_REPO IMPLEMENTATION.
METHOD bind_listener.
mi_listener = ii_listener.
ENDMETHOD.
METHOD check_for_restart.
CONSTANTS:
lc_abapgit_prog TYPE progname VALUE `ZABAPGIT`.
" If abapGit was used to update itself, then restart to avoid LOAD_PROGRAM_&_MISMATCH dumps
" because abapGit code was changed at runtime
IF zcl_abapgit_ui_factory=>get_frontend_services( )->gui_is_available( ) = abap_true AND
zcl_abapgit_url=>is_abapgit_repo( ms_data-url ) = abap_true AND
sy-batch = abap_false AND
sy-cprog = lc_abapgit_prog.
IF zcl_abapgit_persist_factory=>get_settings( )->read( )->get_show_default_repo( ) = abap_false.
MESSAGE 'abapGit was updated and will restart itself' TYPE 'I'.
ENDIF.
SUBMIT (sy-cprog).
ENDIF.
ENDMETHOD.
METHOD check_language.
DATA:
lv_main_language TYPE spras,
lv_error_message TYPE string,
lv_error_longtext TYPE string.
" assumes find_remote_dot_abapgit has been called before
lv_main_language = get_dot_abapgit( )->get_main_language( ).
IF lv_main_language <> sy-langu.
lv_error_message = |Current login language |
&& |'{ zcl_abapgit_convert=>conversion_exit_isola_output( sy-langu ) }'|
&& | does not match main language |
&& |'{ zcl_abapgit_convert=>conversion_exit_isola_output( lv_main_language ) }'.|.
" Feature open in main language only exists if abapGit tcode is present
IF zcl_abapgit_services_abapgit=>get_abapgit_tcode( ) IS INITIAL.
lv_error_message = lv_error_message && | Please logon in main language and retry.|.
lv_error_longtext = |For the Advanced menu option 'Open in Main Language' to be available a transaction code| &&
| must be assigned to report { sy-cprog }.|.
ELSE.
lv_error_message = lv_error_message && | Select 'Advanced' > 'Open in Main Language'|.
ENDIF.
zcx_abapgit_exception=>raise( iv_text = lv_error_message
iv_longtext = lv_error_longtext ).
ENDIF.
ENDMETHOD.
METHOD check_write_protect.
IF get_local_settings( )-write_protected = abap_true.
zcx_abapgit_exception=>raise( 'Cannot deserialize. Local code is write-protected by repo config' ).
ENDIF.
ENDMETHOD.
METHOD constructor.
ASSERT NOT is_data-key IS INITIAL.
ms_data = is_data.
mv_request_remote_refresh = abap_true.
ENDMETHOD.
METHOD create_new_log.
CREATE OBJECT mi_log TYPE zcl_abapgit_log.
mi_log->set_title( iv_title ).
ri_log = mi_log.
ENDMETHOD.
METHOD delete_checks.
DATA: li_package TYPE REF TO zif_abapgit_sap_package.
li_package = zcl_abapgit_factory=>get_sap_package( get_package( ) ).
rs_checks-transport-required = li_package->are_changes_recorded_in_tr_req( ).
ENDMETHOD.
METHOD deserialize.
DATA: lt_updated_files TYPE zif_abapgit_definitions=>ty_file_signatures_tt,
lt_result TYPE zif_abapgit_data_deserializer=>ty_results,
lx_error TYPE REF TO zcx_abapgit_exception.
find_remote_dot_abapgit( ).
find_remote_dot_apack( ).
check_write_protect( ).
check_language( ).
IF is_checks-requirements-met = zif_abapgit_definitions=>c_no AND is_checks-requirements-decision IS INITIAL.
zcx_abapgit_exception=>raise( 'Requirements not met and undecided' ).
ENDIF.
IF is_checks-dependencies-met = zif_abapgit_definitions=>c_no.
zcx_abapgit_exception=>raise( 'APACK dependencies not met' ).
ENDIF.
IF is_checks-transport-required = abap_true AND is_checks-transport-transport IS INITIAL.
zcx_abapgit_exception=>raise( |No transport request was supplied| ).
ENDIF.
" Deserialize objects
TRY.
lt_updated_files = zcl_abapgit_objects=>deserialize(
io_repo = me
is_checks = is_checks
ii_log = ii_log ).
CATCH zcx_abapgit_exception INTO lx_error.
" Ensure to reset default transport request task
zcl_abapgit_default_transport=>get_instance( )->reset( ).
refresh( iv_drop_log = abap_false ).
RAISE EXCEPTION lx_error.
ENDTRY.
APPEND get_dot_abapgit( )->get_signature( ) TO lt_updated_files.
zif_abapgit_repo~checksums( )->update( lt_updated_files ).
" Deserialize data (no save to database, just test for now)
lt_result = zcl_abapgit_data_factory=>get_deserializer( )->deserialize(
ii_config = get_data_config( )
it_files = get_files_remote( ) ).
CLEAR: mt_local.
update_last_deserialize( ).
reset_status( ).
COMMIT WORK AND WAIT.
check_for_restart( ).
ENDMETHOD.
METHOD deserialize_checks.
DATA: lt_requirements TYPE zif_abapgit_dot_abapgit=>ty_requirement_tt,
lt_dependencies TYPE zif_abapgit_apack_definitions=>ty_dependencies.
find_remote_dot_abapgit( ).
find_remote_dot_apack( ).
check_write_protect( ).
check_language( ).
rs_checks = zcl_abapgit_objects=>deserialize_checks( me ).
lt_requirements = get_dot_abapgit( )->get_data( )-requirements.
rs_checks-requirements-met = zcl_abapgit_requirement_helper=>is_requirements_met( lt_requirements ).
lt_dependencies = get_dot_apack( )->get_manifest_descriptor( )-dependencies.
rs_checks-dependencies-met = zcl_abapgit_apack_helper=>are_dependencies_met( lt_dependencies ).
ENDMETHOD.
METHOD find_remote_dot_abapgit.
FIELD-SYMBOLS: <ls_remote> LIKE LINE OF mt_remote.
get_files_remote( ).
READ TABLE mt_remote ASSIGNING <ls_remote>
WITH KEY file_path
COMPONENTS path = zif_abapgit_definitions=>c_root_dir
filename = zif_abapgit_definitions=>c_dot_abapgit.
IF sy-subrc = 0.
ro_dot = zcl_abapgit_dot_abapgit=>deserialize( <ls_remote>-data ).
set_dot_abapgit( ro_dot ).
COMMIT WORK AND WAIT. " to release lock
ENDIF.
ENDMETHOD.
METHOD find_remote_dot_apack.
FIELD-SYMBOLS: <ls_remote> LIKE LINE OF mt_remote.
get_files_remote( ).
READ TABLE mt_remote ASSIGNING <ls_remote>
WITH KEY file_path
COMPONENTS path = zif_abapgit_definitions=>c_root_dir
filename = zif_abapgit_apack_definitions=>c_dot_apack_manifest.
IF sy-subrc = 0.
ro_dot = zcl_abapgit_apack_reader=>deserialize( iv_package_name = ms_data-package
iv_xstr = <ls_remote>-data ).
set_dot_apack( ro_dot ).
ENDIF.
ENDMETHOD.
METHOD get_data_config.
FIELD-SYMBOLS: <ls_remote> LIKE LINE OF mt_remote.
IF mi_data_config IS BOUND.
ri_config = mi_data_config.
RETURN.
ENDIF.
CREATE OBJECT ri_config TYPE zcl_abapgit_data_config.
mi_data_config = ri_config.
" Assume remote data has been loaded already
READ TABLE mt_remote ASSIGNING <ls_remote>
WITH KEY file_path
COMPONENTS path = zif_abapgit_data_config=>c_default_path.
IF sy-subrc = 0.
ri_config->from_json( mt_remote ).
ENDIF.
ENDMETHOD.
METHOD get_dot_abapgit.
CREATE OBJECT ro_dot_abapgit
EXPORTING
is_data = ms_data-dot_abapgit.
ENDMETHOD.
METHOD get_dot_apack.
IF mo_apack_reader IS NOT BOUND.
mo_apack_reader = zcl_abapgit_apack_reader=>create_instance( ms_data-package ).
ENDIF.
ro_dot_apack = mo_apack_reader.
ENDMETHOD.
METHOD get_files_local.
DATA lo_serialize TYPE REF TO zcl_abapgit_serialize.
DATA lt_filter TYPE zif_abapgit_definitions=>ty_tadir_tt.
" Serialization happened before and no refresh request
IF lines( mt_local ) > 0 AND mv_request_local_refresh = abap_false.
rt_files = mt_local.
RETURN.
ENDIF.
CREATE OBJECT lo_serialize
EXPORTING
io_dot_abapgit = get_dot_abapgit( )
is_local_settings = get_local_settings( ).
IF ii_obj_filter IS NOT INITIAL.
lt_filter = ii_obj_filter->get_filter( ).
ENDIF.
rt_files = lo_serialize->files_local(
iv_package = get_package( )
ii_data_config = get_data_config( )
ii_log = ii_log
it_filter = lt_filter ).
mt_local = rt_files.
mv_request_local_refresh = abap_false. " Fulfill refresh
ENDMETHOD.
METHOD get_files_remote.
DATA lt_filter TYPE zif_abapgit_definitions=>ty_tadir_tt.
DATA lr_filter TYPE REF TO zcl_abapgit_repo_filter.
rt_files = mt_remote.
IF ii_obj_filter IS NOT INITIAL.
lt_filter = ii_obj_filter->get_filter( ).
CREATE OBJECT lr_filter.
lr_filter->apply_object_filter(
EXPORTING
it_filter = lt_filter
io_dot = get_dot_abapgit( )
iv_devclass = get_package( )
CHANGING
ct_files = rt_files ).
ENDIF.
IF iv_ignore_files = abap_true.
remove_ignored_files( CHANGING ct_files = rt_files ).
ENDIF.
ENDMETHOD.
METHOD get_key.
rv_key = ms_data-key.
ENDMETHOD.
METHOD get_local_settings.
rs_settings = ms_data-local_settings.
ENDMETHOD.
METHOD get_log.
ri_log = mi_log.
ENDMETHOD.
METHOD get_name.
rv_name = ms_data-local_settings-display_name.
ENDMETHOD.
METHOD get_package.
rv_package = ms_data-package.
ENDMETHOD.
METHOD get_unsupported_objects_local.
DATA: lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt,
lt_supported_types TYPE zcl_abapgit_objects=>ty_types_tt.
FIELD-SYMBOLS: <ls_tadir> LIKE LINE OF lt_tadir,
<ls_object> LIKE LINE OF rt_objects.
lt_tadir = zcl_abapgit_factory=>get_tadir( )->read(
iv_package = ms_data-package
iv_ignore_subpackages = ms_data-local_settings-ignore_subpackages
iv_only_local_objects = ms_data-local_settings-only_local_objects
io_dot = get_dot_abapgit( ) ).
lt_supported_types = zcl_abapgit_objects=>supported_list( ).
LOOP AT lt_tadir ASSIGNING <ls_tadir>.
READ TABLE lt_supported_types WITH KEY table_line = <ls_tadir>-object TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
APPEND INITIAL LINE TO rt_objects ASSIGNING <ls_object>.
MOVE-CORRESPONDING <ls_tadir> TO <ls_object>.
<ls_object>-obj_type = <ls_tadir>-object.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD is_offline.
rv_offline = ms_data-offline.
ENDMETHOD.
METHOD notify_listener.
DATA ls_meta_slug TYPE zif_abapgit_persistence=>ty_repo_xml.
IF mi_listener IS BOUND.
MOVE-CORRESPONDING ms_data TO ls_meta_slug.
mi_listener->on_meta_change(
iv_key = ms_data-key
is_meta = ls_meta_slug
is_change_mask = is_change_mask ).
ENDIF.
ENDMETHOD.
METHOD refresh.
mv_request_local_refresh = abap_true.
reset_remote( ).
IF iv_drop_log = abap_true.
CLEAR mi_log.
ENDIF.
IF iv_drop_cache = abap_true.
CLEAR mt_local.
ENDIF.
ENDMETHOD.
METHOD refresh_local_object.
DATA:
ls_tadir TYPE zif_abapgit_definitions=>ty_tadir,
lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt,
lt_new_local_files TYPE zif_abapgit_definitions=>ty_files_item_tt,
lo_serialize TYPE REF TO zcl_abapgit_serialize.
lt_tadir = zcl_abapgit_factory=>get_tadir( )->read(
iv_package = ms_data-package
io_dot = get_dot_abapgit( ) ).
DELETE mt_local WHERE item-obj_type = iv_obj_type
AND item-obj_name = iv_obj_name.
READ TABLE lt_tadir INTO ls_tadir
WITH KEY object = iv_obj_type
obj_name = iv_obj_name.
IF sy-subrc <> 0 OR ls_tadir-delflag = abap_true.
" object doesn't exist anymore, nothing todo here
RETURN.
ENDIF.
CLEAR lt_tadir.
INSERT ls_tadir INTO TABLE lt_tadir.
CREATE OBJECT lo_serialize.
lt_new_local_files = lo_serialize->serialize(
iv_package = ms_data-package
it_tadir = lt_tadir ).
INSERT LINES OF lt_new_local_files INTO TABLE mt_local.
ENDMETHOD.
METHOD refresh_local_objects.
mv_request_local_refresh = abap_true.
get_files_local( ).
ENDMETHOD.
METHOD remove_ignored_files.
DATA lo_dot TYPE REF TO zcl_abapgit_dot_abapgit.
DATA lv_index TYPE sy-index.
FIELD-SYMBOLS <ls_files> LIKE LINE OF ct_files.
lo_dot = get_dot_abapgit( ).
" Skip ignored files
LOOP AT ct_files ASSIGNING <ls_files>.
lv_index = sy-tabix.
IF lo_dot->is_ignored( iv_path = <ls_files>-path
iv_filename = <ls_files>-filename ) = abap_true.
DELETE ct_files INDEX lv_index.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD reset_remote.
CLEAR mt_remote.
mv_request_remote_refresh = abap_true.
reset_status( ).
ENDMETHOD.
METHOD reset_status.
CLEAR mt_status.
ENDMETHOD.
METHOD set.
* TODO: refactor, maybe use zcl_abapgit_string_map ?
DATA: ls_mask TYPE zif_abapgit_persistence=>ty_repo_meta_mask.
ASSERT iv_url IS SUPPLIED
OR iv_branch_name IS SUPPLIED
OR iv_selected_commit IS SUPPLIED
OR iv_head_branch IS SUPPLIED
OR iv_offline IS SUPPLIED
OR is_dot_abapgit IS SUPPLIED
OR is_local_settings IS SUPPLIED
OR iv_deserialized_by IS SUPPLIED
OR iv_deserialized_at IS SUPPLIED
OR iv_switched_origin IS SUPPLIED.
IF iv_url IS SUPPLIED.
ms_data-url = iv_url.
ls_mask-url = abap_true.
ENDIF.
IF iv_branch_name IS SUPPLIED.
ms_data-branch_name = iv_branch_name.
ls_mask-branch_name = abap_true.
ENDIF.
IF iv_selected_commit IS SUPPLIED.
ms_data-selected_commit = iv_selected_commit.
ls_mask-selected_commit = abap_true.
ENDIF.
IF iv_head_branch IS SUPPLIED.
ms_data-head_branch = iv_head_branch.
ls_mask-head_branch = abap_true.
ENDIF.
IF iv_offline IS SUPPLIED.
ms_data-offline = iv_offline.
ls_mask-offline = abap_true.
ENDIF.
IF is_dot_abapgit IS SUPPLIED.
ms_data-dot_abapgit = is_dot_abapgit.
ls_mask-dot_abapgit = abap_true.
ENDIF.
IF is_local_settings IS SUPPLIED.
ms_data-local_settings = is_local_settings.
ls_mask-local_settings = abap_true.
ENDIF.
IF iv_deserialized_at IS SUPPLIED OR iv_deserialized_by IS SUPPLIED.
ms_data-deserialized_at = iv_deserialized_at.
ms_data-deserialized_by = iv_deserialized_by.
ls_mask-deserialized_at = abap_true.
ls_mask-deserialized_by = abap_true.
ENDIF.
IF iv_switched_origin IS SUPPLIED.
ms_data-switched_origin = iv_switched_origin.
ls_mask-switched_origin = abap_true.
ENDIF.
notify_listener( ls_mask ).
ENDMETHOD.
METHOD set_dot_abapgit.
set( is_dot_abapgit = io_dot_abapgit->get_data( ) ).
ENDMETHOD.
METHOD set_dot_apack.
get_dot_apack( ).
mo_apack_reader->set_manifest_descriptor( io_dot_apack->get_manifest_descriptor( ) ).
ENDMETHOD.
METHOD set_files_remote.
mt_remote = it_files.
mv_request_remote_refresh = abap_false.
ENDMETHOD.
METHOD set_local_settings.
set( is_local_settings = is_settings ).
ENDMETHOD.
METHOD status.
IF lines( mt_status ) = 0.
mt_status = zcl_abapgit_file_status=>status( io_repo = me
ii_log = ii_log ).
ENDIF.
rt_results = mt_status.
ENDMETHOD.
METHOD switch_repo_type.
IF iv_offline = ms_data-offline.
zcx_abapgit_exception=>raise( |Cannot switch_repo_type, offline already = "{ ms_data-offline }"| ).
ENDIF.
IF iv_offline = abap_true. " On-line -> OFFline
set( iv_url = zcl_abapgit_url=>name( ms_data-url )
iv_branch_name = ''
iv_selected_commit = ''
iv_head_branch = ''
iv_offline = abap_true ).
ELSE. " OFFline -> On-line
set( iv_offline = abap_false ).
ENDIF.
ENDMETHOD.
METHOD update_last_deserialize.
DATA: lv_deserialized_at TYPE zif_abapgit_persistence=>ty_repo-deserialized_at,
lv_deserialized_by TYPE zif_abapgit_persistence=>ty_repo-deserialized_by.
GET TIME STAMP FIELD lv_deserialized_at.
lv_deserialized_by = sy-uname.
set( iv_deserialized_at = lv_deserialized_at
iv_deserialized_by = lv_deserialized_by ).
ENDMETHOD.
METHOD zif_abapgit_repo~checksums.
CREATE OBJECT ri_checksums TYPE zcl_abapgit_repo_checksums
EXPORTING
iv_repo_key = ms_data-key.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
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,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
13,
628,
220,
220,
220,
8355,
43429,
1546,
13845,
62,
7890,
7473,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
93,
907,
62,
7890,
13,
198,
220,
220,
220,
8355,
43429,
1546,
25,
198,
220,
220,
220,
220,
220,
651,
62,
2539,
7473,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
93,
1136,
62,
2539,
11,
198,
220,
220,
220,
220,
220,
651,
62,
3672,
7473,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
93,
1136,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
318,
62,
2364,
1370,
7473,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
93,
271,
62,
2364,
1370,
11,
198,
220,
220,
220,
220,
220,
651,
62,
26495,
7473,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
93,
1136,
62,
26495,
11,
198,
220,
220,
220,
220,
220,
651,
62,
16624,
62,
12001,
7473,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
93,
1136,
62,
16624,
62,
12001,
11,
198,
220,
220,
220,
220,
220,
651,
62,
16624,
62,
47960,
7473,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
93,
1136,
62,
16624,
62,
47960,
11,
198,
220,
220,
220,
220,
220,
651,
62,
12001,
62,
33692,
7473,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
93,
1136,
62,
12001,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
14976,
7473,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
93,
5420,
3447,
11,
198,
220,
220,
220,
220,
220,
651,
62,
26518,
62,
397,
499,
18300,
7473,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
93,
1136,
62,
26518,
62,
397,
499,
18300,
11,
198,
220,
220,
220,
220,
220,
900,
62,
26518,
62,
397,
499,
18300,
7473,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
93,
2617,
62,
26518,
62,
397,
499,
18300,
11,
198,
220,
220,
220,
220,
220,
748,
48499,
1096,
7473,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
93,
8906,
48499,
1096,
11,
198,
220,
220,
220,
220,
220,
748,
48499,
1096,
62,
42116,
7473,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
93,
8906,
48499,
1096,
62,
42116,
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,
271,
62,
7890,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
764,
628,
220,
220,
220,
337,
36252,
50,
11007,
62,
4868,
877,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
4868,
877,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
62,
4868,
877,
764,
198,
220,
220,
220,
337,
36252,
50,
12233,
62,
42116,
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,
33678,
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,
337,
36252,
50,
651,
62,
26518,
62,
499,
441,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
26518,
62,
499,
441,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
499,
441,
62,
46862,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
7890,
62,
11250,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
11250,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
7890,
62,
11250,
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,
1064,
62,
47960,
62,
26518,
62,
397,
499,
18300,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
26518,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
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,
16624,
62,
47960,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
16624,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
62,
926,
764,
198,
220,
220,
220,
337,
36252,
50,
900,
62,
12001,
62,
33692,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
33692,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
12001,
62,
33692,
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,
468,
62,
47960,
62,
10459,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9564,
18601,
10659,
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,
764,
198,
220,
220,
220,
337,
36252,
50,
3722,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
6404,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS ltcl_requirements DEFINITION FINAL FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
DATA mo_cut TYPE REF TO lcl_requirements.
METHODS setup.
METHODS different_fields_are_one_group FOR TESTING RAISING cx_static_check.
METHODS repeat_field_adds_new_group FOR TESTING RAISING cx_static_check.
METHODS check_field_mapping FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_requirements IMPLEMENTATION.
METHOD setup.
mo_cut = lcl_requirements=>new( ).
ENDMETHOD.
METHOD check_field_mapping.
DATA ls_actual TYPE zif_abapgit_dot_abapgit=>ty_requirement.
DATA ls_expected TYPE zif_abapgit_dot_abapgit=>ty_requirement.
DATA lt_requirements TYPE zif_abapgit_dot_abapgit=>ty_requirement_tt.
mo_cut->set_component( '2' ).
mo_cut->set_min_release( '3' ).
mo_cut->set_min_patch( '4' ).
lt_requirements = mo_cut->get_as_table( ).
READ TABLE lt_requirements INDEX 1 INTO ls_actual.
ls_expected-component = '2'.
ls_expected-min_release = '3'.
ls_expected-min_patch = '4'.
cl_abap_unit_assert=>assert_equals( act = ls_actual
exp = ls_expected ).
ENDMETHOD.
METHOD different_fields_are_one_group.
DATA lt_requirements TYPE zif_abapgit_dot_abapgit=>ty_requirement_tt.
mo_cut->set_component( '1' ).
mo_cut->set_min_release( '1' ).
mo_cut->set_min_patch( '1' ).
lt_requirements = mo_cut->get_as_table( ).
cl_abap_unit_assert=>assert_equals( act = lines( lt_requirements )
exp = 1 ).
ENDMETHOD.
METHOD repeat_field_adds_new_group.
DATA lt_requirements TYPE zif_abapgit_dot_abapgit=>ty_requirement_tt.
mo_cut->set_component( '1' ).
mo_cut->set_min_release( '1' ).
mo_cut->set_component( '1' ).
lt_requirements = mo_cut->get_as_table( ).
cl_abap_unit_assert=>assert_equals( act = lines( lt_requirements )
exp = 2 ).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
8897,
18883,
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,
6941,
62,
8968,
41876,
4526,
37,
5390,
300,
565,
62,
8897,
18883,
13,
628,
220,
220,
220,
337,
36252,
50,
9058,
13,
198,
220,
220,
220,
337,
36252,
50,
1180,
62,
25747,
62,
533,
62,
505,
62,
8094,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
9585,
62,
3245,
62,
2860,
82,
62,
3605,
62,
8094,
220,
220,
220,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
2198,
62,
3245,
62,
76,
5912,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
198,
10619,
31631,
13,
628,
198,
31631,
300,
83,
565,
62,
8897,
18883,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
6941,
62,
8968,
796,
300,
565,
62,
8897,
18883,
14804,
3605,
7,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
2198,
62,
3245,
62,
76,
5912,
13,
628,
220,
220,
220,
42865,
43979,
62,
50039,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
14804,
774,
62,
8897,
24615,
13,
198,
220,
220,
220,
42865,
43979,
62,
40319,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
14804,
774,
62,
8897,
24615,
13,
198,
220,
220,
220,
42865,
300,
83,
62,
8897,
18883,
41876,
1976,
361,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
14804,
774,
62,
8897,
24615,
62,
926,
13,
628,
220,
220,
220,
6941,
62,
8968,
3784,
2617,
62,
42895,
7,
705,
17,
6,
6739,
198,
220,
220,
220,
6941,
62,
8968,
3784,
2617,
62,
1084,
62,
20979,
7,
705,
18,
6,
6739,
198,
220,
220,
220,
6941,
62,
8968,
3784,
2617,
62,
1084,
62,
17147,
7,
705,
19,
6,
6739,
628,
220,
220,
220,
300,
83,
62,
8897,
18883,
796,
6941,
62,
8968,
3784,
1136,
62,
292,
62,
11487,
7,
6739,
198,
220,
220,
220,
20832,
43679,
300,
83,
62,
8897,
18883,
24413,
6369,
352,
39319,
43979,
62,
50039,
13,
628,
220,
220,
220,
43979,
62,
40319,
12,
42895,
220,
220,
796,
705,
17,
4458,
198,
220,
220,
220,
43979,
62,
40319,
12,
1084,
62,
20979,
796,
705,
18,
4458,
198,
220,
220,
220,
43979,
62,
40319,
12,
1084,
62,
17147,
220,
220,
796,
705,
19,
4458,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
719,
796,
43979,
62,
50039,
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,
43979,
62,
40319,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1180,
62,
25747,
62,
533,
62,
505,
62,
8094,
13,
628,
220,
220,
220,
42865,
300,
83,
62,
8897,
18883,
41876,
1976,
361,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
14804,
774,
62,
8897,
24615,
62,
926,
13,
628,
220,
220,
220,
6941,
62,
8968,
3784,
2617,
62,
42895,
7,
705,
16,
6,
6739,
198,
220,
220,
220,
6941,
62,
8968,
3784,
2617,
62,
1084,
62,
20979,
7,
705,
16,
6,
6739,
198,
220,
220,
220,
6941,
62,
8968,
3784,
2617,
62,
1084,
62,
17147,
7,
705,
16,
6,
6739,
628,
220,
220,
220,
300,
83,
62,
8897,
18883,
796,
6941,
62,
8968,
3784,
1136,
62,
292,
62,
11487,
7,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
719,
796,
3951,
7,
300,
83,
62,
8897,
18883,
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,
1033,
796,
352,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
9585,
62,
3245,
62,
2860,
82,
62,
3605,
62,
8094,
13,
628,
220,
220,
220,
42865,
300,
83,
62,
8897,
18883,
41876,
1976,
361,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
14804,
774,
62,
8897,
24615,
62,
926,
13,
628,
220,
220,
220,
6941,
62,
8968,
3784,
2617,
62,
42895,
7,
705,
16,
6,
6739,
198,
220,
220,
220,
6941,
62,
8968,
3784,
2617,
62,
1084,
62,
20979,
7,
705,
16,
6,
6739,
198,
220,
220,
220,
6941,
62,
8968,
3784,
2617,
62,
42895,
7,
705,
16,
6,
6739,
628,
220,
220,
220,
300,
83,
62,
8897,
18883,
796,
6941,
62,
8968,
3784,
1136,
62,
292,
62,
11487,
7,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
719,
796,
3951,
7,
300,
83,
62,
8897,
18883,
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,
1033,
796,
362,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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TESTING
FINAL
INHERITING FROM zcl_abapgit_xml
FRIENDS ltcl_xml.
ENDCLASS.
CLASS ltcl_xml_concrete IMPLEMENTATION.
ENDCLASS.
CLASS ltcl_xml DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS setup.
METHODS:
space_leading_trailing FOR TESTING
RAISING zcx_abapgit_exception,
bad_xml_raises_exc FOR TESTING RAISING cx_static_check.
METHODS:
parse_xml
IMPORTING
iv_xml TYPE csequence
RAISING
zcx_abapgit_exception,
render_xml
IMPORTING
iv_name TYPE string
RETURNING
VALUE(rv_xml) TYPE string.
DATA mo_xml TYPE REF TO ltcl_xml_concrete.
ENDCLASS.
CLASS ltcl_xml IMPLEMENTATION.
METHOD setup.
CREATE OBJECT mo_xml.
ENDMETHOD.
METHOD parse_xml.
DATA lv_xml TYPE string.
lv_xml = |<?xml version="1.0"?>|
&& |<{ mo_xml->c_abapgit_tag } { mo_xml->c_attr_version }="{ zif_abapgit_version=>c_xml_version }">|
&& iv_xml
&& |</{ mo_xml->c_abapgit_tag }>|.
mo_xml->parse( iv_xml = lv_xml ).
ENDMETHOD.
METHOD space_leading_trailing.
DATA: lv_from_xml TYPE string,
lv_to_xml TYPE string.
lv_from_xml = `<FOO> A </FOO>`.
parse_xml( lv_from_xml ).
lv_to_xml = render_xml( 'FOO' ).
cl_abap_unit_assert=>assert_equals(
act = lv_to_xml
exp = lv_from_xml ).
ENDMETHOD.
METHOD render_xml.
DATA: li_element TYPE REF TO if_ixml_element,
li_ostream TYPE REF TO if_ixml_ostream,
li_streamfactory TYPE REF TO if_ixml_stream_factory.
li_element = mo_xml->mi_xml_doc->find_from_path( |/{ mo_xml->c_abapgit_tag }/{ iv_name }| ).
li_streamfactory = mo_xml->mi_ixml->create_stream_factory( ).
li_ostream = li_streamfactory->create_ostream_cstring( rv_xml ).
li_element->render( ostream = li_ostream ).
ENDMETHOD.
METHOD bad_xml_raises_exc.
DATA: lv_xml TYPE string,
lo_error TYPE REF TO zcx_abapgit_exception,
lv_text TYPE string.
lv_xml = |<?xml version="1.0"?>|
&& |<{ mo_xml->c_abapgit_tag } { mo_xml->c_attr_version }="{ zif_abapgit_version=>c_xml_version }">|
&& |<open_tag>|
&& |</{ mo_xml->c_abapgit_tag }>|.
TRY.
mo_xml->parse( iv_xml = lv_xml ).
cl_abap_unit_assert=>fail( msg = 'Exception not raised' ).
CATCH zcx_abapgit_exception INTO lo_error.
lv_text = lo_error->get_text( ).
cl_abap_unit_assert=>assert_char_cp(
act = lv_text
exp = '*open_tag*' ).
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
19875,
5550,
20032,
17941,
23449,
1137,
22083,
13,
198,
198,
31631,
300,
83,
565,
62,
19875,
62,
1102,
38669,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
220,
220,
25261,
198,
220,
220,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
19875,
198,
220,
220,
220,
48167,
1677,
5258,
300,
83,
565,
62,
19875,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
19875,
62,
1102,
38669,
30023,
2538,
10979,
6234,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
19875,
5550,
20032,
17941,
7473,
43001,
2751,
360,
4261,
6234,
6006,
9863,
45698,
42,
49277,
43638,
5805,
7597,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
9058,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
2272,
62,
12294,
62,
9535,
4386,
7473,
43001,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
2089,
62,
19875,
62,
430,
2696,
62,
41194,
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,
21136,
62,
19875,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
19875,
41876,
269,
43167,
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,
8543,
62,
19875,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3672,
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,
19875,
8,
41876,
4731,
13,
628,
220,
220,
220,
42865,
6941,
62,
19875,
41876,
4526,
37,
5390,
300,
83,
565,
62,
19875,
62,
1102,
38669,
13,
198,
198,
10619,
31631,
13,
628,
198,
31631,
300,
83,
565,
62,
19875,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
6941,
62,
19875,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
21136,
62,
19875,
13,
628,
220,
220,
220,
42865,
300,
85,
62,
19875,
41876,
4731,
13,
628,
220,
220,
220,
300,
85,
62,
19875,
796,
930,
47934,
19875,
2196,
2625,
16,
13,
15,
13984,
29,
91,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11405,
930,
27,
90,
6941,
62,
19875,
3784,
66,
62,
397,
499,
18300,
62,
12985,
1782,
1391,
6941,
62,
19875,
3784,
66,
62,
35226,
62,
9641,
1782,
2625,
90,
1976,
361,
62,
397,
499,
18300,
62,
9641,
14804,
66,
62,
19875,
62,
9641,
1782,
5320,
91,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11405,
21628,
62,
19875,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11405,
930,
3556,
90,
6941,
62,
19875,
3784,
66,
62,
397,
499,
18300,
62,
12985,
1782,
29,
91,
13,
628,
220,
220,
220,
6941,
62,
19875,
3784,
29572,
7,
21628,
62,
19875,
796,
300,
85,
62,
19875,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
2272,
62,
12294,
62,
9535,
4386,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
6738,
62,
19875,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
1462,
62,
19875,
220,
220,
41876,
4731,
13,
628,
198,
220,
220,
220,
300,
85,
62,
6738,
62,
19875,
796,
4600,
27,
6080,
46,
29,
317,
7359,
6080,
46,
29,
44646,
628,
220,
220,
220,
21136,
62,
19875,
7,
300,
85,
62,
6738,
62,
19875,
6739,
628,
220,
220,
220,
300,
85,
62,
1462,
62,
19875,
796,
8543,
62,
19875,
7,
705,
6080,
46,
6,
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,
1462,
62,
19875,
198,
220,
220,
220,
220,
220,
1033,
796,
300,
85,
62,
6738,
62,
19875,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
8543,
62,
19875,
13,
628,
220,
220,
220,
42865,
25,
7649,
62,
30854,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7649,
62,
455,
1476,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
455,
1476,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7649,
62,
5532,
69,
9548,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
5532,
62,
69,
9548,
13,
628,
220,
220,
220,
7649,
62,
30854,
796,
6941,
62,
19875,
3784,
11632,
62,
19875,
62,
15390,
3784,
19796,
62,
6738,
62,
6978,
7,
930,
14,
90,
6941,
62,
19875,
3784,
66,
62,
397,
499,
18300,
62,
12985,
1782,
14,
90,
21628,
62,
3672,
1782,
91,
6739,
628,
220,
220,
220,
7649,
62,
5532,
69,
9548,
796,
6941,
62,
19875,
3784,
11632,
62,
844,
4029,
3784,
17953,
62,
5532,
62,
69,
9548,
7,
6739,
628,
220,
220,
220,
7649,
62,
455,
1476,
796,
7649,
62,
5532,
69,
9548,
3784,
17953,
62,
455,
1476,
62,
66,
8841,
7,
374,
85,
62,
19875,
6739,
628,
220,
220,
220,
7649,
62,
30854,
3784,
13287,
7,
267,
5532,
796,
7649,
62,
455,
1476,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
2089,
62,
19875,
62,
430,
2696,
62,
41194,
13,
198,
220,
220,
220,
42865,
25,
300,
85,
62,
19875,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
18224,
41876,
4526,
37,
5390,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
5239,
41876,
4731,
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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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
] |
CLASS /dmo/cl_flight_amdp12 DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_amdp_marker_hdb.
CLASS-METHODS convert_currency IMPORTING VALUE(iv_amount) TYPE /dmo/total_price12
VALUE(iv_currency_code_source) TYPE /dmo/currency_code12
VALUE(iv_currency_code_target) TYPE /dmo/currency_code12
VALUE(iv_exchange_rate_date) TYPE d
EXPORTING VALUE(ev_amount) TYPE /dmo/total_price12.
ENDCLASS.
CLASS /dmo/cl_flight_amdp12 IMPLEMENTATION.
METHOD convert_currency BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT OPTIONS READ-ONLY .
tab = SELECT CONVERT_CURRENCY( amount => :iv_amount,
source_unit => :iv_currency_code_source,
target_unit => :iv_currency_code_target,
reference_date => :iv_exchange_rate_date,
schema => CURRENT_SCHEMA,
error_handling => 'set to null',
steps => 'shift,convert,shift_back',
client => SESSION_CONTEXT( 'CLIENT' )
) AS target_value
FROM dummy ;
ev_amount = :tab.target_value[1];
ENDMETHOD.
ENDCLASS.
| [
31631,
1220,
67,
5908,
14,
565,
62,
22560,
62,
321,
26059,
1065,
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,
611,
62,
321,
26059,
62,
4102,
263,
62,
71,
9945,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
10385,
62,
34415,
30023,
9863,
2751,
26173,
8924,
7,
452,
62,
17287,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
23350,
62,
20888,
1065,
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,
26173,
8924,
7,
452,
62,
34415,
62,
8189,
62,
10459,
8,
41876,
1220,
67,
5908,
14,
34415,
62,
8189,
1065,
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,
26173,
8924,
7,
452,
62,
34415,
62,
8189,
62,
16793,
8,
41876,
1220,
67,
5908,
14,
34415,
62,
8189,
1065,
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,
26173,
8924,
7,
452,
62,
1069,
3803,
62,
4873,
62,
4475,
8,
220,
220,
41876,
288,
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,
7788,
15490,
2751,
26173,
8924,
7,
1990,
62,
17287,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
23350,
62,
20888,
1065,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1220,
67,
5908,
14,
565,
62,
22560,
62,
321,
26059,
1065,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
10385,
62,
34415,
11050,
360,
1404,
6242,
11159,
41755,
1961,
11335,
7473,
5572,
33,
406,
15567,
52,
11879,
16363,
6173,
46023,
39852,
11053,
20832,
12,
1340,
11319,
764,
198,
220,
220,
220,
7400,
796,
33493,
7102,
15858,
62,
34,
31302,
45155,
7,
2033,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
1058,
452,
62,
17287,
11,
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,
2723,
62,
20850,
220,
220,
220,
5218,
1058,
452,
62,
34415,
62,
8189,
62,
10459,
11,
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,
2496,
62,
20850,
220,
220,
220,
5218,
1058,
452,
62,
34415,
62,
8189,
62,
16793,
11,
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,
4941,
62,
4475,
5218,
1058,
452,
62,
1069,
3803,
62,
4873,
62,
4475,
11,
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,
32815,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
327,
39237,
62,
50,
3398,
27630,
11,
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,
4049,
62,
4993,
1359,
5218,
705,
2617,
284,
9242,
3256,
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,
4831,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
705,
30846,
11,
1102,
1851,
11,
30846,
62,
1891,
3256,
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,
5456,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
311,
47621,
62,
10943,
32541,
7,
705,
5097,
28495,
6,
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,
1267,
7054,
2496,
62,
8367,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16034,
31548,
2162,
198,
220,
220,
220,
819,
62,
17287,
796,
1058,
8658,
13,
16793,
62,
8367,
58,
16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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
] |
CLASS zcl_abapgit_object_avar DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_objects_super
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_object .
PROTECTED SECTION.
PRIVATE SECTION.
METHODS: create_object
RETURNING VALUE(ro_aab_var) TYPE REF TO cl_aab_variant
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_AVAR IMPLEMENTATION.
METHOD create_object.
DATA: lv_name TYPE aab_var_name.
lv_name = ms_item-obj_name.
CREATE OBJECT ro_aab_var
EXPORTING
im_name = lv_name
im_local = ''
EXCEPTIONS
name_not_allowed = 1
user_not_valid = 2
no_authorization = 3
OTHERS = 4.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
DATA: lo_aab TYPE REF TO cl_aab_variant.
lo_aab = create_object( ).
lo_aab->get_author( IMPORTING ex_author = rv_user ).
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lo_aab TYPE REF TO cl_aab_variant.
lo_aab = create_object( ).
lo_aab->enqueue( ).
lo_aab->delete(
EXCEPTIONS
var_not_found = 1
prop_error = 2
propt_error = 3
var_id_error = 4
no_authorization = 5
cts_error = 6
cts_devclass = 7
OTHERS = 8 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error deleting AVAR { ms_item-obj_name }| ).
ENDIF.
lo_aab->dequeue( ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_possible TYPE abap_bool,
lv_description TYPE aab_var_descript,
ls_is TYPE aab_var_obj_act,
lt_ids TYPE aab_var_obj_act_tab,
lo_aab TYPE REF TO cl_aab_variant.
" AVAR can only be created in transportable packages
lv_possible = zcl_abapgit_factory=>get_sap_package( iv_package )->are_changes_recorded_in_tr_req( ).
IF lv_possible = abap_false.
zcx_abapgit_exception=>raise( |Global activation variants require a transportable package| ).
ENDIF.
" Create AVAR with description and object (id) list
io_xml->read( EXPORTING iv_name = 'DESCRIPTION'
CHANGING cg_data = lv_description ).
io_xml->read( EXPORTING iv_name = 'IDS'
CHANGING cg_data = lt_ids ).
lo_aab = create_object( ).
lo_aab->enqueue( ).
lo_aab->set_descript(
EXPORTING
im_descript = lv_description
EXCEPTIONS
no_authorization = 1 ).
IF sy-subrc <> 0.
lo_aab->dequeue( ).
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
LOOP AT lt_ids INTO ls_is.
lo_aab->set_id(
EXPORTING
im_name = ls_is-name
im_object = ls_is-object
im_actmode = ls_is-actmode
EXCEPTIONS
no_authorization = 1
id_not_exists = 2
id_not_transportable = 3
OTHERS = 4 ).
IF sy-subrc <> 0.
lo_aab->dequeue( ).
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDLOOP.
tadir_insert( iv_package ).
lo_aab->save(
EXCEPTIONS
no_descript_specified = 1
prop_error = 2
propt_error = 3
var_id_error = 4
no_changes_found = 5
cts_error = 6 ).
IF sy-subrc <> 0.
lo_aab->dequeue( ).
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
lo_aab->dequeue( ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_state TYPE abap_bool,
lo_aab TYPE REF TO cl_aab_variant.
lo_aab = create_object( ).
lo_aab->get_state( IMPORTING ex_state = lv_state ).
rv_bool = xsdbool( lv_state = abap_true ).
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( ).
rs_metadata-delete_tadir = 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.
zcx_abapgit_exception=>raise( |Jump to AVAR is not supported| ).
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lo_aab TYPE REF TO cl_aab_variant,
lt_ids TYPE aab_var_obj_act_tab,
lv_description TYPE aab_var_descript.
IF zif_abapgit_object~exists( ) = abap_false.
RETURN.
ENDIF.
lo_aab = create_object( ).
lo_aab->get_descript(
IMPORTING
ex_descript = lv_description
EXCEPTIONS
no_descript_found = 1 ).
IF sy-subrc = 0.
io_xml->add( iv_name = 'DESCRIPTION'
ig_data = lv_description ).
ENDIF.
lo_aab->get_ids( IMPORTING ex_ids = lt_ids ).
io_xml->add( iv_name = 'IDS'
ig_data = lt_ids ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
615,
283,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
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,
397,
499,
18300,
62,
15252,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
2251,
62,
15252,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
305,
62,
64,
397,
62,
7785,
8,
41876,
4526,
37,
5390,
537,
62,
64,
397,
62,
25641,
415,
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,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
10116,
1503,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
2251,
62,
15252,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
3672,
41876,
257,
397,
62,
7785,
62,
3672,
13,
628,
220,
220,
220,
300,
85,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
686,
62,
64,
397,
62,
7785,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
545,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
545,
62,
12001,
220,
220,
220,
220,
220,
220,
220,
220,
796,
10148,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
62,
1662,
62,
40845,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2836,
62,
1662,
62,
12102,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
645,
62,
9800,
1634,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
604,
13,
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,
62,
83,
3064,
7,
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,
64,
397,
41876,
4526,
37,
5390,
537,
62,
64,
397,
62,
25641,
415,
13,
628,
220,
220,
220,
2376,
62,
64,
397,
796,
2251,
62,
15252,
7,
6739,
198,
220,
220,
220,
2376,
62,
64,
397,
3784,
1136,
62,
9800,
7,
30023,
9863,
2751,
409,
62,
9800,
796,
374,
85,
62,
7220,
6739,
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,
64,
397,
41876,
4526,
37,
5390,
537,
62,
64,
397,
62,
25641,
415,
13,
628,
220,
220,
220,
2376,
62,
64,
397,
796,
2251,
62,
15252,
7,
6739,
198,
220,
220,
220,
2376,
62,
64,
397,
3784,
268,
36560,
7,
6739,
198,
220,
220,
220,
2376,
62,
64,
397,
3784,
33678,
7,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
1401,
62,
1662,
62,
9275,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2632,
62,
18224,
220,
220,
220,
220,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
386,
457,
62,
18224,
220,
220,
220,
220,
220,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
1401,
62,
312,
62,
18224,
220,
220,
220,
220,
796,
604,
198,
220,
220,
220,
220,
220,
220,
220,
645,
62,
9800,
1634,
796,
642,
198,
220,
220,
220,
220,
220,
220,
220,
269,
912,
62,
18224,
220,
220,
220,
220,
220,
220,
220,
796,
718,
198,
220,
220,
220,
220,
220,
220,
220,
269,
912,
62,
7959,
4871,
220,
220,
220,
220,
796,
767,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
807,
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,
930,
12331,
34817,
14661,
1503,
1391,
13845,
62,
9186,
12,
26801,
62,
3672,
1782,
91,
6739,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
2376,
62,
64,
397,
3784,
2934,
36560,
7,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
8906,
48499,
1096,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
79,
4733,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
11213,
41876,
257,
397,
62,
7785,
62,
20147,
1968,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
271,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
257,
397,
62,
7785,
62,
26801,
62,
529,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
2340,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
257,
397,
62,
7785,
62,
26801,
62,
529,
62,
8658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
64,
397,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
537,
62,
64,
397,
62,
25641,
415,
13,
628,
220,
220,
220,
366,
14661,
1503,
460,
691,
307,
2727,
287,
4839,
540,
10392,
198,
220,
220,
220,
300,
85,
62,
79,
4733,
796,
1976,
565,
62,
397,
499,
18300,
62,
69,
9548,
14804,
1136,
62,
82,
499,
62,
26495,
7,
21628,
62,
26495,
1267,
3784,
533,
62,
36653,
62,
47398,
62,
259,
62,
2213,
62,
42180
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
class ZSAPLINK_SMARTFORM definition
public
inheriting from ZSAPLINK
final
create public .
public section.
methods CHECKEXISTS
redefinition .
methods CREATEIXMLDOCFROMOBJECT
redefinition .
methods CREATEOBJECTFROMIXMLDOC
redefinition .
protected section.
methods DELETEOBJECT
redefinition .
methods GETOBJECTTYPE
redefinition .
private section.
endclass. "ZSAPLINK_SMARTFORM definition
*----------------------------------------------------------------------*
* class ZSAPLINK_SMARTFORM implementation.
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class ZSAPLINK_SMARTFORM implementation.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version. |
*| |
*| SAPlink is distributed in the hope that it will be useful, |
*| but WITHOUT ANY WARRANTY; without even the implied warranty of |
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
*| GNU General Public License for more details. |
*| |
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the |
*| Free Software Foundation, Inc., |
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
*\---------------------------------------------------------------------/
METHOD checkexists .
SELECT SINGLE formname FROM stxfadm INTO objname WHERE formname = objname.
IF sy-subrc = 0.
exists = 'X'.
ENDIF.
ENDMETHOD.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version. |
*| |
*| SAPlink is distributed in the hope that it will be useful, |
*| but WITHOUT ANY WARRANTY; without even the implied warranty of |
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
*| GNU General Public License for more details. |
*| |
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the |
*| Free Software Foundation, Inc., |
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
*\---------------------------------------------------------------------/
METHOD createixmldocfromobject .
DATA rootnode TYPE REF TO if_ixml_element.
DATA sourcenode TYPE REF TO if_ixml_element.
DATA rc TYPE sysubrc.
DATA sourcestring TYPE string.
DATA _objtype TYPE string.
DATA: l_filename TYPE string,
l_file_filter TYPE string,
l_user_action TYPE i.
DATA: wa_node type ssfgnode,
l_element TYPE REF TO if_ixml_element.
DATA: l_language_str TYPE string,
l_language(2) TYPE c.
DATA: l_lines TYPE i,
l_splitted_name_tab TYPE TABLE OF string.
DATA: l_stylename TYPE tdssname,
l_stylevari TYPE tdvariant,
l_save_style TYPE tdssname.
TYPES: t_raw(250) TYPE x.
CONSTANTS: c_xml_ns_uri_sf(255) TYPE c
VALUE 'urn:sap-com:SmartForms:2000:internal-structure',"#EC NOTEXT
c_xml_ns_uri_ifr(255) TYPE c
VALUE 'urn:sap-com:sdixml-ifr:2000'. "#EC NOTEXT
DATA: g_ixml TYPE REF TO if_ixml,
xml_macro_rc TYPE i,
xml_document TYPE REF TO if_ixml_document,
xml_ns_prefix_sf TYPE string,
xml_ns_uri_sf TYPE string,
xml_ns_uri_ifr TYPE string,
xml_document_size TYPE i,
xml_xtable TYPE TABLE OF t_raw,
xml_xtable2 TYPE TABLE OF string,
sform_name TYPE tdsfname.
DATA ref_ssf TYPE REF TO cl_ssf_fb_smart_form.
sform_name = objname.
IF g_ixml IS INITIAL.
g_ixml = cl_ixml=>create( ).
ENDIF.
xml_document = g_ixml->create_document( ).
xml_ns_prefix_sf = 'sf'.
xml_ns_uri_sf = c_xml_ns_uri_sf.
xml_ns_uri_ifr = c_xml_ns_uri_ifr.
CLEAR: xml_document_size, xml_xtable[], xml_xtable2[].
CREATE OBJECT ref_ssf.
TRY.
CALL METHOD ref_ssf->load
EXPORTING
im_formname = sform_name.
ref_ssf->xml_init( ).
CALL METHOD ref_ssf->xml_download
EXPORTING
parent = xml_document
CHANGING
document = xml_document.
* namespace
l_element = xml_document->get_root_element( ).
l_element->set_attribute( name = xml_ns_prefix_sf
namespace = 'xmlns'
value = xml_ns_uri_sf ).
l_element->set_attribute( name = 'xmlns'
value = xml_ns_uri_ifr ).
* language
WRITE sy-langu TO l_language.
l_language_str = l_language.
xml_macro_rc = l_element->set_attribute(
name = 'language'
namespace = xml_ns_prefix_sf
value = l_language_str ).
* convert DOM to xml
CALL FUNCTION 'SDIXML_DOM_TO_XML'
EXPORTING
document = xml_document
IMPORTING
size = xml_document_size
TABLES
xml_as_table = xml_xtable
EXCEPTIONS
OTHERS = 1.
CHECK sy-subrc EQ 0.
_objtype = getobjecttype( ).
rootnode = xmldoc->create_element( _objtype ).
DATA: wa_stxfadm TYPE stxfadm.
SELECT SINGLE * FROM stxfadm INTO wa_stxfadm WHERE formname = objname.
setattributesfromstructure( node = rootnode structure = wa_stxfadm
).
sourcenode = xmldoc->create_element( 'smartform' ).
xml_xtable2 = xml_xtable[].
sourcestring = buildsourcestring( sourcetable = xml_xtable2[] ).
rc = sourcenode->if_ixml_node~set_value( sourcestring ).
rc = rootnode->append_child( sourcenode ).
rc = xmldoc->append_child( rootnode ).
ixmldocument = xmldoc.
FREE: xml_document, xml_xtable[], xml_document_size.
CATCH cx_ssf_fb .
CLEAR ixmldocument.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_found.
ENDTRY.
ENDMETHOD.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version. |
*| |
*| SAPlink is distributed in the hope that it will be useful, |
*| but WITHOUT ANY WARRANTY; without even the implied warranty of |
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
*| GNU General Public License for more details. |
*| |
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the |
*| Free Software Foundation, Inc., |
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
*\---------------------------------------------------------------------/
METHOD createobjectfromixmldoc .
TYPES: t_raw(250) TYPE x.
DATA rootnode TYPE REF TO if_ixml_element.
DATA progattribs TYPE trdir.
DATA sourcenode TYPE REF TO if_ixml_element.
DATA l_xml_node TYPE REF TO if_ixml_element.
DATA source TYPE string.
DATA sourcetable TYPE table_of_strings.
DATA _objtype TYPE string.
DATA checkexists TYPE flag.
DATA: wa_stxfadm TYPE stxfadm,
formname TYPE tdsfname,
master_language TYPE sylangu,
lv_devclass TYPE devclass,
korrnum TYPE trkorr,
modif_language TYPE sylangu.
DATA: g_ixml TYPE REF TO if_ixml,
xml_macro_rc TYPE i,
xml_document TYPE REF TO if_ixml_document,
l_element TYPE REF TO if_ixml_element,
xml_ns_prefix_sf TYPE string,
xml_ns_uri_sf TYPE string,
xml_ns_uri_ifr TYPE string,
xml_document_size TYPE i,
xml_xtable TYPE TABLE OF t_raw,
l_ns_uri TYPE string,
l_name TYPE string,
l_language TYPE string,
p_dequeue TYPE tdbool,
l_cancel TYPE tdsfflag,
sf_exception TYPE REF TO cx_ssf_fb.
DATA: ref_ssf TYPE REF TO cl_ssf_fb_smart_form,
l_upload_smartform TYPE REF TO cl_ssf_fb_smart_form.
_objtype = getobjecttype( ).
xmldoc = ixmldocument.
rootnode = xmldoc->find_from_name( _objtype ).
CALL METHOD getstructurefromattributes
EXPORTING
node = rootnode
CHANGING
structure = wa_stxfadm.
objname = wa_stxfadm-formname.
checkexists = checkexists( ).
IF checkexists IS NOT INITIAL.
IF overwrite IS INITIAL.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>existing.
ELSE.
* delete object for new install
deleteobject( ).
ENDIF.
ENDIF.
sourcenode = rootnode->find_from_name( 'smartform' ).
source = sourcenode->get_value( ).
sourcetable = buildtablefromstring( source ).
xml_xtable = sourcetable.
xml_document_size = STRLEN( source ).
CREATE OBJECT ref_ssf.
formname = objname.
* Check access permission and enqueue smart form
master_language = sy-langu.
TRY.
CALL METHOD ref_ssf->enqueue
EXPORTING
suppress_corr_check = space
language_upd_exit = ' '
master_language = master_language
mode = 'INSERT'
formname = formname
IMPORTING
devclass = lv_devclass
new_master_language = master_language
korrnum = korrnum
modification_language = modif_language.
CATCH cx_ssf_fb INTO sf_exception.
CASE sf_exception->textid.
WHEN cx_ssf_fb=>enqueued_by_user OR cx_ssf_fb=>enqueue_system_failure.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING msg = 'Enqueued by user'.
WHEN cx_ssf_fb=>no_modify_permission OR cx_ssf_fb=>no_show_permission.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING msg = 'Permission Error'.
WHEN cx_ssf_fb=>permission_failure.
EXIT.
WHEN cx_ssf_fb=>request_language_denied.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING msg = 'Language request denied'.
WHEN OTHERS.
EXIT.
ENDCASE.
ENDTRY.
CALL FUNCTION 'SDIXML_XML_TO_DOM'
EXPORTING
xml = xml_xtable[]
size = xml_document_size
IMPORTING
document = xml_document
EXCEPTIONS
OTHERS = 1.
l_xml_node = xml_document->get_root_element( ).
l_ns_uri = l_xml_node->get_namespace_uri( ).
l_name = l_xml_node->get_name( ).
l_element ?= l_xml_node->query_interface( ixml_iid_element ).
l_language = l_element->get_attribute( name = 'language'
namespace = xml_ns_prefix_sf ).
CREATE OBJECT l_upload_smartform.
CALL METHOD l_upload_smartform->xml_upload
EXPORTING
dom = l_xml_node
formname = formname
language = master_language
CHANGING
sform = ref_ssf.
ref_ssf = l_upload_smartform.
PERFORM save_form IN PROGRAM saplstxb
USING
' ' 'X'
CHANGING
ref_ssf
l_cancel.
FREE: xml_document.
* dequeue form
ref_ssf->dequeue( formname = formname ).
* successful install
name = objname.
ENDMETHOD.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version. |
*| |
*| SAPlink is distributed in the hope that it will be useful, |
*| but WITHOUT ANY WARRANTY; without even the implied warranty of |
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
*| GNU General Public License for more details. |
*| |
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the |
*| Free Software Foundation, Inc., |
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
*\---------------------------------------------------------------------/
METHOD deleteobject .
CALL FUNCTION 'FB_DELETE_FORM'
EXPORTING
I_FORMNAME = OBJNAME
* I_FORMTYPE = ' '
* I_WITH_DIALOG = 'X'
* I_WITH_CONFIRM_DIALOG = 'X'
* IMPORTING
* O_FORMNAME =
EXCEPTIONS
NO_NAME = 1
NO_FORM = 2
FORM_LOCKED = 3
NO_ACCESS_PERMISSION = 4
ILLEGAL_LANGUAGE = 5
ILLEGAL_FORMTYPE = 6
OTHERS = 7
.
IF sy-subrc <> 0.
ENDIF.
ENDMETHOD. "createobjectfromixmldoc
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version. |
*| |
*| SAPlink is distributed in the hope that it will be useful, |
*| but WITHOUT ANY WARRANTY; without even the implied warranty of |
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
*| GNU General Public License for more details. |
*| |
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the |
*| Free Software Foundation, Inc., |
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
*\---------------------------------------------------------------------/
method GETOBJECTTYPE .
objectType = 'SSFO'. "SAP Smartforms
endmethod.
endclass. "ZSAPLINK_SMARTFORM implementation | [
4871,
1168,
50,
2969,
43,
17248,
62,
12310,
7227,
21389,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
1168,
50,
2969,
43,
17248,
198,
220,
2457,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
5050,
5870,
25171,
6369,
1797,
4694,
198,
220,
220,
220,
34087,
17750,
764,
198,
220,
5050,
29244,
6158,
10426,
5805,
38715,
10913,
2662,
9864,
23680,
198,
220,
220,
220,
34087,
17750,
764,
198,
220,
5050,
29244,
1404,
4720,
33,
23680,
10913,
2662,
10426,
5805,
38715,
198,
220,
220,
220,
34087,
17750,
764,
198,
24326,
2665,
13,
628,
220,
5050,
5550,
28882,
4720,
33,
23680,
198,
220,
220,
220,
34087,
17750,
764,
198,
220,
5050,
17151,
9864,
23680,
25216,
198,
220,
220,
220,
34087,
17750,
764,
198,
19734,
2665,
13,
198,
437,
4871,
13,
366,
57,
50,
2969,
43,
17248,
62,
12310,
7227,
21389,
6770,
628,
198,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
1398,
1168,
50,
2969,
43,
17248,
62,
12310,
7227,
21389,
7822,
13,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
4871,
1168,
50,
2969,
43,
17248,
62,
12310,
7227,
21389,
7822,
13,
628,
198,
16208,
10097,
30934,
59,
198,
9,
91,
220,
220,
770,
2393,
318,
636,
286,
48323,
8726,
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,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
48323,
8726,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
220,
220,
930,
198,
9,
91,
220,
220,
340,
739,
262,
2846,
286,
262,
22961,
3611,
5094,
13789,
355,
3199,
930,
198,
9,
91,
220,
220,
416,
262,
3232,
10442,
5693,
26,
2035,
2196,
362,
286,
262,
13789,
11,
930,
198,
9,
91,
220,
220,
393,
357,
265,
534,
3038,
8,
597,
1568,
2196,
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,
930,
198,
9,
91,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
48323,
8726,
318,
9387,
287,
262,
2911,
326,
340,
481,
307,
4465,
11,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
475,
42881,
15529,
34764,
56,
26,
1231,
772,
262,
17142,
18215,
286,
220,
220,
220,
930,
198,
9,
91,
220,
220,
34482,
3398,
1565,
5603,
25382,
393,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
13,
220,
4091,
262,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
22961,
3611,
5094,
13789,
329,
517,
3307,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
921,
815,
423,
2722,
257,
4866,
286,
262,
22961,
3611,
5094,
13789,
930,
198,
9,
91,
220,
220,
1863,
351,
48323,
8726,
26,
611,
407,
11,
3551,
284,
262,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
3232,
10442,
5693,
11,
3457,
1539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
6885,
14021,
520,
11,
19383,
22343,
11,
6182,
11,
8779,
220,
657,
2481,
940,
12,
1485,
486,
220,
4916,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
59,
10097,
30934,
14,
198,
49273,
1125,
66,
365,
87,
1023,
764,
628,
220,
33493,
311,
2751,
2538,
1296,
3672,
16034,
336,
26152,
324,
76,
39319,
26181,
3672,
33411,
1296,
3672,
796,
26181,
3672,
13,
198,
220,
16876,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
7160,
796,
705,
55,
4458,
198,
220,
23578,
5064,
13,
198,
198,
10619,
49273,
13,
628,
198,
16208,
10097,
30934,
59,
198,
9,
91,
220,
220,
770,
2393,
318,
636,
286,
48323,
8726,
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,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
48323,
8726,
318,
1479
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_aoc_super DEFINITION
PUBLIC
INHERITING FROM cl_ci_test_scan
ABSTRACT
CREATE PUBLIC
GLOBAL FRIENDS zcl_aoc_unit_test .
PUBLIC SECTION.
TYPE-POOLS zzaoc .
TYPES:
ty_structures_tt TYPE STANDARD TABLE OF sstruc WITH NON-UNIQUE DEFAULT KEY .
METHODS constructor .
METHODS check
IMPORTING
!io_scan TYPE REF TO zcl_aoc_scan .
CLASS-METHODS get_destination
RETURNING
VALUE(rv_result) TYPE rfcdest .
METHODS set_source
IMPORTING
!iv_name TYPE level_name
!it_code TYPE string_table .
METHODS get_attributes
REDEFINITION .
METHODS if_ci_test~display_documentation
REDEFINITION .
METHODS if_ci_test~query_attributes
REDEFINITION .
METHODS put_attributes
REDEFINITION .
METHODS run
REDEFINITION .
PROTECTED SECTION.
TYPES:
BEGIN OF ty_destination_cache,
srcid TYPE sysuuid_x,
rfcdest TYPE rfcdest,
END OF ty_destination_cache .
TYPES ty_scimessage_text TYPE c LENGTH 255.
DATA mv_errty TYPE sci_errty .
CLASS-DATA gs_destination_cache TYPE ty_destination_cache .
METHODS enable_rfc .
METHODS get_source
IMPORTING
!is_level TYPE slevel
RETURNING
VALUE(rt_code) TYPE string_table .
METHODS is_class_pool
IMPORTING
!iv_include TYPE level_name
RETURNING
VALUE(rv_bool) TYPE abap_bool .
METHODS is_class_definition
IMPORTING
!iv_include TYPE level_name
RETURNING
VALUE(rv_bool) TYPE abap_bool .
METHODS is_generated
IMPORTING
!iv_name TYPE csequence OPTIONAL
RETURNING
VALUE(rv_generated) TYPE abap_bool .
METHODS enable_checksum.
METHODS is_checksum_enabled
RETURNING
VALUE(rv_enabled) TYPE abap_bool.
METHODS insert_scimessage
IMPORTING
!iv_code TYPE scimessage-code
!iv_text TYPE ty_scimessage_text
!iv_pcom TYPE scimessage-pcom OPTIONAL .
METHODS has_pseudo_comment
IMPORTING
!i_comment TYPE scimessage-pcom
!is_statement TYPE sstmnt
RETURNING
VALUE(r_comment_exists) TYPE abap_bool.
METHODS inform
REDEFINITION .
PRIVATE SECTION.
TYPES:
BEGIN OF ty_source,
name TYPE level_name,
code TYPE string_table,
END OF ty_source .
TYPES:
ty_source_tt TYPE SORTED TABLE OF ty_source WITH UNIQUE KEY name .
DATA mt_source TYPE ty_source_tt.
DATA mv_uses_checksum TYPE abap_bool.
METHODS check_class
IMPORTING
!iv_sub_obj_name TYPE sobj_name
RETURNING
VALUE(rv_skip) TYPE abap_bool .
METHODS check_wdy
IMPORTING
!iv_sub_obj_type TYPE trobjtype
!iv_sub_obj_name TYPE sobj_name
!iv_line TYPE token_row
RETURNING
VALUE(rv_skip) TYPE abap_bool .
METHODS get_checksum
IMPORTING
!iv_position TYPE int4
RETURNING
VALUE(rv_checksum) TYPE int4.
METHODS set_uses_checksum
IMPORTING
!iv_enable TYPE abap_bool DEFAULT abap_true.
ENDCLASS.
CLASS ZCL_AOC_SUPER IMPLEMENTATION.
METHOD check.
* add code here
ASSERT 0 = 1.
ENDMETHOD.
METHOD check_class.
DATA: lv_category TYPE seoclassdf-category,
lv_proxy TYPE seoclassdf-clsproxy,
lv_abstract TYPE seoclassdf-clsabstrct,
lv_super TYPE seometarel-refclsname,
ls_mtdkey TYPE seocpdkey.
IF object_type <> 'CLAS'
AND object_type <> 'INTF'.
RETURN.
ENDIF.
SELECT SINGLE category clsproxy clsabstrct FROM seoclassdf
INTO (lv_category, lv_proxy, lv_abstract)
WHERE clsname = object_name
AND version = '1'.
IF sy-subrc <> 0.
RETURN.
ENDIF.
* skip persistent co-classes and web dynpro runtime objects
IF lv_category = seoc_category_p_agent
OR lv_category = seoc_category_webdynpro_class
OR lv_proxy = abap_true.
rv_skip = abap_true.
RETURN.
ENDIF.
* skip constructor in exception classes
IF lv_category = seoc_category_exception.
cl_oo_classname_service=>get_method_by_include(
EXPORTING
incname = iv_sub_obj_name
RECEIVING
mtdkey = ls_mtdkey
EXCEPTIONS
class_not_existing = 1
method_not_existing = 2
OTHERS = 3 ).
IF sy-subrc = 0 AND ls_mtdkey-cpdname = 'CONSTRUCTOR'.
rv_skip = abap_true.
RETURN.
ENDIF.
ENDIF.
* skip BOPF constants interfaces
IF object_type = 'INTF' AND object_name CP '*_C'.
SELECT SINGLE refclsname FROM seometarel INTO lv_super
WHERE clsname = object_name
AND reltype = '0'. "#EC CI_NOORDER
IF sy-subrc = 0 AND lv_super = '/BOBF/IF_LIB_CONSTANTS'.
rv_skip = abap_true.
RETURN.
ENDIF.
ENDIF.
* skip classes generated by Gateway Builder/SEGW
IF ( lv_abstract = abap_true AND object_name CP '*_DPC' )
OR object_name CP '*_MPC'. "#EC CI_NOORDER
SELECT SINGLE refclsname FROM seometarel INTO lv_super
WHERE clsname = object_name AND reltype = '2'.
IF sy-subrc = 0
AND ( lv_super = '/IWBEP/CL_MGW_PUSH_ABS_MODEL'
OR lv_super = '/IWBEP/CL_MGW_PUSH_ABS_DATA' ).
rv_skip = abap_true.
RETURN.
ENDIF.
ENDIF.
* skip objects generated by SADL toolkit
IF lv_super = 'CL_SADL_GTK_EXPOSURE_MPC'.
rv_skip = abap_true.
ENDIF.
ENDMETHOD.
METHOD check_wdy.
DATA: ls_map_header TYPE wdy_wb_sourcemap,
lo_tool_state TYPE REF TO cl_wdy_wb_vc_state,
lv_inclname TYPE program,
ls_controller TYPE wdy_controller_key,
lt_map TYPE wdyrt_line_info_tab_type,
lv_no_codepos TYPE seu_bool.
IF iv_sub_obj_type <> 'PROG' OR iv_sub_obj_name(8) <> '/1BCWDY/'.
RETURN.
ENDIF.
lv_inclname = iv_sub_obj_name.
CALL FUNCTION 'WDY_WB_GET_SOURCECODE_MAPPING'
EXPORTING
p_include = lv_inclname
IMPORTING
p_map = lt_map
p_header = ls_map_header
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
RETURN.
ENDIF.
ls_controller-component_name = ls_map_header-component_name.
ls_controller-controller_name = ls_map_header-controller_name.
cl_wdy_wb_error_handling=>create_tool_state_for_codepos(
EXPORTING
p_controller_key = ls_controller
p_controller_type = ls_map_header-ctrl_type
p_line = iv_line
p_lineinfo = lt_map
IMPORTING
p_no_corresponding_codepos = lv_no_codepos
p_tool_state = lo_tool_state ).
IF lv_no_codepos = abap_true OR lo_tool_state IS INITIAL.
rv_skip = abap_true.
ENDIF.
ENDMETHOD.
METHOD constructor.
super->constructor( ).
"get description of check class
SELECT SINGLE descript FROM seoclasstx INTO description
WHERE clsname = myname
AND langu = sy-langu.
IF sy-subrc <> 0.
SELECT SINGLE descript FROM seoclasstx INTO description
WHERE clsname = myname. "#EC CI_NOORDER "#EC CI_SUBRC
ENDIF.
category = 'ZCL_AOC_CATEGORY'.
mv_errty = 'E'.
ENDMETHOD.
METHOD enable_checksum.
mv_uses_checksum = abap_true.
ENDMETHOD.
METHOD enable_rfc.
* RFC enable the check, new feature for central ATC on 7.51
FIELD-SYMBOLS: <lv_rfc> TYPE abap_bool.
ASSIGN ('REMOTE_RFC_ENABLED') TO <lv_rfc>.
IF sy-subrc = 0.
<lv_rfc> = abap_true.
ENDIF.
ENDMETHOD.
METHOD get_attributes.
EXPORT mv_errty = mv_errty TO DATA BUFFER p_attributes.
ENDMETHOD.
METHOD get_checksum.
DATA: ls_statement TYPE sstmnt,
ls_checksum TYPE sci_crc64.
IF is_checksum_enabled( ) = abap_false.
RETURN.
ENDIF.
IF ref_scan IS INITIAL.
rv_checksum = 123456. " running as unit test, return fixed checksum
RETURN.
ENDIF.
READ TABLE ref_scan->statements INDEX iv_position INTO ls_statement.
IF sy-subrc <> 0 OR ls_statement-type = 'P' OR ls_statement-type = 'S' OR ls_statement-type = 'G'.
set_uses_checksum( abap_false ).
ELSE.
TRY.
* parameter "p_version" does not exist in 751
* value p_version = '2' does not exist in 752
CALL METHOD ('GET_STMT_CHECKSUM')
EXPORTING
p_position = iv_position
CHANGING
p_checksum = ls_checksum
EXCEPTIONS
error = 0.
CATCH cx_sy_dyn_call_illegal_method cx_sy_dyn_call_param_not_found.
RETURN.
ENDTRY.
rv_checksum = ls_checksum-i1.
ENDIF.
ENDMETHOD.
METHOD get_destination.
"get destination of calling system (RFC enabled checks only)
"class, method and variable may not valid in 7.02 systems -> dynamic calls
FIELD-SYMBOLS: <lv_srcid> TYPE sysuuid_x.
ASSIGN ('SRCID') TO <lv_srcid>.
IF NOT <lv_srcid> IS ASSIGNED OR <lv_srcid> IS INITIAL.
rv_result = |NONE|.
RETURN.
ENDIF.
IF gs_destination_cache-srcid = <lv_srcid>.
rv_result = gs_destination_cache-rfcdest.
RETURN.
ENDIF.
TRY.
CALL METHOD ('CL_ABAP_SOURCE_ID')=>('GET_DESTINATION')
EXPORTING
p_srcid = <lv_srcid>
RECEIVING
p_destination = rv_result
EXCEPTIONS
not_found = 1.
IF sy-subrc <> 0.
rv_result = |NONE|.
ELSE.
* database table SCR_SRCID is not buffered, so buffer it here
gs_destination_cache-srcid = <lv_srcid>.
gs_destination_cache-rfcdest = rv_result.
ENDIF.
CATCH cx_sy_dyn_call_illegal_class
cx_sy_dyn_call_illegal_method.
rv_result = |NONE|.
ENDTRY.
ENDMETHOD.
METHOD get_source.
DATA: ls_source LIKE LINE OF mt_source,
lt_source TYPE STANDARD TABLE OF abaptxt255 WITH DEFAULT KEY,
lv_destination TYPE rfcdest.
FIELD-SYMBOLS: <ls_source> LIKE LINE OF mt_source.
IF is_level-type = zcl_aoc_scan=>gc_level-macro_define
OR is_level-type = zcl_aoc_scan=>gc_level-macro_trmac.
RETURN.
ENDIF.
READ TABLE mt_source ASSIGNING <ls_source> WITH KEY name = is_level-name.
IF sy-subrc = 0.
rt_code = <ls_source>-code.
ELSE.
lv_destination = get_destination( ).
CALL FUNCTION 'RPY_PROGRAM_READ'
DESTINATION lv_destination
EXPORTING
program_name = is_level-name
with_includelist = abap_false
only_source = abap_true
with_lowercase = abap_true
TABLES
source_extended = lt_source
EXCEPTIONS
cancelled = 1
not_found = 2
permission_error = 3
OTHERS = 4.
ASSERT sy-subrc = 0.
rt_code = lt_source.
ls_source-name = is_level-name.
ls_source-code = rt_code.
INSERT ls_source INTO TABLE mt_source.
ENDIF.
ENDMETHOD.
METHOD if_ci_test~display_documentation.
DATA: lv_url TYPE string VALUE 'http://docs.abapopenchecks.org/checks/' ##NO_TEXT,
lt_string TYPE STANDARD TABLE OF string,
lv_num TYPE string,
lv_lines TYPE i.
SPLIT myname AT '_' INTO TABLE lt_string.
lv_lines = lines( lt_string ).
READ TABLE lt_string INTO lv_num INDEX lv_lines.
CONCATENATE lv_url lv_num INTO lv_url.
cl_gui_frontend_services=>execute(
EXPORTING
document = lv_url
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
synchronous_failed = 8
not_supported_by_gui = 9
OTHERS = 10 ). "#EC CI_SUBRC
ENDMETHOD.
METHOD if_ci_test~query_attributes.
zzaoc_top.
zzaoc_fill_att mv_errty 'Error Type' ''. "#EC NOTEXT
zzaoc_popup.
ENDMETHOD.
METHOD inform.
DATA: lv_cnam TYPE reposrc-cnam,
lv_area TYPE tvdir-area,
lv_skip TYPE abap_bool,
lv_sub_obj_type LIKE p_sub_obj_type,
lv_line LIKE p_line,
lv_column LIKE p_column,
lv_checksum_1 TYPE int4.
FIELD-SYMBOLS: <ls_message> LIKE LINE OF scimessages.
lv_sub_obj_type = p_sub_obj_type.
IF lv_sub_obj_type IS INITIAL AND NOT p_sub_obj_name IS INITIAL.
lv_sub_obj_type = 'PROG'.
ENDIF.
IF lv_sub_obj_type = 'PROG' AND p_sub_obj_name <> ''.
IF p_sub_obj_name CP 'MP9+++BI' OR p_sub_obj_name CP 'MP9+++00'.
RETURN. " custom HR infotype includes
ENDIF.
IF cl_enh_badi_def_utility=>is_sap_system( ) = abap_false.
SELECT SINGLE cnam FROM reposrc INTO lv_cnam
WHERE progname = p_sub_obj_name AND r3state = 'A'.
IF sy-subrc = 0
AND ( lv_cnam = 'SAP'
OR lv_cnam = 'SAP*'
OR lv_cnam = 'DDIC' ).
RETURN.
ENDIF.
ENDIF.
ENDIF.
IF object_type = 'SSFO'
AND lv_sub_obj_type = 'PROG'
AND ( p_sub_obj_name CP '/1BCDWB/LSF*'
OR p_sub_obj_name CP '/1BCDWB/SAPL*' ).
RETURN.
ENDIF.
IF object_type = 'FUGR'.
IF p_sub_obj_name CP 'LY*UXX'
OR p_sub_obj_name CP 'LZ*UXX'
OR zcl_aoc_util_reg_atc_namespace=>is_registered_fugr_uxx( p_sub_obj_name ) = abap_true.
RETURN.
ENDIF.
SELECT SINGLE area FROM tvdir INTO lv_area
WHERE area = object_name ##WARN_OK. "#EC CI_GENBUFF
IF sy-subrc = 0.
RETURN.
ENDIF.
ENDIF.
lv_skip = check_class( p_sub_obj_name ).
IF lv_skip = abap_true.
RETURN.
ENDIF.
lv_skip = check_wdy( iv_sub_obj_type = lv_sub_obj_type
iv_sub_obj_name = p_sub_obj_name
iv_line = p_line ).
IF lv_skip = abap_true.
RETURN.
ENDIF.
READ TABLE scimessages ASSIGNING <ls_message>
WITH KEY test = myname code = p_code.
IF sy-subrc = 0.
<ls_message>-kind = p_kind.
ENDIF.
IF sy-subrc = 0 AND NOT mt_source IS INITIAL.
READ TABLE mt_source
WITH KEY name = '----------------------------------------'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0 AND lines( mt_source ) = 1.
* fix failing unit tests
CLEAR <ls_message>-pcom.
ENDIF.
ENDIF.
" Determine line and column, if empty.
" Findings in macros for example are reported with line 0.
" This leads to problems with the filter for findings in SAP standard code.
" We need to find the calling statement and point to this line.
lv_line = p_line.
lv_column = p_column.
IF ( lv_line = 0 OR lv_column = 0 ) AND p_position <> 0 AND NOT ref_scan IS INITIAL.
READ TABLE ref_scan->statements INTO statement_wa INDEX p_position.
IF sy-subrc = 0.
get_line_column_rel(
EXPORTING
p_n = 1
IMPORTING
p_line = lv_line
p_column = lv_column ).
ENDIF.
ENDIF.
set_uses_checksum( is_checksum_enabled( ) ).
IF sy-subrc = 0 AND p_checksum_1 IS NOT INITIAL.
lv_checksum_1 = p_checksum_1.
ELSE.
lv_checksum_1 = get_checksum( p_position ).
ENDIF.
super->inform(
p_sub_obj_type = lv_sub_obj_type
p_sub_obj_name = p_sub_obj_name
p_position = p_position
p_line = lv_line
p_column = lv_column
p_errcnt = p_errcnt
p_kind = p_kind
p_test = p_test
p_code = p_code
p_suppress = p_suppress
p_param_1 = p_param_1
p_param_2 = p_param_2
p_param_3 = p_param_3
p_param_4 = p_param_4
p_inclspec = p_inclspec
p_detail = p_detail
p_checksum_1 = lv_checksum_1 ).
set_uses_checksum( is_checksum_enabled( ) ).
ENDMETHOD.
METHOD insert_scimessage.
* Insert entry into table scimessages, this table is used to determine the message text for a finding.
DATA ls_scimessage LIKE LINE OF scimessages.
ls_scimessage-test = myname.
ls_scimessage-code = iv_code.
ls_scimessage-kind = mv_errty.
ls_scimessage-text = iv_text.
ls_scimessage-pcom = iv_pcom.
INSERT ls_scimessage INTO TABLE scimessages.
ENDMETHOD.
METHOD is_checksum_enabled.
rv_enabled = mv_uses_checksum.
ENDMETHOD.
METHOD is_class_definition.
IF strlen( iv_include ) = 32
AND ( object_type = 'CLAS' OR object_type = 'INTF' )
AND ( iv_include+30(2) = 'CO'
OR iv_include+30(2) = 'CI'
OR iv_include+30(2) = 'CU'
OR iv_include+30(2) = 'IU' ).
rv_bool = abap_true.
ELSE.
rv_bool = abap_false.
ENDIF.
ENDMETHOD.
METHOD is_class_pool.
IF strlen( iv_include ) = 32
AND ( ( object_type = 'CLAS'
AND iv_include+30(2) = 'CP' )
OR ( object_type = 'INTF'
AND iv_include+30(2) = 'IP' ) ).
rv_bool = abap_true.
ELSE.
rv_bool = abap_false.
ENDIF.
ENDMETHOD.
METHOD is_generated.
DATA lv_genflag TYPE tadir-genflag.
SELECT SINGLE genflag
FROM tadir
INTO lv_genflag
WHERE pgmid = 'R3TR'
AND object = object_type
AND obj_name = object_name
AND genflag = abap_true.
rv_generated = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD put_attributes.
IMPORT
mv_errty = mv_errty
FROM DATA BUFFER p_attributes. "#EC CI_USE_WANTED
ASSERT sy-subrc = 0.
ENDMETHOD.
METHOD run.
* abapOpenChecks
* https://github.com/larshp/abapOpenChecks
* MIT License
CLEAR mt_source. " limit memory use
IF program_name IS INITIAL.
RETURN.
ENDIF.
IF ref_scan IS INITIAL AND get( ) <> abap_true.
RETURN.
ENDIF.
IF is_generated( ) = abap_true.
RETURN.
ENDIF.
IF ref_include IS BOUND.
* ref_include is not set when running checks via RFC
set_source( iv_name = ref_include->trdir-name
it_code = ref_include->lines ).
ENDIF.
check( zcl_aoc_scan=>create_from_ref( ref_scan ) ).
ENDMETHOD.
METHOD set_source.
* used for unit testing
DATA: ls_source LIKE LINE OF mt_source.
ls_source-name = iv_name.
ls_source-code = it_code.
INSERT ls_source INTO TABLE mt_source.
ENDMETHOD.
METHOD set_uses_checksum.
* Activate checksum for current check, new feature for central ATC on 7.51
FIELD-SYMBOLS: <lv_uses_checksum> TYPE abap_bool.
IF is_checksum_enabled( ) = abap_false.
RETURN.
ENDIF.
ASSIGN ('USES_CHECKSUM') TO <lv_uses_checksum>.
IF sy-subrc = 0.
<lv_uses_checksum> = iv_enable.
ENDIF.
ENDMETHOD.
METHOD has_pseudo_comment.
r_comment_exists = abap_false.
LOOP AT ref_scan->statements TRANSPORTING NO FIELDS
WHERE table_line = is_statement.
DATA(comment_statement_index) = sy-tabix - 1.
EXIT.
ENDLOOP.
IF sy-subrc <> 0.
RETURN.
ENDIF.
"Read Previous Statement
READ TABLE ref_scan->statements INTO DATA(ls_statement)
INDEX comment_statement_index.
IF sy-subrc <> 0 OR
( ls_statement-type <> zcl_aoc_scan=>gc_statement-comment and
ls_statement-type <> zcl_aoc_scan=>gc_statement-comment_in_stmnt ).
"No Preceding Statement or Not a comment statement
RETURN.
ENDIF.
"Check Comment Statement
LOOP AT ref_scan->tokens INTO DATA(ls_token)
FROM ls_statement-from TO ls_statement-to.
IF ( ls_token-type = zcl_aoc_scan=>gc_token-comment AND ls_token-str = |"#EC { to_upper( i_comment ) }| ).
r_comment_exists = abap_true.
RETURN.
ENDIF.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
64,
420,
62,
16668,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
537,
62,
979,
62,
9288,
62,
35836,
198,
220,
9564,
18601,
10659,
198,
220,
29244,
6158,
44731,
198,
220,
10188,
9864,
1847,
48167,
1677,
5258,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
41876,
12,
16402,
3535,
50,
1976,
4496,
420,
764,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
7249,
942,
62,
926,
41876,
49053,
9795,
43679,
3963,
264,
19554,
66,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
764,
628,
220,
220,
220,
337,
36252,
50,
23772,
764,
198,
220,
220,
220,
337,
36252,
50,
2198,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
35836,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
35836,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
16520,
1883,
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,
374,
69,
10210,
395,
764,
198,
220,
220,
220,
337,
36252,
50,
900,
62,
10459,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
41876,
1241,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
8189,
41876,
4731,
62,
11487,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
1078,
7657,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
611,
62,
979,
62,
9288,
93,
13812,
62,
22897,
341,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
611,
62,
979,
62,
9288,
93,
22766,
62,
1078,
7657,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
1234,
62,
1078,
7657,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
1057,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
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,
16520,
1883,
62,
23870,
11,
198,
220,
220,
220,
220,
220,
220,
220,
12351,
312,
220,
220,
41876,
827,
2385,
27112,
62,
87,
11,
198,
220,
220,
220,
220,
220,
220,
220,
374,
69,
10210,
395,
41876,
374,
69,
10210,
395,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
16520,
1883,
62,
23870,
764,
198,
220,
220,
220,
24412,
47,
1546,
1259,
62,
1416,
320,
7589,
62,
5239,
41876,
269,
406,
49494,
14280,
13,
628,
220,
220,
220,
42865,
285,
85,
62,
8056,
774,
41876,
20681,
62,
8056,
774,
764,
198,
220,
220,
220,
42715,
12,
26947,
308,
82,
62,
16520,
1883,
62,
23870,
41876,
1259,
62,
16520,
1883,
62,
23870,
764,
628,
220,
220,
220,
337,
36252,
50,
7139,
62,
81,
16072,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
10459,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
5715,
220,
220,
220,
220,
220,
41876,
3133,
626,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
8189,
8,
41876,
4731,
62,
11487,
764,
198,
220,
220,
220,
337,
36252,
50,
318,
62,
4871,
62,
7742,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
17256,
220,
220,
220,
41876,
1241,
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,
30388,
8,
41876,
450,
499,
62,
30388,
764,
198,
220,
220,
220,
337,
36252,
50,
318,
62,
4871,
62,
46758,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
17256,
220,
220,
220,
41876,
1241,
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,
30388,
8,
41876,
450,
499,
62,
30388,
764,
198,
220,
220,
220,
337,
36252,
50,
318,
62,
27568,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
43167,
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,
27568,
8,
41876,
450,
499,
62,
30388,
764,
198,
220,
220,
220,
337,
36252,
50,
7139,
62,
42116,
388,
13,
198,
220,
220,
220,
337,
36252,
50,
318,
62,
42116,
388,
62,
25616,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
25616,
8,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
337,
36252,
50,
7550,
62,
1416,
320,
7589,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8189,
41876,
629,
320,
7589,
12,
8189,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
5239,
41876,
1259,
62,
1416,
320,
7589,
62,
5239,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
79,
785,
41876,
629,
320,
7589,
12,
79,
785,
39852,
2849,
1847,
764,
198,
220,
220,
220,
337,
36252,
50,
468,
62,
7752,
12003,
62,
23893,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
23893,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
629,
320,
7589,
12,
79,
785,
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,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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
] |
*&---------------------------------------------------------------------*
*& Include ZREST_SCHED_BATCH_F01
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
* Modification History *
*----------------------------------------------------------------------*
* Date | USER ID | VSTF | Transport | Remarks *
*-----------|----------|--------|------------|-------------------------*
*Feb' 2018 | V-MYAL | 3019845| MP2K905030 | Initial development *
*05/17/2018 | V-MYAL | 3454161| MP2K905442 | More enhancements *
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM get_data CHANGING pv_job_count TYPE i
pv_rec_cnt TYPE i
pv_rc TYPE sy-subrc.
SELECT zmessageid INTO TABLE gt_zmessageid FROM zrest_monitor
WHERE zmessageid IN s_messag
AND zuser IN s_user
AND zexedate IN s_exedat
AND zexetime IN s_exetim
AND zretrydate IN s_retdat
AND zretrytime IN s_rettim
AND submit_date IN s_subdat
AND submit_time IN s_subtim
AND ( httpstatus LT 200 OR httpstatus GE 300 )
AND interface_id IN s_id
AND calling_program IN s_callpr
AND calling_method IN s_callme
AND businessid IN s_busine
AND status = ''.
IF sy-subrc NE 0.
pv_rc = 1.
ELSE.
DESCRIBE TABLE gt_zmessageid LINES pv_rec_cnt.
***Begin of MP2K905442
* pv_job_count = round( val = pv_rec_cnt / p_batch dec = 0 ).
*
* IF pv_job_count = 0.
* pv_job_count = 1.
* ENDIF.
pv_job_count = round( val = pv_rec_cnt / p_batch dec = 0 mode = '1' ).
***End of MP2K905442
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form CREATE_JOB
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM create_job .
DATA: lv_jobcnt TYPE tbtcjob-jobcount,
ls_print_params TYPE pri_params.
ADD 1 TO gv_jobno.
lv_jobcnt = gv_jobno.
***Target Server
CLEAR gv_targetserver.
IF NOT p_bsname IS INITIAL.
gv_targetserver = p_bsname.
ENDIF.
***Build Job Name
CONCATENATE 'REST_SCHED_SUB'
sy-datum
sy-uzeit
'_'
gv_jobno
INTO gv_jobname.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = gv_jobname
IMPORTING
jobcount = lv_jobcnt
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE i026(bt) WITH gv_jobname .
ELSE.
* SUBMIT zrest_scheduler WITH s_messag IN gtr_zmessageid "MP2K905442
SUBMIT zrest_scheduler_telemetry WITH s_messag IN gtr_zmessageid "MP2K905442
TO SAP-SPOOL
SPOOL PARAMETERS ls_print_params
WITHOUT SPOOL DYNPRO
VIA JOB gv_jobname NUMBER lv_jobcnt
AND RETURN.
IF sy-subrc EQ 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = lv_jobcnt
jobname = gv_jobname
strtimmed = 'X'
targetserver = gv_targetserver
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
invalid_target = 8
OTHERS = 9.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
MESSAGE s000(55) WITH gv_msg_cnt text-004 gv_jobno gv_jobname.
ENDIF.
ELSE.
ENDIF.
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form F4_BATCH_SERVER
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* <--P_P_BSNAME text
*----------------------------------------------------------------------*
FORM f4_batch_server CHANGING pv_bsname TYPE bpsrvgrp.
DATA: lt_list TYPE TABLE OF msxxlist,
ls_list TYPE msxxlist,
lt_tsrvgrp TYPE STANDARD TABLE OF tsrvgrp,
ls_tsrvgrp TYPE tsrvgrp,
lv_sel_server LIKE tbtcjob-execserver.
DATA BEGIN OF lt_sys_list OCCURS 10.
INCLUDE STRUCTURE btctgtsrvr.
DATA END OF lt_sys_list.
DATA BEGIN OF field_tbl OCCURS 10.
INCLUDE STRUCTURE help_value.
DATA END OF field_tbl.
CALL FUNCTION 'TH_SERVER_LIST'
EXPORTING
services = '08'
TABLES
list = lt_list
EXCEPTIONS
no_server_list = 1
OTHERS = 2.
IF sy-subrc <> 0.
EXIT.
ENDIF.
***Get custom server groups if any
SELECT * FROM tsrvgrp INTO TABLE lt_tsrvgrp.
LOOP AT lt_list INTO ls_list.
lt_sys_list-srvname = ls_list-name.
APPEND lt_sys_list.
ENDLOOP.
LOOP AT lt_tsrvgrp INTO ls_tsrvgrp.
lt_sys_list-srvname = ls_tsrvgrp-grpname.
APPEND lt_sys_list.
ENDLOOP.
FREE field_tbl.
field_tbl-tabname = 'BTCTGTSRVR'.
field_tbl-fieldname = 'SRVNAME'.
field_tbl-selectflag = 'X'.
APPEND field_tbl.
* read batch server
CALL FUNCTION 'F4TOOL_F4FUNCTION_BRIDGE'
EXPORTING
tabname = field_tbl-tabname
fieldname = field_tbl-fieldname
display_only = space
IMPORTING
selected_value = lv_sel_server
TABLES
value_tab = lt_sys_list
fields_tab = field_tbl.
pv_bsname = lv_sel_server.
ENDFORM.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
40348,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1168,
49,
6465,
62,
50,
3398,
1961,
62,
33,
11417,
62,
37,
486,
198,
9,
5,
10097,
30934,
9,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3401,
2649,
7443,
220,
220,
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,
9,
10097,
23031,
9,
198,
9,
7536,
220,
220,
220,
220,
220,
930,
1294,
1137,
4522,
220,
930,
220,
569,
2257,
37,
220,
930,
19940,
220,
930,
3982,
5558,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
32284,
91,
35937,
91,
982,
91,
10541,
91,
22369,
12,
9,
198,
9,
15146,
6,
2864,
220,
930,
569,
12,
26708,
1847,
220,
220,
930,
25643,
4089,
2231,
91,
4904,
17,
42,
3829,
1120,
1270,
220,
930,
20768,
2478,
220,
220,
220,
1635,
198,
9,
2713,
14,
1558,
14,
7908,
930,
569,
12,
26708,
1847,
220,
220,
930,
513,
34229,
25948,
91,
4904,
17,
42,
44928,
39506,
930,
3125,
29754,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
10097,
23031,
9,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
220,
220,
220,
220,
5178,
220,
17151,
62,
26947,
198,
9,
5,
10097,
30934,
9,
198,
9,
220,
220,
220,
220,
220,
220,
2420,
198,
9,
10097,
23031,
9,
198,
9,
220,
14610,
220,
279,
16,
220,
220,
220,
220,
220,
220,
220,
2420,
198,
9,
220,
1279,
438,
220,
279,
17,
220,
220,
220,
220,
220,
220,
220,
2420,
198,
9,
10097,
23031,
9,
198,
21389,
651,
62,
7890,
5870,
15567,
2751,
279,
85,
62,
21858,
62,
9127,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
85,
62,
8344,
62,
66,
429,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
85,
62,
6015,
41876,
827,
12,
7266,
6015,
13,
628,
220,
33493,
1976,
20500,
312,
39319,
43679,
308,
83,
62,
89,
20500,
312,
16034,
1976,
2118,
62,
41143,
198,
220,
220,
220,
220,
220,
220,
220,
220,
33411,
1976,
20500,
312,
3268,
264,
62,
37348,
363,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
220,
220,
220,
1976,
7220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3268,
220,
264,
62,
7220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
220,
220,
220,
1976,
1069,
276,
378,
220,
220,
220,
220,
220,
220,
220,
220,
3268,
220,
264,
62,
1069,
276,
265,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
220,
220,
220,
1976,
1069,
8079,
220,
220,
220,
220,
220,
220,
220,
220,
3268,
220,
264,
62,
1069,
316,
320,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
220,
220,
220,
1976,
1186,
563,
4475,
220,
220,
220,
220,
220,
220,
3268,
220,
264,
62,
1186,
19608,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
220,
220,
220,
1976,
1186,
563,
2435,
220,
220,
220,
220,
220,
220,
3268,
220,
264,
62,
11489,
320,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
220,
220,
220,
9199,
62,
4475,
220,
220,
220,
220,
220,
3268,
220,
264,
62,
7266,
19608,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
220,
220,
220,
9199,
62,
2435,
220,
220,
220,
220,
220,
3268,
220,
264,
62,
7266,
16514,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
220,
220,
220,
357,
2638,
13376,
34146,
939,
6375,
2638,
13376,
22319,
5867,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
220,
220,
220,
7071,
62,
312,
220,
220,
220,
220,
3268,
220,
264,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
220,
220,
220,
4585,
62,
23065,
220,
3268,
220,
264,
62,
13345,
1050,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
220,
220,
220,
4585,
62,
24396,
220,
220,
3268,
220,
264,
62,
13345,
1326,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
220,
220,
220,
1597,
312,
220,
220,
220,
220,
220,
220,
3268,
220,
264,
62,
10885,
500,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
220,
220,
220,
3722,
796,
705,
4458,
628,
220,
16876,
827,
12,
7266,
6015,
10635,
657,
13,
198,
220,
220,
220,
279,
85,
62,
6015,
796,
352,
13,
198,
220,
17852,
5188,
13,
628,
220,
220,
220,
22196,
34,
7112,
12473,
43679,
308,
83,
62,
89,
20500,
312,
43277,
1546,
279,
85,
62,
8344,
62,
66,
429,
13,
198,
198,
8162,
44140,
286,
220,
4904,
17,
42,
44928,
39506,
198,
9,
220,
220,
220,
279,
85,
62,
21858,
62,
9127,
796,
2835,
7,
1188,
796,
279,
85,
62,
8344,
62,
66,
429,
1220,
279,
62,
43501,
875,
796,
657,
6739,
198,
9,
198,
9,
220,
220,
220,
16876,
279,
85,
62,
21858,
62,
9127,
796,
657,
13,
198,
9,
220,
220,
220,
220,
220,
279,
85,
62,
21858,
62,
9127,
796,
352,
13,
198,
9,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
279,
85,
62,
21858,
62,
9127,
796,
2835,
7,
1188,
796,
279,
85,
62,
8344,
62,
66,
429,
1220,
279,
62,
43501,
875,
796,
657,
220,
4235,
796,
705,
16,
6,
6739,
198,
198,
8162,
12915,
286,
220,
4904,
17,
42,
44928,
39506,
628,
220,
23578,
5064,
13,
198,
198,
1677,
8068,
1581,
44,
13,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
220,
220,
220,
220,
5178,
220,
29244,
6158,
62,
41,
9864,
198,
9,
5,
10097,
30934,
9,
198,
9,
220,
220,
220,
220,
220,
220,
2420,
198,
9,
10097,
23031,
9,
198,
9,
220,
14610,
220,
279,
16,
220,
220,
220,
220,
220,
220,
220,
2420,
198,
9,
220,
1279,
438,
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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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
] |
CLASS y_check_method_return_bool DEFINITION PUBLIC INHERITING FROM y_check_base CREATE PUBLIC.
PUBLIC SECTION.
METHODS constructor.
PROTECTED SECTION.
DATA method_name TYPE string.
METHODS inspect_tokens REDEFINITION.
PRIVATE SECTION.
DATA good_method_names_beginning TYPE TABLE OF string.
DATA good_method_names_containing TYPE TABLE OF string.
METHODS contains_name_condition IMPORTING stmnt_index TYPE i
RETURNING VALUE(result) TYPE abap_bool.
ENDCLASS.
CLASS Y_CHECK_METHOD_RETURN_BOOL IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
settings-pseudo_comment = '"#EC METH_RET_BOOL' ##NO_TEXT.
settings-disable_threshold_selection = abap_true.
settings-threshold = 0.
settings-documentation = |{ c_docs_path-checks }method-return-bool.md|.
relevant_statement_types = VALUE #( ( scan_struc_stmnt_type-class_definition )
( scan_struc_stmnt_type-interface ) ).
relevant_structure_types = VALUE #( ).
set_check_message( 'Method &1 has a misleading name for boolean return type!' ).
APPEND 'IS_' TO good_method_names_beginning.
APPEND 'HAS_' TO good_method_names_beginning.
APPEND 'ARE_' TO good_method_names_beginning.
APPEND 'TRY_' TO good_method_names_beginning.
APPEND 'CAN_' TO good_method_names_beginning.
APPEND 'HAVE_' TO good_method_names_beginning.
APPEND 'MUST_' TO good_method_names_beginning.
APPEND 'STARTS_' TO good_method_names_beginning.
APPEND 'ENDS_' TO good_method_names_beginning.
APPEND 'SHOULD_' TO good_method_names_beginning.
APPEND 'WAS_' TO good_method_names_beginning.
APPEND 'WERE_' TO good_method_names_beginning.
APPEND 'EXIST' TO good_method_names_containing.
APPEND 'EQUAL' TO good_method_names_containing.
APPEND 'CONTAIN' TO good_method_names_containing.
ENDMETHOD.
METHOD contains_name_condition.
method_name = get_token_abs( stmnt_index + 1 ).
LOOP AT good_method_names_beginning ASSIGNING FIELD-SYMBOL(<good_name_beginning>).
IF strlen( method_name ) >= strlen( <good_name_beginning> ).
DATA(prefix) = substring( val = method_name
len = strlen( <good_name_beginning> ) ).
IF prefix = <good_name_beginning>.
result = abap_true.
RETURN.
ENDIF.
ENDIF.
ENDLOOP.
LOOP AT good_method_names_containing ASSIGNING FIELD-SYMBOL(<good_name_containing>).
IF strlen( method_name ) >= strlen( <good_name_containing> )
AND method_name CS <good_name_containing>.
result = abap_true.
RETURN.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD inspect_tokens.
CHECK get_token_abs( statement-from ) = 'METHODS'.
DATA(has_found_bool) = abap_false.
DATA(token_index) = statement-from.
LOOP AT ref_scan->tokens ASSIGNING FIELD-SYMBOL(<token>)
FROM statement-from TO statement-to.
IF <token>-str = 'ABAP_BOOL'
AND get_token_abs( token_index - 3 ) = 'RETURNING'.
has_found_bool = abap_true.
ENDIF.
token_index = token_index + 1.
ENDLOOP.
IF has_found_bool = abap_true
AND contains_name_condition( statement-from ) = abap_false.
DATA(check_configuration) = detect_check_configuration( statement ).
raise_error( statement_level = statement-level
statement_index = index
statement_from = statement-from
check_configuration = check_configuration
parameter_01 = |{ method_name }| ).
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
62,
9122,
62,
24396,
62,
7783,
62,
30388,
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,
42865,
2446,
62,
3672,
41876,
4731,
13,
628,
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,
922,
62,
24396,
62,
14933,
62,
27471,
768,
41876,
43679,
3963,
4731,
13,
198,
220,
220,
220,
42865,
922,
62,
24396,
62,
14933,
62,
38301,
41876,
43679,
3963,
4731,
13,
628,
220,
220,
220,
337,
36252,
50,
4909,
62,
3672,
62,
31448,
30023,
9863,
2751,
336,
76,
429,
62,
9630,
220,
41876,
1312,
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,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
575,
62,
50084,
62,
49273,
62,
26087,
27064,
62,
8202,
3535,
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,
337,
20702,
62,
26087,
62,
8202,
3535,
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,
24396,
12,
7783,
12,
30388,
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,
39994,
1267,
6739,
628,
220,
220,
220,
5981,
62,
301,
5620,
62,
19199,
796,
26173,
8924,
1303,
7,
6739,
628,
220,
220,
220,
900,
62,
9122,
62,
20500,
7,
705,
17410,
1222,
16,
468,
257,
15850,
1438,
329,
25131,
1441,
2099,
13679,
6739,
628,
220,
220,
220,
43504,
10619,
705,
1797,
62,
6,
220,
220,
220,
220,
5390,
922,
62,
24396,
62,
14933,
62,
27471,
768,
13,
198,
220,
220,
220,
43504,
10619,
705,
39,
1921,
62,
6,
220,
220,
220,
5390,
922,
62,
24396,
62,
14933,
62,
27471,
768,
13,
198,
220,
220,
220,
43504,
10619,
705,
12203,
62,
6,
220,
220,
220,
5390,
922,
62,
24396,
62,
14933,
62,
27471,
768,
13,
198,
220,
220,
220,
43504,
10619,
705,
40405,
62,
6,
220,
220,
220,
5390,
922,
62,
24396,
62,
14933,
62,
27471,
768,
13,
198,
220,
220,
220,
43504,
10619,
705,
44565,
62,
6,
220,
220,
220,
5390,
922,
62,
24396,
62,
14933,
62,
27471,
768,
13,
198,
220,
220,
220,
43504,
10619,
705,
7801,
6089,
62,
6,
220,
220,
5390,
922,
62,
24396,
62,
14933,
62,
27471,
768,
13,
198,
220,
220,
220,
43504,
10619,
705,
44,
7759,
62,
6,
220,
220,
5390,
922,
62,
24396,
62,
14933,
62,
27471,
768,
13,
198,
220,
220,
220,
43504,
10619,
705,
46678,
4694,
62,
6,
5390,
922,
62,
24396,
62,
14933,
62,
27471,
768,
13,
198,
220,
220,
220,
43504,
10619,
705,
1677,
5258,
62,
6,
220,
220,
5390,
922,
62,
24396,
62,
14933,
62,
27471,
768,
13,
198,
220,
220,
220,
43504,
10619,
705,
9693,
24010,
62,
6,
5390,
922,
62,
24396,
62,
14933,
62,
27471,
768,
13,
198,
220,
220,
220,
43504,
10619,
705,
54,
1921,
62,
6,
220,
220,
220,
5390,
922,
62,
24396,
62,
14933,
62,
27471,
768,
13,
198,
220,
220,
220,
43504,
10619,
705,
54,
9338,
62,
6,
220,
220,
5390,
922,
62,
24396,
62,
14933,
62,
27471,
768,
13,
628,
220,
220,
220,
43504,
10619,
705,
6369,
8808,
6,
220,
220,
5390,
922,
62,
24396,
62,
14933,
62,
38301,
13,
198,
220,
220,
220,
43504,
10619,
705,
36,
10917,
1847,
6,
220,
220,
5390,
922,
62,
24396,
62,
14933,
62,
38301,
13,
198,
220,
220,
220,
43504,
10619,
705,
10943,
30339,
6,
5390,
922,
62,
24396,
62,
14933,
62,
38301,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
4909,
62,
3672,
62,
31448,
13,
198,
220,
220,
220,
2446,
62,
3672,
796,
651,
62,
30001,
62,
8937,
7,
336,
76,
429,
62,
9630,
1343,
352,
6739,
628,
220,
220,
220,
17579,
3185,
5161,
922,
62,
24396,
62,
14933,
62,
27471,
768,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
11274,
62,
3672,
62,
27471,
768,
29,
737,
198,
220,
220,
220,
220,
220,
16876,
965,
11925,
7,
2446,
62,
3672,
1267,
18189,
965,
11925,
7,
1279,
11274,
62,
3672,
62,
27471,
768,
29,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
40290,
8,
796,
3293,
1806,
7,
1188,
796,
2446,
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,
220,
220,
220,
18896,
796,
965,
11925,
7,
1279,
11274,
62,
3672,
62,
27471,
768,
29,
1267,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
16876,
21231,
796,
1279,
11274,
62,
3672,
62,
27471,
768,
28401,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
21982
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
*&---------------------------------------------------------------------*
*& Report z_xslt_rename_demo
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT z_xslt_rename_demo.
CLASS lcl_app DEFINITION FINAL.
PUBLIC SECTION.
METHODS at_selection_screen.
METHODS set_ref_sscrfields
IMPORTING
ref_sscrfields TYPE REF TO sscrfields.
METHODS start_of_selection
RAISING
zcx_excel
cx_static_check.
PRIVATE SECTION.
TYPES: ty_file_range TYPE RANGE OF text1024.
METHODS get_abap2xlsx_demo_files
RETURNING
VALUE(result) TYPE string_table.
METHODS gui_upload
IMPORTING
file_name TYPE string
RETURNING
VALUE(result) TYPE xstring
RAISING
zcx_excel.
METHODS gui_download
IMPORTING
file_name TYPE string
file_contents TYPE xstring
RAISING
zcx_excel.
METHODS get_xlsx_special_attributes
RETURNING
VALUE(result) TYPE REF TO if_ixml_node_collection.
DATA: ref_sscrfields TYPE REF TO sscrfields.
ENDCLASS.
CLASS lcl_xml_rename_xmlns_prefixes DEFINITION.
PUBLIC SECTION.
METHODS rename
IMPORTING
xml_xstring TYPE xstring
namespace_prefix_prefix TYPE string
special_attributes TYPE REF TO if_ixml_node_collection OPTIONAL
RETURNING
VALUE(result) TYPE xstring
RAISING
cx_static_check.
PRIVATE SECTION.
METHODS del_dummy_attrib_orphan_xmlns
CHANGING
xml TYPE string.
DATA: namespace_prefix_prefix TYPE string.
ENDCLASS.
CLASS lcl_zip_rename_xmlns_prefixes DEFINITION.
PUBLIC SECTION.
METHODS rename
IMPORTING
zip_xstring TYPE xstring
namespace_prefix_prefix TYPE string
special_attributes TYPE REF TO if_ixml_node_collection OPTIONAL
RETURNING
VALUE(result) TYPE xstring
RAISING
cx_static_check.
ENDCLASS.
CLASS zcl_zip_cleanup_for_diff DEFINITION
CREATE PUBLIC .
PUBLIC SECTION.
METHODS cleanup
IMPORTING
zip_xstring TYPE xstring
RETURNING
VALUE(result) TYPE xstring
RAISING
zcx_excel.
PRIVATE SECTION.
TYPES : BEGIN OF ty_zip_structure,
ref_to_structure TYPE REF TO data,
ref_to_x TYPE REF TO data,
length TYPE i,
view TYPE REF TO cl_abap_view_offlen,
charset_bit TYPE i,
conv_in_utf8 TYPE REF TO cl_abap_conv_in_ce,
conv_in_ibm437 TYPE REF TO cl_abap_conv_in_ce,
conv_out_utf8 TYPE REF TO cl_abap_conv_out_ce,
conv_out_ibm437 TYPE REF TO cl_abap_conv_out_ce,
END OF ty_zip_structure.
METHODS write_zip
IMPORTING
offset TYPE i
CHANGING
zip_structure TYPE ty_zip_structure
zip_xstring TYPE xstring.
METHODS read_zip
IMPORTING
zip_xstring TYPE xstring
offset TYPE i
CHANGING
zip_structure TYPE ty_zip_structure.
METHODS init_structure
IMPORTING
length TYPE i
charset_bit TYPE i
structure TYPE any
RETURNING
VALUE(result) TYPE ty_zip_structure.
ENDCLASS.
CLASS lcl_xml_rename_xmlns_prefixes IMPLEMENTATION.
METHOD rename.
IF special_attributes IS BOUND.
DATA(local_special_attributes) = special_attributes.
ELSE.
DATA(xml_string) = cl_abap_codepage=>convert_to( |<attributes/>| ).
DATA xml_doc TYPE REF TO if_ixml_document.
CALL FUNCTION 'SDIXML_XML_TO_DOM'
EXPORTING
xml = xml_string
IMPORTING
document = xml_doc
EXCEPTIONS
invalid_input = 1
OTHERS = 2.
local_special_attributes = xml_doc->get_elements_by_tag_name( 'attribute' ).
ENDIF.
TRY.
" dummy parsing just to check whether it's XML or not
DATA(l_content_text) = VALUE string( ).
CALL TRANSFORMATION id SOURCE XML xml_xstring RESULT XML l_content_text.
" no exception -> it's XML
TRY.
DATA(l_content_2) = VALUE string( ).
CALL TRANSFORMATION zxsltrename_xmlns
SOURCE XML l_content_text
RESULT XML l_content_2
PARAMETERS new = namespace_prefix_prefix
attributes = local_special_attributes.
del_dummy_attrib_orphan_xmlns( CHANGING xml = l_content_2 ).
CALL TRANSFORMATION id SOURCE XML l_content_2 RESULT XML result.
CATCH cx_root INTO DATA(error2).
RAISE EXCEPTION error2.
ENDTRY.
CATCH cx_xslt_runtime_error INTO DATA(error1).
" exception -> it's not XML (image, etc.), just continue (except if it's invalid XML)
IF error1->textid <> error1->bad_source_context.
RAISE EXCEPTION error1.
ENDIF.
result = xml_xstring.
ENDTRY.
ENDMETHOD.
METHOD del_dummy_attrib_orphan_xmlns.
" Excel needs xmlns:xr3="..." with mc:Ignorable="xr3 xr4" in Excel sheet#.xml, XSLT/XPath cannot
" read xmlns:xxxx if there's no element/attribute referencing the xxxx prefix, so adding dummy
" attributes by transformation. All prefixes of Ignorable must be known at that node or parent node.
" Excel fails if it finds /cp:coreProperties[@xx:dummy=""] with xmlns:xx="http://purl.org/dc/dcmitype/"
" in Props/core.xml, so removing all "dummy" attributes added by transformation.
REPLACE ALL OCCURRENCES OF ` dummy=""` IN xml WITH ``.
REPLACE ALL OCCURRENCES OF REGEX ` ` && namespace_prefix_prefix && `[^: <>]+:dummy=""` IN xml WITH ``.
ENDMETHOD.
ENDCLASS.
CLASS lcl_zip_rename_xmlns_prefixes IMPLEMENTATION.
METHOD rename.
DATA(lo_zip) = NEW cl_abap_zip( ).
lo_zip->load(
EXPORTING
zip = zip_xstring
EXCEPTIONS
zip_parse_error = 1
OTHERS = 2 ).
DATA(result_zip) = NEW cl_abap_zip( ).
LOOP AT lo_zip->files ASSIGNING FIELD-SYMBOL(<ls_zip_file>).
lo_zip->get(
EXPORTING
name = <ls_zip_file>-name
IMPORTING
content = DATA(l_content)
EXCEPTIONS
zip_index_error = 1
zip_decompression_error = 2
OTHERS = 3 ).
l_content = NEW lcl_xml_rename_xmlns_prefixes( )->rename( xml_xstring = l_content namespace_prefix_prefix = namespace_prefix_prefix special_attributes = special_attributes ).
result_zip->add(
EXPORTING
name = <ls_zip_file>-name
content = l_content ).
ENDLOOP.
result = result_zip->save( ).
ENDMETHOD.
ENDCLASS.
CLASS lcl_app IMPLEMENTATION.
METHOD at_selection_screen.
FIELD-SYMBOLS:
<file_range> TYPE ty_file_range.
CASE ref_sscrfields->ucomm.
WHEN 'A2X'.
ASSIGN ('S_FILES[]') TO <file_range>.
ASSERT sy-subrc = 0.
DATA(files) = get_abap2xlsx_demo_files( ).
LOOP AT files ASSIGNING FIELD-SYMBOL(<file>).
IF NOT line_exists( <file_range>[ low = <file> ] ).
APPEND INITIAL LINE TO <file_range> ASSIGNING FIELD-SYMBOL(<file_range_line>).
<file_range_line> = VALUE #( sign = 'I' option = 'EQ' low = <file> ).
ENDIF.
ENDLOOP.
ENDCASE.
ENDMETHOD.
METHOD start_of_selection.
DATA: new_xlsx_xstring TYPE xstring.
FIELD-SYMBOLS:
<file_range> TYPE ty_file_range,
<namespace_prefix_prefix> TYPE string,
<use_xlsx_special_attributes> TYPE abap_bool.
ASSIGN ('P_XLSX') TO <use_xlsx_special_attributes>.
ASSERT sy-subrc = 0.
ASSIGN ('S_FILES[]') TO <file_range>.
ASSERT sy-subrc = 0.
ASSIGN ('P_PREFIX') TO <namespace_prefix_prefix>.
ASSERT sy-subrc = 0.
ASSIGN ('P_INPUT') TO FIELD-SYMBOL(<folder>).
ASSERT sy-subrc = 0.
ASSIGN ('P_OUTPUT') TO FIELD-SYMBOL(<output_folder>).
ASSERT sy-subrc = 0.
DATA(files) = get_abap2xlsx_demo_files( ).
DATA(xlsx_special_attributes) = get_xlsx_special_attributes( ).
LOOP AT <file_range> ASSIGNING FIELD-SYMBOL(<file>).
DATA(file_xstring) = gui_upload( <folder> && <file>-low ).
IF <file>-low CP '*.xlsx'.
new_xlsx_xstring = NEW lcl_zip_rename_xmlns_prefixes(
)->rename( zip_xstring = file_xstring
namespace_prefix_prefix = <namespace_prefix_prefix>
special_attributes = xlsx_special_attributes ).
ELSEIF <file>-low CP '*.xml'.
new_xlsx_xstring = NEW lcl_xml_rename_xmlns_prefixes(
)->rename( xml_xstring = file_xstring
namespace_prefix_prefix = <namespace_prefix_prefix>
special_attributes = COND #( WHEN <use_xlsx_special_attributes> = abap_true THEN xlsx_special_attributes ) ).
ENDIF.
gui_download( file_name = <output_folder> && <file>-low file_contents = new_xlsx_xstring ).
ENDLOOP.
ENDMETHOD.
METHOD gui_upload.
DATA(solix_tab) = VALUE solix_tab( ).
cl_gui_frontend_services=>gui_upload(
EXPORTING
filename = file_name
filetype = 'BIN'
IMPORTING
filelength = DATA(file_length)
CHANGING
data_tab = solix_tab
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.
RAISE EXCEPTION TYPE zcx_excel EXPORTING error = |gui_upload error { file_name }|.
ENDIF.
result = cl_bcs_convert=>solix_to_xstring( it_solix = solix_tab iv_size = file_length ).
ENDMETHOD.
METHOD get_abap2xlsx_demo_files.
APPEND '01_HelloWorld.xlsx' TO result.
APPEND '02_Styles.xlsx' TO result.
APPEND '03_iTab.xlsx' TO result.
APPEND '04_Sheets.xlsx' TO result.
APPEND '05_Conditional.xlsx' TO result.
APPEND '06_Formulas.xlsx' TO result.
APPEND '07_ConditionalAll.xlsx' TO result.
APPEND '08_Range.xlsx' TO result.
APPEND '09_DataValidation.xlsx' TO result.
APPEND '10_iTabFieldCatalog.xlsx' TO result.
APPEND '12_HideSizeOutlineRowsAndColumns.xlsx' TO result.
APPEND '13_MergedCells.xlsx' TO result.
APPEND '14_Alignment.xlsx' TO result.
APPEND '16_Drawings.xlsx' TO result.
APPEND '17_SheetProtection.xlsx' TO result.
APPEND '18_BookProtection.xlsx' TO result.
APPEND '19_SetActiveSheet.xlsx' TO result.
APPEND '21_BackgroundColorPicker.xlsx' TO result.
APPEND '22_itab_fieldcatalog.xlsx' TO result.
APPEND '23_Sheets_with_and_without_grid_lines.xlsx' TO result.
APPEND '24_Sheets_with_different_default_date_formats.xlsx' TO result.
APPEND '27_ConditionalFormatting.xlsx' TO result.
APPEND '30_CellDataTypes.xlsx' TO result.
APPEND '31_AutosizeWithDifferentFontSizes.xlsx' TO result.
APPEND '33_autofilter.xlsx' TO result.
APPEND '34_Static Styles_Chess.xlsx' TO result.
APPEND '35_Static_Styles.xlsx' TO result.
APPEND '36_DefaultStyles.xlsx' TO result.
APPEND '37- Read template and output.xlsx' TO result.
APPEND '38_SAP-Icons.xlsx' TO result.
APPEND '39_Charts.xlsx' TO result.
APPEND '40_Printsettings.xlsx' TO result.
APPEND 'ABAP2XLSX Inheritance.xlsx' TO result.
APPEND 'Comments.xlsx' TO result.
APPEND 'Image_Header_Footer.xlsx' TO result.
APPEND '15_01_HelloWorldFromReader.xlsx' TO result.
APPEND '15_02_StylesFromReader.xlsx' TO result.
APPEND '15_03_iTabFromReader.xlsx' TO result.
APPEND '15_04_SheetsFromReader.xlsx' TO result.
APPEND '15_05_ConditionalFromReader.xlsx' TO result.
APPEND '15_07_ConditionalAllFromReader.xlsx' TO result.
APPEND '15_08_RangeFromReader.xlsx' TO result.
APPEND '15_13_MergedCellsFromReader.xlsx' TO result.
APPEND '15_24_Sheets_with_different_default_date_formatsFromReader.xlsx' TO result.
APPEND '15_31_AutosizeWithDifferentFontSizesFromReader.xlsx' TO result.
ENDMETHOD.
METHOD get_xlsx_special_attributes.
DATA(xml_string) = cl_abap_codepage=>convert_to(
|<attributes>|
" xl/workbook.xml:
"====================
" <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
" mc:Ignorable="x14ac"
" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"
" <workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
" mc:Ignorable="x15 xr"
" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"
" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision"/>
&& | <attribute localName="Ignorable" localNamespaceUri="http://schemas.openxmlformats.org/markup-compatibility/2006"|
&& | valueContainingNamespacePrefixes="1"/>|
" xl/workbook.xml:
"====================
" <mc:Choice Requires="x15"
" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"/>
&& | <attribute localName="Requires" localNamespaceUri=""|
&& | parentLocalName="Choice" parentNamespaceUri="http://schemas.openxmlformats.org/markup-compatibility/2006"|
&& | valueContainingNamespacePrefixes="1"/>|
" docProps/core.xml:
"====================
" <cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
" xmlns:dcterms="http://purl.org/dc/terms/"
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
" <dcterms:created xsi:type="dcterms:W3CDTF">2018-07-10T12:34:31Z</dcterms:created>
" <dcterms:modified xsi:type="dcterms:W3CDTF">2021-12-26T16:56:41Z</dcterms:modified>
&& | <attribute localName="type" localNamespaceUri="http://www.w3.org/2001/XMLSchema-instance"|
&& | valueContainingQName="1"/>|
&& |</attributes>| ).
DATA xml_doc TYPE REF TO if_ixml_document.
CALL FUNCTION 'SDIXML_XML_TO_DOM'
EXPORTING
xml = xml_string
IMPORTING
document = xml_doc
EXCEPTIONS
invalid_input = 1
OTHERS = 2.
result = xml_doc->get_elements_by_tag_name( 'attribute' ).
ENDMETHOD.
METHOD gui_download.
DATA(bin_filesize) = xstrlen( file_contents ).
DATA(solix_tab) = cl_bcs_convert=>xstring_to_solix( file_contents ).
cl_gui_frontend_services=>gui_download(
EXPORTING
bin_filesize = bin_filesize
filename = file_name
filetype = 'BIN'
CHANGING
data_tab = solix_tab
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
not_supported_by_gui = 22
error_no_gui = 23
OTHERS = 24 ).
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_excel EXPORTING error = |gui_download error { file_name }|.
ENDIF.
ENDMETHOD.
METHOD set_ref_sscrfields.
me->ref_sscrfields = ref_sscrfields.
ENDMETHOD.
ENDCLASS.
CLASS zcl_zip_cleanup_for_diff IMPLEMENTATION.
METHOD cleanup.
TYPES : BEGIN OF ty_local_file_header,
local_file_header_signature TYPE x LENGTH 4, " 04034b50
version_needed_to_extract TYPE x LENGTH 2,
general_purpose_bit_flag TYPE x LENGTH 2,
compression_method TYPE x LENGTH 2,
last_mod_file_time TYPE int2,
last_mod_file_date TYPE int2,
crc_32 TYPE x LENGTH 4,
compressed_size TYPE i,
uncompressed_size TYPE i,
file_name_length TYPE int2,
extra_field_length TYPE int2,
" file name (variable size)
" extra field (variable size)
END OF ty_local_file_header,
BEGIN OF ty_central_file_header,
central_file_header_signature TYPE x LENGTH 4, " 02014b50
version_made_by TYPE x LENGTH 2,
version_needed_to_extract TYPE x LENGTH 2,
general_purpose_bit_flag TYPE x LENGTH 2,
compression_method TYPE x LENGTH 2,
last_mod_file_time TYPE int2,
last_mod_file_date TYPE int2,
crc_32 TYPE x LENGTH 4,
compressed_size TYPE i,
uncompressed_size TYPE i,
file_name_length TYPE int2, " field 12
extra_field_length TYPE int2, " field 13
file_comment_length TYPE int2, " field 14
disk_number_start TYPE int2,
internal_file_attributes TYPE x LENGTH 2,
external_file_attributes TYPE x LENGTH 4,
rel_offset_of_local_header TYPE x LENGTH 4,
" file name (variable size defined in 12)
" extra field (variable size defined in 13)
" file comment (variable size defined in 14)
END OF ty_central_file_header,
BEGIN OF ty_end_of_central_dir,
signature TYPE x LENGTH 4, " 0x06054b50
number_of_this_disk TYPE int2,
disk_num_start_of_central_dir TYPE int2,
n_of_entries_in_central_dir_dk TYPE int2,
n_of_entries_in_central_dir TYPE int2,
size_of_central_dir TYPE i,
offset_start_of_central_dir TYPE i,
file_comment_length TYPE int2,
END OF ty_end_of_central_dir.
FIELD-SYMBOLS:
<local_file_header_x> TYPE x,
<central_file_header_x> TYPE x,
<end_of_central_dir_x> TYPE x,
<local_file_header> TYPE ty_local_file_header,
<central_file_header> TYPE ty_central_file_header,
<end_of_central_dir> TYPE ty_end_of_central_dir.
CONSTANTS:
local_file_header_signature TYPE x LENGTH 4 VALUE '504B0304',
central_file_header_signature TYPE x LENGTH 4 VALUE '504B0102',
end_of_central_dir_signature TYPE x LENGTH 4 VALUE '504B0506'.
DATA:
dummy_local_file_header TYPE ty_local_file_header,
dummy_central_file_header TYPE ty_central_file_header,
dummy_end_of_central_dir TYPE ty_end_of_central_dir,
local_file_header TYPE ty_zip_structure,
central_file_header TYPE ty_zip_structure,
end_of_central_dir TYPE ty_zip_structure,
offset TYPE i,
max_offset TYPE i.
local_file_header = init_structure( length = 30 charset_bit = 60 structure = dummy_local_file_header ).
ASSIGN local_file_header-ref_to_structure->* TO <local_file_header>.
ASSIGN local_file_header-ref_to_x->* TO <local_file_header_x>.
central_file_header = init_structure( length = 46 charset_bit = 76 structure = dummy_central_file_header ).
ASSIGN central_file_header-ref_to_structure->* TO <central_file_header>.
ASSIGN central_file_header-ref_to_x->* TO <central_file_header_x>.
end_of_central_dir = init_structure( length = 22 charset_bit = 0 structure = dummy_end_of_central_dir ).
ASSIGN end_of_central_dir-ref_to_structure->* TO <end_of_central_dir>.
ASSIGN end_of_central_dir-ref_to_x->* TO <end_of_central_dir_x>.
result = zip_xstring.
offset = 0.
max_offset = xstrlen( result ) - 4.
WHILE offset <= max_offset.
CASE result+offset(4).
WHEN local_file_header_signature.
read_zip( EXPORTING zip_xstring = result offset = offset CHANGING zip_structure = local_file_header ).
CLEAR <local_file_header>-last_mod_file_date.
CLEAR <local_file_header>-last_mod_file_time.
write_zip( EXPORTING offset = offset CHANGING zip_structure = local_file_header zip_xstring = result ).
offset = offset + local_file_header-length + <local_file_header>-file_name_length + <local_file_header>-extra_field_length + <local_file_header>-compressed_size.
WHEN central_file_header_signature.
read_zip( EXPORTING zip_xstring = result offset = offset CHANGING zip_structure = central_file_header ).
CLEAR <central_file_header>-last_mod_file_date.
CLEAR <central_file_header>-last_mod_file_time.
write_zip( EXPORTING offset = offset CHANGING zip_structure = central_file_header zip_xstring = result ).
offset = offset + central_file_header-length + <central_file_header>-file_name_length + <central_file_header>-extra_field_length + <central_file_header>-file_comment_length.
WHEN end_of_central_dir_signature.
read_zip( EXPORTING zip_xstring = result offset = offset CHANGING zip_structure = end_of_central_dir ).
offset = offset + end_of_central_dir-length + <end_of_central_dir>-file_comment_length.
WHEN OTHERS.
RAISE EXCEPTION TYPE zcx_excel EXPORTING error = 'Invalid ZIP file'.
ENDCASE.
ENDWHILE.
ENDMETHOD.
METHOD read_zip.
DATA:
charset TYPE i.
FIELD-SYMBOLS:
<zip_structure_x> TYPE x,
<zip_structure> TYPE any.
ASSIGN zip_structure-ref_to_x->* TO <zip_structure_x>.
ASSIGN zip_structure-ref_to_structure->* TO <zip_structure>.
<zip_structure_x> = zip_xstring+offset.
IF zip_structure-charset_bit >= 1.
GET BIT zip_structure-charset_bit OF <zip_structure_x> INTO charset.
ENDIF.
IF charset = 0.
IF zip_structure-conv_in_ibm437 IS NOT BOUND.
zip_structure-conv_in_ibm437 = cl_abap_conv_in_ce=>create(
encoding = '1107'
endian = 'L' ).
ENDIF.
zip_structure-conv_in_ibm437->convert_struc(
EXPORTING input = <zip_structure_x>
view = zip_structure-view
IMPORTING data = <zip_structure> ).
ELSE.
IF zip_structure-conv_in_utf8 IS NOT BOUND.
zip_structure-conv_in_utf8 = cl_abap_conv_in_ce=>create(
encoding = '4110'
endian = 'L' ).
ENDIF.
zip_structure-conv_in_utf8->convert_struc(
EXPORTING input = <zip_structure_x>
view = zip_structure-view
IMPORTING data = <zip_structure> ).
ENDIF.
ENDMETHOD.
METHOD write_zip.
DATA:
charset TYPE i.
FIELD-SYMBOLS:
<zip_structure_x> TYPE x,
<zip_structure> TYPE any.
ASSIGN zip_structure-ref_to_x->* TO <zip_structure_x>.
ASSIGN zip_structure-ref_to_structure->* TO <zip_structure>.
IF zip_structure-charset_bit >= 1.
GET BIT zip_structure-charset_bit OF <zip_structure_x> INTO charset.
ENDIF.
IF charset = 0.
IF zip_structure-conv_out_ibm437 IS NOT BOUND.
zip_structure-conv_out_ibm437 = cl_abap_conv_out_ce=>create(
encoding = '1107'
endian = 'L' ).
ENDIF.
zip_structure-conv_out_ibm437->convert_struc(
EXPORTING data = <zip_structure>
view = zip_structure-view
IMPORTING buffer = <zip_structure_x> ).
ELSE.
IF zip_structure-conv_out_utf8 IS NOT BOUND.
zip_structure-conv_out_utf8 = cl_abap_conv_out_ce=>create(
encoding = '4110'
endian = 'L' ).
ENDIF.
zip_structure-conv_out_utf8->convert_struc(
EXPORTING data = <zip_structure>
view = zip_structure-view
IMPORTING buffer = <zip_structure_x> ).
ENDIF.
REPLACE SECTION OFFSET offset LENGTH zip_structure-length OF zip_xstring WITH <zip_structure_x> IN BYTE MODE.
ENDMETHOD.
METHOD init_structure.
DATA:
offset TYPE i,
rtts_struct TYPE REF TO cl_abap_structdescr.
FIELD-SYMBOLS:
<component> TYPE abap_compdescr.
CREATE DATA result-ref_to_structure LIKE structure.
result-length = length.
result-charset_bit = charset_bit.
CREATE DATA result-ref_to_x TYPE x LENGTH length.
result-view = cl_abap_view_offlen=>create( ).
offset = 0.
rtts_struct ?= cl_abap_typedescr=>describe_by_data( structure ).
LOOP AT rtts_struct->components ASSIGNING <component>.
result-view->append( off = offset len = <component>-length ).
offset = offset + <component>-length.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
TABLES sscrfields.
DATA file TYPE text1024.
SELECT-OPTIONS s_files FOR file DEFAULT '01_HelloWorld.xlsx' NO INTERVALS.
SELECTION-SCREEN PUSHBUTTON /1(50) a2x_text USER-COMMAND a2x.
PARAMETERS p_prefix TYPE string LOWER CASE DEFAULT 'new'.
PARAMETERS p_input TYPE string LOWER CASE DEFAULT 'C:\Users\sandra.rossi\Documents\SAP GUI\'.
PARAMETERS p_output TYPE string LOWER CASE DEFAULT 'C:\Users\sandra.rossi\Documents\SAP GUI\fromReader_'.
PARAMETERS p_xlsx AS CHECKBOX DEFAULT 'X'.
LOAD-OF-PROGRAM.
a2x_text = 'Initialize list of abap2xlsx demo files'(001).
DATA(app) = NEW lcl_app( ).
app->set_ref_sscrfields( REF #( sscrfields ) ).
AT SELECTION-SCREEN.
TRY.
app->at_selection_screen( ).
CATCH cx_root INTO DATA(error).
MESSAGE error TYPE 'I' DISPLAY LIKE 'E'.
ENDTRY.
ASSERT 1 = 1. " debug helper
START-OF-SELECTION.
TRY.
NEW lcl_app( )->start_of_selection( ).
CATCH cx_root INTO DATA(error).
MESSAGE error TYPE 'I' DISPLAY LIKE 'E'.
ENDTRY.
ASSERT 1 = 1. " debug helper
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
1976,
62,
34223,
2528,
62,
918,
480,
62,
9536,
78,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
198,
9,
5,
10097,
30934,
9,
198,
2200,
15490,
1976,
62,
34223,
2528,
62,
918,
480,
62,
9536,
78,
13,
198,
198,
31631,
300,
565,
62,
1324,
5550,
20032,
17941,
25261,
13,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
379,
62,
49283,
62,
9612,
13,
628,
220,
220,
220,
337,
36252,
50,
900,
62,
5420,
62,
824,
6098,
25747,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1006,
62,
824,
6098,
25747,
41876,
4526,
37,
5390,
264,
1416,
81,
25747,
13,
628,
220,
220,
220,
337,
36252,
50,
923,
62,
1659,
62,
49283,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
1069,
5276,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
12708,
62,
9122,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
1259,
62,
7753,
62,
9521,
41876,
371,
27746,
3963,
2420,
35500,
13,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
397,
499,
17,
87,
7278,
87,
62,
9536,
78,
62,
16624,
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,
628,
220,
220,
220,
337,
36252,
50,
11774,
62,
25850,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
3672,
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,
20274,
8,
41876,
2124,
8841,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
1069,
5276,
13,
628,
220,
220,
220,
337,
36252,
50,
11774,
62,
15002,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
3672,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
3642,
658,
41876,
2124,
8841,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
1069,
5276,
13,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
87,
7278,
87,
62,
20887,
62,
1078,
7657,
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,
611,
62,
844,
4029,
62,
17440,
62,
43681,
13,
628,
220,
220,
220,
42865,
25,
1006,
62,
824,
6098,
25747,
41876,
4526,
37,
5390,
264,
1416,
81,
25747,
13,
198,
198,
10619,
31631,
13,
628,
198,
31631,
300,
565,
62,
19875,
62,
918,
480,
62,
19875,
5907,
62,
40290,
274,
5550,
20032,
17941,
13,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
36265,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
35555,
62,
87,
8841,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
2124,
8841,
198,
220,
220,
220,
220,
220,
220,
220,
25745,
62,
40290,
62,
40290,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
2041,
62,
1078,
7657,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
17440,
62,
43681,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
2124,
8841,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
12708,
62,
9122,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
1619,
62,
67,
13513,
62,
1078,
822,
62,
13425,
272,
62,
19875,
5907,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
35555,
41876,
4731,
13,
628,
220,
220,
220,
42865,
25,
25745,
62,
40290,
62,
40290,
41876,
4731,
13,
198,
198,
10619,
31631,
13,
628,
198,
31631,
300,
565,
62,
13344,
62,
918,
480,
62,
19875,
5907,
62,
40290,
274,
5550,
20032,
17941,
13,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
36265,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
19974,
62,
87,
8841,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
2124,
8841,
198,
220,
220,
220,
220,
220,
220,
220,
25745,
62,
40290,
62,
40290,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
2041,
62,
1078,
7657,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
17440,
62,
43681,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
2124,
8841,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
12708,
62,
9122,
13,
198,
198,
10619,
31631,
13,
628,
198,
31631,
1976,
565,
62,
13344,
62,
27773,
929,
62,
1640,
62,
26069,
5550,
20032,
17941,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
27425,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
19974,
62,
87,
8841,
220,
220,
41876,
2124,
8841,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
2124,
8841,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
1069,
5276,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
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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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
] |
interface /HEC1/IF_CONFIG_DET_GENERAL
public .
class-methods GET_ACT_KEY
importing
!IV_ACT_METHODE_NAME type SEOCPDNAME
returning
value(RV_ACT_KEY) type /BOBF/CONF_KEY .
class-methods SET_ACT_NODE_KEYS
importing
!IS_CTX type /HEC1/S_CTX_GENERAL optional
!IT_KEY type /BOBF/T_FRW_KEY
!IV_ACTION type /BOBF/ACT_KEY
!IR_ACT_PARAM type ref to DATA optional
!IV_ACT_EXECORDER type /HEC1/S_BOPF_ACT_EXORDER optional
!IV_ACT_EXECTIME type /BOBF/CONF_EXECTIME optional
!IV_NOTIFY type FLAG optional .
class-methods SET_ACT_NODE_KEYS_DIRECT
importing
!IS_CTX type /HEC1/S_CTX_GENERAL optional
!IT_KEY type /BOBF/T_FRW_KEY
!IV_ACTION type /BOBF/ACT_KEY
!IR_ACT_PARAM type ref to DATA optional
!IV_ACT_EXECORDER type /HEC1/S_BOPF_ACT_EXORDER optional
!IV_ACT_EXECTIME type /BOBF/CONF_EXECTIME optional
!IV_NOTIFY type FLAG optional .
endinterface.
| [
39994,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
35,
2767,
62,
35353,
27130,
198,
220,
1171,
764,
628,
198,
220,
1398,
12,
24396,
82,
17151,
62,
10659,
62,
20373,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
10659,
62,
44,
20702,
16820,
62,
20608,
2099,
7946,
4503,
5760,
20608,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
10659,
62,
20373,
8,
2099,
1220,
8202,
29499,
14,
10943,
37,
62,
20373,
764,
198,
220,
1398,
12,
24396,
82,
25823,
62,
10659,
62,
45,
16820,
62,
7336,
16309,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
1797,
62,
4177,
55,
2099,
1220,
39,
2943,
16,
14,
50,
62,
4177,
55,
62,
35353,
27130,
11902,
198,
220,
220,
220,
220,
220,
5145,
2043,
62,
20373,
2099,
1220,
8202,
29499,
14,
51,
62,
10913,
54,
62,
20373,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
44710,
2099,
1220,
8202,
29499,
14,
10659,
62,
20373,
198,
220,
220,
220,
220,
220,
5145,
4663,
62,
10659,
62,
27082,
2390,
2099,
1006,
284,
42865,
11902,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
10659,
62,
6369,
2943,
12532,
1137,
2099,
1220,
39,
2943,
16,
14,
50,
62,
33,
3185,
37,
62,
10659,
62,
6369,
12532,
1137,
11902,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
10659,
62,
6369,
9782,
12789,
2099,
1220,
8202,
29499,
14,
10943,
37,
62,
6369,
9782,
12789,
11902,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
11929,
5064,
56,
2099,
9977,
4760,
11902,
764,
198,
220,
1398,
12,
24396,
82,
25823,
62,
10659,
62,
45,
16820,
62,
7336,
16309,
62,
17931,
23988,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
1797,
62,
4177,
55,
2099,
1220,
39,
2943,
16,
14,
50,
62,
4177,
55,
62,
35353,
27130,
11902,
198,
220,
220,
220,
220,
220,
5145,
2043,
62,
20373,
2099,
1220,
8202,
29499,
14,
51,
62,
10913,
54,
62,
20373,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
44710,
2099,
1220,
8202,
29499,
14,
10659,
62,
20373,
198,
220,
220,
220,
220,
220,
5145,
4663,
62,
10659,
62,
27082,
2390,
2099,
1006,
284,
42865,
11902,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
10659,
62,
6369,
2943,
12532,
1137,
2099,
1220,
39,
2943,
16,
14,
50,
62,
33,
3185,
37,
62,
10659,
62,
6369,
12532,
1137,
11902,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
10659,
62,
6369,
9782,
12789,
2099,
1220,
8202,
29499,
14,
10943,
37,
62,
6369,
9782,
12789,
11902,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
11929,
5064,
56,
2099,
9977,
4760,
11902,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_ajson_mapping DEFINITION
PUBLIC
FINAL
CREATE PUBLIC.
PUBLIC SECTION.
CLASS-METHODS create_camel_case
IMPORTING
it_mapping_fields TYPE zif_abapgit_ajson_mapping=>ty_mapping_fields OPTIONAL
iv_first_json_upper TYPE abap_bool DEFAULT abap_true
RETURNING
VALUE(ri_mapping) TYPE REF TO zif_abapgit_ajson_mapping.
CLASS-METHODS create_upper_case
IMPORTING
it_mapping_fields TYPE zif_abapgit_ajson_mapping=>ty_mapping_fields OPTIONAL
RETURNING
VALUE(ri_mapping) TYPE REF TO zif_abapgit_ajson_mapping.
CLASS-METHODS create_lower_case
IMPORTING
it_mapping_fields TYPE zif_abapgit_ajson_mapping=>ty_mapping_fields OPTIONAL
RETURNING
VALUE(ri_mapping) TYPE REF TO zif_abapgit_ajson_mapping.
CLASS-METHODS create_field_mapping
IMPORTING
it_mapping_fields TYPE zif_abapgit_ajson_mapping=>ty_mapping_fields
RETURNING
VALUE(ri_mapping) TYPE REF TO zif_abapgit_ajson_mapping.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_abapgit_ajson_mapping IMPLEMENTATION.
METHOD create_camel_case.
CREATE OBJECT ri_mapping TYPE lcl_mapping_camel EXPORTING it_mapping_fields = it_mapping_fields
iv_first_json_upper = iv_first_json_upper.
ENDMETHOD.
METHOD create_field_mapping.
CREATE OBJECT ri_mapping TYPE lcl_mapping_fields EXPORTING it_mapping_fields = it_mapping_fields.
ENDMETHOD.
METHOD create_lower_case.
CREATE OBJECT ri_mapping TYPE lcl_mapping_to_lower EXPORTING it_mapping_fields = it_mapping_fields.
ENDMETHOD.
METHOD create_upper_case.
CREATE OBJECT ri_mapping TYPE lcl_mapping_to_upper EXPORTING it_mapping_fields = it_mapping_fields.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
2251,
62,
66,
17983,
62,
7442,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
340,
62,
76,
5912,
62,
25747,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
14804,
774,
62,
76,
5912,
62,
25747,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
11085,
62,
17752,
62,
45828,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
76,
5912,
8,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
2251,
62,
45828,
62,
7442,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
340,
62,
76,
5912,
62,
25747,
41876,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
14804,
774,
62,
76,
5912,
62,
25747,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
76,
5912,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
2251,
62,
21037,
62,
7442,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
340,
62,
76,
5912,
62,
25747,
41876,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
14804,
774,
62,
76,
5912,
62,
25747,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
76,
5912,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
2251,
62,
3245,
62,
76,
5912,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
340,
62,
76,
5912,
62,
25747,
41876,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
14804,
774,
62,
76,
5912,
62,
25747,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
76,
5912,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
1228,
1559,
62,
76,
5912,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
2251,
62,
66,
17983,
62,
7442,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
72,
62,
76,
5912,
41876,
300,
565,
62,
76,
5912,
62,
66,
17983,
7788,
15490,
2751,
340,
62,
76,
5912,
62,
25747,
796,
340,
62,
76,
5912,
62,
25747,
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,
21628,
62,
11085,
62,
17752,
62,
45828,
796,
21628,
62,
11085,
62,
17752,
62,
45828,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
2251,
62,
3245,
62,
76,
5912,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
72,
62,
76,
5912,
41876,
300,
565,
62,
76,
5912,
62,
25747,
7788,
15490,
2751,
340,
62,
76,
5912,
62,
25747,
796,
340,
62,
76,
5912,
62,
25747,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
2251,
62,
21037,
62,
7442,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
72,
62,
76,
5912,
41876,
300,
565,
62,
76,
5912,
62,
1462,
62,
21037,
7788,
15490,
2751,
340,
62,
76,
5912,
62,
25747,
796,
340,
62,
76,
5912,
62,
25747,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
2251,
62,
45828,
62,
7442,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
72,
62,
76,
5912,
41876,
300,
565,
62,
76,
5912,
62,
1462,
62,
45828,
7788,
15490,
2751,
340,
62,
76,
5912,
62,
25747,
796,
340,
62,
76,
5912,
62,
25747,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_object_tobj 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_tobj,
tddat TYPE tddat,
tvdir TYPE tvdir,
tvimf TYPE STANDARD TABLE OF tvimf WITH DEFAULT KEY,
END OF ty_tobj.
METHODS:
read_extra IMPORTING iv_tabname TYPE vim_name
RETURNING VALUE(rs_tobj) TYPE ty_tobj,
update_extra IMPORTING is_tobj TYPE ty_tobj,
delete_extra IMPORTING iv_tabname TYPE vim_name.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_TOBJ IMPLEMENTATION.
METHOD delete_extra.
DELETE FROM tddat WHERE tabname = iv_tabname.
DELETE FROM tvdir WHERE tabname = iv_tabname.
DELETE FROM tvimf WHERE tabname = iv_tabname.
ENDMETHOD.
METHOD read_extra.
SELECT SINGLE * FROM tddat INTO rs_tobj-tddat WHERE tabname = iv_tabname.
SELECT SINGLE * FROM tvdir INTO rs_tobj-tvdir WHERE tabname = iv_tabname.
CLEAR: rs_tobj-tvdir-gendate, rs_tobj-tvdir-gentime.
SELECT * FROM tvimf INTO TABLE rs_tobj-tvimf WHERE tabname = iv_tabname.
ENDMETHOD.
METHOD update_extra.
DATA: lt_current_tvimf TYPE STANDARD TABLE OF tvimf.
FIELD-SYMBOLS: <ls_tvimf> TYPE tvimf.
MODIFY tddat FROM is_tobj-tddat.
MODIFY tvdir FROM is_tobj-tvdir.
SELECT * INTO TABLE lt_current_tvimf
FROM tvimf
WHERE tabname = is_tobj-tddat-tabname
ORDER BY PRIMARY KEY.
LOOP AT lt_current_tvimf ASSIGNING <ls_tvimf>.
READ TABLE is_tobj-tvimf WITH KEY tabname = <ls_tvimf>-tabname
event = <ls_tvimf>-event
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
DELETE FROM tvimf
WHERE tabname = <ls_tvimf>-tabname
AND event = <ls_tvimf>-event.
ENDIF.
ENDLOOP.
MODIFY tvimf FROM TABLE is_tobj-tvimf.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
DATA: lv_type_pos TYPE i.
lv_type_pos = strlen( ms_item-obj_name ) - 1.
SELECT SINGLE luser FROM objh INTO rv_user
WHERE objectname = ms_item-obj_name(lv_type_pos)
AND objecttype = ms_item-obj_name+lv_type_pos. "#EC CI_GENBUFF
IF sy-subrc <> 0.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: ls_objh TYPE objh,
lv_type_pos TYPE i.
lv_type_pos = strlen( ms_item-obj_name ) - 1.
ls_objh-objectname = ms_item-obj_name(lv_type_pos).
ls_objh-objecttype = ms_item-obj_name+lv_type_pos.
CALL FUNCTION 'OBJ_GENERATE'
EXPORTING
iv_objectname = ls_objh-objectname
iv_objecttype = ls_objh-objecttype
iv_maint_mode = 'D'
EXCEPTIONS
illegal_call = 1
object_not_found = 2
generate_error = 3
transport_error = 4
object_enqueue_failed = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from OBJ_GENERATE' ).
ENDIF.
delete_extra( ls_objh-objectname ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_objh TYPE objh,
ls_objt TYPE objt,
lt_objs TYPE tt_objs,
lt_objsl TYPE tt_objsl,
lt_objm TYPE tt_objm,
ls_tobj TYPE ty_tobj.
io_xml->read( EXPORTING iv_name = 'OBJH'
CHANGING cg_data = ls_objh ).
io_xml->read( EXPORTING iv_name = 'OBJT'
CHANGING cg_data = ls_objt ).
io_xml->read( EXPORTING iv_name = 'OBJS'
CHANGING cg_data = lt_objs ).
io_xml->read( EXPORTING iv_name = 'OBJSL'
CHANGING cg_data = lt_objsl ).
io_xml->read( EXPORTING iv_name = 'OBJM'
CHANGING cg_data = lt_objm ).
CALL FUNCTION 'OBJ_GENERATE'
EXPORTING
iv_objectname = ls_objh-objectname
iv_objecttype = ls_objh-objecttype
iv_maint_mode = 'I'
iv_objecttext = ls_objt-ddtext
iv_objcateg = ls_objh-objcateg
iv_objtransp = ls_objh-objtransp
iv_devclass = iv_package
TABLES
tt_v_obj_s = lt_objs
tt_objm = lt_objm
EXCEPTIONS
illegal_call = 1
object_not_found = 2
generate_error = 3
transport_error = 4
object_enqueue_failed = 5
OTHERS = 6.
IF sy-subrc <> 0.
* TOBJ has to be saved/generated after the DDIC tables have been
* activated - fixed with late deserialization
zcx_abapgit_exception=>raise( 'error from OBJ_GENERATE' ).
ENDIF.
CALL FUNCTION 'OBJ_SET_IMPORTABLE'
EXPORTING
iv_objectname = ls_objh-objectname
iv_objecttype = ls_objh-objecttype
iv_importable = ls_objh-importable
EXCEPTIONS
object_not_defined = 1
invalid = 2
transport_error = 3
object_enqueue_failed = 4
OTHERS = 5.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from OBJ_SET_IMPORTABLE' ).
ENDIF.
* fm OBJ_GENERATE takes the defaults from the DDIC object
* set OBJTRANSP directly, should be okay looking at the code in OBJ_SET_IMPORTABLE
* locking has been done in OBJ_SET_IMPORTABLE plus recording of transport
UPDATE objh SET objtransp = ls_objh-objtransp
WHERE objectname = ls_objh-objectname
AND objecttype = ls_objh-objecttype.
io_xml->read( EXPORTING iv_name = 'TOBJ'
CHANGING cg_data = ls_tobj ).
ls_tobj-tvdir-gendate = sy-datum.
ls_tobj-tvdir-gentime = sy-uzeit.
update_extra( ls_tobj ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_objectname TYPE objh-objectname,
lv_type_pos TYPE i.
lv_type_pos = strlen( ms_item-obj_name ) - 1.
SELECT SINGLE objectname FROM objh INTO lv_objectname
WHERE objectname = ms_item-obj_name(lv_type_pos)
AND objecttype = ms_item-obj_name+lv_type_pos. "#EC CI_GENBUFF
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-late TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-late_deser = abap_true.
rs_metadata-delete_tadir = 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.
DATA: lv_object_name TYPE e071-obj_name.
lv_object_name = ms_item-obj_name.
CALL FUNCTION 'TR_OBJECT_JUMP_TO_TOOL'
EXPORTING
iv_pgmid = 'R3TR'
iv_object = ms_item-obj_type
iv_obj_name = lv_object_name
EXCEPTIONS
jump_not_possible = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Jump not possible. Subrc={ sy-subrc } from TR_OBJECT_JUMP_TO_TOOL| ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_objh TYPE objh,
ls_objt TYPE objt,
lt_objs TYPE tt_objs,
lt_objsl TYPE tt_objsl,
lt_objm TYPE tt_objm,
ls_tobj TYPE ty_tobj,
lv_type_pos TYPE i.
lv_type_pos = strlen( ms_item-obj_name ) - 1.
ls_objh-objectname = ms_item-obj_name(lv_type_pos).
ls_objh-objecttype = ms_item-obj_name+lv_type_pos.
CALL FUNCTION 'CTO_OBJECT_GET'
EXPORTING
iv_objectname = ls_objh-objectname
iv_objecttype = ls_objh-objecttype
iv_language = mv_language
iv_sel_objt = abap_true
iv_sel_objs = abap_true
iv_sel_objsl = abap_true
iv_sel_objm = abap_true
IMPORTING
es_objh = ls_objh
es_objt = ls_objt
TABLES
tt_objs = lt_objs
tt_objsl = lt_objsl
tt_objm = lt_objm
EXCEPTIONS
object_not_defined = 1
OTHERS = 2.
IF sy-subrc = 1.
RETURN.
ELSEIF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from CTO_OBJECT_GET' ).
ENDIF.
CLEAR: ls_objh-luser,
ls_objh-ldate.
io_xml->add( iv_name = 'OBJH'
ig_data = ls_objh ).
io_xml->add( iv_name = 'OBJT'
ig_data = ls_objt ).
io_xml->add( iv_name = 'OBJS'
ig_data = lt_objs ).
io_xml->add( iv_name = 'OBJSL'
ig_data = lt_objsl ).
io_xml->add( iv_name = 'OBJM'
ig_data = lt_objm ).
ls_tobj = read_extra( ls_objh-objectname ).
io_xml->add( iv_name = 'TOBJ'
ig_data = ls_tobj ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
83,
26801,
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,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
83,
26801,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
1860,
265,
41876,
256,
1860,
265,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
15908,
41876,
31557,
15908,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
31124,
69,
41876,
49053,
9795,
43679,
3963,
256,
31124,
69,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
83,
26801,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
1100,
62,
26086,
30023,
9863,
2751,
21628,
62,
8658,
3672,
220,
220,
220,
220,
41876,
43907,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
83,
26801,
8,
41876,
1259,
62,
83,
26801,
11,
198,
220,
220,
220,
220,
220,
4296,
62,
26086,
30023,
9863,
2751,
318,
62,
83,
26801,
41876,
1259,
62,
83,
26801,
11,
198,
220,
220,
220,
220,
220,
12233,
62,
26086,
30023,
9863,
2751,
21628,
62,
8658,
3672,
41876,
43907,
62,
3672,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
51,
9864,
41,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
12233,
62,
26086,
13,
628,
220,
220,
220,
5550,
2538,
9328,
16034,
256,
1860,
265,
33411,
7400,
3672,
796,
21628,
62,
8658,
3672,
13,
198,
220,
220,
220,
5550,
2538,
9328,
16034,
31557,
15908,
33411,
7400,
3672,
796,
21628,
62,
8658,
3672,
13,
198,
220,
220,
220,
5550,
2538,
9328,
16034,
256,
31124,
69,
33411,
7400,
3672,
796,
21628,
62,
8658,
3672,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1100,
62,
26086,
13,
628,
220,
220,
220,
33493,
311,
2751,
2538,
1635,
16034,
256,
1860,
265,
39319,
44608,
62,
83,
26801,
12,
83,
1860,
265,
33411,
7400,
3672,
796,
21628,
62,
8658,
3672,
13,
628,
220,
220,
220,
33493,
311,
2751,
2538,
1635,
16034,
31557,
15908,
39319,
44608,
62,
83,
26801,
12,
14981,
15908,
33411,
7400,
3672,
796,
21628,
62,
8658,
3672,
13,
198,
220,
220,
220,
30301,
1503,
25,
44608,
62,
83,
26801,
12,
14981,
15908,
12,
70,
437,
378,
11,
44608,
62,
83,
26801,
12,
14981,
15908,
12,
6783,
524,
13,
628,
220,
220,
220,
33493,
1635,
16034,
256,
31124,
69,
39319,
43679,
44608,
62,
83,
26801,
12,
14981,
320,
69,
33411,
7400,
3672,
796,
21628,
62,
8658,
3672,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
4296,
62,
26086,
13,
198,
220,
220,
220,
42865,
25,
300,
83,
62,
14421,
62,
14981,
320,
69,
41876,
49053,
9795,
43679,
3963,
256,
31124,
69,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
14981,
320,
69,
29,
41876,
256,
31124,
69,
13,
628,
220,
220,
220,
19164,
5064,
56,
256,
1860,
265,
16034,
318,
62,
83,
26801,
12,
83,
1860,
265,
13,
198,
220,
220,
220,
19164,
5064,
56,
31557,
15908,
16034,
318,
62,
83,
26801,
12,
14981,
15908,
13,
628,
220,
220,
220,
33493,
1635,
39319,
43679,
300,
83,
62,
14421,
62,
14981,
320,
69,
198,
220,
220,
220,
220,
220,
16034,
256,
31124,
69,
198,
220,
220,
220,
220,
220,
33411,
7400,
3672,
796,
318,
62,
83,
26801,
12,
83,
1860,
265,
12,
8658,
3672,
198,
220,
220,
220,
220,
220,
38678,
11050,
4810,
3955,
13153,
35374,
13,
628,
220,
220,
220,
17579,
3185,
5161,
300,
83,
62,
14421,
62,
14981,
320,
69,
24994,
3528,
15871,
1279,
7278,
62,
14981,
320,
69,
28401,
198,
220,
220,
220,
220,
220,
20832,
43679,
318,
62,
83,
26801,
12,
14981,
320,
69,
13315,
35374,
7400,
3672,
796,
1279,
7278,
62,
14981,
320,
69,
29,
12,
8658,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1785,
220,
220,
796,
1279,
7278,
62,
14981,
320,
69,
29,
12,
15596,
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,
48213,
4303,
9863,
2751,
8005,
18930,
3698,
5258,
13,
198,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
5550,
2538,
9328,
16034,
256,
31124,
69,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33411,
7400,
3672,
796,
1279,
7278,
62,
14981,
320,
69,
29,
12,
8658,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
1785,
796,
1279,
7278,
62,
14981,
320,
69,
29,
12,
15596,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
19164,
5064,
56,
256,
31124,
69,
16034,
43679,
318,
62,
83,
26801,
12,
14981,
320,
69,
13,
198,
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,
300,
85,
62,
4906,
62,
1930,
41876,
1312,
13,
628,
220,
220,
220,
300,
85,
62,
4906,
62,
1930,
796,
965,
11925,
7,
13845,
62,
9186,
12,
26801,
62,
3672,
1267,
532,
352,
13,
628,
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,
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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
] |
*&---------------------------------------------------------------------*
*& Include ZALL_PAIRS_CIO1
*&---------------------------------------------------------------------*
* Local Class Implemntations
*----------------------------------------------------------------------*
CLASS lcl_all_pairs IMPLEMENTATION.
METHOD main.
*--------------------------------------------------------------------*
* IMPORTING it_configuration TYPE g_tt_configuration
* RETURNING VALUE(rt_test_cases) TYPE g_tt_output_data.
*--------------------------------------------------------------------*
* The unit test example
* would give us 3 x 2 x 2 x 2 x 2 x 2 = 96 test cases using exhaustive testing
* The all pairs will return a lower value i.e. 8
* The theory is that testing those 8 cases will give you just an accurate
* result as testing all 96
*--------------------------------------------------------------------*
mt_configuration = it_configuration.
calculate_mapping( ).
DATA(no_of_variables) = lines( mt_mapping ).
process_first_two_columns( ).
DATA(new_column) = 2.
WHILE new_column LT no_of_variables.
ADD 1 TO new_column.
insert_new_column( new_column ).
ENDWHILE.
rt_test_cases = mt_test_cases.
ENDMETHOD.
METHOD calculate_mapping.
*--------------------------------------------------------------------*
* Here we see which variable has the highest number of values, then we put the variables with more possibilities
* in the left most columns. The minimum amount of test cases is COUNT( column_one) * COUNT( column_two )
*--------------------------------------------------------------------*
LOOP AT mt_configuration ASSIGNING FIELD-SYMBOL(<configuration>).
READ TABLE mt_mapping ASSIGNING FIELD-SYMBOL(<mapping>)
WITH KEY variable_name = <configuration>-variable_name.
IF sy-subrc NE 0.
APPEND INITIAL LINE TO mt_mapping ASSIGNING <mapping>.
ENDIF.
<mapping>-variable_name = <configuration>-variable_name.
ADD 1 TO <mapping>-value_count.
ENDLOOP.
* The mapping table should now have one line for each variables saying how many distinct values
* there are. There is probably an even more compact way to do this like REDUCE. If so then it is
* a valid example in my book (in more ways than one).
SORT mt_mapping BY value_count DESCENDING.
LOOP AT mt_mapping ASSIGNING <mapping>.
<mapping>-column_number = sy-tabix.
ENDLOOP.
ENDMETHOD.
METHOD process_first_two_columns.
*--------------------------------------------------------------------*
* This is the easy bit. The initial version of the test case table
* just contains the pairs from the first two columns i.e. if there
* are six different values in column one and three different values
* in column two, we will have 18 lines, none of them arbitrary
*--------------------------------------------------------------------*
DATA: all_pairs LIKE LINE OF mt_pairs.
READ TABLE mt_mapping INTO DATA(mapping)
WITH KEY column_number = 1.
DATA(first_variable) = mapping-variable_name.
READ TABLE mt_mapping INTO mapping
WITH KEY column_number = 2.
DATA(second_variable) = mapping-variable_name.
LOOP AT mt_configuration ASSIGNING FIELD-SYMBOL(<first_column>) WHERE variable_name = first_variable.
LOOP AT mt_configuration ASSIGNING FIELD-SYMBOL(<second_column>) WHERE variable_name = second_variable.
APPEND INITIAL LINE TO mt_test_cases ASSIGNING FIELD-SYMBOL(<test_case>).
<test_case>-case_number = lines( mt_test_cases[] ).
<test_case>-column_01 = <first_column>-possible_value.
<test_case>-arbitrary_01 = abap_false.
<test_case>-column_02 = <second_column>-possible_value.
<test_case>-arbitrary_01 = abap_false.
all_pairs-test_case = <test_case>-case_number.
all_pairs-variable_1 = first_variable.
all_pairs-value_1 = <first_column>-possible_value.
all_pairs-variable_2 = second_variable.
all_pairs-value_2 = <second_column>-possible_value.
INSERT all_pairs INTO TABLE mt_pairs.
ENDLOOP."Values for second column
ENDLOOP."Values for Fisrt Column
*--------------------------------------------------------------------*
* 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
*--------------------------------------------------------------------*
ENDMETHOD.
METHOD insert_new_column.
*--------------------------------------------------------------------*
* IMPORTING new_column TYPE i
*--------------------------------------------------------------------*
DATA(left_column) = new_column - 1.
populate( left_populated_column = left_column
right_blank_column = new_column ).
SUBTRACT 1 FROM left_column.
WHILE left_column GT 1.
compare_columns( left_column = left_column
right_column = new_column ).
SUBTRACT 1 FROM left_column.
ENDWHILE.
ENDMETHOD.
METHOD pair_is_in_test_case.
*--------------------------------------------------------------------*
* IMPORTING variable_1 TYPE string
* first_value TYPE string
* variable_2 TYPE string
* second_value TYPE string
* RETURNING VALUE(yes_it_is) TYPE abap_bool.
*--------------------------------------------------------------------*
DATA: column_01 TYPE string,
column_02 TYPE string,
number_a TYPE n LENGTH 2,
number_b TYPE n LENGTH 2.
FIELD-SYMBOLS: <value_a> TYPE any,
<value_b> TYPE any.
DATA(column_no_1) = get_column_for_variable( variable_1 ).
DATA(column_no_2) = get_column_for_variable( variable_2 ).
number_a = column_no_1.
number_b = column_no_2.
column_01 = 'COLUMN_' && number_a.
column_02 = 'COLUMN_' && number_b.
LOOP AT mt_test_cases ASSIGNING FIELD-SYMBOL(<test_case>).
UNASSIGN <value_a>.
ASSIGN COMPONENT column_01 OF STRUCTURE <test_case> TO <value_a>.
CHECK <value_a> IS ASSIGNED.
UNASSIGN <value_b>.
ASSIGN COMPONENT column_02 OF STRUCTURE <test_case> TO <value_b>.
CHECK <value_b> IS ASSIGNED.
CHECK <value_a> = first_value.
CHECK <value_b> = second_value.
yes_it_is = abap_true.
RETURN.
ENDLOOP."Test Cases
ENDMETHOD.
METHOD compare_columns.
*--------------------------------------------------------------------*
* IMPORTING left_column TYPE i
* right_column TYPE i
*--------------------------------------------------------------------*
* For each combination (pair) of the possible values in columns A and B
* we make sure that pair exists somewhere in the test case table
* If not, then naturally we need to add it. If we can add it to an
* existing row, sweet, otherwise we need a new row
*--------------------------------------------------------------------*
DATA: all_pairs LIKE LINE OF mt_pairs,
pair_inserted TYPE abap_bool.
READ TABLE mt_mapping INTO DATA(mapping)
WITH KEY column_number = left_column.
DATA(first_variable) = mapping-variable_name.
READ TABLE mt_mapping INTO mapping
WITH KEY column_number = right_column.
DATA(second_variable) = mapping-variable_name.
DATA: left_column_name TYPE string,
right_column_name TYPE string,
arbitrary_01 TYPE string,
arbitrary_02 TYPE string,
number_a TYPE n LENGTH 2,
number_b TYPE n LENGTH 2.
number_a = left_column.
number_b = right_column.
left_column_name = 'COLUMN_' && number_a.
right_column_name = 'COLUMN_' && number_b.
arbitrary_01 = 'ARBITRARY_' && number_a.
arbitrary_02 = 'ARBITRARY_' && number_b.
FIELD-SYMBOLS: <value_a> TYPE any,
<value_b> TYPE any,
<arbitrary_01_flag> TYPE any,
<arbitrary_02_flag> TYPE any.
LOOP AT mt_configuration ASSIGNING FIELD-SYMBOL(<first_column>) WHERE variable_name = first_variable.
LOOP AT mt_configuration ASSIGNING FIELD-SYMBOL(<second_column>) WHERE variable_name = second_variable.
READ TABLE mt_pairs TRANSPORTING NO FIELDS
WITH TABLE KEY variable_1 = first_variable
value_1 = <first_column>-possible_value
variable_2 = second_variable
value_2 = <second_column>-possible_value.
IF sy-subrc EQ 0.
"We already have this pair of values in a test case, all good
CONTINUE."With next pair
ENDIF.
pair_inserted = abap_false.
LOOP AT mt_test_cases ASSIGNING FIELD-SYMBOL(<test_case>).
UNASSIGN <value_a>.
ASSIGN COMPONENT left_column_name OF STRUCTURE <test_case> TO <value_a>.
CHECK <value_a> IS ASSIGNED.
CHECK <value_a> EQ <first_column>-possible_value.
UNASSIGN <value_b>.
ASSIGN COMPONENT right_column_name OF STRUCTURE <test_case> TO <value_b>.
CHECK <value_b> IS ASSIGNED.
UNASSIGN <arbitrary_01_flag>.
ASSIGN COMPONENT arbitrary_01 OF STRUCTURE <test_case> TO <arbitrary_01_flag>.
CHECK <arbitrary_01_flag> IS ASSIGNED.
UNASSIGN <arbitrary_02_flag>.
ASSIGN COMPONENT arbitrary_02 OF STRUCTURE <test_case> TO <arbitrary_02_flag>.
CHECK <arbitrary_02_flag> IS ASSIGNED.
*--------------------------------------------------------------------*
* The value in the second column is blank. Thus we can add a new pair
*--------------------------------------------------------------------*
IF <value_b> IS INITIAL.
<value_a> = <first_column>-possible_value. "It already is, just making this obvious
<arbitrary_01_flag> = abap_false.
<value_b> = <second_column>-possible_value.
<arbitrary_02_flag> = abap_false.
all_pairs-test_case = <test_case>-case_number.
all_pairs-variable_1 = first_variable.
all_pairs-value_1 = <first_column>-possible_value.
all_pairs-variable_2 = second_variable.
all_pairs-value_2 = <second_column>-possible_value.
INSERT all_pairs INTO TABLE mt_pairs.
pair_inserted = abap_true.
EXIT."From list of test cases
ENDIF.
*--------------------------------------------------------------------*
* This combination exists already thus we can add it to the all
* pairs table as a valid combination
*--------------------------------------------------------------------*
IF <value_b> = <second_column>-possible_value.
<arbitrary_01_flag> = abap_false. "No longer arbitrary
<arbitrary_02_flag> = abap_false. "No longer arbitrary
all_pairs-test_case = <test_case>-case_number.
all_pairs-variable_1 = first_variable.
all_pairs-value_1 = <first_column>-possible_value.
all_pairs-variable_2 = second_variable.
all_pairs-value_2 = <second_column>-possible_value.
INSERT all_pairs INTO TABLE mt_pairs.
pair_inserted = abap_true.
EXIT."From List of Test Cases
ENDIF.
*--------------------------------------------------------------------*
* If the value in the second column is an arbitrary value, we can replace it
*--------------------------------------------------------------------*
CHECK <arbitrary_02_flag> EQ abap_true.
<value_b> = <second_column>-possible_value.
<arbitrary_01_flag> = abap_false. "No longer arbitrary
<arbitrary_02_flag> = abap_false. "No longer arbitrary
all_pairs-test_case = <test_case>-case_number.
all_pairs-variable_1 = first_variable.
all_pairs-value_1 = <first_column>-possible_value.
all_pairs-variable_2 = second_variable.
all_pairs-value_2 = <second_column>-possible_value.
INSERT all_pairs INTO TABLE mt_pairs.
pair_inserted = abap_true.
EXIT."From list of test cases
ENDLOOP."Existing Test Cases
IF pair_inserted EQ abap_true.
CONTINUE."With next pair of values
ENDIF.
*--------------------------------------------------------------------*
* If we get here, then we could not add our unique pair of values to the
* existing list of test cases, so we need a new one
*--------------------------------------------------------------------*
DATA: random_number TYPE qfranint.
GET TIME."To make sure random number generator works
CALL FUNCTION 'QF05_RANDOM_INTEGER'
EXPORTING
ran_int_max = lines( mt_test_cases[] )
ran_int_min = 1
IMPORTING
ran_int = random_number
EXCEPTIONS
invalid_input = 1
OTHERS = 2.
IF sy-subrc <> 0.
random_number = lines( mt_test_cases[] ) / 2.
ENDIF.
* The idea is to pick one of the existing lines. As more columns get added
* that new line will have the arbitrary values replaced with real ones
READ TABLE mt_test_cases INTO DATA(last_test_case) INDEX random_number.
ASSERT sy-subrc EQ 0.
APPEND INITIAL LINE TO mt_test_cases ASSIGNING <test_case>.
MOVE-CORRESPONDING last_test_case TO <test_case>.
<test_case>-case_number = lines( mt_test_cases[] ).
<test_case>-arbitrary_01 = abap_true.
<test_case>-arbitrary_02 = abap_true.
<test_case>-arbitrary_03 = abap_true.
<test_case>-arbitrary_04 = abap_true.
<test_case>-arbitrary_05 = abap_true.
UNASSIGN <value_a>.
ASSIGN COMPONENT left_column_name OF STRUCTURE <test_case> TO <value_a>.
CHECK <value_a> IS ASSIGNED.
UNASSIGN <value_b>.
ASSIGN COMPONENT right_column_name OF STRUCTURE <test_case> TO <value_b>.
CHECK <value_b> IS ASSIGNED.
UNASSIGN <arbitrary_01_flag>.
ASSIGN COMPONENT arbitrary_01 OF STRUCTURE <test_case> TO <arbitrary_01_flag>.
CHECK <arbitrary_01_flag> IS ASSIGNED.
UNASSIGN <arbitrary_02_flag>.
ASSIGN COMPONENT arbitrary_02 OF STRUCTURE <test_case> TO <arbitrary_02_flag>.
CHECK <arbitrary_02_flag> IS ASSIGNED.
<value_a> = <first_column>-possible_value.
<value_b> = <second_column>-possible_value.
<arbitrary_01_flag> = abap_false.
<arbitrary_02_flag> = abap_false.
all_pairs-test_case = <test_case>-case_number.
all_pairs-variable_1 = first_variable.
all_pairs-value_1 = <first_column>-possible_value.
all_pairs-variable_2 = second_variable.
all_pairs-value_2 = <second_column>-possible_value.
INSERT all_pairs INTO TABLE mt_pairs.
ENDLOOP."Possible Values of Column B
ENDLOOP."Possible Values of Column A
ENDMETHOD.
METHOD populate.
*--------------------------------------------------------------------*
* IMPORTING right_blank_column TYPE i
* left_populated_column TYPE i
*--------------------------------------------------------------------*
* The idea is to loop through the test cases - the new column is blank
* at this point
* We keep iterating through the possible values of the new column
* If we can find a new pair with the eixtsing value in the comparison
* column and the value we are checking then great, add to test case
* and all pairs table
* If not try again with next possible value
* Once we have all possible pairs, fill the remaining test cases with
* arbitrary values, but looping through the possible values of the
* new column
*--------------------------------------------------------------------*
* What is the variable for the compariosn column?
DATA(full_column_variable) = get_variable_for_column( left_populated_column ).
* What is the variable we are going to populate the column with?
DATA(right_blank_column_variable) = get_variable_for_column( right_blank_column ).
* How many different values do we have for the new column?
DATA(number_of_new_values) = get_number_of_new_values_for( right_blank_column_variable ).
DATA: current_new_value_index TYPE i.
* Loop through test cases, filling new blank column
LOOP AT mt_test_cases ASSIGNING FIELD-SYMBOL(<ls_test_case>).
DO number_of_new_values TIMES.
ADD 1 TO current_new_value_index.
IF current_new_value_index GT number_of_new_values.
current_new_value_index = 1.
ENDIF.
* What value is it we are trying to insert?
DATA(proposed_value) = get_proposed_value( variable_name = right_blank_column_variable
index = current_new_value_index ).
* What value is it in the comparison column?
get_current_value( EXPORTING test_case = <ls_test_case>
column = left_populated_column
IMPORTING value = DATA(current_value) ).
* I think the current value for column 2 is XXX
* and the iterated value proposed for column 3 is YYY
* We need to see if this combination is already in the all pairs table
* If so great, if not add
DATA(combination_exists) = combination_exists( variable_1 = full_column_variable
first_value = current_value
variable_2 = right_blank_column_variable
second_value = proposed_value ).
IF combination_exists EQ abap_true.
CONTINUE."With next possible value in blank column
ELSE.
"Add a proper pair to the test case line and also add to all pairs table
set_test_case_value( EXPORTING column = left_populated_column
value = current_value
arbitrary = abap_false "In case it currently is arbitrary
CHANGING test_case = <ls_test_case> ).
set_test_case_value( EXPORTING column = right_blank_column
value = proposed_value
arbitrary = abap_false
CHANGING test_case = <ls_test_case> ).
"Add to all pairs table
DATA(ls_all_pairs) = VALUE m_typ_pairs( test_case = <ls_test_case>-case_number
variable_1 = full_column_variable
value_1 = current_value
variable_2 = right_blank_column_variable
value_2 = proposed_value ).
INSERT ls_all_pairs INTO TABLE mt_pairs.
"Move on to next test case
EXIT.
ENDIF.
ENDDO."Possible values in blank column
ENDLOOP."Test Cases
*--------------------------------------------------------------------*
* We have added all possible pairs for these two columns. Now we
* fill the remaining blank values with arbitrary values
*--------------------------------------------------------------------*
LOOP AT mt_test_cases ASSIGNING <ls_test_case>.
get_current_value( EXPORTING test_case = <ls_test_case>
column = right_blank_column
IMPORTING value = current_value ).
CHECK current_value IS INITIAL.
ADD 1 TO current_new_value_index.
IF current_new_value_index GT number_of_new_values.
current_new_value_index = 1.
ENDIF.
* What value is it we are trying to insert?
proposed_value = get_proposed_value( variable_name = right_blank_column_variable
index = current_new_value_index ).
set_test_case_value( EXPORTING column = right_blank_column
value = proposed_value
arbitrary = abap_true
CHANGING test_case = <ls_test_case> ).
ENDLOOP.
ENDMETHOD."Populate Blank Column
METHOD get_variable_for_column.
*--------------------------------------------------------------------*
* IMPORTING column TYPE i
* RETURNING VALUE(variable) TYPE string.
*--------------------------------------------------------------------*
READ TABLE mt_mapping INTO DATA(mapping)
WITH KEY column_number = column.
ASSERT sy-subrc EQ 0.
variable = mapping-variable_name.
ENDMETHOD.
METHOD get_column_for_variable.
*--------------------------------------------------------------------*
* IMPORTING variable TYPE string
* RETURNING VALUE(column) TYPE i
*--------------------------------------------------------------------*
READ TABLE mt_mapping INTO DATA(mapping)
WITH KEY variable_name = variable.
ASSERT sy-subrc EQ 0.
column = mapping-column_number.
ENDMETHOD.
METHOD get_number_of_new_values_for.
*--------------------------------------------------------------------*
* IMPORTING variable_name TYPE string
* RETURNING VALUE(no_of_values) TYPE i.
*--------------------------------------------------------------------*
LOOP AT mt_mapping ASSIGNING FIELD-SYMBOL(<mapping>) WHERE variable_name = variable_name.
no_of_values = <mapping>-value_count.
ENDLOOP.
ENDMETHOD.
METHOD get_proposed_value.
*--------------------------------------------------------------------*
* IMPORTING variable_name TYPE string
* index TYPE i
* RETURNING VALUE(value) TYPE string
*--------------------------------------------------------------------*
READ TABLE mt_configuration INTO DATA(configuration)
WITH KEY variable_name = variable_name
count = index.
ASSERT sy-subrc EQ 0.
value = configuration-possible_value.
ENDMETHOD.
METHOD get_current_value.
*--------------------------------------------------------------------*
* IMPORTING column TYPE i
* EXPORTING value TYPE sring
* arbitrary TYPE abap_bool
*--------------------------------------------------------------------*
DATA: column_name TYPE string,
arbitrary_name TYPE string,
number TYPE n LENGTH 2.
number = column.
column_name = 'COLUMN_' && number.
arbitrary_name = 'ARBITRARY_' && number.
FIELD-SYMBOLS: <value> TYPE any,
<arbitrary_flag> TYPE any.
UNASSIGN <value>.
ASSIGN COMPONENT column_name OF STRUCTURE test_case TO <value>.
CHECK <value> IS ASSIGNED.
UNASSIGN <arbitrary_flag>.
ASSIGN COMPONENT arbitrary_name OF STRUCTURE test_case TO <arbitrary_flag>.
CHECK <arbitrary_flag> IS ASSIGNED.
value = <value>.
arbitrary = <arbitrary_flag>.
ENDMETHOD.
METHOD set_test_case_value.
*--------------------------------------------------------------------*
* IMPORTING column TYPE i
* value TYPE string
* arbitrary TYPE abap_bool
* CHANGING test_case TYPE m_typ_test_case,l
*--------------------------------------------------------------------*
DATA: column_name TYPE string,
arbitrary_name TYPE string,
number TYPE n LENGTH 2.
* Preconditions
CHECK column IS NOT INITIAL.
CHECK value IS NOT INITIAL.
number = column.
column_name = 'COLUMN_' && number.
arbitrary_name = 'ARBITRARY_' && number.
FIELD-SYMBOLS: <value> TYPE any,
<arbitrary_flag> TYPE any.
UNASSIGN <value>.
ASSIGN COMPONENT column_name OF STRUCTURE test_case TO <value>.
CHECK <value> IS ASSIGNED.
UNASSIGN <arbitrary_flag>.
ASSIGN COMPONENT arbitrary_name OF STRUCTURE test_case TO <arbitrary_flag>.
CHECK <arbitrary_flag> IS ASSIGNED.
<value> = value.
<arbitrary_flag> = arbitrary.
ENDMETHOD."Set Test Case Value
METHOD combination_exists.
*--------------------------------------------------------------------*
* IMPORTING first_value TYPE string
* second_value TYPE string
* RETURNING VALUE(yes_it_does) TYPE abap_bool
*--------------------------------------------------------------------*
READ TABLE mt_pairs TRANSPORTING NO FIELDS
WITH TABLE KEY variable_1 = variable_1
value_1 = first_value
variable_2 = variable_2
value_2 = second_value.
IF sy-subrc EQ 0.
yes_it_does = abap_true.
ELSE.
yes_it_does = abap_false.
ENDIF.
ENDMETHOD.
ENDCLASS."LCL_ALL_PAIRS
CLASS lcl_application IMPLEMENTATION.
METHOD main.
"Hard Coded here - would use configuration or similar in
"real life
DATA(context_data_list) = VALUE wdr_simple_name_value_list( (
name = 'UI_TECHNOLOGY'
value = 'CL_SALV_TABLE' ) ).
CREATE OBJECT mo_model.
zcl_ocp_factory=>return_object_given(
EXPORTING it_context_data = context_data_list
CHANGING co_object = mo_view ).
CREATE OBJECT mo_controller
EXPORTING
io_model = mo_model
io_view = mo_view.
mo_model->data_retrieval( ).
mo_model->prepare_data_for_ouput( ).
mo_model->fill_field_texts( ).
"It is bad news to pass system variables as parameters
DATA(repid) = sy-repid.
IF sy-batch IS INITIAL.
*--------------------------------------------------------------------*
* Listing 10.31 - Calling a SALV report whilst creating a container
* automatically
*--------------------------------------------------------------------*
* Program flow is as follows:-
* ZCL_BC_VIEW_SALV_TABLE->CREATE_CONTAINER_PREPARE_DATA
* Function ZSALV_CSQT_CREATE_CONTAINER
* ZSALV_CSQT_CREATE_CONTAINER->FILL_CONTAINER_CONTENT
* ZCL_BC_VIEW_SALV_TABLE->PREPARE_DISPLAY_DATA
* --> INITIALISE (Generic)
* --> Application Specific Changes (Generic)
* --> Display (Generic)
mo_view->create_container_prep_display(
EXPORTING
id_report_name = repid " Calling program
if_start_in_edit_mode = abap_false
id_edit_control_field = mo_model->md_edit_control_field
is_layout = mo_model->ms_layout
it_editable_fields = mo_model->mt_editable_fields
it_technicals = mo_model->mt_technicals
it_hidden = mo_model->mt_hidden
it_hotspots = mo_model->mt_hotspots
it_checkboxes = mo_model->mt_checkboxes
it_subtotal_fields = mo_model->mt_subtotal_fields
it_field_texts = mo_model->mt_field_texts " Display Variant as specified by user
it_user_commands = mo_model->mt_user_commands
CHANGING
ct_data_table = mo_model->mt_output_data ).
ELSE.
* If this is running in the background there is no way
* in the world we want/need a container, as there is no
* chance for the user to press any user command buttons or
* edit the data, as there is no user, and no screen for the
* container to live on for that matter
mo_view->prepare_display_data(
EXPORTING
id_report_name = repid
it_technicals = mo_model->mt_technicals
it_hidden = mo_model->mt_hidden
it_hotspots = mo_model->mt_hotspots
it_checkboxes = mo_model->mt_checkboxes
it_subtotal_fields = mo_model->mt_subtotal_fields
it_field_texts = mo_model->mt_field_texts
it_user_commands = mo_model->mt_user_commands
CHANGING
ct_data_table = mo_model->mt_output_data ).
ENDIF."Are we running in the background?
ENDMETHOD. "main
ENDCLASS. "lcl_application IMPLEMENTATION
*----------------------------------------------------------------------*
* CLASS lcl_selections IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_selections IMPLEMENTATION.
METHOD constructor.
p_file = ip_file.
ENDMETHOD. "constructor
ENDCLASS."Local Selections
*----------------------------------------------------------------------*
* CLASS lcl_persistency_layer IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_persistency_layer IMPLEMENTATION.
METHOD get_data.
*--------------------------------------------------------------------*
* EXPORTING et_output_data TYPE g_tt_output_data.
*--------------------------------------------------------------------*
* Really, we should use ABAP2XLSX to read spreadsheets
* This is a good example of how to extract the contents from an
* EXCEL file and do whatever you want with the data
*--------------------------------------------------------------------*
* Local variables
DATA: extension TYPE string,
reader TYPE REF TO zif_excel_reader,
column TYPE zexcel_cell_column VALUE 1,
row TYPE int4 VALUE 1,
configuration LIKE LINE OF et_configuration.
FIND REGEX '(\.xlsx|\.xlsm)\s*$' IN go_selections->p_file SUBMATCHES extension.
TRANSLATE extension TO UPPER CASE.
CASE extension.
WHEN '.XLSX'.
CREATE OBJECT reader TYPE zcl_excel_reader_2007.
DATA(excel) = reader->load_file( go_selections->p_file ).
WHEN '.XLSM'.
CREATE OBJECT reader TYPE zcl_excel_reader_xlsm.
excel = reader->load_file( go_selections->p_file ).
WHEN OTHERS.
MESSAGE 'Unsupported filetype'(002) TYPE 'I'.
RETURN.
ENDCASE.
DATA(worksheet) = excel->get_active_worksheet( ).
DATA(highest_column) = worksheet->get_highest_column( ).
DATA(highest_row) = worksheet->get_highest_row( ).
WHILE row <= highest_row.
WHILE column <= highest_column.
DATA(col_str) = zcl_excel_common=>convert_column2alpha( column ).
worksheet->get_cell(
EXPORTING ip_column = col_str
ip_row = row
IMPORTING ep_value = DATA(value) ).
IF column = 1.
configuration-variable_name = value.
ELSEIF column = 2.
configuration-possible_value = value.
ELSE.
EXIT."From looking at columns
ENDIF.
column = column + 1.
ENDWHILE.
APPEND configuration TO et_configuration.
column = 1.
row = row + 1.
ENDWHILE.
DATA: current_variable TYPE string,
current_value TYPE sy-tabix.
LOOP AT et_configuration ASSIGNING FIELD-SYMBOL(<configuration>).
IF current_variable IS INITIAL.
current_variable = <configuration>-variable_name.
current_value = 0.
ELSEIF current_variable NE <configuration>-variable_name.
current_variable = <configuration>-variable_name.
current_value = 0.
ENDIF.
ADD 1 TO current_value.
<configuration>-count = current_value.
ENDLOOP.
RETURN.
ENDMETHOD. "get_data
ENDCLASS. "lcl_persistency_layer IMPLEMENTATION
*----------------------------------------------------------------------*
* CLASS lcl_model IMPLEMENTATION
*----------------------------------------------------------------------*
* When creating the model for real we do not fill the import parameter
* and thus the data is read for real
* When creating the model within a unit test, we pass in a reference to
* the fake database access class
*----------------------------------------------------------------------*
CLASS lcl_model IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
IF io_access_class IS SUPPLIED.
mo_persistency_layer = io_access_class.
ELSE.
CREATE OBJECT mo_persistency_layer.
ENDIF.
fill_user_commands( ).
fill_layout_data( ).
fill_technical_fields( ).
fill_hidden_fields( ).
fill_hotspot_fields( ).
fill_subtotal_fields( ).
fill_editable_fields( ).
fill_checkbox_fields( ).
set_edit_control_field( ).
ENDMETHOD. "constructor
METHOD data_retrieval.
TRY.
mt_configuration = mo_persistency_layer->get_data( ).
CATCH zcx_excel.
MESSAGE 'Oh Dear!'(003) TYPE 'E'.
ENDTRY.
ENDMETHOD. "data_retrieval
**********************************************************************
* METHOD prepare_data_for_output
**********************************************************************
* Get text names of objects, mapping, etc etc
*----------------------------------------------------------------------*
METHOD prepare_data_for_ouput.
mo_all_pairs = NEW lcl_all_pairs( ).
mt_output_data = mo_all_pairs->main( mt_configuration ).
ENDMETHOD. "prepare_data_for_ouput
METHOD fill_user_commands.
REFRESH mt_user_commands.
ENDMETHOD. "fill_user_commands
METHOD fill_layout_data.
ms_layout = VALUE #( list_header = 'All Pairs Test Cases'(004)
colwidth_optimize = abap_true
striped_pattern = abap_true
no_cell_merging = abap_true ).
ENDMETHOD.
METHOD fill_editable_fields ##needed.
ENDMETHOD. "fill_editable_fields
METHOD fill_hidden_fields ##needed.
"No Hidden Fields
ENDMETHOD. "fill_hidden_fields
METHOD fill_technical_fields ##needed.
ENDMETHOD. "fill_technical_fields
METHOD fill_hotspot_fields ##needed.
ENDMETHOD. "fill_hotspot_fields
METHOD fill_subtotal_fields ##needed.
"No Subtotals
ENDMETHOD. "fill_subtotal_fields
METHOD fill_field_texts.
*--------------------------------------------------------------------*
* This has to be done "late in the day" as it were because we have to
* wait till the model is aware of the mapping, before we can say
* what the column names are going to be
*--------------------------------------------------------------------*
* Local Variables
DATA: column_number TYPE n LENGTH 2,
field_texts LIKE LINE OF mt_field_texts.
* Preconditions
CHECK mo_all_pairs->mt_mapping[] IS NOT INITIAL.
REFRESH mt_field_texts.
field_texts-field_name = 'CASE_NUMBER'.
field_texts-long_text = 'Case Number'(005).
APPEND field_texts TO mt_field_texts.
LOOP AT mo_all_pairs->mt_mapping ASSIGNING FIELD-SYMBOL(<mapping_entry>).
READ TABLE mt_field_texts TRANSPORTING NO FIELDS
WITH KEY long_text = <mapping_entry>-variable_name ##WARN_OK.
IF sy-subrc EQ 0.
"We have already handled this variable, move on
CONTINUE.
ENDIF.
ADD 1 TO column_number.
IF column_number GT 6.
"Only six possible variables for this example. Feel free to add more...
EXIT.
ENDIF.
CLEAR field_texts.
field_texts-field_name = 'COLUMN_' && column_number.
field_texts-long_text = <mapping_entry>-variable_name.
APPEND field_texts TO mt_field_texts.
field_texts-field_name = 'ARBITRARY_' && column_number.
field_texts-long_text = 'A'.
field_texts-tooltip = 'Arbitrary Value?'(006).
APPEND field_texts TO mt_field_texts.
ENDLOOP.
ENDMETHOD. "fill_field_texts
METHOD fill_checkbox_fields ##needed.
ENDMETHOD. "fill_checkbox_fields
METHOD user_command ##needed.
ENDMETHOD."User Command / Model
ENDCLASS. "lcl_model IMPLEMENTATION
*----------------------------------------------------------------------*
* CLASS lcl_view IMPLEMENTATION
*----------------------------------------------------------------------*
CLASS lcl_view IMPLEMENTATION.
ENDCLASS. "lcl_view IMPLEMENTATION
*----------------------------------------------------------------------*
* CLASS lcl_controller IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_controller IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
mo_model = io_model.
mo_view = io_view.
"Make the controller react to the views events
SET HANDLER on_user_command FOR mo_view.
"If the model changes some data, then it needs to
"tell the controller, so it can tell the view
"to refresh the data
SET HANDLER on_data_changed FOR mo_model.
ENDMETHOD. "constructor
METHOD on_user_command.
*--------------------------------------------------------------------*
* Listing 10.32 - User Command to Make a SALV Grid Editable
*--------------------------------------------------------------------*
* FOR EVENT added_function OF cl_salv_events
* IMPORTING ed_user_command
* ed_row
* ed_column.
*--------------------------------------------------------------------*
mo_model->user_command(
EXPORTING
id_user_command = ed_user_command " Function code that PAI triggered
id_column = ed_column " Selected Column
id_row = ed_row ). " Selected Row
mo_view->refresh_display( ).
ENDMETHOD."User Command / Controller
METHOD on_data_changed.
mo_view->refresh_display( ).
ENDMETHOD. "on_data_changed
ENDCLASS. "lcl_controller IMPLEMENTATION
| [
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,
34,
9399,
16,
198,
9,
5,
10097,
30934,
9,
198,
9,
10714,
5016,
1846,
1154,
76,
429,
602,
198,
9,
10097,
23031,
9,
198,
31631,
300,
565,
62,
439,
62,
79,
3468,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
1388,
13,
198,
9,
10097,
650,
9,
198,
9,
30023,
9863,
2751,
340,
62,
11250,
3924,
220,
220,
220,
220,
41876,
308,
62,
926,
62,
11250,
3924,
198,
9,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
9288,
62,
33964,
8,
41876,
308,
62,
926,
62,
22915,
62,
7890,
13,
198,
9,
10097,
650,
9,
198,
9,
383,
4326,
1332,
1672,
198,
9,
561,
1577,
514,
513,
2124,
362,
2124,
362,
2124,
362,
2124,
362,
2124,
362,
796,
9907,
1332,
2663,
1262,
36049,
4856,
198,
9,
383,
477,
14729,
481,
1441,
257,
2793,
1988,
1312,
13,
68,
13,
807,
198,
9,
383,
4583,
318,
326,
4856,
883,
807,
2663,
481,
1577,
345,
655,
281,
7187,
198,
9,
1255,
355,
4856,
477,
9907,
198,
9,
10097,
650,
9,
198,
220,
220,
220,
45079,
62,
11250,
3924,
796,
340,
62,
11250,
3924,
13,
628,
220,
220,
220,
15284,
62,
76,
5912,
7,
6739,
628,
220,
220,
220,
42865,
7,
3919,
62,
1659,
62,
25641,
2977,
8,
796,
3951,
7,
45079,
62,
76,
5912,
6739,
628,
220,
220,
220,
1429,
62,
11085,
62,
11545,
62,
28665,
82,
7,
6739,
628,
220,
220,
220,
42865,
7,
3605,
62,
28665,
8,
796,
362,
13,
628,
220,
220,
220,
7655,
41119,
649,
62,
28665,
34146,
645,
62,
1659,
62,
25641,
2977,
13,
628,
220,
220,
220,
220,
220,
27841,
352,
5390,
649,
62,
28665,
13,
628,
220,
220,
220,
220,
220,
7550,
62,
3605,
62,
28665,
7,
649,
62,
28665,
6739,
628,
220,
220,
220,
23578,
12418,
41119,
13,
628,
220,
220,
220,
374,
83,
62,
9288,
62,
33964,
796,
45079,
62,
9288,
62,
33964,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
15284,
62,
76,
5912,
13,
198,
9,
10097,
650,
9,
198,
9,
3423,
356,
766,
543,
7885,
468,
262,
4511,
1271,
286,
3815,
11,
788,
356,
1234,
262,
9633,
351,
517,
12779,
198,
9,
287,
262,
1364,
749,
15180,
13,
383,
5288,
2033,
286,
1332,
2663,
318,
327,
28270,
7,
5721,
62,
505,
8,
1635,
327,
28270,
7,
5721,
62,
11545,
1267,
198,
9,
10097,
650,
9,
198,
220,
220,
220,
17579,
3185,
5161,
45079,
62,
11250,
3924,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
11250,
3924,
29,
737,
628,
220,
220,
220,
220,
220,
20832,
43679,
45079,
62,
76,
5912,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
76,
5912,
43734,
198,
220,
220,
220,
220,
220,
13315,
35374,
7885,
62,
3672,
796,
1279,
11250,
3924,
29,
12,
45286,
62,
3672,
13,
628,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
10635,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
43504,
10619,
3268,
2043,
12576,
48920,
5390,
45079,
62,
76,
5912,
24994,
3528,
15871,
1279,
76,
5912,
28401,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
220,
220,
1279,
76,
5912,
29,
12,
45286,
62,
3672,
796,
1279,
11250,
3924,
29,
12,
45286,
62,
3672,
13,
198,
220,
220,
220,
220,
220,
27841,
352,
5390,
1279,
76,
5912,
29,
12,
8367,
62,
9127,
13,
628,
220,
220,
220,
23578,
21982,
3185,
13,
198,
198,
9,
383,
16855,
3084,
815,
783,
423,
530,
1627,
329,
1123,
9633,
2282,
703,
867,
7310,
3815,
198,
9,
612,
389,
13,
1318,
318,
2192,
281,
772,
517,
16001,
835,
284,
466,
428,
588,
23848,
52,
5222,
13,
1002,
523,
788,
340,
318,
198,
9,
257,
4938,
1672,
287,
616,
1492,
357,
259,
517,
2842,
621,
530,
737,
198,
220,
220,
220,
311,
9863,
45079,
62,
76,
5912,
11050,
1988,
62,
9127,
22196,
34,
10619,
2751,
13,
628,
220,
220,
220,
17579,
3185,
5161,
45079,
62,
76,
5912,
24994,
3528,
15871,
1279,
76,
5912,
28401,
198,
220,
220,
220,
220,
220,
1279,
76,
5912,
29,
12,
28665,
62,
17618,
796,
827,
12,
8658,
844,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1429,
62,
11085,
62,
11545,
62,
28665,
82,
13,
198,
9,
10097,
650,
9,
198,
9,
770,
318,
262,
2562,
1643,
13,
383,
4238,
2196,
286,
262,
1332,
1339,
3084,
198,
9,
655,
4909,
262,
14729,
422,
262,
717,
734,
15180,
1312,
13,
68,
13,
611,
612,
198,
9,
389,
2237,
1180,
3815,
287,
5721,
530,
290,
1115,
1180,
3815,
198,
9,
287,
5721,
734,
11,
356,
481,
423,
1248,
3951,
11,
4844,
286,
606,
14977,
198,
9,
10097,
650,
9,
198,
220,
220,
220,
42865,
25,
477,
62,
79,
3468,
34178,
48920,
3963,
45079,
62,
79,
3468,
13,
628,
220,
220,
220,
20832,
43679,
45079,
62,
76,
5912,
39319,
42865,
7,
76,
5912,
8,
198,
220,
220,
220,
13315,
35374,
5721,
62,
17618,
796,
352,
13,
628,
220,
220,
220,
42865,
7,
11085,
62,
45286,
8,
796,
16855,
12,
45286,
62,
3672,
13,
628,
220,
220,
220,
20832,
43679,
45079,
62,
76,
5912,
39319,
16855,
198,
220,
220,
220,
13315,
35374,
5721,
62,
17618,
796,
362,
13,
628,
220,
220,
220,
42865,
7,
12227,
62,
45286,
8,
796,
16855,
12,
45286,
62,
3672,
13,
628,
220,
220,
220,
17579,
3185,
5161,
45079,
62,
11250,
3924,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
11085,
62,
28665,
43734,
33411,
7885,
62,
3672,
796,
717,
62,
45286,
13,
198,
220,
220,
220,
220,
220,
17579,
3185,
5161,
45079,
62,
11250,
3924,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
12227,
62,
28665,
43734,
33411,
7885,
62,
3672,
796,
1218,
62,
45286,
13,
628,
220,
220,
220,
220,
220,
220,
220,
43504,
10619,
3268,
2043,
12576,
48920,
5390,
45079,
62,
9288,
62,
33964,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
9288,
62,
7442,
29,
737,
628,
220,
220,
220,
220,
220,
220,
220,
1279,
9288,
62,
7442,
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,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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
] |
*&---------------------------------------------------------------------*
*& Include ZAL30_MAIN_VIEW_TOP
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
* Tablas de diccionario
*----------------------------------------------------------------------*
TABLES: zal30_t_view.
*----------------------------------------------------------------------*
* Tipos de datos
*----------------------------------------------------------------------*
TYPE-POOLS: cntb, icon, abap.
TYPES: BEGIN OF ts_control_data,
tabix TYPE sytabix,
updkz TYPE char01,
END OF ts_control_data.
TYPES: tt_control_data TYPE STANDARD TABLE OF ts_control_data.
TYPES: BEGIN OF ts_opt_selscreen_field_text,
text TYPE string,
len TYPE i,
END OF ts_opt_selscreen_field_text.
TYPES: tt_opt_selscreen_field_text TYPE STANDARD TABLE OF ts_opt_selscreen_field_text WITH EMPTY KEY.
TYPES: BEGIN OF ts_sel_screen,
tabname TYPE tabname,
selid TYPE rsdynsel-selid,
fields_ranges TYPE rsds_trange,
where_clauses TYPE rsds_twhere,
expressions TYPE rsds_texpr,
fields TYPE rsdsfields_t,
fields_text TYPE STANDARD TABLE OF rsdstexts WITH EMPTY KEY,
fields_desc TYPE STANDARD TABLE OF fldconvert WITH EMPTY KEY,
END OF ts_sel_screen.
TYPES tt_sel_screen TYPE STANDARD TABLE OF ts_sel_screen WITH EMPTY KEY.
* Tipo que contiene los campos para controlar la configuración
* y determinados datos de la dynpro
TYPES: BEGIN OF ts_conf_screen,
sel_screen TYPE tt_sel_screen,
origin_tcode TYPE sytcode,
origin_tcode_text TYPE string,
END OF ts_conf_screen.
*----------------------------------------------------------------------*
* Internal tables
*----------------------------------------------------------------------*
* Campos de la parametrización de la vista
DATA mt_fields TYPE zif_al30_data=>tt_fields_view_alv.
DATA mt_fields_text TYPE zif_al30_data=>tt_fields_text_view_alv.
DATA mt_fields_ddic TYPE dd03ptab.
DATA mt_foreign_key_ddic TYPE dd05mttyp.
DATA mt_control_data TYPE tt_control_data.
*----------------------------------------------------------------------*
* Datos de la vista
*----------------------------------------------------------------------*
* Datos para que procese el ALV
DATA mo_datos TYPE REF TO data.
FIELD-SYMBOLS <it_datos> TYPE STANDARD TABLE.
* Registros que se tienen que borrar borran
DATA mo_datos_del TYPE REF TO data.
FIELD-SYMBOLS <it_datos_del> TYPE STANDARD TABLE.
*----------------------------------------------------------------------*
* Variables
*----------------------------------------------------------------------*
* boton pulsado en dynpro 9000, la principal.
DATA mv_okcode_9000 TYPE sy-ucomm.
* boton pulsado en dynpro 9001, la del listado.
DATA mv_okcode_9001 TYPE sy-ucomm.
* boton pulsado en dynpro 9002, la del listado.
DATA mv_okcode_9002 TYPE sy-ucomm.
* Modo de visualización del programa.
DATA mv_mode TYPE char1.
* Texto de la vista (se toma del diccionario)
DATA mv_text_view TYPE as4text.
* Verificación que los datos de la pestaña son correctos
DATA mv_datos_validos TYPE sap_bool.
* Datos principales de la vista
DATA ms_view TYPE zal30_t_view.
* Se generará una orden al grabar los datos
DATA mv_pedir_orden TYPE sap_bool.
* Orden donde se guardan los datos
DATA mv_orden_transporte TYPE e070-trkorr.
* Texto de idioma de la tabla de texto
DATA mv_field_lang_textable TYPE fieldname.
" Configuración y determinados datos de las pantallas
DATA ms_conf_screen TYPE ts_conf_screen.
" Lenguaje de visualización
DATA mv_lang_vis TYPE sylangu.
* Leer datos de la vista
DATA mv_read_data_view TYPE sap_bool.
*----------------------------------------------------------------------*
* Class
*----------------------------------------------------------------------*
DATA mo_cnt_al30 TYPE REF TO zcl_al30_controller.
*----------------------------------------------------------------------*
* Declaración para los ALV
*----------------------------------------------------------------------*
* Catalogo de campos de la vista
DATA mt_fieldcat TYPE lvc_t_fcat.
* Funciones de la barra del ALV que se excluiran
DATA mt_excluding TYPE ui_functions.
DATA ms_stable TYPE lvc_s_stbl.
DATA ms_layout TYPE lvc_s_layo.
DATA mt_filters TYPE lvc_t_filt.
DATA mo_alv TYPE REF TO cl_gui_alv_grid.
DATA mo_container TYPE REF TO cl_gui_docking_container.
CLASS lcl_controller DEFINITION DEFERRED.
DATA mo_controller TYPE REF TO lcl_controller.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
40348,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1168,
1847,
1270,
62,
5673,
1268,
62,
28206,
62,
35222,
198,
9,
5,
10097,
30934,
9,
198,
9,
10097,
23031,
9,
198,
9,
16904,
21921,
390,
288,
44240,
295,
4982,
198,
9,
10097,
23031,
9,
198,
5603,
9148,
1546,
25,
1976,
282,
1270,
62,
83,
62,
1177,
13,
198,
198,
9,
10097,
23031,
9,
198,
9,
23095,
418,
390,
4818,
418,
198,
9,
10097,
23031,
9,
198,
198,
25216,
12,
16402,
3535,
50,
25,
269,
429,
65,
11,
7196,
11,
450,
499,
13,
198,
198,
9936,
47,
1546,
25,
347,
43312,
3963,
40379,
62,
13716,
62,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
7400,
844,
41876,
827,
8658,
844,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
2325,
74,
89,
41876,
1149,
486,
11,
198,
220,
220,
220,
220,
220,
220,
23578,
3963,
40379,
62,
13716,
62,
7890,
13,
198,
9936,
47,
1546,
25,
256,
83,
62,
13716,
62,
7890,
41876,
49053,
9795,
43679,
3963,
40379,
62,
13716,
62,
7890,
13,
198,
198,
9936,
47,
1546,
25,
347,
43312,
3963,
40379,
62,
8738,
62,
741,
9612,
62,
3245,
62,
5239,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
2420,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
18896,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
23578,
3963,
40379,
62,
8738,
62,
741,
9612,
62,
3245,
62,
5239,
13,
198,
9936,
47,
1546,
25,
256,
83,
62,
8738,
62,
741,
9612,
62,
3245,
62,
5239,
41876,
49053,
9795,
43679,
3963,
40379,
62,
8738,
62,
741,
9612,
62,
3245,
62,
5239,
13315,
38144,
9936,
35374,
13,
198,
198,
9936,
47,
1546,
25,
347,
43312,
3963,
40379,
62,
741,
62,
9612,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
7400,
3672,
220,
220,
220,
220,
220,
220,
41876,
7400,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
384,
75,
312,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
374,
21282,
2047,
741,
12,
741,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
7032,
62,
81,
6231,
41876,
44608,
9310,
62,
2213,
858,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
810,
62,
565,
64,
2664,
41876,
44608,
9310,
62,
83,
3003,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
14700,
220,
220,
41876,
44608,
9310,
62,
16886,
1050,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
7032,
220,
220,
220,
220,
220,
220,
220,
41876,
44608,
9310,
25747,
62,
83,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
7032,
62,
5239,
220,
220,
41876,
49053,
9795,
43679,
3963,
374,
21282,
301,
2302,
82,
13315,
38144,
9936,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
7032,
62,
20147,
220,
220,
41876,
49053,
9795,
43679,
3963,
277,
335,
1102,
1851,
13315,
38144,
9936,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
23578,
3963,
40379,
62,
741,
62,
9612,
13,
198,
9936,
47,
1546,
256,
83,
62,
741,
62,
9612,
41876,
49053,
9795,
43679,
3963,
40379,
62,
741,
62,
9612,
13315,
38144,
9936,
35374,
13,
198,
198,
9,
23095,
78,
8358,
542,
72,
1734,
22346,
1413,
418,
31215,
1630,
283,
8591,
4566,
333,
32009,
18840,
198,
9,
331,
3416,
22484,
4818,
418,
390,
8591,
37860,
1676,
198,
9936,
47,
1546,
25,
347,
43312,
3963,
40379,
62,
10414,
62,
9612,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
384,
75,
62,
9612,
220,
220,
220,
220,
220,
220,
220,
41876,
256,
83,
62,
741,
62,
9612,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
8159,
62,
83,
8189,
220,
220,
220,
220,
220,
41876,
827,
83,
8189,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
8159,
62,
83,
8189,
62,
5239,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
23578,
3963,
40379,
62,
10414,
62,
9612,
13,
198,
198,
9,
10097,
23031,
9,
198,
9,
18628,
8893,
198,
9,
10097,
23031,
9,
198,
9,
5425,
418,
390,
8591,
5772,
316,
47847,
32009,
18840,
390,
8591,
410,
12523,
198,
26947,
45079,
62,
25747,
41876,
1976,
361,
62,
282,
1270,
62,
7890,
14804,
926,
62,
25747,
62,
1177,
62,
282,
85,
13,
198,
26947,
45079,
62,
25747,
62,
5239,
41876,
1976,
361,
62,
282,
1270,
62,
7890,
14804,
926,
62,
25747,
62,
5239,
62,
1177,
62,
282,
85,
13,
198,
26947,
45079,
62,
25747,
62,
1860,
291,
41876,
49427,
3070,
457,
397,
13,
198,
26947,
45079,
62,
38823,
62,
2539,
62,
1860,
291,
41876,
49427,
2713,
16762,
28004,
13,
198,
198,
26947,
45079,
62,
13716,
62,
7890,
41876,
256,
83,
62,
13716,
62,
7890,
13,
198,
198,
9,
10097,
23031,
9,
198,
9,
16092,
418,
390,
8591,
410,
12523,
198,
9,
10097,
23031,
9,
198,
9,
16092,
418,
31215,
8358,
386,
728,
68,
1288,
8355,
53,
198,
26947,
6941,
62,
19608,
418,
41876,
4526,
37,
5390,
1366,
13,
198,
44603,
12,
23060,
10744,
3535,
50,
1279,
270,
62,
19608,
418,
29,
41876,
49053,
9795,
43679,
13,
198,
198,
9,
13811,
4951,
8358,
384,
256,
2013,
268,
8358,
275,
273,
20040,
275,
273,
2596,
198,
26947,
6941,
62,
19608,
418,
62,
12381,
41876,
4526,
37,
5390,
1366,
13,
198,
44603,
12,
23060,
10744,
3535,
50,
1279,
270,
62,
19608,
418,
62,
12381,
29,
41876,
49053,
9795,
43679,
13,
628,
198,
9,
10097,
23031,
9,
198,
9,
15965,
2977,
198,
9,
10097,
23031,
9,
198,
9,
10214,
261,
22271,
4533,
551,
37860,
1676,
50138,
11,
8591,
10033,
13,
198,
26947,
285,
85,
62,
482,
8189,
62,
24,
830,
41876,
827,
12,
84,
9503,
13,
198,
198,
9,
10214,
261,
22271,
4533,
551,
37860,
1676,
860,
8298,
11,
8591,
1619,
1351,
4533,
13,
198,
26947,
285,
85,
62,
482,
8189,
62,
24,
8298,
41876,
827,
12,
84,
9503,
13,
198,
198,
9,
10214,
261,
22271,
4533,
551,
37860,
1676,
15897,
17,
11,
8591,
1619,
1351,
4533,
13,
198,
26947,
285,
85,
62,
482,
8189,
62,
12865,
17,
41876,
827,
12,
84,
9503,
13,
198,
198,
9,
3401,
78,
390,
5874,
528
] | [
1,
1,
1,
1,
1,
1,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sfbf DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
PROTECTED SECTION.
PRIVATE SECTION.
METHODS:
get
RETURNING VALUE(ro_bf) TYPE REF TO cl_sfw_bf
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS zcl_abapgit_object_sfbf IMPLEMENTATION.
METHOD get.
DATA: lv_bf TYPE sfw_bfunction.
lv_bf = ms_item-obj_name.
TRY.
* make sure to clear cache, method GET_BF_FROM_DB does not exist in 702
ro_bf = cl_sfw_bf=>get_bf( lv_bf ).
ro_bf->free( ).
ro_bf = cl_sfw_bf=>get_bf( lv_bf ).
CATCH cx_pak_invalid_data cx_pak_invalid_state cx_pak_not_authorized.
zcx_abapgit_exception=>raise( 'Error from CL_SFW_BF=>GET_BF' ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
DATA: ls_data TYPE sfw_bf.
ls_data = get( )->get_header_data( ).
rv_user = ls_data-changedby.
IF rv_user IS INITIAL.
rv_user = ls_data-author.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_bf TYPE sfw_bfunction,
lt_delete TYPE sfw_bftab,
lt_msgtab TYPE sprot_u_tab.
lv_bf = ms_item-obj_name.
APPEND lv_bf TO lt_delete.
cl_sfw_activate=>delete_sfbf( EXPORTING p_bfuncts = lt_delete
IMPORTING p_msgtab = lt_msgtab ).
READ TABLE lt_msgtab WITH KEY severity = 'E' TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
zcx_abapgit_exception=>raise( 'Error deleting SFBF' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_bf TYPE sfw_bfunction,
lo_bf TYPE REF TO cl_sfw_bf,
ls_header TYPE sfw_bf,
lv_name_32 TYPE sfw_name32,
lv_name_80 TYPE sfw_name80,
lt_assigned_switches TYPE sfw_swbf_outtab,
lt_dependancies TYPE sfw_depend_outtab,
ls_sfw_bfc_kw TYPE sfw_bfc_kw,
ls_sfw_bfc_tc TYPE sfw_bfc_tc,
ls_sfw_bfc_rn TYPE sfw_bfc_rn,
lt_parent_bfs TYPE sfw_bs_bf_outtab.
io_xml->read( EXPORTING iv_name = 'HEADER'
CHANGING cg_data = ls_header ).
io_xml->read( EXPORTING iv_name = 'NAME32'
CHANGING cg_data = lv_name_32 ).
io_xml->read( EXPORTING iv_name = 'NAME80'
CHANGING cg_data = lv_name_80 ).
io_xml->read( EXPORTING iv_name = 'ASSIGNED_SWITCHES'
CHANGING cg_data = lt_assigned_switches ).
io_xml->read( EXPORTING iv_name = 'DEPENDANCIES'
CHANGING cg_data = lt_dependancies ).
io_xml->read( EXPORTING iv_name = 'CONTENT_KW'
CHANGING cg_data = ls_sfw_bfc_kw ).
io_xml->read( EXPORTING iv_name = 'CONTENT_TC'
CHANGING cg_data = ls_sfw_bfc_tc ).
io_xml->read( EXPORTING iv_name = 'CONTENT_RN'
CHANGING cg_data = ls_sfw_bfc_rn ).
io_xml->read( EXPORTING iv_name = 'PARENT_BFS'
CHANGING cg_data = lt_parent_bfs ).
lv_bf = ms_item-obj_name.
TRY.
lo_bf = cl_sfw_bf=>create_bf( lv_bf ).
CATCH cx_pak_not_authorized cx_pak_invalid_state cx_pak_invalid_data.
zcx_abapgit_exception=>raise( 'error in CL_SFW_BF=>CREATE_BF' ).
ENDTRY.
ls_header-author = sy-uname.
ls_header-createdon = sy-datum.
lo_bf->set_header_data( ls_header ).
lo_bf->set_texts( p_32 = lv_name_32
p_80 = lv_name_80 ).
lo_bf->set_assigned_switches( lt_assigned_switches ).
lo_bf->set_excluded_bf( lt_dependancies ).
lo_bf->set_content_data(
im_sfw_bfc_kw = ls_sfw_bfc_kw
im_sfw_bfc_rn = ls_sfw_bfc_rn
im_sfw_bfc_tc = ls_sfw_bfc_tc ).
lo_bf->set_parent_bfs( lt_parent_bfs ).
set_default_package( iv_package ).
tadir_insert( iv_package ).
lo_bf->save_all( ).
zcl_abapgit_objects_activation=>add_item( ms_item ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: ls_tadir TYPE tadir,
lv_bf TYPE sfw_bfunction.
lv_bf = ms_item-obj_name.
IF cl_sfw_bf=>check_existence( lv_bf ) = abap_false.
RETURN.
ENDIF.
SELECT SINGLE * FROM tadir INTO ls_tadir
WHERE pgmid = 'R3TR'
AND object = ms_item-obj_type
AND obj_name = ms_item-obj_name.
IF ls_tadir IS INITIAL.
RETURN.
ENDIF.
rv_bool = abap_true.
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.
rs_metadata-delete_tadir = 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.
" Covered by ZCL_ABAPGIT_OBJECTS=>JUMP
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lo_bf TYPE REF TO cl_sfw_bf,
ls_header TYPE sfw_bf,
lv_name_32 TYPE sfw_name32,
lv_name_80 TYPE sfw_name80,
lt_assigned_switches TYPE sfw_swbf_outtab,
lt_dependancies TYPE sfw_depend_outtab,
ls_sfw_bfc_kw TYPE sfw_bfc_kw,
ls_sfw_bfc_tc TYPE sfw_bfc_tc,
ls_sfw_bfc_rn TYPE sfw_bfc_rn,
lt_parent_bfs TYPE sfw_bs_bf_outtab.
IF zif_abapgit_object~exists( ) = abap_false.
RETURN.
ENDIF.
lo_bf = get( ).
ls_header = lo_bf->get_header_data( ).
CLEAR: ls_header-author,
ls_header-createdon,
ls_header-changedby,
ls_header-changedon,
ls_header-timestamp.
lo_bf->get_texts(
IMPORTING
p_32 = lv_name_32
p_80 = lv_name_80 ).
lt_assigned_switches = lo_bf->get_assigned_switches( ).
lt_dependancies = lo_bf->get_excluded_bf( ).
lo_bf->get_content_data(
IMPORTING
ex_sfw_bfc_kw = ls_sfw_bfc_kw
ex_sfw_bfc_tc = ls_sfw_bfc_tc
ex_sfw_bfc_rn = ls_sfw_bfc_rn ).
lt_parent_bfs = lo_bf->get_parent_bfs( ).
io_xml->add( ig_data = ls_header
iv_name = 'HEADER' ).
io_xml->add( ig_data = lv_name_32
iv_name = 'NAME32' ).
io_xml->add( ig_data = lv_name_80
iv_name = 'NAME80' ).
io_xml->add( ig_data = lt_assigned_switches
iv_name = 'ASSIGNED_SWITCHES' ).
io_xml->add( ig_data = lt_dependancies
iv_name = 'DEPENDANCIES' ).
io_xml->add( ig_data = ls_sfw_bfc_kw
iv_name = 'CONTENT_KW' ).
io_xml->add( ig_data = ls_sfw_bfc_tc
iv_name = 'CONTENT_TC' ).
io_xml->add( ig_data = ls_sfw_bfc_rn
iv_name = 'CONTENT_RN' ).
io_xml->add( ig_data = lt_parent_bfs
iv_name = 'PARENT_BFS' ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
28202,
19881,
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,
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,
19881,
8,
41876,
4526,
37,
5390,
537,
62,
28202,
86,
62,
19881,
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,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
28202,
19881,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
651,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
19881,
41876,
264,
44482,
62,
65,
8818,
13,
628,
198,
220,
220,
220,
300,
85,
62,
19881,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
9,
787,
1654,
284,
1598,
12940,
11,
2446,
17151,
62,
29499,
62,
10913,
2662,
62,
11012,
857,
407,
2152,
287,
43379,
198,
220,
220,
220,
220,
220,
220,
220,
686,
62,
19881,
796,
537,
62,
28202,
86,
62,
19881,
14804,
1136,
62,
19881,
7,
300,
85,
62,
19881,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
686,
62,
19881,
3784,
5787,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
686,
62,
19881,
796,
537,
62,
28202,
86,
62,
19881,
14804,
1136,
62,
19881,
7,
300,
85,
62,
19881,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
41091,
62,
259,
12102,
62,
7890,
43213,
62,
41091,
62,
259,
12102,
62,
5219,
43213,
62,
41091,
62,
1662,
62,
19721,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
12331,
422,
7852,
62,
20802,
54,
62,
29499,
14804,
18851,
62,
29499,
6,
6739,
198,
220,
220,
220,
23578,
40405,
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,
43979,
62,
7890,
41876,
264,
44482,
62,
19881,
13,
628,
220,
220,
220,
43979,
62,
7890,
796,
651,
7,
1267,
3784,
1136,
62,
25677,
62,
7890,
7,
6739,
628,
220,
220,
220,
374,
85,
62,
7220,
796,
43979,
62,
7890,
12,
40985,
1525,
13,
628,
220,
220,
220,
16876,
374,
85,
62,
7220,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
7220,
796,
43979,
62,
7890,
12,
9800,
13,
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,
33678,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
19881,
220,
220,
220,
220,
41876,
264,
44482,
62,
65,
8818,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
33678,
41876,
264,
44482,
62,
65,
701,
397,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
19662,
8658,
41876,
599,
10599,
62,
84,
62,
8658,
13,
628,
198,
220,
220,
220,
300,
85,
62,
19881,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
198,
220,
220,
220,
43504,
10619,
300,
85,
62,
19881,
5390,
300,
83,
62,
33678,
13,
628,
220,
220,
220,
537,
62,
28202,
86,
62,
39022,
14804,
33678,
62,
28202,
19881,
7,
7788,
15490,
2751,
279,
62,
65,
12543,
310,
82,
796,
300,
83,
62,
33678,
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,
30023,
9863,
2751,
279,
62,
19662,
8658,
796,
300,
83,
62,
19662,
8658,
6739,
628,
220,
220,
220,
20832,
43679,
300,
83,
62,
19662,
8658,
13315,
35374,
19440,
796,
705,
36,
6,
48213,
4303,
9863,
2751,
8005,
18930,
3698,
5258,
13,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
12331,
34817,
14362,
29499,
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,
8906,
48499,
1096,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
19881,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
264,
44482,
62,
65,
8818,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
19881,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
537,
62,
28202,
86,
62,
19881,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
25677,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
264,
44482,
62,
19881,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
3672,
62,
2624,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
264,
44482,
62,
3672,
2624,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
3672,
62,
1795,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
264,
44482,
62,
3672,
1795,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
562,
3916,
62,
2032,
9249,
41876,
264,
44482,
62,
2032,
19881,
62,
448,
8658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
45841,
16183,
220,
220,
220,
220,
220,
41876,
264,
44482,
62,
45841,
62,
448,
8658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
28202,
86,
62,
65,
16072
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1,
1,
1,
1,
1
] |
CLASS ycl_a2g_json_cond_rule 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_cond_rule,
ranges TYPE ycl_a2g_json_gridrange=>ty_t_json_gridrange,
booleanRule type ycl_a2g_json_booleanrule=>ty_s_json_booleanrule,
gradientRule type ycl_a2g_json_gradientRule=>ty_s_json_gradientRule,
END OF ty_s_json_cond_rule.
TYPES ty_t_json_cond_rule TYPE STANDARD TABLE OF ty_s_json_cond_rule WITH NON-UNIQUE KEY gradientRule.
PROTECTED SECTION.
METHODS generate_rules REDEFINITION.
METHODS rebuild_data REDEFINITION.
METHODS push_data REDEFINITION.
DATA: gs_cond_rule TYPE ty_s_json_cond_rule.
PRIVATE SECTION.
ENDCLASS.
CLASS ycl_a2g_json_cond_rule IMPLEMENTATION.
METHOD push_data.
ENDMETHOD.
METHOD rebuild_data.
ENDMETHOD.
METHOD constructor.
super->constructor( if_msg_manager ).
me->gv_data = REF #( me->gs_cond_rule ).
ENDMETHOD.
METHOD generate_rules.
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
17561,
62,
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,
17561,
62,
25135,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16069,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
25928,
9521,
14804,
774,
62,
83,
62,
17752,
62,
25928,
9521,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25131,
31929,
2099,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
2127,
21052,
25135,
14804,
774,
62,
82,
62,
17752,
62,
2127,
21052,
25135,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31312,
31929,
2099,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
49607,
31929,
14804,
774,
62,
82,
62,
17752,
62,
49607,
31929,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
82,
62,
17752,
62,
17561,
62,
25135,
13,
198,
220,
220,
220,
24412,
47,
1546,
1259,
62,
83,
62,
17752,
62,
17561,
62,
25135,
41876,
49053,
9795,
43679,
3963,
1259,
62,
82,
62,
17752,
62,
17561,
62,
25135,
13315,
44521,
12,
4944,
33866,
8924,
35374,
31312,
31929,
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,
17561,
62,
25135,
220,
41876,
1259,
62,
82,
62,
17752,
62,
17561,
62,
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,
17561,
62,
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,
17561,
62,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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H 1,
value TYPE string,
code TYPE string,
rulename TYPE string,
END OF ty_token .
TYPES:
ty_tokens_tt TYPE STANDARD TABLE OF ty_token WITH NON-UNIQUE DEFAULT KEY .
TYPES:
BEGIN OF ty_result,
match TYPE abap_bool,
tokens TYPE ty_tokens_tt,
END OF ty_result .
CONSTANTS:
BEGIN OF c_type,
role TYPE c VALUE 'R' ##NO_TEXT,
terminal TYPE c VALUE 'T' ##NO_TEXT,
nonterminal TYPE c VALUE 'N' ##NO_TEXT,
END OF c_type .
CONSTANTS:
BEGIN OF c_role,
fielddefid TYPE string VALUE 'FieldDefId' ##NO_TEXT,
fieldid TYPE string VALUE 'FieldId' ##NO_TEXT,
formid TYPE string VALUE 'FormId' ##NO_TEXT,
formdefid TYPE string VALUE 'FormDefId' ##NO_TEXT,
classexctypeid TYPE string VALUE 'ClassexcTypeId' ##NO_TEXT,
typeid TYPE string VALUE 'TypeId' ##NO_TEXT,
END OF c_role .
CLASS-METHODS run
IMPORTING
!it_code TYPE string_table
!iv_debug TYPE abap_bool DEFAULT abap_false
!iv_rule TYPE string DEFAULT 'START'
!iv_allow_obsolete TYPE abap_bool DEFAULT abap_true
RETURNING
VALUE(rs_result) TYPE ty_result.
PROTECTED SECTION.
TYPES: ty_syntax_tt TYPE STANDARD TABLE OF ssyntaxstructure.
CONSTANTS: gc_dummy TYPE zcl_aoc_parser_node=>ty_node_type VALUE 'D',
gc_start TYPE zcl_aoc_parser_node=>ty_node_type VALUE 'S',
gc_end TYPE zcl_aoc_parser_node=>ty_node_type VALUE 'E',
gc_role TYPE zcl_aoc_parser_node=>ty_node_type VALUE 'R',
gc_terminal TYPE zcl_aoc_parser_node=>ty_node_type VALUE 'T',
gc_nonterminal TYPE zcl_aoc_parser_node=>ty_node_type VALUE 'N'.
CLASS-METHODS download
IMPORTING
!iv_filename TYPE string
!iv_data TYPE string.
CLASS-METHODS parents
CHANGING
!ct_tokens TYPE ty_tokens_tt.
CLASS-METHODS xml_fix
CHANGING
!cv_xml TYPE string.
CLASS-METHODS build_permutation
IMPORTING
!ii_rule TYPE REF TO if_ixml_node
!iv_rulename TYPE string
!io_before TYPE REF TO zcl_aoc_parser_node
!io_after TYPE REF TO zcl_aoc_parser_node.
CLASS-METHODS build_optionlist
IMPORTING
!ii_rule TYPE REF TO if_ixml_node
!iv_rulename TYPE string
!io_before TYPE REF TO zcl_aoc_parser_node
!io_after TYPE REF TO zcl_aoc_parser_node.
CLASS-METHODS build_option
IMPORTING
!ii_rule TYPE REF TO if_ixml_node
!iv_rulename TYPE string
!io_before TYPE REF TO zcl_aoc_parser_node
!io_after TYPE REF TO zcl_aoc_parser_node.
CLASS-METHODS build_nonterminal
IMPORTING
!ii_rule TYPE REF TO if_ixml_node
!iv_rulename TYPE string
!io_before TYPE REF TO zcl_aoc_parser_node
!io_after TYPE REF TO zcl_aoc_parser_node.
CLASS-METHODS build_iteration
IMPORTING
!ii_rule TYPE REF TO if_ixml_node
!iv_rulename TYPE string
!io_before TYPE REF TO zcl_aoc_parser_node
!io_after TYPE REF TO zcl_aoc_parser_node.
CLASS-METHODS build_alternative
IMPORTING
!ii_rule TYPE REF TO if_ixml_node
!iv_rulename TYPE string
!io_before TYPE REF TO zcl_aoc_parser_node
!io_after TYPE REF TO zcl_aoc_parser_node.
CLASS-METHODS build
IMPORTING
!ii_rule TYPE REF TO if_ixml_node
!iv_rulename TYPE string
!io_before TYPE REF TO zcl_aoc_parser_node
!io_after TYPE REF TO zcl_aoc_parser_node.
CLASS-METHODS graph_build
IMPORTING
!iv_rulename TYPE string
EXPORTING
!eo_start TYPE REF TO zcl_aoc_parser_node
!eo_end TYPE REF TO zcl_aoc_parser_node.
CLASS-METHODS graph_download
IMPORTING
!iv_rulename TYPE string
!io_start TYPE REF TO zcl_aoc_parser_node.
CLASS-METHODS graph_to_text
IMPORTING
!io_node TYPE REF TO zcl_aoc_parser_node
RETURNING
VALUE(rv_text) TYPE string .
CLASS-METHODS walk
IMPORTING
!io_node TYPE REF TO zcl_aoc_parser_node
!iv_index TYPE i
RETURNING
VALUE(rs_result) TYPE ty_result.
CLASS-METHODS xml_download
IMPORTING
!iv_rulename TYPE string
!ii_xml TYPE REF TO if_ixml
!ii_xml_doc TYPE REF TO if_ixml_document.
CLASS-METHODS build_role
IMPORTING
!ii_rule TYPE REF TO if_ixml_node
!iv_rulename TYPE string
!io_before TYPE REF TO zcl_aoc_parser_node
!io_after TYPE REF TO zcl_aoc_parser_node.
CLASS-METHODS build_sequence
IMPORTING
!ii_rule TYPE REF TO if_ixml_node
!iv_rulename TYPE string
!io_before TYPE REF TO zcl_aoc_parser_node
!io_after TYPE REF TO zcl_aoc_parser_node.
CLASS-METHODS build_terminal
IMPORTING
!ii_rule TYPE REF TO if_ixml_node
!iv_rulename TYPE string
!io_before TYPE REF TO zcl_aoc_parser_node
!io_after TYPE REF TO zcl_aoc_parser_node.
CLASS-METHODS walk_terminal
IMPORTING
!io_node TYPE REF TO zcl_aoc_parser_node
!iv_index TYPE i
RETURNING
VALUE(rs_result) TYPE ty_result.
CLASS-METHODS walk_role
IMPORTING
!io_node TYPE REF TO zcl_aoc_parser_node
!iv_index TYPE i
RETURNING
VALUE(rs_result) TYPE ty_result.
CLASS-METHODS walk_nonterminal
IMPORTING
!io_node TYPE REF TO zcl_aoc_parser_node
!iv_index TYPE i
RETURNING
VALUE(rs_result) TYPE ty_result.
CLASS-METHODS walk_node
IMPORTING
!io_node TYPE REF TO zcl_aoc_parser_node
!iv_index TYPE i
RETURNING
VALUE(rs_result) TYPE ty_result.
CLASS-METHODS walk_end
IMPORTING
!io_node TYPE REF TO zcl_aoc_parser_node
!iv_index TYPE i
RETURNING
VALUE(rs_result) TYPE ty_result.
CLASS-METHODS xml_get
IMPORTING
!iv_rulename TYPE string
RETURNING
VALUE(ri_rule) TYPE REF TO if_ixml_node.
CLASS-METHODS xml_parse
IMPORTING
!iv_rulename TYPE string
!iv_xml TYPE string
RETURNING
VALUE(ri_rule) TYPE REF TO if_ixml_node.
CLASS-METHODS parse
IMPORTING
!it_tokens TYPE stokesx_tab
!it_statements TYPE sstmnt_tab
RETURNING
VALUE(rs_result) TYPE ty_result.
PRIVATE SECTION.
TYPES: BEGIN OF ty_cache,
rulename TYPE string,
node TYPE REF TO if_ixml_node,
END OF ty_cache.
CLASS-DATA gt_cache TYPE SORTED TABLE OF ty_cache WITH UNIQUE KEY rulename.
CLASS-DATA gt_syntax TYPE ty_syntax_tt.
CLASS-DATA gt_tokens TYPE string_table.
CLASS-DATA gv_end_rule TYPE string.
CLASS-DATA gv_debug TYPE abap_bool.
CLASS-DATA gv_allow_obsolete TYPE abap_bool.
ENDCLASS.
CLASS zcl_aoc_parser IMPLEMENTATION.
METHOD build.
DATA: lv_name TYPE string.
IF NOT ii_rule IS BOUND.
io_before->edge( io_after ).
RETURN.
ENDIF.
lv_name = ii_rule->get_name( ).
* todo, change input to structure instead?
CASE lv_name.
WHEN 'Sequence'.
build_sequence(
ii_rule = ii_rule
iv_rulename = iv_rulename
io_before = io_before
io_after = io_after ).
WHEN 'Alternative'.
build_alternative(
ii_rule = ii_rule
iv_rulename = iv_rulename
io_before = io_before
io_after = io_after ).
WHEN 'Nonterminal'.
build_nonterminal(
ii_rule = ii_rule
iv_rulename = iv_rulename
io_before = io_before
io_after = io_after ).
WHEN 'Terminal'.
build_terminal(
ii_rule = ii_rule
iv_rulename = iv_rulename
io_before = io_before
io_after = io_after ).
WHEN 'Role'.
build_role(
ii_rule = ii_rule
iv_rulename = iv_rulename
io_before = io_before
io_after = io_after ).
WHEN 'Option'.
build_option(
ii_rule = ii_rule
iv_rulename = iv_rulename
io_before = io_before
io_after = io_after ).
WHEN 'Permutation'.
build_permutation(
ii_rule = ii_rule
iv_rulename = iv_rulename
io_before = io_before
io_after = io_after ).
WHEN 'Iteration'.
build_iteration(
ii_rule = ii_rule
iv_rulename = iv_rulename
io_before = io_before
io_after = io_after ).
WHEN 'Optionlist'.
build_optionlist(
ii_rule = ii_rule
iv_rulename = iv_rulename
io_before = io_before
io_after = io_after ).
ENDCASE.
ENDMETHOD.
METHOD build_alternative.
DATA: li_children TYPE REF TO if_ixml_node_list,
lo_dummy TYPE REF TO zcl_aoc_parser_node,
li_child TYPE REF TO if_ixml_node.
CREATE OBJECT lo_dummy
EXPORTING
iv_type = gc_dummy
iv_value = 'Alternative'
iv_rulename = iv_rulename. "#EC NOTEXT
li_children = ii_rule->get_children( ).
io_before->edge( lo_dummy ).
DO li_children->get_length( ) TIMES.
li_child = li_children->get_item( sy-index - 1 ).
li_child = li_child->get_first_child( ). " get rid of <Alt> tag
build( ii_rule = li_child
iv_rulename = iv_rulename
io_before = lo_dummy
io_after = io_after ).
ENDDO.
ENDMETHOD.
METHOD build_iteration.
DATA: li_child TYPE REF TO if_ixml_node,
lo_dummy1 TYPE REF TO zcl_aoc_parser_node,
lo_dummy2 TYPE REF TO zcl_aoc_parser_node.
li_child = ii_rule->get_first_child( ).
CREATE OBJECT lo_dummy1
EXPORTING
iv_type = gc_dummy
iv_value = 'IterationStart'
iv_rulename = iv_rulename. "#EC NOTEXT
CREATE OBJECT lo_dummy2
EXPORTING
iv_type = gc_dummy
iv_value = 'IterationEnd'
iv_rulename = iv_rulename. "#EC NOTEXT
io_before->edge( lo_dummy1 ).
lo_dummy2->edge( io_after ).
lo_dummy2->edge( lo_dummy1 ).
build( ii_rule = li_child
iv_rulename = iv_rulename
io_before = lo_dummy1
io_after = lo_dummy2 ).
ENDMETHOD.
METHOD build_nonterminal.
DATA: lv_rulename TYPE string,
lo_node TYPE REF TO zcl_aoc_parser_node.
lv_rulename = ii_rule->get_value( ).
CREATE OBJECT lo_node
EXPORTING
iv_type = gc_nonterminal
iv_value = lv_rulename
iv_rulename = iv_rulename.
io_before->edge( lo_node ).
lo_node->edge( io_after ).
ENDMETHOD.
METHOD build_option.
DATA: li_child TYPE REF TO if_ixml_node,
lo_dummy TYPE REF TO zcl_aoc_parser_node.
CREATE OBJECT lo_dummy
EXPORTING
iv_type = gc_dummy
iv_value = 'Option'
iv_rulename = iv_rulename. "#EC NOTEXT
li_child = ii_rule->get_first_child( ).
io_before->edge( lo_dummy ).
build( ii_rule = li_child
iv_rulename = iv_rulename
io_before = lo_dummy
io_after = io_after ).
* easy way should be the last option/edge
lo_dummy->edge( io_after ).
ENDMETHOD.
METHOD build_optionlist.
DATA: li_children TYPE REF TO if_ixml_node_list,
li_append TYPE REF TO if_ixml_node_list,
li_child TYPE REF TO if_ixml_node,
lv_last TYPE abap_bool,
lo_before TYPE REF TO zcl_aoc_parser_node,
lo_after TYPE REF TO zcl_aoc_parser_node,
lo_seq_before TYPE REF TO zcl_aoc_parser_node,
lo_seq_after TYPE REF TO zcl_aoc_parser_node,
lt_opt TYPE TABLE OF REF TO if_ixml_node_list,
li_opt LIKE LINE OF lt_opt.
li_children = ii_rule->get_children( ).
DO li_children->get_length( ) TIMES.
li_child = li_children->get_item( sy-index - 1 ).
li_append = li_child->get_children( ). " get rid of <Opt> tag
APPEND li_append TO lt_opt.
ENDDO.
lo_before = io_before.
LOOP AT lt_opt INTO li_opt.
IF sy-tabix = lines( lt_opt ).
lo_after = io_after.
ELSE.
CREATE OBJECT lo_after
EXPORTING
iv_type = gc_dummy
iv_value = 'Optionlist'
iv_rulename = iv_rulename. "#EC NOTEXT
ENDIF.
lo_before->edge( lo_after ).
lv_last = abap_false.
lo_seq_before = lo_before.
DO li_opt->get_length( ) TIMES.
IF li_opt->get_length( ) = sy-index.
lv_last = abap_true.
ENDIF.
CREATE OBJECT lo_seq_after
EXPORTING
iv_type = gc_dummy
iv_value = 'Optionlist Seq'
iv_rulename = iv_rulename. "#EC NOTEXT
li_child = li_opt->get_item( sy-index - 1 ).
build( ii_rule = li_child
iv_rulename = iv_rulename
io_before = lo_seq_before
io_after = lo_seq_after ).
IF lv_last = abap_true.
lo_seq_after->edge( lo_after ).
ELSE.
lo_seq_before = lo_seq_after.
ENDIF.
ENDDO.
lo_before = lo_after.
ENDLOOP.
ENDMETHOD.
METHOD build_permutation.
TYPES: BEGIN OF ty_pair,
before TYPE REF TO zcl_aoc_parser_node,
after TYPE REF TO zcl_aoc_parser_node,
END OF ty_pair.
DATA: li_append TYPE REF TO if_ixml_node_list,
li_child TYPE REF TO if_ixml_node,
lv_index TYPE i,
lo_before TYPE REF TO zcl_aoc_parser_node,
lv_name TYPE string,
lo_after TYPE REF TO zcl_aoc_parser_node,
lo_seq_before TYPE REF TO zcl_aoc_parser_node,
lo_seq_after TYPE REF TO zcl_aoc_parser_node,
lt_pair TYPE TABLE OF ty_pair,
lt_per TYPE TABLE OF REF TO if_ixml_node_list,
li_children LIKE LINE OF lt_per.
FIELD-SYMBOLS: <ls_pair> LIKE LINE OF lt_pair,
<ls_to> LIKE LINE OF lt_pair.
* good enough, but allows statements like ASCENDING ASCENDING
li_children = ii_rule->get_children( ).
DO li_children->get_length( ) TIMES.
li_child = li_children->get_item( sy-index - 1 ).
li_append = li_child->get_children( ). " get rid of <Per> tag
APPEND li_append TO lt_per.
ENDDO.
LOOP AT lt_per INTO li_children.
CREATE OBJECT lo_before
EXPORTING
iv_type = gc_dummy
iv_value = 'PerBefore'
iv_rulename = iv_rulename.
io_before->edge( lo_before ).
CREATE OBJECT lo_after
EXPORTING
iv_type = gc_dummy
iv_value = 'PerAfter'
iv_rulename = iv_rulename.
lo_after->edge( io_after ).
APPEND INITIAL LINE TO lt_pair ASSIGNING <ls_pair>.
<ls_pair>-before = lo_before.
<ls_pair>-after = lo_after.
DO li_children->get_length( ) TIMES.
lv_index = sy-index.
li_child = li_children->get_item( sy-index - 1 ).
* permutations are always treated as optional, so make sure its not possible
* to cycle in the graph without meeting terminals
IF li_children->get_length( ) = 1.
lv_name = li_child->get_name( ).
IF lv_name = 'Option'.
li_child = li_child->get_first_child( ).
ENDIF.
ENDIF.
* handle un<Sequence>d permutations
IF lv_index = 1.
lo_seq_before = lo_before.
ELSE.
lo_seq_before = lo_seq_after.
ENDIF.
CREATE OBJECT lo_seq_after
EXPORTING
iv_type = gc_dummy
iv_value = 'PerSeq'
iv_rulename = iv_rulename.
build( ii_rule = li_child
iv_rulename = iv_rulename
io_before = lo_seq_before
io_after = lo_seq_after ).
IF lv_index = li_children->get_length( ).
lo_seq_after->edge( lo_after ).
ENDIF.
ENDDO.
ENDLOOP.
LOOP AT lt_pair ASSIGNING <ls_pair>.
LOOP AT lt_pair ASSIGNING <ls_to> WHERE before <> <ls_pair>-before.
<ls_pair>-after->edge( <ls_to>-before ).
ENDLOOP.
ENDLOOP.
* easy way as last option
io_before->edge( io_after ).
ENDMETHOD.
METHOD build_role.
DATA: lo_node TYPE REF TO zcl_aoc_parser_node,
lv_value TYPE string.
lv_value = ii_rule->get_value( ).
CREATE OBJECT lo_node
EXPORTING
iv_type = gc_role
iv_value = lv_value
iv_rulename = iv_rulename.
io_before->edge( lo_node ).
lo_node->edge( io_after ).
ENDMETHOD.
METHOD build_sequence.
DATA: lo_before TYPE REF TO zcl_aoc_parser_node,
lo_after TYPE REF TO zcl_aoc_parser_node,
li_children TYPE REF TO if_ixml_node_list,
li_child TYPE REF TO if_ixml_node.
li_children = ii_rule->get_children( ).
CREATE OBJECT lo_before
EXPORTING
iv_type = gc_dummy
iv_value = 'Sequence'
iv_rulename = iv_rulename. "#EC NOTEXT
io_before->edge( lo_before ).
DO li_children->get_length( ) TIMES.
IF sy-index = li_children->get_length( ).
lo_after = io_after.
ELSE.
CREATE OBJECT lo_after
EXPORTING
iv_type = gc_dummy
iv_value = 'Sequence'
iv_rulename = iv_rulename. "#EC NOTEXT
ENDIF.
li_child = li_children->get_item( sy-index - 1 ).
build( ii_rule = li_child
iv_rulename = iv_rulename
io_before = lo_before
io_after = lo_after ).
lo_before = lo_after.
ENDDO.
ENDMETHOD.
METHOD build_terminal.
DATA: lo_node TYPE REF TO zcl_aoc_parser_node,
lv_value TYPE string.
lv_value = ii_rule->get_value( ).
CREATE OBJECT lo_node
EXPORTING
iv_type = gc_terminal
iv_value = lv_value
iv_rulename = iv_rulename.
io_before->edge( lo_node ).
lo_node->edge( io_after ).
ENDMETHOD.
METHOD download.
DATA: lv_desktop TYPE string,
lv_filename TYPE string,
lt_data TYPE TABLE OF string.
cl_gui_frontend_services=>get_desktop_directory(
CHANGING
desktop_directory = lv_desktop
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4 ).
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
cl_gui_cfw=>flush( ).
APPEND iv_data TO lt_data.
lv_filename = lv_desktop && '\graphviz\' && iv_filename. "#EC NOTEXT
cl_gui_frontend_services=>gui_download(
EXPORTING
filename = lv_filename
CHANGING
data_tab = lt_data
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
not_supported_by_gui = 22
error_no_gui = 23
OTHERS = 24 ).
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDMETHOD.
METHOD graph_build.
DATA: li_rule TYPE REF TO if_ixml_node.
li_rule = xml_get( iv_rulename ).
CREATE OBJECT eo_start
EXPORTING
iv_type = gc_start
iv_value = iv_rulename
iv_rulename = iv_rulename.
CREATE OBJECT eo_end
EXPORTING
iv_type = gc_end
iv_value = iv_rulename
iv_rulename = iv_rulename.
build( ii_rule = li_rule
iv_rulename = iv_rulename
io_before = eo_start
io_after = eo_end ).
IF gv_debug = abap_true.
graph_download(
iv_rulename = iv_rulename
io_start = eo_start ).
ENDIF.
ENDMETHOD.
METHOD graph_download.
DATA: lv_text TYPE string.
lv_text = graph_to_text( io_start ).
download( iv_filename = iv_rulename && '.txt'
iv_data = lv_text ) ##NO_TEXT.
ENDMETHOD.
METHOD graph_to_text.
* see http://www.graphviz.org/
DATA: lt_nodes TYPE TABLE OF REF TO zcl_aoc_parser_node,
lv_label TYPE string,
lo_node LIKE LINE OF lt_nodes,
lv_node TYPE string,
lo_edge LIKE LINE OF lo_node->mt_edges,
lv_edge TYPE string,
lv_value TYPE string.
DEFINE _out.
rv_text = rv_text && &1 && cl_abap_char_utilities=>cr_lf.
END-OF-DEFINITION.
APPEND io_node TO lt_nodes.
_out 'digraph {'. "#EC NOTEXT
LOOP AT lt_nodes INTO lo_node.
lv_value = lo_node->mv_value.
* escape some characters
REPLACE ALL OCCURRENCES OF '>' IN lv_value WITH '\>'.
REPLACE ALL OCCURRENCES OF '<' IN lv_value WITH '\<'.
lv_label = 'Type\n' && lo_node->mv_type && '|' &&
'Key\n' && lo_node->mv_key && '|' &&
'Value\n' && lv_value. "#EC NOTEXT
lv_node = 'node' && lo_node->mv_key &&
' [label = "' && lv_label &&
'" shape = "record"];'. "#EC NOTEXT
_out lv_node.
LOOP AT lo_node->mt_edges INTO lo_edge.
lv_edge = 'node' && lo_node->mv_key &&
' -> node' && lo_edge->mv_key && ';'. "#EC NOTEXT
_out lv_edge.
READ TABLE lt_nodes FROM lo_edge TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
APPEND lo_edge TO lt_nodes.
ENDIF.
ENDLOOP.
ENDLOOP.
_out '}'.
ENDMETHOD.
METHOD parents.
DATA: lv_index TYPE i.
FIELD-SYMBOLS: <ls_token> LIKE LINE OF ct_tokens,
<ls_child> LIKE LINE OF ct_tokens.
LOOP AT ct_tokens ASSIGNING <ls_token>.
<ls_token>-id = sy-tabix.
ENDLOOP.
DO lines( ct_tokens ) TIMES.
lv_index = sy-index.
READ TABLE ct_tokens INDEX lv_index ASSIGNING <ls_child>.
ASSERT sy-subrc = 0.
IF <ls_child>-rulename = gv_end_rule.
CONTINUE. " current loop.
ENDIF.
LOOP AT ct_tokens ASSIGNING <ls_token>
TO lv_index - 1
WHERE type = c_type-nonterminal
AND statement = <ls_child>-statement
AND value = <ls_child>-rulename.
<ls_child>-parent = <ls_token>-id.
ENDLOOP.
ASSERT sy-subrc = 0.
ENDDO.
ENDMETHOD.
METHOD parse.
DATA: lo_start TYPE REF TO zcl_aoc_parser_node,
lt_rt TYPE ty_tokens_tt,
lv_statement TYPE i,
lt_res_tok LIKE rs_result-tokens,
lv_index TYPE i.
FIELD-SYMBOLS: <ls_statement> LIKE LINE OF it_statements,
<ls_token> LIKE LINE OF it_tokens,
<ls_res_tok> LIKE LINE OF lt_res_tok.
READ TABLE it_statements WITH KEY terminator = space TRANSPORTING NO FIELDS.
IF sy-subrc = 0 AND gv_end_rule = 'START'.
rs_result-match = abap_false.
RETURN.
ENDIF.
LOOP AT it_statements ASSIGNING <ls_statement>.
lv_statement = sy-tabix.
CLEAR gt_tokens.
LOOP AT it_tokens ASSIGNING <ls_token> FROM <ls_statement>-from TO <ls_statement>-to.
APPEND <ls_token>-str TO gt_tokens.
ENDLOOP.
IF gv_end_rule = 'START'.
APPEND '.' TO gt_tokens.
ENDIF.
graph_build( EXPORTING iv_rulename = gv_end_rule
IMPORTING eo_start = lo_start ).
rs_result = walk( io_node = lo_start
iv_index = 1 ).
IF rs_result-match = abap_false.
RETURN.
ENDIF.
* reverse token order
lt_res_tok = rs_result-tokens.
lv_index = lines( lt_res_tok ).
DO lines( lt_res_tok ) TIMES.
READ TABLE lt_res_tok INDEX lv_index ASSIGNING <ls_res_tok>.
ASSERT sy-subrc = 0.
<ls_res_tok>-statement = lv_statement.
APPEND <ls_res_tok> TO lt_rt.
lv_index = lv_index - 1.
ENDDO.
ENDLOOP.
parents( CHANGING ct_tokens = lt_rt ).
IF sy-subrc = 0.
rs_result-match = abap_true.
ELSE.
rs_result-match = abap_false.
ENDIF.
rs_result-tokens = lt_rt.
ENDMETHOD.
METHOD run.
* abapOpenChecks
* https://github.com/larshp/abapOpenChecks
* MIT License
DATA: lt_tokens TYPE stokesx_tab,
lt_statements TYPE sstmnt_tab.
SCAN ABAP-SOURCE it_code
TOKENS INTO lt_tokens
STATEMENTS INTO lt_statements
WITH ANALYSIS.
IF sy-subrc <> 0.
rs_result-match = abap_false.
RETURN.
ENDIF.
gv_debug = iv_debug.
gv_end_rule = iv_rule.
gv_allow_obsolete = iv_allow_obsolete.
rs_result = parse( it_tokens = lt_tokens
it_statements = lt_statements ).
ENDMETHOD.
METHOD walk.
CASE io_node->mv_type.
WHEN gc_dummy OR gc_start.
rs_result = walk_node( io_node = io_node
iv_index = iv_index ).
WHEN gc_end.
rs_result = walk_end( io_node = io_node
iv_index = iv_index ).
WHEN gc_role.
rs_result = walk_role( io_node = io_node
iv_index = iv_index ).
WHEN gc_terminal.
rs_result = walk_terminal( io_node = io_node
iv_index = iv_index ).
WHEN gc_nonterminal.
rs_result = walk_nonterminal( io_node = io_node
iv_index = iv_index ).
ENDCASE.
ENDMETHOD.
METHOD walk_end.
IF iv_index = lines( gt_tokens ) + 1
AND io_node->mv_value = gv_end_rule.
rs_result-match = abap_true.
RETURN.
ENDIF.
rs_result = walk_node( io_node = io_node
iv_index = iv_index ).
ENDMETHOD.
METHOD walk_node.
DATA: lo_node LIKE LINE OF io_node->mt_edges.
LOOP AT io_node->mt_edges INTO lo_node.
rs_result = walk( io_node = lo_node
iv_index = iv_index ).
IF rs_result-match = abap_true.
RETURN.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD walk_nonterminal.
DATA: lv_rulename TYPE string,
lo_start TYPE REF TO zcl_aoc_parser_node,
lo_end TYPE REF TO zcl_aoc_parser_node,
lo_node LIKE LINE OF io_node->mt_edges.
FIELD-SYMBOLS: <ls_token> LIKE LINE OF rs_result-tokens.
lv_rulename = io_node->mv_value.
IF lv_rulename = 'MACRO'.
* macro call makes everything valid ABAP code
rs_result-match = abap_false.
RETURN.
ENDIF.
graph_build(
EXPORTING
iv_rulename = lv_rulename
IMPORTING
eo_start = lo_start
eo_end = lo_end ).
ASSERT lo_start IS BOUND.
ASSERT lo_end IS BOUND.
* add edges from io_node to end of nonterminal graph
LOOP AT io_node->mt_edges INTO lo_node.
lo_end->edge( lo_node ).
ENDLOOP.
rs_result = walk_node( io_node = lo_start
iv_index = iv_index ).
IF rs_result-match = abap_true.
APPEND INITIAL LINE TO rs_result-tokens ASSIGNING <ls_token>.
<ls_token>-type = c_type-nonterminal.
<ls_token>-value = io_node->mv_value.
<ls_token>-rulename = io_node->mv_rulename.
ENDIF.
ENDMETHOD.
METHOD walk_role.
DATA: lv_token LIKE LINE OF gt_tokens.
FIELD-SYMBOLS: <ls_token> LIKE LINE OF rs_result-tokens.
READ TABLE gt_tokens INDEX iv_index INTO lv_token.
IF sy-subrc <> 0.
rs_result-match = abap_false.
RETURN.
ENDIF.
CASE io_node->mv_value.
WHEN 'FieldId' OR 'FieldIdW'.
FIND REGEX '^[a-zA-Z0-9_\-=<>~+]+["\[\]"]*["("0-9")"]*$' IN lv_token. "#EC NOTEXT
IF sy-subrc <> 0.
FIND REGEX '^''.*''["("0-9")"]*$' IN lv_token.
ENDIF.
WHEN 'FieldDefId'.
FIND REGEX '^[a-zA-Z0-9_\-]+["("0-9")"]*$' IN lv_token. "#EC NOTEXT
WHEN 'TypeId'
OR 'ScreenId'
OR 'ItabFieldId'.
FIND REGEX '^[a-zA-Z0-9_\-=>~]+$' IN lv_token. "#EC NOTEXT
WHEN 'FieldListId'
OR 'LdbNodeId'
OR 'MacroId'
OR 'MethodDefId'
OR 'FormParamId'
OR 'FormId'
OR 'FormDefId'
OR 'ClasstypeDefId'
OR 'SwitchId'
OR 'BlockDefId'
OR 'ClassexcTypeId'
OR 'FieldGroupId'
OR 'ProgramId'
OR 'ProgramDefId'
OR 'MacroDefId'
OR 'ClassrefFieldId'
OR 'ClassexcrefFieldId'.
FIND REGEX '^[a-zA-Z0-9_]+$' IN lv_token. "#EC NOTEXT
WHEN 'FieldCompId'.
FIND REGEX '^\(?[a-zA-Z0-9_]+\)?$' IN lv_token. "#EC NOTEXT
WHEN 'FunctionId'.
FIND REGEX '^''.*''$' IN lv_token.
WHEN 'MethodId('.
FIND REGEX '^[a-zA-Z0-9_\=\-<>~]+\($' IN lv_token. "#EC NOTEXT
WHEN 'MethodId'.
FIND REGEX '^[a-zA-Z0-9_\=\-<>~]+\(?$' IN lv_token. "#EC NOTEXT
WHEN 'LocationId'.
FIND REGEX '^/?[0-9]*["("0-9")"]*$' IN lv_token.
WHEN 'SelOptId'.
rs_result-match = abap_false.
RETURN.
WHEN 'FieldSymbolDefId'.
FIND REGEX '^<[a-zA-Z0-9_\-]+>$' IN lv_token. "#EC NOTEXT
WHEN 'ComponentId'.
FIND REGEX '^[a-zA-Z0-9_\*]+$' IN lv_token. "#EC NOTEXT
WHEN 'MessageNumber'.
FIND REGEX '^.[0-9][0-9][0-9](\(.+\))?$' IN lv_token.
ENDCASE.
IF sy-subrc = 0.
rs_result = walk_node( io_node = io_node
iv_index = iv_index + 1 ).
IF rs_result-match = abap_true.
APPEND INITIAL LINE TO rs_result-tokens ASSIGNING <ls_token>.
<ls_token>-type = c_type-role.
<ls_token>-value = io_node->mv_value.
<ls_token>-code = lv_token.
<ls_token>-rulename = io_node->mv_rulename.
ENDIF.
ELSE.
rs_result-match = abap_false.
ENDIF.
ENDMETHOD.
METHOD walk_terminal.
DATA: lv_nws TYPE abap_bool,
lv_len TYPE i,
lv_token LIKE LINE OF gt_tokens.
* too many variables with similar names
FIELD-SYMBOLS: <lv_token> LIKE LINE OF gt_tokens,
<ls_token> LIKE LINE OF rs_result-tokens.
rs_result-match = abap_true.
READ TABLE gt_tokens INDEX iv_index INTO lv_token.
IF sy-subrc <> 0.
rs_result-match = abap_false.
ENDIF.
CASE io_node->mv_value.
WHEN '#ILITERAL#'.
FIND REGEX '^[0-9]+$' IN lv_token.
IF sy-subrc <> 0.
rs_result-match = abap_false.
ENDIF.
WHEN '#ASTERISK_NWS#'.
IF lv_token CP '#*+*'.
lv_token = '*'.
lv_nws = abap_true.
ELSE.
rs_result-match = abap_false.
ENDIF.
WHEN '#RPAREN_NWS#'.
IF lv_token CP ')+*'.
lv_token = ')'.
lv_nws = abap_true.
ELSE.
rs_result-match = abap_false.
ENDIF.
WHEN '#PLUS_NWS#'.
IF lv_token CP '#++*'.
lv_token = '+'.
lv_nws = abap_true.
ELSE.
rs_result-match = abap_false.
ENDIF.
WHEN '#NWS_ARROW_NWS#'.
IF lv_token CP '->+*' OR lv_token CP '=>+*'.
lv_token = lv_token(2).
lv_nws = abap_true.
ELSE.
rs_result-match = abap_false.
ENDIF.
WHEN '#NWS_MINUS_NWS#'.
IF lv_token CP '-+*'.
lv_token = '-'.
lv_nws = abap_true.
ELSE.
rs_result-match = abap_false.
ENDIF.
WHEN OTHERS.
IF lv_token <> io_node->mv_value.
rs_result-match = abap_false.
ENDIF.
ENDCASE.
IF rs_result-match = abap_false.
RETURN.
ENDIF.
IF lv_nws = abap_true.
READ TABLE gt_tokens INDEX iv_index ASSIGNING <lv_token>.
ASSERT sy-subrc = 0.
lv_len = strlen( lv_token ).
<lv_token> = <lv_token>+lv_len.
rs_result = walk_node( io_node = io_node
iv_index = iv_index ).
IF rs_result-match = abap_false.
CONCATENATE lv_token <lv_token> INTO <lv_token>.
ENDIF.
ELSE.
rs_result = walk_node( io_node = io_node
iv_index = iv_index + 1 ).
ENDIF.
IF rs_result-match = abap_true.
APPEND INITIAL LINE TO rs_result-tokens ASSIGNING <ls_token>.
<ls_token>-type = c_type-terminal.
<ls_token>-value = io_node->mv_value.
<ls_token>-code = lv_token.
<ls_token>-rulename = io_node->mv_rulename.
ENDIF.
ENDMETHOD.
METHOD xml_download.
DATA: lv_xml TYPE string,
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 = ii_xml->create_stream_factory( ).
li_ostream = li_streamfactory->create_ostream_cstring( lv_xml ).
li_renderer = ii_xml->create_renderer( ostream = li_ostream
document = ii_xml_doc ).
li_renderer->set_normalizing( ).
li_renderer->render( ).
* make sure newlines work in notepad
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>newline
IN lv_xml WITH cl_abap_char_utilities=>cr_lf.
download( iv_filename = iv_rulename && '.xml'
iv_data = lv_xml ) ##NO_TEXT.
ENDMETHOD.
METHOD xml_fix.
WHILE sy-subrc = 0.
REPLACE ALL OCCURRENCES OF REGEX
'<Terminal>([A-Z-]*)</Terminal>' &&
'<Terminal>#NWS_MINUS_NWS#</Terminal>' &&
'<Terminal>([A-Z-]*)</Terminal>'
IN cv_xml
WITH '<Terminal>$1-$2</Terminal>' IGNORING CASE.
ENDWHILE.
REPLACE ALL OCCURRENCES OF REGEX
'<Role>MethodId</Role><Terminal>#NWS_LPAREN#</Terminal>'
IN cv_xml
WITH '<Role>MethodId(</Role>' IGNORING CASE.
* todo #RPAREN_NWS# ?
REPLACE ALL OCCURRENCES OF REGEX '<Terminal>#LPAREN#</Terminal>'
IN cv_xml
WITH '<Terminal>(</Terminal>' IGNORING CASE.
REPLACE ALL OCCURRENCES OF REGEX '<Terminal>#RPAREN#</Terminal>'
IN cv_xml
WITH '<Terminal>)</Terminal>' IGNORING CASE.
REPLACE ALL OCCURRENCES OF REGEX '<Terminal>#PLUS#</Terminal>'
IN cv_xml
WITH '<Terminal>+</Terminal>' IGNORING CASE.
REPLACE ALL OCCURRENCES OF REGEX '<Terminal>#MINUS#</Terminal>'
IN cv_xml
WITH '<Terminal>-</Terminal>' IGNORING CASE.
REPLACE ALL OCCURRENCES OF REGEX '<Terminal>#ASTERISK#</Terminal>'
IN cv_xml
WITH '<Terminal>*</Terminal>' IGNORING CASE.
REPLACE ALL OCCURRENCES OF REGEX '<Terminal>#SLASH#</Terminal>'
IN cv_xml
WITH '<Terminal>/</Terminal>' IGNORING CASE.
* #ASTERISK_NWS# ?
REPLACE ALL OCCURRENCES OF REGEX '<Terminal>%_SORTMODE</Terminal>'
IN cv_xml
WITH '' IGNORING CASE.
* comparison operators
REPLACE ALL OCCURRENCES OF REGEX
'<Terminal>#LT_NWS#</Terminal><Terminal>#NWS_GT#</Terminal>'
IN cv_xml
WITH '<Terminal><></Terminal>' IGNORING CASE.
REPLACE ALL OCCURRENCES OF REGEX
'<Terminal>#GT_NWS#</Terminal><Terminal>#NWS_LT#</Terminal>'
IN cv_xml
WITH '<Terminal>><</Terminal>' IGNORING CASE.
REPLACE ALL OCCURRENCES OF REGEX '<Terminal>#LT#</Terminal>'
IN cv_xml
WITH '<Terminal><</Terminal>' IGNORING CASE.
REPLACE ALL OCCURRENCES OF REGEX '<Terminal>#LT_NWS#</Terminal><Terminal>=</Terminal>'
IN cv_xml
WITH '<Terminal><=</Terminal>' IGNORING CASE.
REPLACE ALL OCCURRENCES OF REGEX '<Terminal>=</Terminal><Terminal>#NWS_LT#</Terminal>'
IN cv_xml
WITH '<Terminal>=<</Terminal>' IGNORING CASE.
REPLACE ALL OCCURRENCES OF REGEX '<Terminal>#GT#</Terminal>'
IN cv_xml
WITH '<Terminal>></Terminal>' IGNORING CASE.
REPLACE ALL OCCURRENCES OF REGEX '<Terminal>#GT_NWS#</Terminal><Terminal>=</Terminal>'
IN cv_xml
WITH '<Terminal>>=</Terminal>' IGNORING CASE.
ENDMETHOD.
METHOD xml_get.
DATA: lv_rulename TYPE ssyntaxstructure-rulename,
ls_cache LIKE LINE OF gt_cache,
lo_syntax_table_descr TYPE REF TO cl_abap_structdescr,
lt_syntax_table_components TYPE abap_component_tab,
lv_lines TYPE i.
FIELD-SYMBOLS: <ls_syntax> LIKE LINE OF gt_syntax.
READ TABLE gt_cache INTO ls_cache WITH KEY rulename = iv_rulename.
IF sy-subrc = 0.
ri_rule = ls_cache-node.
RETURN.
ENDIF.
IF lines( gt_syntax ) = 0.
lo_syntax_table_descr ?= cl_abap_typedescr=>describe_by_name( 'SSYNTAXSTRUCTURE' ).
lt_syntax_table_components = lo_syntax_table_descr->get_components( ).
READ TABLE lt_syntax_table_components WITH KEY name = 'PROGLANG' TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
SELECT * FROM ssyntaxstructure "#EC CI_SUBRC
INTO TABLE gt_syntax WHERE (`proglang = 'A'`)
OR (`proglang = ''`)
OR (`proglang IS NULL`). "proglang = 'B' is BDL, not ABAP
ELSE.
SELECT * FROM ssyntaxstructure "#EC CI_SUBRC
INTO TABLE gt_syntax.
ENDIF.
SORT gt_syntax BY rulename ASCENDING.
ENDIF.
lv_rulename = iv_rulename. " type conversion
READ TABLE gt_syntax ASSIGNING <ls_syntax>
WITH KEY rulename = lv_rulename BINARY SEARCH.
IF sy-subrc <> 0.
REPLACE ALL OCCURRENCES OF '-' IN lv_rulename WITH '__'.
READ TABLE gt_syntax ASSIGNING <ls_syntax>
WITH KEY rulename = lv_rulename BINARY SEARCH.
ENDIF.
ASSERT sy-subrc = 0.
xml_fix( CHANGING cv_xml = <ls_syntax>-description ).
ri_rule = xml_parse( iv_rulename = iv_rulename
iv_xml = <ls_syntax>-description ).
CLEAR ls_cache.
ls_cache-rulename = iv_rulename.
ls_cache-node = ri_rule.
INSERT ls_cache INTO TABLE gt_cache.
ENDMETHOD.
METHOD xml_parse.
DATA: li_ixml TYPE REF TO if_ixml,
li_xml_doc TYPE REF TO if_ixml_document,
li_type TYPE REF TO if_ixml_node,
li_attr TYPE REF TO if_ixml_named_node_map,
lv_type TYPE string,
li_collection TYPE REF TO if_ixml_node_collection,
li_iterator TYPE REF TO if_ixml_node_iterator,
li_node TYPE REF TO if_ixml_node,
li_normal TYPE REF TO if_ixml_node,
li_obsolete TYPE REF TO if_ixml_node,
li_private TYPE REF TO if_ixml_node,
li_stream_factory TYPE REF TO if_ixml_stream_factory,
li_istream TYPE REF TO if_ixml_istream,
li_parser TYPE REF TO if_ixml_parser.
li_ixml = cl_ixml=>create( ).
li_xml_doc = li_ixml->create_document( ).
li_stream_factory = li_ixml->create_stream_factory( ).
li_istream = li_stream_factory->create_istream_string( iv_xml ).
li_parser = li_ixml->create_parser( stream_factory = li_stream_factory
istream = li_istream
document = li_xml_doc ).
ASSERT li_parser->parse( ) = 0.
li_istream->close( ).
IF gv_debug = abap_true.
xml_download(
iv_rulename = iv_rulename
ii_xml = li_ixml
ii_xml_doc = li_xml_doc ).
ENDIF.
li_collection =
li_xml_doc->get_elements_by_tag_name( depth = 0 name = 'View' ). "#EC NOTEXT
li_iterator = li_collection->create_iterator( ).
li_node = li_iterator->get_next( ).
WHILE li_node IS BOUND.
li_attr = li_node->get_attributes( ).
li_type = li_attr->get_named_item( 'type' ). "#EC NOTEXT
lv_type = li_type->get_value( ).
CASE lv_type.
WHEN 'Normal'. "#EC NOTEXT
li_normal = li_node.
WHEN 'Obsolete'. "#EC NOTEXT
li_obsolete = li_node.
WHEN 'Private'. "#EC NOTEXT
li_private = li_node.
ENDCASE.
li_node = li_iterator->get_next( ).
ENDWHILE.
IF li_obsolete IS BOUND AND gv_allow_obsolete = abap_true.
ri_rule = li_obsolete->get_first_child( ).
ELSEIF li_normal IS BOUND.
ri_rule = li_normal->get_first_child( ).
ELSEIF li_private IS BOUND.
ri_rule = li_private->get_first_child( ).
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
64,
420,
62,
48610,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
41876,
12,
16402,
3535,
50,
450,
499,
764,
198,
220,
220,
220,
42715,
1976,
565,
62,
64,
420,
62,
48610,
5550,
20032,
17941,
17579,
2885,
764,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
30001,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2643,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4686,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2560,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
41876,
269,
406,
49494,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2438,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2155,
12453,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
30001,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
83,
482,
641,
62,
926,
41876,
49053,
9795,
43679,
3963,
1259,
62,
30001,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
20274,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2872,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
16326,
41876,
1259,
62,
83,
482,
641,
62,
926,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
20274,
764,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2597,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
26173,
8924,
705,
49,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
12094,
220,
220,
220,
41876,
269,
26173,
8924,
705,
51,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1729,
23705,
282,
41876,
269,
26173,
8924,
705,
45,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
4906,
764,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
18090,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2214,
4299,
312,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
15878,
7469,
7390,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2214,
312,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
15878,
7390,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1296,
312,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
8479,
7390,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1296,
4299,
312,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
8479,
7469,
7390,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
537,
292,
8044,
310,
2981,
312,
41876,
4731,
26173,
8924,
705,
2601,
292,
8044,
66,
6030,
7390,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
312,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
6030,
7390,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
18090,
764,
628,
220,
220,
220,
42715,
12,
49273,
50,
1057,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
8189,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
62,
11487,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
24442,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
25135,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
5550,
38865,
705,
2257,
7227,
6,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
12154,
62,
672,
23869,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
20274,
8,
220,
220,
41876,
1259,
62,
20274,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
1259,
62,
1837,
41641,
62,
926,
41876,
49053,
9795,
43679,
3963,
264,
1837,
41641,
301,
5620,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
308,
66,
62,
67,
13513,
220,
220,
220,
220,
220,
220,
41876,
1976,
565,
62,
64,
420,
62,
48610,
62,
17440,
14804,
774,
62,
17440,
62,
4906,
26173,
8924,
705,
35,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
308,
66,
62,
9688,
220,
220,
220,
220,
220,
220,
41876,
1976,
565,
62,
64,
420,
62,
48610,
62,
17440,
14804,
774,
62,
17440,
62,
4906,
26173,
8924,
705,
50,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
308,
66,
62,
437,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
565,
62,
64,
420,
62,
48610,
62,
17440,
14804,
774,
62,
17440,
62,
4906,
26173,
8924,
705,
36,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
308,
66,
62,
18090,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
565,
62,
64,
420,
62,
48610,
62,
17440,
14804,
774,
62,
17440,
62,
4906,
26173,
8924,
705,
49,
3256,
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,
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ION.
INTERFACES: zif_abapgit_popups.
ALIASES:
popup_package_export FOR zif_abapgit_popups~popup_package_export,
popup_folder_logic FOR zif_abapgit_popups~popup_folder_logic,
popup_object FOR zif_abapgit_popups~popup_object,
create_branch_popup FOR zif_abapgit_popups~create_branch_popup,
run_page_class_popup FOR zif_abapgit_popups~run_page_class_popup,
repo_new_offline FOR zif_abapgit_popups~repo_new_offline,
branch_list_popup FOR zif_abapgit_popups~branch_list_popup,
repo_popup FOR zif_abapgit_popups~repo_popup,
popup_to_confirm FOR zif_abapgit_popups~popup_to_confirm,
popup_to_inform FOR zif_abapgit_popups~popup_to_inform,
popup_to_create_package FOR zif_abapgit_popups~popup_to_create_package,
popup_to_create_transp_branch FOR zif_abapgit_popups~popup_to_create_transp_branch,
popup_to_select_transports FOR zif_abapgit_popups~popup_to_select_transports,
popup_to_select_from_list FOR zif_abapgit_popups~popup_to_select_from_list,
branch_popup_callback FOR zif_abapgit_popups~branch_popup_callback,
package_popup_callback FOR zif_abapgit_popups~package_popup_callback,
popup_transport_request FOR zif_abapgit_popups~popup_transport_request.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
ty_sval_tt TYPE STANDARD TABLE OF sval WITH DEFAULT KEY.
CONSTANTS c_fieldname_selected TYPE lvc_fname VALUE `SELECTED` ##NO_TEXT.
CONSTANTS c_answer_cancel TYPE char1 VALUE 'A' ##NO_TEXT.
DATA mo_select_list_popup TYPE REF TO cl_salv_table .
DATA mr_table TYPE REF TO data .
DATA mv_cancel TYPE abap_bool .
DATA mo_table_descr TYPE REF TO cl_abap_tabledescr .
METHODS add_field
IMPORTING
!iv_tabname TYPE sval-tabname
!iv_fieldname TYPE sval-fieldname
!iv_fieldtext TYPE sval-fieldtext
!iv_value TYPE clike DEFAULT ''
!iv_field_attr TYPE sval-field_attr DEFAULT ''
!iv_obligatory TYPE spo_obl OPTIONAL
CHANGING
!ct_fields TYPE ty_sval_tt .
METHODS create_new_table
IMPORTING
!it_list TYPE STANDARD TABLE .
METHODS get_selected_rows
EXPORTING
!et_list TYPE INDEX TABLE .
METHODS on_select_list_link_click
FOR EVENT link_click OF cl_salv_events_table
IMPORTING
!row
!column .
METHODS on_select_list_function_click
FOR EVENT added_function OF cl_salv_events_table
IMPORTING
!e_salv_function .
METHODS extract_field_values
IMPORTING
it_fields TYPE ty_sval_tt
EXPORTING
ev_url TYPE abaptxt255-line
ev_package TYPE tdevc-devclass
ev_branch TYPE textl-line
ev_display_name TYPE trm255-text.
TYPES:
ty_lt_fields TYPE STANDARD TABLE OF sval WITH DEFAULT KEY.
METHODS _popup_2_get_values
IMPORTING iv_popup_title TYPE string
iv_no_value_check TYPE abap_bool DEFAULT abap_false
EXPORTING ev_value_1 TYPE spo_value
ev_value_2 TYPE spo_value
CHANGING ct_fields TYPE ty_lt_fields
RAISING zcx_abapgit_exception
zcx_abapgit_cancel.
METHODS validate_folder_logic
IMPORTING
iv_folder_logic TYPE string
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_POPUPS IMPLEMENTATION.
METHOD add_field.
FIELD-SYMBOLS: <ls_field> LIKE LINE OF ct_fields.
APPEND INITIAL LINE TO ct_fields ASSIGNING <ls_field>.
<ls_field>-tabname = iv_tabname.
<ls_field>-fieldname = iv_fieldname.
<ls_field>-fieldtext = iv_fieldtext.
<ls_field>-value = iv_value.
<ls_field>-field_attr = iv_field_attr.
<ls_field>-field_obl = iv_obligatory.
ENDMETHOD.
METHOD create_new_table.
" create and populate a table on the fly derived from
" it_data with a select column
DATA: lr_struct TYPE REF TO data,
lt_components TYPE cl_abap_structdescr=>component_table,
lo_struct_descr TYPE REF TO cl_abap_structdescr,
lo_struct_descr2 TYPE REF TO cl_abap_structdescr.
FIELD-SYMBOLS: <lt_table> TYPE STANDARD TABLE,
<ls_component> TYPE abap_componentdescr,
<lg_line> TYPE data,
<lg_data> TYPE any.
mo_table_descr ?= cl_abap_tabledescr=>describe_by_data( it_list ).
lo_struct_descr ?= mo_table_descr->get_table_line_type( ).
lt_components = lo_struct_descr->get_components( ).
INSERT INITIAL LINE INTO lt_components ASSIGNING <ls_component> INDEX 1.
ASSERT sy-subrc = 0.
<ls_component>-name = c_fieldname_selected.
<ls_component>-type ?= cl_abap_datadescr=>describe_by_name( 'FLAG' ).
lo_struct_descr2 = cl_abap_structdescr=>create( lt_components ).
mo_table_descr = cl_abap_tabledescr=>create( lo_struct_descr2 ).
CREATE DATA mr_table TYPE HANDLE mo_table_descr.
ASSIGN mr_table->* TO <lt_table>.
ASSERT sy-subrc = 0.
CREATE DATA lr_struct TYPE HANDLE lo_struct_descr2.
ASSIGN lr_struct->* TO <lg_line>.
ASSERT sy-subrc = 0.
LOOP AT it_list ASSIGNING <lg_data>.
CLEAR <lg_line>.
MOVE-CORRESPONDING <lg_data> TO <lg_line>.
INSERT <lg_line> INTO TABLE <lt_table>.
ENDLOOP.
ENDMETHOD.
METHOD extract_field_values.
FIELD-SYMBOLS: <ls_field> LIKE LINE OF it_fields.
CLEAR: ev_url,
ev_package,
ev_branch,
ev_display_name.
READ TABLE it_fields INDEX 1 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_url = <ls_field>-value.
READ TABLE it_fields INDEX 2 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_package = <ls_field>-value.
TRANSLATE ev_package TO UPPER CASE.
READ TABLE it_fields INDEX 3 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_branch = <ls_field>-value.
READ TABLE it_fields INDEX 4 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_display_name = <ls_field>-value.
ENDMETHOD.
METHOD get_selected_rows.
DATA: lv_condition TYPE string,
lr_exporting TYPE REF TO data.
FIELD-SYMBOLS: <lg_exporting> TYPE any,
<lt_table> TYPE STANDARD TABLE,
<lg_line> TYPE any.
lv_condition = |{ c_fieldname_selected } = ABAP_TRUE|.
ASSIGN mr_table->* TO <lt_table>.
ASSERT sy-subrc = 0.
CREATE DATA lr_exporting LIKE LINE OF et_list.
ASSIGN lr_exporting->* TO <lg_exporting>.
LOOP AT <lt_table> ASSIGNING <lg_line> WHERE (lv_condition).
CLEAR <lg_exporting>.
MOVE-CORRESPONDING <lg_line> TO <lg_exporting>.
APPEND <lg_exporting> TO et_list.
ENDLOOP.
ENDMETHOD.
METHOD on_select_list_function_click.
FIELD-SYMBOLS: <lt_table> TYPE STANDARD TABLE,
<lg_line> TYPE any,
<lv_selected> TYPE abap_bool.
ASSIGN mr_table->* TO <lt_table>.
ASSERT sy-subrc = 0.
CASE e_salv_function.
WHEN 'O.K.'.
mv_cancel = abap_false.
mo_select_list_popup->close_screen( ).
WHEN 'ABR'.
"Canceled: clear list to overwrite nothing
CLEAR <lt_table>.
mv_cancel = abap_true.
mo_select_list_popup->close_screen( ).
WHEN 'SALL'.
LOOP AT <lt_table> ASSIGNING <lg_line>.
ASSIGN COMPONENT c_fieldname_selected
OF STRUCTURE <lg_line>
TO <lv_selected>.
ASSERT sy-subrc = 0.
<lv_selected> = abap_true.
ENDLOOP.
mo_select_list_popup->refresh( ).
WHEN 'DSEL'.
LOOP AT <lt_table> ASSIGNING <lg_line>.
ASSIGN COMPONENT c_fieldname_selected
OF STRUCTURE <lg_line>
TO <lv_selected>.
ASSERT sy-subrc = 0.
<lv_selected> = abap_false.
ENDLOOP.
mo_select_list_popup->refresh( ).
WHEN OTHERS.
CLEAR <lt_table>.
mo_select_list_popup->close_screen( ).
ENDCASE.
ENDMETHOD.
METHOD on_select_list_link_click.
DATA: lv_line TYPE sytabix.
FIELD-SYMBOLS: <lt_table> TYPE STANDARD TABLE,
<lg_line> TYPE any,
<lv_selected> TYPE abap_bool.
ASSIGN mr_table->* TO <lt_table>.
ASSERT sy-subrc = 0.
lv_line = row.
READ TABLE <lt_table> ASSIGNING <lg_line>
INDEX lv_line.
IF sy-subrc = 0.
ASSIGN COMPONENT c_fieldname_selected
OF STRUCTURE <lg_line>
TO <lv_selected>.
ASSERT sy-subrc = 0.
IF <lv_selected> = abap_true.
<lv_selected> = abap_false.
ELSE.
<lv_selected> = abap_true.
ENDIF.
ENDIF.
mo_select_list_popup->refresh( ).
ENDMETHOD.
METHOD validate_folder_logic.
IF iv_folder_logic <> zif_abapgit_dot_abapgit=>c_folder_logic-prefix
AND iv_folder_logic <> zif_abapgit_dot_abapgit=>c_folder_logic-full.
zcx_abapgit_exception=>raise( |Invalid folder logic { iv_folder_logic }. |
&& |Choose either { zif_abapgit_dot_abapgit=>c_folder_logic-prefix } |
&& |or { zif_abapgit_dot_abapgit=>c_folder_logic-full } | ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~branch_list_popup.
DATA: lo_branches TYPE REF TO zcl_abapgit_git_branch_list,
lt_branches TYPE zif_abapgit_definitions=>ty_git_branch_list_tt,
lv_answer TYPE c LENGTH 1,
lv_default TYPE i,
lv_head_suffix TYPE string,
lv_head_symref TYPE string,
lt_selection TYPE TABLE OF spopli.
FIELD-SYMBOLS: <ls_sel> LIKE LINE OF lt_selection,
<ls_branch> LIKE LINE OF lt_branches.
lo_branches = zcl_abapgit_git_transport=>branches( iv_url ).
lt_branches = lo_branches->get_branches_only( ).
lv_head_suffix = | ({ zif_abapgit_definitions=>c_head_name })|.
lv_head_symref = lo_branches->get_head_symref( ).
IF iv_hide_branch IS NOT INITIAL.
DELETE lt_branches WHERE name = iv_hide_branch.
ENDIF.
IF iv_hide_head IS NOT INITIAL.
DELETE lt_branches WHERE name = zif_abapgit_definitions=>c_head_name
OR is_head = abap_true.
ENDIF.
IF lt_branches IS INITIAL.
zcx_abapgit_exception=>raise( 'No branch to select' ).
ENDIF.
LOOP AT lt_branches ASSIGNING <ls_branch>.
CHECK <ls_branch>-name IS NOT INITIAL. " To ensure some below ifs
IF <ls_branch>-is_head = abap_true.
IF <ls_branch>-name = zif_abapgit_definitions=>c_head_name. " HEAD
IF <ls_branch>-name <> lv_head_symref AND lv_head_symref IS NOT INITIAL.
" HEAD but other HEAD symref exists - ignore
CONTINUE.
ELSE.
INSERT INITIAL LINE INTO lt_selection INDEX 1 ASSIGNING <ls_sel>.
<ls_sel>-varoption = <ls_branch>-name.
ENDIF.
ELSE.
INSERT INITIAL LINE INTO lt_selection INDEX 1 ASSIGNING <ls_sel>.
<ls_sel>-varoption = <ls_branch>-display_name && lv_head_suffix.
ENDIF.
IF lv_default > 0. " Shift down default if set
lv_default = lv_default + 1.
ENDIF.
ELSE.
APPEND INITIAL LINE TO lt_selection ASSIGNING <ls_sel>.
<ls_sel>-varoption = <ls_branch>-display_name.
ENDIF.
IF <ls_branch>-name = iv_default_branch.
IF <ls_branch>-is_head = abap_true.
lv_default = 1.
ELSE.
lv_default = sy-tabix.
ENDIF.
ENDIF.
ENDLOOP.
IF iv_show_new_option = abap_true.
APPEND INITIAL LINE TO lt_selection ASSIGNING <ls_sel>.
<ls_sel>-varoption = zif_abapgit_popups=>c_new_branch_label.
ENDIF.
CALL FUNCTION 'POPUP_TO_DECIDE_LIST'
EXPORTING
textline1 = 'Select branch'
titel = 'Select branch'
start_col = 30
start_row = 5
cursorline = lv_default
IMPORTING
answer = lv_answer
TABLES
t_spopli = lt_selection
EXCEPTIONS
OTHERS = 1. "#EC NOTEXT
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error from POPUP_TO_DECIDE_LIST' ).
ENDIF.
IF lv_answer = c_answer_cancel.
RETURN.
ENDIF.
READ TABLE lt_selection ASSIGNING <ls_sel> WITH KEY selflag = abap_true.
ASSERT sy-subrc = 0.
IF iv_show_new_option = abap_true AND <ls_sel>-varoption = zif_abapgit_popups=>c_new_branch_label.
rs_branch-name = zif_abapgit_popups=>c_new_branch_label.
ELSE.
REPLACE FIRST OCCURRENCE OF lv_head_suffix IN <ls_sel>-varoption WITH ''.
READ TABLE lt_branches WITH KEY display_name = <ls_sel>-varoption ASSIGNING <ls_branch>.
IF sy-subrc <> 0.
* branch name longer than 65 characters
LOOP AT lt_branches ASSIGNING <ls_branch> WHERE display_name CS <ls_sel>-varoption.
EXIT. " current loop
ENDLOOP.
ENDIF.
ASSERT <ls_branch> IS ASSIGNED.
rs_branch = lo_branches->find_by_name( <ls_branch>-name ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~branch_popup_callback.
DATA: lv_url TYPE string,
ls_package_data TYPE scompkdtln,
ls_branch TYPE zif_abapgit_definitions=>ty_git_branch,
lv_create TYPE abap_bool,
lv_text TYPE string.
FIELD-SYMBOLS: <ls_furl> LIKE LINE OF ct_fields,
<ls_fbranch> LIKE LINE OF ct_fields,
<ls_fpackage> LIKE LINE OF ct_fields.
CLEAR cs_error.
IF iv_code = 'COD1'.
cv_show_popup = abap_true.
READ TABLE ct_fields ASSIGNING <ls_furl> WITH KEY tabname = 'ABAPTXT255'.
IF sy-subrc <> 0 OR <ls_furl>-value IS INITIAL.
MESSAGE 'Fill URL' TYPE 'S' DISPLAY LIKE 'E'. "#EC NOTEXT
RETURN.
ENDIF.
lv_url = <ls_furl>-value.
ls_branch = branch_list_popup( lv_url ).
IF ls_branch IS INITIAL.
RETURN.
ENDIF.
READ TABLE ct_fields ASSIGNING <ls_fbranch> WITH KEY tabname = 'TEXTL'.
ASSERT sy-subrc = 0.
<ls_fbranch>-value = ls_branch-name.
ELSEIF iv_code = 'COD2'.
cv_show_popup = abap_true.
READ TABLE ct_fields ASSIGNING <ls_fpackage> WITH KEY fieldname = 'DEVCLASS'.
ASSERT sy-subrc = 0.
ls_package_data-devclass = <ls_fpackage>-value.
IF zcl_abapgit_factory=>get_sap_package( ls_package_data-devclass )->exists( ) = abap_true.
lv_text = |Package { ls_package_data-devclass } already exists|.
MESSAGE lv_text TYPE 'I' DISPLAY LIKE 'E'.
RETURN.
ENDIF.
popup_to_create_package(
IMPORTING
es_package_data = ls_package_data
ev_create = lv_create ).
IF lv_create = abap_false.
RETURN.
ENDIF.
zcl_abapgit_factory=>get_sap_package( ls_package_data-devclass )->create( ls_package_data ).
COMMIT WORK.
<ls_fpackage>-value = ls_package_data-devclass.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~create_branch_popup.
DATA: lt_fields TYPE TABLE OF sval.
DATA: lv_name TYPE spo_value.
CLEAR: ev_name, ev_cancel.
add_field( EXPORTING iv_tabname = 'TEXTL'
iv_fieldname = 'LINE'
iv_fieldtext = 'Name'
iv_value = 'new-branch-name'
CHANGING ct_fields = lt_fields ).
TRY.
_popup_2_get_values( EXPORTING iv_popup_title = 'Create branch' "#EC NOTEXT
IMPORTING ev_value_1 = lv_name
CHANGING ct_fields = lt_fields ).
ev_name = zcl_abapgit_git_branch_list=>complete_heads_branch_name(
zcl_abapgit_git_branch_list=>normalize_branch_name( lv_name ) ).
CATCH zcx_abapgit_cancel.
ev_cancel = abap_true.
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_popups~package_popup_callback.
DATA: ls_package_data TYPE scompkdtln,
lv_create TYPE abap_bool.
FIELD-SYMBOLS: <ls_fpackage> LIKE LINE OF ct_fields.
CLEAR cs_error.
IF iv_code = 'COD1'.
cv_show_popup = abap_true.
READ TABLE ct_fields ASSIGNING <ls_fpackage> WITH KEY fieldname = 'DEVCLASS'.
ASSERT sy-subrc = 0.
ls_package_data-devclass = <ls_fpackage>-value.
popup_to_create_package( IMPORTING es_package_data = ls_package_data
ev_create = lv_create ).
IF lv_create = abap_false.
RETURN.
ENDIF.
zcl_abapgit_factory=>get_sap_package( ls_package_data-devclass )->create( ls_package_data ).
COMMIT WORK.
<ls_fpackage>-value = ls_package_data-devclass.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_folder_logic.
DATA: lt_fields TYPE TABLE OF sval.
DATA: lv_folder_logic TYPE spo_value.
CLEAR: rv_folder_logic.
add_field( EXPORTING iv_tabname = 'TDEVC'
iv_fieldname = 'INTSYS'
iv_fieldtext = 'Folder logic'
iv_value = 'PREFIX'
CHANGING ct_fields = lt_fields ).
TRY.
_popup_2_get_values( EXPORTING iv_popup_title = 'Export package' "#EC NOTEXT
iv_no_value_check = abap_true
IMPORTING ev_value_1 = lv_folder_logic
CHANGING ct_fields = lt_fields ).
rv_folder_logic = to_upper( lv_folder_logic ).
CATCH zcx_abapgit_cancel.
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_object.
DATA: lt_fields TYPE TABLE OF sval.
DATA: lv_object_type TYPE spo_value.
DATA: lv_object_name TYPE spo_value.
CLEAR: rs_tadir-object, rs_tadir-obj_name.
add_field( EXPORTING iv_tabname = 'TADIR'
iv_fieldname = 'OBJECT'
iv_fieldtext = 'Type'
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TADIR'
iv_fieldname = 'OBJ_NAME'
iv_fieldtext = 'Name'
CHANGING ct_fields = lt_fields ).
TRY.
_popup_2_get_values( EXPORTING iv_popup_title = 'Object' "#EC NOTEXT
iv_no_value_check = abap_true
IMPORTING ev_value_1 = lv_object_type
ev_value_2 = lv_object_name
CHANGING ct_fields = lt_fields ).
rs_tadir = zcl_abapgit_factory=>get_tadir( )->read_single(
iv_object = to_upper( lv_object_type )
iv_obj_name = to_upper( lv_object_name ) ).
CATCH zcx_abapgit_cancel.
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_package_export.
DATA: lt_fields TYPE TABLE OF sval.
DATA: lv_package TYPE spo_value.
DATA: lv_folder_logic TYPE spo_value.
add_field( EXPORTING iv_tabname = 'TDEVC'
iv_fieldname = 'DEVCLASS'
iv_fieldtext = 'Package'
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TDEVC'
iv_fieldname = 'INTSYS'
iv_fieldtext = 'Folder logic'
iv_value = 'PREFIX'
CHANGING ct_fields = lt_fields ).
TRY.
_popup_2_get_values( EXPORTING iv_popup_title = 'Export package' "#EC NOTEXT
iv_no_value_check = abap_true
IMPORTING ev_value_1 = lv_package
ev_value_2 = lv_folder_logic
CHANGING ct_fields = lt_fields ).
ev_package = to_upper( lv_package ).
ev_folder_logic = to_upper( lv_folder_logic ).
CATCH zcx_abapgit_cancel.
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_to_confirm.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = iv_titlebar
text_question = iv_text_question
text_button_1 = iv_text_button_1
icon_button_1 = iv_icon_button_1
text_button_2 = iv_text_button_2
icon_button_2 = iv_icon_button_2
default_button = iv_default_button
display_cancel_button = iv_display_cancel_button
IMPORTING
answer = rv_answer
EXCEPTIONS
text_not_found = 1
OTHERS = 2. "#EC NOTEXT
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from POPUP_TO_CONFIRM' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_to_create_package.
CALL FUNCTION 'FUNCTION_EXISTS'
EXPORTING
funcname = 'PB_POPUP_PACKAGE_CREATE'
EXCEPTIONS
function_not_exist = 1
OTHERS = 2.
IF sy-subrc = 1.
* looks like the function module used does not exist on all
* versions since 702, so show an error
zcx_abapgit_exception=>raise( 'Your system does not support automatic creation of packages.' &&
'Please, create the package manually.' ).
ENDIF.
CALL FUNCTION 'PB_POPUP_PACKAGE_CREATE'
CHANGING
p_object_data = es_package_data
EXCEPTIONS
action_cancelled = 1.
IF sy-subrc = 0.
ev_create = abap_true.
ELSE.
ev_create = abap_false.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_to_create_transp_branch.
DATA: lt_fields TYPE TABLE OF sval,
lv_transports_as_text TYPE string,
lv_desc_as_text TYPE string,
ls_transport_header LIKE LINE OF it_transport_headers.
DATA: lv_branch_name TYPE spo_value.
DATA: lv_commit_text TYPE spo_value.
CLEAR: rs_transport_branch-branch_name, rs_transport_branch-commit_text.
" If we only have one transport selected set branch name to Transport
" name and commit description to transport description.
IF lines( it_transport_headers ) = 1.
READ TABLE it_transport_headers INDEX 1 INTO ls_transport_header.
lv_transports_as_text = ls_transport_header-trkorr.
SELECT SINGLE as4text FROM e07t INTO lv_desc_as_text WHERE
trkorr = ls_transport_header-trkorr AND
langu = sy-langu.
ELSE. " Else set branch name and commit message to 'Transport(s)_TRXXXXXX_TRXXXXX'
lv_transports_as_text = 'Transport(s)'.
LOOP AT it_transport_headers INTO ls_transport_header.
CONCATENATE lv_transports_as_text '_' ls_transport_header-trkorr INTO lv_transports_as_text.
ENDLOOP.
lv_desc_as_text = lv_transports_as_text.
ENDIF.
add_field( EXPORTING iv_tabname = 'TEXTL'
iv_fieldname = 'LINE'
iv_fieldtext = 'Branch name'
iv_value = lv_transports_as_text
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'ABAPTXT255'
iv_fieldname = 'LINE'
iv_fieldtext = 'Commit text'
iv_value = lv_desc_as_text
CHANGING ct_fields = lt_fields ).
_popup_2_get_values( EXPORTING iv_popup_title = 'Transport to new Branch' "#EC NOTEXT
IMPORTING ev_value_1 = lv_branch_name
ev_value_2 = lv_commit_text
CHANGING ct_fields = lt_fields ).
rs_transport_branch-branch_name = lv_branch_name.
rs_transport_branch-commit_text = lv_commit_text.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_to_inform.
DATA: lv_line1 TYPE char70,
lv_line2 TYPE char70.
lv_line1 = iv_text_message.
IF strlen( iv_text_message ) > 70.
lv_line2 = iv_text_message+70.
ENDIF.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = iv_titlebar
txt1 = lv_line1
txt2 = lv_line2.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_to_select_from_list.
DATA:
lo_events TYPE REF TO cl_salv_events_table,
lo_columns TYPE REF TO cl_salv_columns_table,
lt_columns TYPE salv_t_column_ref,
ls_column TYPE salv_s_column_ref,
lo_column TYPE REF TO cl_salv_column_list,
lo_table_header TYPE REF TO cl_salv_form_text.
FIELD-SYMBOLS: <lt_table> TYPE STANDARD TABLE.
CLEAR: et_list.
create_new_table( it_list ).
ASSIGN mr_table->* TO <lt_table>.
ASSERT sy-subrc = 0.
TRY.
cl_salv_table=>factory( IMPORTING r_salv_table = mo_select_list_popup
CHANGING t_table = <lt_table> ).
mo_select_list_popup->set_screen_status( pfstatus = '102'
report = 'SAPMSVIM' ).
mo_select_list_popup->set_screen_popup( start_column = 1
end_column = 65
start_line = 1
end_line = 20 ).
lo_events = mo_select_list_popup->get_event( ).
SET HANDLER on_select_list_link_click FOR lo_events.
SET HANDLER on_select_list_function_click FOR lo_events.
CREATE OBJECT lo_table_header
EXPORTING
text = iv_header_text.
mo_select_list_popup->set_top_of_list( lo_table_header ).
lo_columns = mo_select_list_popup->get_columns( ).
lo_columns->set_optimize( abap_true ).
lt_columns = lo_columns->get( ).
LOOP AT lt_columns INTO ls_column.
IF ls_column-columnname = c_fieldname_selected.
lo_column ?= ls_column-r_column.
lo_column->set_cell_type( if_salv_c_cell_type=>checkbox_hotspot ).
lo_column->set_output_length( 20 ).
lo_column->set_short_text( |{ iv_select_column_text }| ).
lo_column->set_medium_text( |{ iv_select_column_text }| ).
lo_column->set_long_text( |{ iv_select_column_text }| ).
CONTINUE.
ENDIF.
READ TABLE it_columns_to_display TRANSPORTING NO FIELDS
WITH KEY table_line = ls_column-columnname.
IF sy-subrc <> 0.
ls_column-r_column->set_technical( abap_true ).
ENDIF.
ENDLOOP.
mo_select_list_popup->display( ).
CATCH cx_salv_msg.
zcx_abapgit_exception=>raise( 'Error from POPUP_TO_SELECT_FROM_LIST' ).
ENDTRY.
IF mv_cancel = abap_true.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ENDIF.
get_selected_rows(
IMPORTING
et_list = et_list ).
CLEAR: mo_select_list_popup,
mr_table,
mo_table_descr.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_to_select_transports.
* todo, method to be renamed, it only returns one transport
DATA: lv_trkorr TYPE e070-trkorr,
ls_trkorr LIKE LINE OF rt_trkorr.
CALL FUNCTION 'TR_F4_REQUESTS'
IMPORTING
ev_selected_request = lv_trkorr.
IF NOT lv_trkorr IS INITIAL.
ls_trkorr-trkorr = lv_trkorr.
APPEND ls_trkorr TO rt_trkorr.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_transport_request.
DATA: lt_e071 TYPE STANDARD TABLE OF e071,
lt_e071k TYPE STANDARD TABLE OF e071k.
CALL FUNCTION 'TRINT_ORDER_CHOICE'
EXPORTING
wi_order_type = is_transport_type-request
wi_task_type = is_transport_type-task
IMPORTING
we_order = rv_transport
TABLES
wt_e071 = lt_e071
wt_e071k = lt_e071k
EXCEPTIONS
no_correction_selected = 1
display_mode = 2
object_append_error = 3
recursive_call = 4
wrong_order_type = 5
OTHERS = 6.
IF sy-subrc = 1.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ELSEIF sy-subrc > 1.
zcx_abapgit_exception=>raise( |Error from TRINT_ORDER_CHOICE { sy-subrc }| ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~repo_new_offline.
DATA: lv_returncode TYPE c,
lt_fields TYPE TABLE OF sval,
lv_icon_ok TYPE icon-name,
lv_button1 TYPE svalbutton-buttontext,
lv_icon1 TYPE icon-name,
lv_finished TYPE abap_bool,
lx_error TYPE REF TO zcx_abapgit_exception.
FIELD-SYMBOLS: <ls_field> LIKE LINE OF lt_fields.
add_field( EXPORTING iv_tabname = 'ABAPTXT255'
iv_fieldname = 'LINE'
iv_fieldtext = 'Name'
iv_obligatory = abap_true
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TDEVC'
iv_fieldname = 'DEVCLASS'
iv_fieldtext = 'Package'
iv_obligatory = abap_true
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'ZABAPGIT'
iv_fieldname = 'VALUE'
iv_fieldtext = 'Folder logic'
iv_obligatory = abap_true
iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix
CHANGING ct_fields = lt_fields ).
WHILE lv_finished = abap_false.
lv_icon_ok = icon_okay.
lv_button1 = 'Create package' ##NO_TEXT.
lv_icon1 = icon_folder.
CALL FUNCTION 'POPUP_GET_VALUES_USER_BUTTONS'
EXPORTING
popup_title = 'New Offline Project'
programname = sy-cprog
formname = 'PACKAGE_POPUP'
ok_pushbuttontext = 'OK'
icon_ok_push = lv_icon_ok
first_pushbutton = lv_button1
icon_button_1 = lv_icon1
second_pushbutton = ''
icon_button_2 = ''
IMPORTING
returncode = lv_returncode
TABLES
fields = lt_fields
EXCEPTIONS
error_in_fields = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error from POPUP_GET_VALUES' ).
ENDIF.
IF lv_returncode = c_answer_cancel.
rs_popup-cancel = abap_true.
RETURN.
ENDIF.
READ TABLE lt_fields INDEX 1 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
rs_popup-url = <ls_field>-value.
READ TABLE lt_fields INDEX 2 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
TRANSLATE <ls_field>-value TO UPPER CASE.
rs_popup-package = <ls_field>-value.
READ TABLE lt_fields INDEX 3 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
TRANSLATE <ls_field>-value TO UPPER CASE.
rs_popup-folder_logic = <ls_field>-value.
lv_finished = abap_true.
TRY.
zcl_abapgit_repo_srv=>get_instance( )->validate_package( rs_popup-package ).
validate_folder_logic( rs_popup-folder_logic ).
CATCH zcx_abapgit_exception INTO lx_error.
" in case of validation errors we display the popup again
MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'.
CLEAR lv_finished.
ENDTRY.
ENDWHILE.
ENDMETHOD.
METHOD zif_abapgit_popups~repo_popup.
DATA: lv_returncode TYPE c,
lv_icon_ok TYPE icon-name,
lv_icon_br TYPE icon-name,
lt_fields TYPE TABLE OF sval,
lv_uattr TYPE spo_fattr,
lv_pattr TYPE spo_fattr,
lv_button2 TYPE svalbutton-buttontext,
lv_icon2 TYPE icon-name,
lv_package TYPE tdevc-devclass,
lv_url TYPE abaptxt255-line,
lv_branch TYPE textl-line,
lv_display_name TYPE trm255-text,
lv_finished TYPE abap_bool,
lx_error TYPE REF TO zcx_abapgit_exception.
IF iv_freeze_url = abap_true.
lv_uattr = '05'.
ENDIF.
IF iv_freeze_package = abap_true.
lv_pattr = '05'.
ENDIF.
IF iv_package IS INITIAL. " Empty package -> can be created
lv_button2 = 'Create package' ##NO_TEXT.
lv_icon2 = icon_folder.
ENDIF.
lv_package = iv_package.
lv_url = iv_url.
lv_branch = iv_branch.
WHILE lv_finished = abap_false.
CLEAR: lt_fields.
add_field( EXPORTING iv_tabname = 'ABAPTXT255'
iv_fieldname = 'LINE'
iv_fieldtext = 'Git clone URL'
iv_value = lv_url
iv_field_attr = lv_uattr
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TDEVC'
iv_fieldname = 'DEVCLASS'
iv_fieldtext = 'Package'
iv_value = lv_package
iv_field_attr = lv_pattr
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TEXTL'
iv_fieldname = 'LINE'
iv_fieldtext = 'Branch'
iv_value = lv_branch
iv_field_attr = '05'
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TRM255'
iv_fieldname = 'TEXT'
iv_fieldtext = 'Display name (opt.)'
iv_value = lv_display_name
CHANGING ct_fields = lt_fields ).
lv_icon_ok = icon_okay.
lv_icon_br = icon_workflow_fork.
CALL FUNCTION 'POPUP_GET_VALUES_USER_BUTTONS'
EXPORTING
popup_title = iv_title
programname = sy-cprog
formname = 'BRANCH_POPUP'
ok_pushbuttontext = 'OK'
icon_ok_push = lv_icon_ok
first_pushbutton = 'Select branch'
icon_button_1 = lv_icon_br
second_pushbutton = lv_button2
icon_button_2 = lv_icon2
IMPORTING
returncode = lv_returncode
TABLES
fields = lt_fields
EXCEPTIONS
error_in_fields = 1
OTHERS = 2. "#EC NOTEXT
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error from POPUP_GET_VALUES' ).
ENDIF.
IF lv_returncode = c_answer_cancel.
rs_popup-cancel = abap_true.
RETURN.
ENDIF.
extract_field_values(
EXPORTING
it_fields = lt_fields
IMPORTING
ev_url = lv_url
ev_package = lv_package
ev_branch = lv_branch
ev_display_name = lv_display_name ).
lv_finished = abap_true.
TRY.
zcl_abapgit_url=>validate( |{ lv_url }| ).
IF iv_freeze_package = abap_false.
zcl_abapgit_repo_srv=>get_instance( )->validate_package( lv_package ).
ENDIF.
CATCH zcx_abapgit_exception INTO lx_error.
MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'.
" in case of validation errors we display the popup again
CLEAR lv_finished.
ENDTRY.
ENDWHILE.
rs_popup-url = lv_url.
rs_popup-package = lv_package.
rs_popup-branch_name = lv_branch.
rs_popup-display_name = lv_display_name.
ENDMETHOD.
METHOD zif_abapgit_popups~run_page_class_popup.
DATA: lt_fields TYPE TABLE OF sval.
DATA: lv_name TYPE spo_value.
CLEAR: ev_name, ev_cancel.
add_field( EXPORTING iv_tabname = 'TEXTL'
iv_fieldname = 'LINE'
iv_fieldtext = 'Name'
iv_value = 'lcl_gui_page_'
CHANGING ct_fields = lt_fields ).
TRY.
_popup_2_get_values( EXPORTING iv_popup_title = 'Run page manually' "#EC NOTEXT
IMPORTING ev_value_1 = lv_name
CHANGING ct_fields = lt_fields ).
ev_name = to_upper( lv_name ).
CATCH zcx_abapgit_cancel.
ev_cancel = abap_true.
ENDTRY.
ENDMETHOD.
METHOD _popup_2_get_values.
DATA lv_answer TYPE char1.
FIELD-SYMBOLS: <ls_field> TYPE sval.
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
no_value_check = iv_no_value_check
popup_title = iv_popup_title
IMPORTING
returncode = lv_answer
TABLES
fields = ct_fields
EXCEPTIONS
OTHERS = 1 ##NO_TEXT.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from POPUP_GET_VALUES' ).
ENDIF.
IF lv_answer = c_answer_cancel.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ENDIF.
IF ev_value_1 IS SUPPLIED.
READ TABLE ct_fields INDEX 1 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_value_1 = <ls_field>-value.
ENDIF.
IF ev_value_2 IS SUPPLIED.
READ TABLE ct_fields INDEX 2 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_value_2 = <ls_field>-value.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
12924,
4739,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
4810,
3824,
6158,
198,
220,
10188,
9864,
1847,
48167,
1677,
5258,
1976,
565,
62,
397,
499,
18300,
62,
9019,
62,
69,
9548,
13,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
23255,
37,
2246,
1546,
25,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
13,
198,
220,
220,
220,
8355,
43429,
1546,
25,
198,
220,
220,
220,
220,
220,
46207,
62,
26495,
62,
39344,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
26495,
62,
39344,
11,
198,
220,
220,
220,
220,
220,
46207,
62,
43551,
62,
6404,
291,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
43551,
62,
6404,
291,
11,
198,
220,
220,
220,
220,
220,
46207,
62,
15252,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
15252,
11,
198,
220,
220,
220,
220,
220,
2251,
62,
1671,
3702,
62,
12924,
929,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
17953,
62,
1671,
3702,
62,
12924,
929,
11,
198,
220,
220,
220,
220,
220,
1057,
62,
7700,
62,
4871,
62,
12924,
929,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
5143,
62,
7700,
62,
4871,
62,
12924,
929,
11,
198,
220,
220,
220,
220,
220,
29924,
62,
3605,
62,
2364,
1370,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
260,
7501,
62,
3605,
62,
2364,
1370,
11,
198,
220,
220,
220,
220,
220,
8478,
62,
4868,
62,
12924,
929,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
1671,
3702,
62,
4868,
62,
12924,
929,
11,
198,
220,
220,
220,
220,
220,
29924,
62,
12924,
929,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
260,
7501,
62,
12924,
929,
11,
198,
220,
220,
220,
220,
220,
46207,
62,
1462,
62,
10414,
2533,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
1462,
62,
10414,
2533,
11,
198,
220,
220,
220,
220,
220,
46207,
62,
1462,
62,
259,
687,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
1462,
62,
259,
687,
11,
198,
220,
220,
220,
220,
220,
46207,
62,
1462,
62,
17953,
62,
26495,
220,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
1462,
62,
17953,
62,
26495,
11,
198,
220,
220,
220,
220,
220,
46207,
62,
1462,
62,
17953,
62,
7645,
79,
62,
1671,
3702,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
1462,
62,
17953,
62,
7645,
79,
62,
1671,
3702,
11,
198,
220,
220,
220,
220,
220,
46207,
62,
1462,
62,
19738,
62,
7645,
3742,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
1462,
62,
19738,
62,
7645,
3742,
11,
198,
220,
220,
220,
220,
220,
46207,
62,
1462,
62,
19738,
62,
6738,
62,
4868,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
1462,
62,
19738,
62,
6738,
62,
4868,
11,
198,
220,
220,
220,
220,
220,
8478,
62,
12924,
929,
62,
47423,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
1671,
3702,
62,
12924,
929,
62,
47423,
11,
198,
220,
220,
220,
220,
220,
5301,
62,
12924,
929,
62,
47423,
220,
220,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
26495,
62,
12924,
929,
62,
47423,
11,
198,
220,
220,
220,
220,
220,
46207,
62,
7645,
634,
62,
25927,
220,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
7645,
634,
62,
25927,
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,
1259,
62,
82,
2100,
62,
926,
41876,
49053,
9795,
43679,
3963,
264,
2100,
13315,
5550,
38865,
35374,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
3245,
3672,
62,
34213,
41876,
300,
28435,
62,
69,
3672,
26173,
8924,
4600,
46506,
1961,
63,
22492,
15285,
62,
32541,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
41484,
62,
66,
21130,
220,
220,
220,
220,
220,
41876,
1149,
16,
26173,
8924,
705,
32,
6,
22492,
15285,
62,
32541,
13,
628,
220,
220,
220,
42865,
6941,
62,
19738,
62,
4868,
62,
12924,
929,
41876,
4526,
37,
5390,
537,
62,
21680,
85,
62,
11487,
764,
198,
220,
220,
220,
42865,
285,
81,
62,
11487,
41876,
4526,
37,
5390,
1366,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
66,
21130,
41876,
450,
499,
62,
30388,
764,
198,
220,
220,
220,
42865,
6941,
62,
11487,
62,
20147,
81,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
83,
4510,
3798,
81,
764,
628,
220,
220,
220,
337,
36252,
50,
751,
62,
3245,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8658,
3672,
220,
220,
220,
41876,
264,
2100,
12,
8658,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3245,
3672,
220,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
class ZCL_EXCEL_WORKSHEET_COLUMNDIME definition
public
final
create public .
*"* public components of class ZCL_EXCEL_WORKSHEET_COLUMNDIME
*"* do not include other source files here!!!
public section.
type-pools ABAP .
methods CONSTRUCTOR
importing
!IP_INDEX type ZEXCEL_CELL_COLUMN_ALPHA
!IP_WORKSHEET type ref to ZCL_EXCEL_WORKSHEET
!IP_EXCEL type ref to ZCL_EXCEL .
methods GET_AUTO_SIZE
returning
value(R_AUTO_SIZE) type ABAP_BOOL .
methods GET_COLLAPSED
returning
value(R_COLLAPSED) type ABAP_BOOL .
methods GET_COLUMN_INDEX
returning
value(R_COLUMN_INDEX) type INT4 .
methods GET_OUTLINE_LEVEL
returning
value(R_OUTLINE_LEVEL) type INT4 .
methods GET_VISIBLE
returning
value(R_VISIBLE) type ABAP_BOOL .
methods GET_WIDTH
returning
value(R_WIDTH) type FLOAT .
methods GET_XF_INDEX
returning
value(R_XF_INDEX) type INT4 .
methods SET_AUTO_SIZE
importing
!IP_AUTO_SIZE type ABAP_BOOL
returning
value(R_WORKSHEET_COLUMNDIME) type ref to ZCL_EXCEL_WORKSHEET_COLUMNDIME .
methods SET_COLLAPSED
importing
!IP_COLLAPSED type ABAP_BOOL
returning
value(R_WORKSHEET_COLUMNDIME) type ref to ZCL_EXCEL_WORKSHEET_COLUMNDIME .
methods SET_COLUMN_INDEX
importing
!IP_INDEX type ZEXCEL_CELL_COLUMN_ALPHA
returning
value(R_WORKSHEET_COLUMNDIME) type ref to ZCL_EXCEL_WORKSHEET_COLUMNDIME .
methods SET_OUTLINE_LEVEL
importing
!IP_OUTLINE_LEVEL type INT4 .
methods SET_VISIBLE
importing
!IP_VISIBLE type ABAP_BOOL
returning
value(R_WORKSHEET_COLUMNDIME) type ref to ZCL_EXCEL_WORKSHEET_COLUMNDIME .
methods SET_WIDTH
importing
!IP_WIDTH type SIMPLE
returning
value(R_WORKSHEET_COLUMNDIME) type ref to ZCL_EXCEL_WORKSHEET_COLUMNDIME
raising
ZCX_EXCEL .
methods SET_XF_INDEX
importing
!IP_XF_INDEX type INT4
returning
value(R_WORKSHEET_COLUMNDIME) type ref to ZCL_EXCEL_WORKSHEET_COLUMNDIME .
methods SET_COLUMN_STYLE_BY_GUID
importing
!IP_STYLE_GUID type ZEXCEL_CELL_STYLE
raising
ZCX_EXCEL .
methods GET_COLUMN_STYLE_GUID
returning
value(EP_STYLE_GUID) type ZEXCEL_CELL_STYLE
raising
ZCX_EXCEL .
*"* protected components of class ZCL_EXCEL_WORKSHEET_COLUMNDIME
*"* do not include other source files here!!!
protected section.
*"* private components of class ZCL_EXCEL_WORKSHEET_COLUMNDIME
*"* do not include other source files here!!!
private section.
data COLUMN_INDEX type INT4 .
data WIDTH type FLOAT .
data AUTO_SIZE type ABAP_BOOL .
data VISIBLE type ABAP_BOOL .
data OUTLINE_LEVEL type INT4 .
data COLLAPSED type ABAP_BOOL .
data XF_INDEX type INT4 .
data STYLE_GUID type ZEXCEL_CELL_STYLE .
data EXCEL type ref to ZCL_EXCEL .
data WORKSHEET type ref to ZCL_EXCEL_WORKSHEET .
ENDCLASS.
CLASS ZCL_EXCEL_WORKSHEET_COLUMNDIME IMPLEMENTATION.
method CONSTRUCTOR.
me->column_index = zcl_excel_common=>convert_column2int( ip_index ).
me->width = -1.
me->auto_size = abap_false.
me->visible = abap_true.
me->outline_level = 0.
me->collapsed = abap_false.
me->excel = ip_excel. "ins issue #157 - Allow Style for columns
me->worksheet = ip_worksheet. "ins issue #157 - Allow Style for columns
" set default index to cellXf
me->xf_index = 0.
endmethod.
method GET_AUTO_SIZE.
r_auto_size = me->auto_size.
endmethod.
method GET_COLLAPSED.
r_Collapsed = me->Collapsed.
endmethod.
method GET_COLUMN_INDEX.
r_column_index = me->column_index.
endmethod.
method GET_COLUMN_STYLE_GUID.
IF me->style_guid IS NOT INITIAL.
ep_style_guid = me->style_guid.
ELSE.
ep_style_guid = me->worksheet->zif_excel_sheet_properties~get_style( ).
ENDIF.
endmethod.
method GET_OUTLINE_LEVEL.
r_outline_level = me->outline_level.
endmethod.
method GET_VISIBLE.
r_Visible = me->Visible.
endmethod.
method GET_WIDTH.
r_WIDTH = me->WIDTH.
endmethod.
method GET_XF_INDEX.
r_xf_index = me->xf_index.
endmethod.
method SET_AUTO_SIZE.
me->auto_size = ip_auto_size.
r_worksheet_columndime = me.
endmethod.
method SET_COLLAPSED.
me->Collapsed = ip_Collapsed.
r_worksheet_columndime = me.
endmethod.
method SET_COLUMN_INDEX.
me->column_index = zcl_excel_common=>convert_column2int( ip_index ).
r_worksheet_columndime = me.
endmethod.
method SET_COLUMN_STYLE_BY_GUID.
DATA: stylemapping TYPE zexcel_s_stylemapping.
IF me->excel IS NOT BOUND.
RAISE EXCEPTION TYPE zcx_excel
EXPORTING
error = 'Internal error - reference to ZCL_EXCEL not bound'.
ENDIF.
TRY.
stylemapping = me->excel->get_style_to_guid( ip_style_guid ).
me->style_guid = stylemapping-guid.
CATCH zcx_excel .
EXIT. " leave as is in case of error
ENDTRY.
endmethod.
method SET_OUTLINE_LEVEL.
me->outline_level = ip_outline_level.
endmethod.
method SET_VISIBLE.
me->Visible = ip_Visible.
r_worksheet_columndime = me.
endmethod.
method SET_WIDTH.
TRY.
me->width = ip_width.
r_worksheet_columndime = me.
CATCH cx_sy_conversion_no_number.
RAISE EXCEPTION TYPE zcx_excel
EXPORTING
error = 'Unable to interpret width as number'.
ENDTRY.
endmethod.
method SET_XF_INDEX.
me->XF_INDEX = ip_XF_INDEX.
r_worksheet_columndime = me.
endmethod.
ENDCLASS.
| [
4871,
1168,
5097,
62,
6369,
34,
3698,
62,
33249,
9693,
36,
2767,
62,
25154,
5883,
8575,
12789,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
1171,
764,
198,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1168,
5097,
62,
6369,
34,
3698,
62,
33249,
9693,
36,
2767,
62,
25154,
5883,
8575,
12789,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
11377,
2665,
13,
198,
220,
2099,
12,
7742,
82,
9564,
2969,
764,
628,
220,
5050,
7102,
46126,
1581,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
4061,
62,
12115,
6369,
2099,
1168,
6369,
34,
3698,
62,
5222,
3069,
62,
25154,
5883,
45,
62,
1847,
47,
7801,
198,
220,
220,
220,
220,
220,
5145,
4061,
62,
33249,
9693,
36,
2767,
2099,
1006,
284,
1168,
5097,
62,
6369,
34,
3698,
62,
33249,
9693,
36,
2767,
198,
220,
220,
220,
220,
220,
5145,
4061,
62,
6369,
34,
3698,
2099,
1006,
284,
1168,
5097,
62,
6369,
34,
3698,
764,
198,
220,
5050,
17151,
62,
39371,
46,
62,
33489,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
62,
39371,
46,
62,
33489,
8,
2099,
9564,
2969,
62,
8202,
3535,
764,
198,
220,
5050,
17151,
62,
8220,
3069,
44580,
1961,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
62,
8220,
3069,
44580,
1961,
8,
2099,
9564,
2969,
62,
8202,
3535,
764,
198,
220,
5050,
17151,
62,
25154,
5883,
45,
62,
12115,
6369,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
62,
25154,
5883,
45,
62,
12115,
6369,
8,
2099,
17828,
19,
764,
198,
220,
5050,
17151,
62,
12425,
24027,
62,
2538,
18697,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
62,
12425,
24027,
62,
2538,
18697,
8,
2099,
17828,
19,
764,
198,
220,
5050,
17151,
62,
29817,
34563,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
62,
29817,
34563,
8,
2099,
9564,
2969,
62,
8202,
3535,
764,
198,
220,
5050,
17151,
62,
54,
2389,
4221,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
62,
54,
2389,
4221,
8,
2099,
9977,
46,
1404,
764,
198,
220,
5050,
17151,
62,
55,
37,
62,
12115,
6369,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
62,
55,
37,
62,
12115,
6369,
8,
2099,
17828,
19,
764,
198,
220,
5050,
25823,
62,
39371,
46,
62,
33489,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
4061,
62,
39371,
46,
62,
33489,
2099,
9564,
2969,
62,
8202,
3535,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
62,
33249,
9693,
36,
2767,
62,
25154,
5883,
8575,
12789,
8,
2099,
1006,
284,
1168,
5097,
62,
6369,
34,
3698,
62,
33249,
9693,
36,
2767,
62,
25154,
5883,
8575,
12789,
764,
198,
220,
5050,
25823,
62,
8220,
3069,
44580,
1961,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
4061,
62,
8220,
3069,
44580,
1961,
2099,
9564,
2969,
62,
8202,
3535,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
62,
33249,
9693,
36,
2767,
62,
25154,
5883,
8575,
12789,
8,
2099,
1006,
284,
1168,
5097,
62,
6369,
34,
3698,
62,
33249,
9693,
36,
2767,
62,
25154,
5883,
8575,
12789,
764,
198,
220,
5050,
25823,
62,
25154,
5883,
45,
62,
12115,
6369,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
4061,
62,
12115,
6369,
2099,
1168,
6369,
34,
3698,
62,
5222,
3069,
62,
25154,
5883,
45,
62,
1847,
47,
7801,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
62,
33249,
9693,
36,
2767,
62,
25154,
5883,
8575,
12789,
8,
2099,
1006,
284,
1168,
5097,
62,
6369,
34,
3698,
62,
33249,
9693,
36,
2767,
62,
25154,
5883,
8575,
12789,
764,
198,
220,
5050,
25823,
62,
12425,
24027,
62,
2538,
18697,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
4061,
62,
12425,
24027,
62,
2538,
18697,
2099,
17828,
19,
764,
198,
220,
5050,
25823,
62,
29817,
34563,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
4061,
62,
29817,
34563,
2099,
9564,
2969,
62,
8202,
3535,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
62,
33249,
9693,
36,
2767,
62,
25154,
5883,
8575,
12789,
8,
2099,
1006,
284,
1168,
5097,
62,
6369,
34,
3698,
62,
33249,
9693,
36,
2767,
62,
25154,
5883,
8575,
12789,
764,
198,
220,
5050,
25823,
62,
54,
2389,
4221,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
4061,
62,
54,
2389,
4221,
2099,
23749,
16437,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
62,
33249,
9693,
36,
2767,
62,
25154,
5883,
8575,
12789,
8,
2099,
1006,
284,
1168,
5097,
62,
6369,
34,
3698,
62,
33249,
9693,
36,
2767,
62,
25154,
5883,
8575,
12789,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
1168,
34,
55,
62,
6369,
34,
3698,
764,
198,
220,
5050,
25823,
62,
55,
37,
62,
12115,
6369,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
4061,
62,
55,
37,
62,
12115,
6369,
2099,
17828,
19,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
62,
33249,
9693,
36,
2767,
62,
25154,
5883,
8575,
12789,
8,
2099,
1006,
284,
1168,
5097,
62,
6369,
34,
3698,
62,
33249,
9693,
36,
2767,
62,
25154,
5883,
8575,
12789,
764,
198,
220,
5050,
25823,
62,
25154,
5883,
45,
62,
2257,
56,
2538,
62,
17513,
62,
38,
27586,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
4061,
62,
2257,
56,
2538,
62,
38,
27586,
2099,
1168,
6369,
34,
3698,
62,
5222,
3069,
62,
2257,
56,
2538,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
1168,
34,
55,
62,
6369,
34,
3698,
764,
198,
220,
5050,
17151,
62,
25154,
5883,
45,
62,
2257,
56,
2538,
62,
38,
27586,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
"! schema.org: The most generic kind of creative work, including books, movies, photographs, software programs, etc.
"! <h1>SchemA</h1>
"! The schema.org ABAP Framework <br/>
"! Copyright (C) 2016 Uwe Fetzer together with the SCN ABAP community <br/>
"! <br/>
"! Project home: https://github.com/se38/SchemA <br/>
"! <br/>
"! Published under Apache License, Version 2.0 <br/>
"! http://www.apache.org/licenses/LICENSE-2.0.html <br/>
CLASS zcl_schema_creativework DEFINITION
PUBLIC
INHERITING FROM zcl_schema_thing
CREATE PUBLIC
GLOBAL FRIENDS zcl_schema_thing.
PUBLIC SECTION.
METHODS:
constructor IMPORTING i_json TYPE string OPTIONAL,
get_about RETURNING VALUE(r_result) TYPE REF TO zcl_schema_thing,
set_about IMPORTING i_about TYPE REF TO zcl_schema_thing,
set_about_json IMPORTING i_about TYPE string,
get_accessibility_api RETURNING VALUE(r_result) TYPE string,
set_accessibility_api IMPORTING i_accessibility_api TYPE string,
get_accessibility_control RETURNING VALUE(r_result) TYPE string,
set_accessibility_control IMPORTING i_accessibility_control TYPE string,
get_accessibility_feature RETURNING VALUE(r_result) TYPE string,
set_accessibility_feature IMPORTING i_accessibility_feature TYPE string,
get_accessibility_hazard RETURNING VALUE(r_result) TYPE string,
set_accessibility_hazard IMPORTING i_accessibility_hazard TYPE string,
get_accountable_person RETURNING VALUE(r_result) TYPE REF TO zcl_schema_person,
set_accountable_person IMPORTING i_accountable_person TYPE REF TO zcl_schema_person,
set_accountable_person_json IMPORTING i_accountable_person TYPE string,
get_aggregate_rating RETURNING VALUE(r_result) TYPE REF TO zcl_schema_aggregaterating,
set_aggregate_rating IMPORTING i_aggregate_rating TYPE REF TO zcl_schema_aggregaterating,
set_aggregate_rating_json IMPORTING i_aggregate_rating TYPE string,
get_alternative_headline RETURNING VALUE(r_result) TYPE string,
set_alternative_headline IMPORTING i_alternative_headline TYPE string,
get_license RETURNING VALUE(r_result) TYPE string,
set_license IMPORTING i_license TYPE string.
PROTECTED SECTION.
METHODS:
"*--- append attributes of this and all super classes as JSON ---*
append_attributes REDEFINITION.
PRIVATE SECTION.
CLASS-DATA:
type TYPE string VALUE 'CreativeWork'.
DATA:
"! The subject matter of the content.
about TYPE REF TO zcl_schema_thing,
"! Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).
accessibility_api TYPE string,
"! Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).
accessibility_control TYPE string,
"! Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).
accessibility_feature TYPE string,
"! A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).
accessibility_hazard TYPE string,
"! Specifies the Person that is legally accountable for the CreativeWork.
accountable_person TYPE REF TO zcl_schema_person,
"! The overall rating, based on a collection of reviews or ratings, of the item.
aggregate_rating TYPE REF TO zcl_schema_aggregaterating,
"! A secondary title of the CreativeWork.
alternative_headline TYPE string,
"! A license document that applies to this content, typically indicated by URL.
license TYPE string.
ENDCLASS.
CLASS ZCL_SCHEMA_CREATIVEWORK IMPLEMENTATION.
METHOD append_attributes.
INCLUDE z_schema_attributes_super.
ENDMETHOD.
METHOD constructor.
INCLUDE z_schema_constructor_super.
ENDMETHOD.
METHOD get_about.
r_result = me->about.
ENDMETHOD.
METHOD get_accessibility_api.
r_result = me->accessibility_api.
ENDMETHOD.
METHOD get_accessibility_control.
r_result = me->accessibility_control.
ENDMETHOD.
METHOD get_accessibility_feature.
r_result = me->accessibility_feature.
ENDMETHOD.
METHOD get_accessibility_hazard.
r_result = me->accessibility_hazard.
ENDMETHOD.
METHOD get_accountable_person.
r_result = me->accountable_person.
ENDMETHOD.
METHOD get_aggregate_rating.
r_result = me->aggregate_rating.
ENDMETHOD.
METHOD get_alternative_headline.
r_result = me->alternative_headline.
ENDMETHOD.
METHOD get_license.
r_result = me->license.
ENDMETHOD.
METHOD set_about.
me->about = i_about.
ENDMETHOD.
METHOD set_about_json.
me->about = NEW #( i_about ).
ENDMETHOD.
METHOD set_accessibility_api.
me->accessibility_api = i_accessibility_api.
ENDMETHOD.
METHOD set_accessibility_control.
me->accessibility_control = i_accessibility_control.
ENDMETHOD.
METHOD set_accessibility_feature.
me->accessibility_feature = i_accessibility_feature.
ENDMETHOD.
METHOD set_accessibility_hazard.
me->accessibility_hazard = i_accessibility_hazard.
ENDMETHOD.
METHOD set_accountable_person.
me->accountable_person = i_accountable_person.
ENDMETHOD.
METHOD set_accountable_person_json.
me->accountable_person = NEW #( i_accountable_person ).
ENDMETHOD.
METHOD set_aggregate_rating.
me->aggregate_rating = i_aggregate_rating.
ENDMETHOD.
METHOD set_aggregate_rating_json.
me->aggregate_rating = NEW #( i_aggregate_rating ).
ENDMETHOD.
METHOD set_alternative_headline.
me->alternative_headline = i_alternative_headline.
ENDMETHOD.
METHOD set_license.
me->license = i_license.
ENDMETHOD.
ENDCLASS.
| [
40484,
32815,
13,
2398,
25,
383,
749,
14276,
1611,
286,
7325,
670,
11,
1390,
3835,
11,
6918,
11,
12566,
11,
3788,
4056,
11,
3503,
13,
198,
40484,
1279,
71,
16,
29,
50,
15245,
32,
3556,
71,
16,
29,
198,
40484,
383,
32815,
13,
2398,
9564,
2969,
25161,
1279,
1671,
15913,
198,
40484,
15069,
357,
34,
8,
1584,
471,
732,
44649,
9107,
1978,
351,
262,
6374,
45,
9564,
2969,
2055,
1279,
1671,
15913,
198,
40484,
1279,
1671,
15913,
198,
40484,
4935,
1363,
25,
3740,
1378,
12567,
13,
785,
14,
325,
2548,
14,
50,
15245,
32,
1279,
1671,
15913,
198,
40484,
1279,
1671,
15913,
198,
40484,
26372,
739,
24843,
13789,
11,
10628,
362,
13,
15,
1279,
1671,
15913,
198,
40484,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
13,
6494,
1279,
1671,
15913,
198,
31631,
1976,
565,
62,
15952,
2611,
62,
20123,
425,
1818,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
15952,
2611,
62,
1197,
198,
220,
29244,
6158,
44731,
198,
220,
10188,
9864,
1847,
48167,
1677,
5258,
1976,
565,
62,
15952,
2611,
62,
1197,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
30023,
9863,
2751,
1312,
62,
17752,
41876,
4731,
39852,
2849,
1847,
11,
198,
220,
220,
220,
220,
220,
651,
62,
10755,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
15952,
2611,
62,
1197,
11,
198,
220,
220,
220,
220,
220,
900,
62,
10755,
30023,
9863,
2751,
1312,
62,
10755,
41876,
4526,
37,
5390,
1976,
565,
62,
15952,
2611,
62,
1197,
11,
198,
220,
220,
220,
220,
220,
900,
62,
10755,
62,
17752,
30023,
9863,
2751,
1312,
62,
10755,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
651,
62,
15526,
2247,
62,
15042,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
900,
62,
15526,
2247,
62,
15042,
30023,
9863,
2751,
1312,
62,
15526,
2247,
62,
15042,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
651,
62,
15526,
2247,
62,
13716,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
900,
62,
15526,
2247,
62,
13716,
30023,
9863,
2751,
1312,
62,
15526,
2247,
62,
13716,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
651,
62,
15526,
2247,
62,
30053,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
900,
62,
15526,
2247,
62,
30053,
30023,
9863,
2751,
1312,
62,
15526,
2247,
62,
30053,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
651,
62,
15526,
2247,
62,
37598,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
900,
62,
15526,
2247,
62,
37598,
30023,
9863,
2751,
1312,
62,
15526,
2247,
62,
37598,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
651,
62,
23317,
540,
62,
6259,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
15952,
2611,
62,
6259,
11,
198,
220,
220,
220,
220,
220,
900,
62,
23317,
540,
62,
6259,
30023,
9863,
2751,
1312,
62,
23317,
540,
62,
6259,
41876,
4526,
37,
5390,
1976,
565,
62,
15952,
2611,
62,
6259,
11,
198,
220,
220,
220,
220,
220,
900,
62,
23317,
540,
62,
6259,
62,
17752,
30023,
9863,
2751,
1312,
62,
23317,
540,
62,
6259,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
651,
62,
9460,
49373,
62,
8821,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
15952,
2611,
62,
9460,
2301,
729,
803,
11,
198,
220,
220,
220,
220,
220,
900,
62,
9460,
49373,
62,
8821,
30023,
9863,
2751,
1312,
62,
9460,
49373,
62,
8821,
41876,
4526,
37,
5390,
1976,
565,
62,
15952,
2611,
62,
9460,
2301,
729,
803,
11,
198,
220,
220,
220,
220,
220,
900,
62,
9460,
49373,
62,
8821,
62,
17752,
30023,
9863,
2751,
1312,
62,
9460,
49373,
62,
8821,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
651,
62,
33645,
876,
62,
2256,
1370,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
900,
62,
33645,
876,
62,
2256,
1370,
30023,
9863,
2751,
1312,
62,
33645,
876,
62,
2256,
1370,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
651,
62,
43085,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
900,
62,
43085,
30023,
9863,
2751,
1312,
62,
43085,
41876,
4731,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
366,
9,
6329,
24443,
12608,
286,
428,
290,
477,
2208,
6097,
355,
19449,
11420,
9,
198,
220,
220,
220,
220,
220,
24443,
62,
1078,
7657,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42715,
12,
26947,
25,
198,
220,
220,
220,
220,
220,
2099,
41876,
4731,
26173,
8924,
705,
16719,
425,
12468,
4458,
628,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
366,
0,
383,
2426,
2300,
286,
262,
2695,
13,
198,
220,
220,
220,
220,
220,
546,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
15952,
2611,
62,
1197,
11,
198,
220,
220,
220,
220,
220,
366,
0,
1423,
16856,
326,
262,
8271,
318,
11670,
351,
262,
20717,
28969,
7824,
357,
13908,
27054,
5356,
22719,
8341,
1744,
3815,
737,
198,
220,
220,
220,
220,
220,
28969,
62,
15042,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
366,
0,
11440,
6945,
5128,
5050,
326,
389,
6751,
284,
3938,
1630,
262,
3417,
8271,
357,
13908,
27054,
5356,
22719,
8341,
1744,
3815,
737,
198,
220,
220,
220,
220,
220,
28969,
62,
13716,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
366,
0,
14041,
3033,
286,
262,
8271,
11,
884,
355
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_af_show_rap_bo_nodes DEFINITION
PUBLIC
INHERITING FROM cl_xco_cp_adt_simple_classrun CREATE PUBLIC.
PUBLIC SECTION.
PROTECTED SECTION.
METHODS: main REDEFINITION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_af_show_rap_bo_nodes IMPLEMENTATION.
METHOD main.
DATA(travel_bo_entities) = new zcl_af_get_nodes_from_rap_bo( 'ZI_SALESORDERES5' ).
LOOP AT travel_bo_entities->get_entities( ) INTO DATA(entity).
out->write( entity->name ).
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
1878,
62,
12860,
62,
2416,
62,
2127,
62,
77,
4147,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
537,
62,
87,
1073,
62,
13155,
62,
324,
83,
62,
36439,
62,
4871,
5143,
29244,
6158,
44731,
13,
198,
220,
44731,
44513,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
1388,
23848,
36,
20032,
17941,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
1878,
62,
12860,
62,
2416,
62,
2127,
62,
77,
4147,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
1388,
13,
198,
220,
220,
220,
42865,
7,
35927,
62,
2127,
62,
298,
871,
8,
796,
649,
1976,
565,
62,
1878,
62,
1136,
62,
77,
4147,
62,
6738,
62,
2416,
62,
2127,
7,
705,
48926,
62,
50,
1847,
1546,
12532,
1137,
1546,
20,
6,
6739,
198,
220,
220,
220,
17579,
3185,
5161,
3067,
62,
2127,
62,
298,
871,
3784,
1136,
62,
298,
871,
7,
220,
1267,
39319,
42865,
7,
26858,
737,
198,
220,
220,
220,
220,
220,
503,
3784,
13564,
7,
9312,
3784,
3672,
6739,
198,
220,
220,
220,
23578,
21982,
3185,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 ltct_bapgit_i18n_lxe definition
for testing
duration short
risk level harmless.
private section.
methods get_lang_iso4 for testing.
methods merge_portion_one for testing.
methods merge_portion_many for testing.
endclass.
class zcl_abapgit_i18n_lxe definition local friends ltct_bapgit_i18n_lxe.
class ltct_bapgit_i18n_lxe implementation.
method get_lang_iso4.
cl_abap_unit_assert=>assert_equals(
act = zcl_abapgit_i18n_lxe=>get_lang_iso4( 'DE' )
exp = 'deDE' ).
endmethod.
method merge_portion_one.
data lo_key_strategy type ref to zcl_abapgit_i18n_key_strategy.
data lo_cut type ref to zcl_abapgit_i18n_lxe.
data lt_langs type zif_abapgit_i18n=>tt_langid.
data lt_tobjs_act type zif_abapgit_i18n=>tt_text_object.
data lt_tobjs_exp type zif_abapgit_i18n=>tt_text_object.
data lt_trans type lxe_tt_pcx_s1.
field-symbols <ls_lxe> like line of lt_trans.
field-symbols <ls_tobj> like line of lt_tobjs_act.
field-symbols <ls_lang> like line of <ls_tobj>-texts.
append 'DE' to lt_langs.
" Never mind params, not testing strategies here
lo_key_strategy = zcl_abapgit_i18n_key_strategy=>create( iv_textkey_config = '32' ).
create object lo_cut
exporting
iv_orig_lang = 'EN'
it_alt_langs = lt_langs.
append initial line to lt_trans assigning <ls_lxe>.
<ls_lxe>-s_text = 'ABC'.
<ls_lxe>-t_text = 'ABC'.
<ls_lxe>-textkey = '1'.
append initial line to lt_trans assigning <ls_lxe>.
<ls_lxe>-s_text = 'EFG'.
<ls_lxe>-t_text = 'EFG'.
<ls_lxe>-textkey = '2'.
append initial line to lt_tobjs_exp assigning <ls_tobj>.
<ls_tobj>-sub_type = 'DYNP'.
<ls_tobj>-sub_name = '2001'.
<ls_tobj>-dev_type = 'SRH4'.
append initial line to <ls_tobj>-texts assigning <ls_lang>.
<ls_lang>-lang = 'EN'.
<ls_lang>-text = 'ABC'.
append initial line to lt_tobjs_exp assigning <ls_tobj>.
<ls_tobj>-sub_type = 'DYNP'.
<ls_tobj>-sub_name = '2001'.
<ls_tobj>-dev_type = 'SRH4'.
append initial line to <ls_tobj>-texts assigning <ls_lang>.
<ls_lang>-lang = 'EN'.
<ls_lang>-text = 'EFG'.
lo_cut->merge_portion(
exporting
iv_sub_type = 'DYNP'
iv_sub_name = '2001'
iv_dev_type = 'SRH4'
iv_iso4 = 'enUS'
it_portion = lt_trans
io_key_strategy = lo_key_strategy
changing
ct_tobjs = lt_tobjs_act ).
loop at lt_tobjs_act assigning <ls_tobj>.
clear <ls_tobj>-id. " Ignore keys for this test
endloop.
cl_abap_unit_assert=>assert_equals( act = lt_tobjs_act exp = lt_tobjs_exp ).
endmethod.
method merge_portion_many.
data lo_key_strategy type ref to zcl_abapgit_i18n_key_strategy.
data lo_cut type ref to zcl_abapgit_i18n_lxe.
data lt_langs type zif_abapgit_i18n=>tt_langid.
data lt_tobjs_act type zif_abapgit_i18n=>tt_text_object.
data lt_tobjs_exp type zif_abapgit_i18n=>tt_text_object.
data lt_trans type lxe_tt_pcx_s1.
field-symbols <ls_lxe> like line of lt_trans.
field-symbols <ls_tobj> like line of lt_tobjs_act.
field-symbols <ls_lang> like line of <ls_tobj>-texts.
append 'DE' to lt_langs.
" Never mind params, not testing strategies here
lo_key_strategy = zcl_abapgit_i18n_key_strategy=>create( iv_textkey_config = '32' ).
create object lo_cut
exporting
iv_orig_lang = 'EN'
it_alt_langs = lt_langs.
" Expected
append initial line to lt_tobjs_exp assigning <ls_tobj>.
<ls_tobj>-sub_type = 'DYNP'.
<ls_tobj>-sub_name = '2001'.
<ls_tobj>-dev_type = 'SRH4'.
append initial line to <ls_tobj>-texts assigning <ls_lang>.
<ls_lang>-lang = 'EN'.
<ls_lang>-text = 'ABC'.
append initial line to <ls_tobj>-texts assigning <ls_lang>.
<ls_lang>-lang = 'DE'.
<ls_lang>-text = 'ABC2'.
append initial line to lt_tobjs_exp assigning <ls_tobj>.
<ls_tobj>-sub_type = 'DYNP'.
<ls_tobj>-sub_name = '2001'.
<ls_tobj>-dev_type = 'SRH4'.
append initial line to <ls_tobj>-texts assigning <ls_lang>.
<ls_lang>-lang = 'EN'.
<ls_lang>-text = 'EFG'.
append initial line to <ls_tobj>-texts assigning <ls_lang>.
<ls_lang>-lang = 'DE'.
<ls_lang>-text = 'EFG2'.
" LXE postion 1
append initial line to lt_trans assigning <ls_lxe>.
<ls_lxe>-s_text = 'ABC'.
<ls_lxe>-t_text = 'ABC'.
<ls_lxe>-textkey = '1'.
append initial line to lt_trans assigning <ls_lxe>.
<ls_lxe>-s_text = 'EFG'.
<ls_lxe>-t_text = 'EFG'.
<ls_lxe>-textkey = '2'.
lo_cut->merge_portion(
exporting
iv_sub_type = 'DYNP'
iv_sub_name = '2001'
iv_dev_type = 'SRH4'
iv_iso4 = 'enUS'
it_portion = lt_trans
io_key_strategy = lo_key_strategy
changing
ct_tobjs = lt_tobjs_act ).
" LXE postion 2
clear lt_trans.
append initial line to lt_trans assigning <ls_lxe>.
<ls_lxe>-s_text = 'ABC'.
<ls_lxe>-t_text = 'ABC2'.
<ls_lxe>-textkey = '1'.
append initial line to lt_trans assigning <ls_lxe>.
<ls_lxe>-s_text = 'EFG'.
<ls_lxe>-t_text = 'EFG2'.
<ls_lxe>-textkey = '2'.
lo_cut->merge_portion(
exporting
iv_sub_type = 'DYNP'
iv_sub_name = '2001'
iv_dev_type = 'SRH4'
iv_iso4 = 'deDE'
it_portion = lt_trans
io_key_strategy = lo_key_strategy
changing
ct_tobjs = lt_tobjs_act ).
loop at lt_tobjs_act assigning <ls_tobj>.
clear <ls_tobj>-id. " Ignore keys for this test
endloop.
cl_abap_unit_assert=>assert_equals( act = lt_tobjs_act exp = lt_tobjs_exp ).
endmethod.
endclass.
| [
4871,
300,
83,
310,
62,
65,
499,
18300,
62,
72,
1507,
77,
62,
75,
27705,
6770,
198,
220,
329,
4856,
198,
220,
9478,
1790,
198,
220,
2526,
1241,
23585,
13,
198,
220,
2839,
2665,
13,
198,
220,
220,
220,
5050,
651,
62,
17204,
62,
26786,
19,
329,
4856,
13,
198,
220,
220,
220,
5050,
20121,
62,
16864,
62,
505,
329,
4856,
13,
198,
220,
220,
220,
5050,
20121,
62,
16864,
62,
21834,
329,
4856,
13,
198,
437,
4871,
13,
198,
198,
4871,
1976,
565,
62,
397,
499,
18300,
62,
72,
1507,
77,
62,
75,
27705,
6770,
1957,
2460,
300,
83,
310,
62,
65,
499,
18300,
62,
72,
1507,
77,
62,
75,
27705,
13,
198,
198,
4871,
300,
83,
310,
62,
65,
499,
18300,
62,
72,
1507,
77,
62,
75,
27705,
7822,
13,
628,
220,
2446,
651,
62,
17204,
62,
26786,
19,
13,
198,
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,
1976,
565,
62,
397,
499,
18300,
62,
72,
1507,
77,
62,
75,
27705,
14804,
1136,
62,
17204,
62,
26786,
19,
7,
705,
7206,
6,
1267,
198,
220,
220,
220,
220,
220,
1033,
796,
705,
2934,
7206,
6,
6739,
198,
220,
886,
24396,
13,
628,
220,
2446,
20121,
62,
16864,
62,
505,
13,
628,
220,
220,
220,
1366,
2376,
62,
2539,
62,
2536,
4338,
2099,
1006,
284,
1976,
565,
62,
397,
499,
18300,
62,
72,
1507,
77,
62,
2539,
62,
2536,
4338,
13,
198,
220,
220,
220,
1366,
2376,
62,
8968,
220,
220,
2099,
1006,
284,
1976,
565,
62,
397,
499,
18300,
62,
72,
1507,
77,
62,
75,
27705,
13,
198,
220,
220,
220,
1366,
300,
83,
62,
17204,
82,
2099,
1976,
361,
62,
397,
499,
18300,
62,
72,
1507,
77,
14804,
926,
62,
17204,
312,
13,
198,
220,
220,
220,
1366,
300,
83,
62,
83,
672,
8457,
62,
529,
2099,
1976,
361,
62,
397,
499,
18300,
62,
72,
1507,
77,
14804,
926,
62,
5239,
62,
15252,
13,
198,
220,
220,
220,
1366,
300,
83,
62,
83,
672,
8457,
62,
11201,
2099,
1976,
361,
62,
397,
499,
18300,
62,
72,
1507,
77,
14804,
926,
62,
5239,
62,
15252,
13,
198,
220,
220,
220,
1366,
300,
83,
62,
7645,
2099,
300,
27705,
62,
926,
62,
14751,
87,
62,
82,
16,
13,
628,
220,
220,
220,
2214,
12,
1837,
2022,
10220,
1279,
7278,
62,
75,
27705,
29,
588,
1627,
286,
300,
83,
62,
7645,
13,
198,
220,
220,
220,
2214,
12,
1837,
2022,
10220,
1279,
7278,
62,
83,
26801,
29,
588,
1627,
286,
300,
83,
62,
83,
672,
8457,
62,
529,
13,
198,
220,
220,
220,
2214,
12,
1837,
2022,
10220,
1279,
7278,
62,
17204,
29,
588,
1627,
286,
1279,
7278,
62,
83,
26801,
29,
12,
5239,
82,
13,
628,
220,
220,
220,
24443,
705,
7206,
6,
284,
300,
83,
62,
17204,
82,
13,
628,
220,
220,
220,
366,
7236,
2000,
42287,
11,
407,
4856,
10064,
994,
198,
220,
220,
220,
2376,
62,
2539,
62,
2536,
4338,
796,
1976,
565,
62,
397,
499,
18300,
62,
72,
1507,
77,
62,
2539,
62,
2536,
4338,
14804,
17953,
7,
21628,
62,
5239,
2539,
62,
11250,
796,
705,
2624,
6,
6739,
628,
220,
220,
220,
2251,
2134,
2376,
62,
8968,
198,
220,
220,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
11612,
62,
17204,
796,
705,
1677,
6,
198,
220,
220,
220,
220,
220,
220,
220,
340,
62,
2501,
62,
17204,
82,
796,
300,
83,
62,
17204,
82,
13,
628,
220,
220,
220,
24443,
4238,
1627,
284,
300,
83,
62,
7645,
38875,
1279,
7278,
62,
75,
27705,
28401,
198,
220,
220,
220,
1279,
7278,
62,
75,
27705,
29,
12,
82,
62,
5239,
796,
705,
24694,
4458,
198,
220,
220,
220,
1279,
7278,
62,
75,
27705,
29,
12,
83,
62,
5239,
796,
705,
24694,
4458,
198,
220,
220,
220,
1279,
7278,
62,
75,
27705,
29,
12,
5239,
2539,
796,
705,
16,
4458,
628,
220,
220,
220,
24443,
4238,
1627,
284,
300,
83,
62,
7645,
38875,
1279,
7278,
62,
75,
27705,
28401,
198,
220,
220,
220,
1279,
7278,
62,
75,
27705,
29,
12,
82,
62,
5239,
796,
705,
25425,
38,
4458,
198,
220,
220,
220,
1279,
7278,
62,
75,
27705,
29,
12,
83,
62,
5239,
796,
705,
25425,
38,
4458,
198,
220,
220,
220,
1279,
7278,
62,
75,
27705,
29,
12,
5239,
2539,
796,
705,
17,
4458,
628,
220,
220,
220,
24443,
4238,
1627,
284,
300,
83,
62,
83,
672,
8457,
62,
11201,
38875,
1279,
7278,
62,
83,
26801,
28401,
198,
220,
220,
220,
1279,
7278,
62,
83,
26801,
29,
12,
7266,
62,
4906,
796,
705,
35,
56,
22182,
4458,
198,
220,
220,
220,
1279,
7278,
62,
83,
26801,
29,
12,
7266,
62,
3672,
796,
705,
14585,
4458,
198,
220,
220,
220,
1279,
7278,
62,
83,
26801,
29,
12,
7959,
62,
4906,
796,
705,
12562,
39,
19,
4458,
198,
220,
220,
220,
24443,
4238,
1627,
284,
1279,
7278,
62,
83,
26801,
29,
12,
5239,
82,
38875,
1279,
7278,
62,
17204,
28401,
198,
220,
220,
220,
1279,
7278,
62,
17204,
29,
12,
17204,
796,
705,
1677,
4458,
198,
220,
220,
220,
1279,
7278,
62,
17204,
29,
12,
5239,
796,
705,
24694,
4458,
628,
220,
220,
220,
24443,
4238,
1627,
284,
300,
83,
62,
83,
672,
8457,
62,
11201,
38875,
1279,
7278,
62,
83,
26801,
28401,
198,
220,
220,
220,
1279,
7278,
62,
83,
26801,
29,
12,
7266,
62,
4906,
796,
705,
35,
56,
22182,
4458,
198,
220,
220,
220,
1279,
7278,
62,
83,
26801,
29,
12,
7266,
62,
3672,
796,
705,
14585,
4458,
198,
220,
220,
220,
1279,
7278,
62,
83,
26801,
29,
12,
7959,
62,
4906,
796,
705,
12562,
39,
19,
4458,
198,
220,
220,
220,
24443,
4238,
1627,
284,
1279,
7278,
62,
83,
26801,
29,
12,
5239,
82,
38875,
1279,
7278,
62,
17204,
28401,
198,
220,
220,
220,
1279,
7278,
62,
17204,
29,
12,
17204,
796,
705,
1677,
4458,
198,
220,
220,
220,
1279,
7278,
62,
17204,
29,
12,
5239,
796,
705,
25425,
38,
4458,
628,
220,
220,
220,
2376,
62,
8968,
3784,
647,
469,
62,
16864,
7,
198,
220,
220,
220,
220,
220,
39133,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
class /OOP/CL_HTTP_MIME_TYPES definition
public
inheriting from /OOP/CL_OBJECT
final
create public .
public section.
*"* public components of class /OOP/CL_HTTP_MIME_TYPES
*"* do not include other source files here!!!
constants APPLICATION_JSON type STRING value 'application/json'. "#EC NOTEXT
constants APPLICATION_OCTETSTREAM type STRING value 'application/octet-stream'. "#EC NOTEXT
constants APPLICATION_PDF type STRING value 'application/pdf'. "#EC NOTEXT
constants APPLICATION_RSS type STRING value 'application/rss+xml'. "#EC NOTEXT
constants APPLICATION_XML type STRING value 'application/xml'. "#EC NOTEXT
constants APPLICATION_X_WWW_FORM_URLENC type STRING value 'application/x-www-form-urlencoded'. "#EC NOTEXT
constants IMAGE_GIF type STRING value 'image/gif'. "#EC NOTEXT
constants IMAGE_JPEG type STRING value 'image/jpeg'. "#EC NOTEXT
constants IMAGE_PNG type STRING value 'image/png'. "#EC NOTEXT
constants TEXT_CSS type STRING value 'text/css'. "#EC NOTEXT
constants TEXT_CSV type STRING value 'text/csv'. "#EC NOTEXT
constants TEXT_HTML type STRING value 'text/html'. "#EC NOTEXT
constants TEXT_PLAIN type STRING value 'text/plain'. "#EC NOTEXT
constants TEXT_XML type STRING value 'text/xml'. "#EC NOTEXT
protected section.
*"* protected components of class /OOP/CL_HTTP_MIME_TYPES
*"* do not include other source files here!!!
private section.
*"* private components of class /OOP/CL_HTTP_MIME_TYPES
*"* do not include other source files here!!!
ENDCLASS.
CLASS /OOP/CL_HTTP_MIME_TYPES IMPLEMENTATION.
ENDCLASS.
| [
4871,
1220,
46,
3185,
14,
5097,
62,
40717,
62,
44,
12789,
62,
9936,
47,
1546,
6770,
201,
198,
220,
1171,
201,
198,
220,
10639,
1780,
422,
1220,
46,
3185,
14,
5097,
62,
9864,
23680,
201,
198,
220,
2457,
201,
198,
220,
2251,
1171,
764,
201,
198,
201,
198,
11377,
2665,
13,
201,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1220,
46,
3185,
14,
5097,
62,
40717,
62,
44,
12789,
62,
9936,
47,
1546,
201,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
201,
198,
201,
198,
220,
38491,
39421,
6234,
62,
40386,
2099,
19269,
2751,
1988,
705,
31438,
14,
17752,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
39421,
6234,
62,
46,
4177,
2767,
2257,
32235,
2099,
19269,
2751,
1988,
705,
31438,
14,
38441,
316,
12,
5532,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
39421,
6234,
62,
20456,
2099,
19269,
2751,
1988,
705,
31438,
14,
12315,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
39421,
6234,
62,
49,
5432,
2099,
19269,
2751,
1988,
705,
31438,
14,
42216,
10,
19875,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
39421,
6234,
62,
55,
5805,
2099,
19269,
2751,
1988,
705,
31438,
14,
19875,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
39421,
6234,
62,
55,
62,
17947,
54,
62,
21389,
62,
21886,
24181,
2099,
19269,
2751,
1988,
705,
31438,
14,
87,
12,
2503,
12,
687,
12,
6371,
12685,
9043,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
8959,
11879,
62,
38,
5064,
2099,
19269,
2751,
1988,
705,
9060,
14,
27908,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
8959,
11879,
62,
12889,
7156,
2099,
19269,
2751,
1988,
705,
9060,
14,
73,
22071,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
8959,
11879,
62,
47,
10503,
2099,
19269,
2751,
1988,
705,
9060,
14,
11134,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
40383,
62,
49155,
2099,
19269,
2751,
1988,
705,
5239,
14,
25471,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
40383,
62,
7902,
53,
2099,
19269,
2751,
1988,
705,
5239,
14,
40664,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
40383,
62,
28656,
2099,
19269,
2751,
1988,
705,
5239,
14,
6494,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
40383,
62,
6489,
29833,
2099,
19269,
2751,
1988,
705,
5239,
14,
25638,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
40383,
62,
55,
5805,
2099,
19269,
2751,
1988,
705,
5239,
14,
19875,
4458,
25113,
2943,
5626,
13918,
201,
198,
24326,
2665,
13,
201,
198,
9,
1,
9,
6861,
6805,
286,
1398,
1220,
46,
3185,
14,
5097,
62,
40717,
62,
44,
12789,
62,
9936,
47,
1546,
201,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
201,
198,
19734,
2665,
13,
201,
198,
9,
1,
9,
2839,
6805,
286,
1398,
1220,
46,
3185,
14,
5097,
62,
40717,
62,
44,
12789,
62,
9936,
47,
1546,
201,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
201,
198,
10619,
31631,
13,
201,
198,
201,
198,
201,
198,
201,
198,
31631,
1220,
46,
3185,
14,
5097,
62,
40717,
62,
44,
12789,
62,
9936,
47,
1546,
30023,
2538,
10979,
6234,
13,
201,
198,
10619,
31631,
13,
201,
198
] | [
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
] |
CLASS zcl_sci_longdoc_check_category DEFINITION INHERITING FROM cl_ci_category_root PUBLIC CREATE PUBLIC FINAL.
PUBLIC SECTION.
METHODS:
constructor.
PRIVATE SECTION.
CONSTANTS:
c_category TYPE string VALUE 'CL_CI_CATEGORY_TOP',
c_position TYPE synum03 VALUE '999',
c_description TYPE string VALUE 'Custom checks: long docs presence (objects and interfaces)' ##NO_TEXT.
ENDCLASS.
CLASS zcl_sci_longdoc_check_category IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
description = c_description.
category = c_category.
position = c_position.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
36216,
62,
6511,
15390,
62,
9122,
62,
22872,
5550,
20032,
17941,
3268,
16879,
2043,
2751,
16034,
537,
62,
979,
62,
22872,
62,
15763,
44731,
29244,
6158,
44731,
25261,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
269,
62,
22872,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
5097,
62,
25690,
62,
34,
6158,
38,
15513,
62,
35222,
3256,
198,
220,
220,
220,
220,
220,
269,
62,
9150,
220,
220,
220,
41876,
6171,
388,
3070,
26173,
8924,
705,
17032,
3256,
198,
220,
220,
220,
220,
220,
269,
62,
11213,
41876,
4731,
26173,
8924,
705,
15022,
8794,
25,
890,
34165,
4931,
357,
48205,
290,
20314,
33047,
22492,
15285,
62,
32541,
13,
198,
10619,
31631,
13,
198,
198,
31631,
1976,
565,
62,
36216,
62,
6511,
15390,
62,
9122,
62,
22872,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
6739,
198,
220,
220,
220,
6764,
796,
269,
62,
11213,
13,
198,
220,
220,
220,
6536,
796,
269,
62,
22872,
13,
198,
220,
220,
220,
2292,
796,
269,
62,
9150,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
"! Bot
INTERFACE zif_cilib_bot PUBLIC.
TYPES:
gty_event TYPE c LENGTH 1,
BEGIN OF gty_transport_info,
transport TYPE trkorr,
system TYPE syst_sysid,
event TYPE gty_event,
return_code TYPE trretcode,
END OF gty_transport_info,
gty_transport_info_tab TYPE STANDARD TABLE OF gty_transport_info WITH DEFAULT KEY.
CONSTANTS:
BEGIN OF gc_events,
released TYPE gty_event VALUE 'R',
imported TYPE gty_event VALUE 'I',
END OF gc_events.
METHODS:
add_info_to_pull_request IMPORTING ii_host TYPE REF TO zif_cilib_host
iv_repo TYPE zcilib_host_repo
iv_branch TYPE string
it_new_info TYPE gty_transport_info_tab
RETURNING VALUE(rv_success) TYPE abap_bool
RAISING zcx_cilib_illegal_argument,
add_info_to_wiki_page IMPORTING ii_host TYPE REF TO zif_cilib_host
iv_repo TYPE zcilib_host_repo
io_repo_config TYPE REF TO zcl_cilib_host_repo_config
it_new_info TYPE gty_transport_info_tab
RETURNING VALUE(rv_success) TYPE abap_bool
RAISING zcx_cilib_illegal_argument,
reorg_cts_comments IMPORTING ii_host TYPE REF TO zif_cilib_host
iv_repo TYPE zcilib_host_repo
iv_branch TYPE string
RAISING zcx_cilib_http_comm_error
zcx_cilib_illegal_argument
zcx_cilib_not_found.
ENDINTERFACE.
| [
40484,
18579,
198,
41358,
49836,
1976,
361,
62,
2856,
571,
62,
13645,
44731,
13,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
308,
774,
62,
15596,
41876,
269,
406,
49494,
352,
11,
198,
220,
220,
220,
347,
43312,
3963,
308,
774,
62,
7645,
634,
62,
10951,
11,
198,
220,
220,
220,
220,
220,
4839,
220,
220,
41876,
491,
74,
38890,
11,
198,
220,
220,
220,
220,
220,
1080,
220,
220,
220,
220,
220,
41876,
827,
301,
62,
17597,
312,
11,
198,
220,
220,
220,
220,
220,
1785,
220,
220,
220,
220,
220,
220,
41876,
308,
774,
62,
15596,
11,
198,
220,
220,
220,
220,
220,
1441,
62,
8189,
41876,
491,
1186,
8189,
11,
198,
220,
220,
220,
23578,
3963,
308,
774,
62,
7645,
634,
62,
10951,
11,
198,
220,
220,
220,
308,
774,
62,
7645,
634,
62,
10951,
62,
8658,
41876,
49053,
9795,
43679,
3963,
308,
774,
62,
7645,
634,
62,
10951,
13315,
5550,
38865,
35374,
13,
198,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
347,
43312,
3963,
308,
66,
62,
31534,
11,
198,
220,
220,
220,
220,
220,
2716,
41876,
308,
774,
62,
15596,
26173,
8924,
705,
49,
3256,
198,
220,
220,
220,
220,
220,
17392,
41876,
308,
774,
62,
15596,
26173,
8924,
705,
40,
3256,
198,
220,
220,
220,
23578,
3963,
308,
66,
62,
31534,
13,
198,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
751,
62,
10951,
62,
1462,
62,
31216,
62,
25927,
30023,
9863,
2751,
21065,
62,
4774,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
2856,
571,
62,
4774,
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,
21628,
62,
260,
7501,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
2856,
571,
62,
4774,
62,
260,
7501,
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,
21628,
62,
1671,
3702,
220,
220,
220,
220,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
3605,
62,
10951,
220,
220,
220,
220,
220,
220,
41876,
308,
774,
62,
7645,
634,
62,
10951,
62,
8658,
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,
81,
85,
62,
13138,
8,
41876,
450,
499,
62,
30388,
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,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
2856,
571,
62,
47749,
62,
49140,
11,
198,
220,
220,
220,
751,
62,
10951,
62,
1462,
62,
15466,
62,
7700,
30023,
9863,
2751,
21065,
62,
4774,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
2856,
571,
62,
4774,
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,
21628,
62,
260,
7501,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
2856,
571,
62,
4774,
62,
260,
7501,
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,
33245,
62,
260,
7501,
62,
11250,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
2856,
571,
62,
4774,
62,
260,
7501,
62,
11250,
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,
340,
62,
3605,
62,
10951,
220,
220,
220,
220,
220,
220,
41876,
308,
774,
62,
7645,
634,
62,
10951,
62,
8658,
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,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
13138,
8,
41876,
450,
499,
62,
30388,
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,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
2856,
571,
62,
47749,
62,
49140,
11,
198,
220,
220,
220,
302,
2398,
62,
310,
82,
62,
15944,
30023,
9863,
2751,
21065,
62,
4774,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
2856,
571,
62,
4774,
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,
21628,
62,
260,
7501,
220,
220,
41876,
1976,
2856,
571,
62,
4774,
62,
260,
7501,
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,
21628,
62,
1671,
3702,
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,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,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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
] |
CLASS ltcl_class DEFINITION FINAL FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
DATA: model_builder TYPE REF TO z2mse_extr3_model_builder,
element_manager TYPE REF TO z2mse_extr3_element_manager,
f_cut TYPE REF TO z2mse_extr3_web_dynpro_comp.
METHODS:
setup,
simple FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_class IMPLEMENTATION.
METHOD setup.
model_builder = NEW #( ).
model_builder->initial_selection_started( ).
element_manager = NEW #( i_model_builder = model_builder
i_exclude_found_sap_intf = abap_true ).
model_builder->initialize( i_element_manager = element_manager ).
f_cut = z2mse_extr3_web_dynpro_comp=>get_instance( element_manager ).
ENDMETHOD.
METHOD simple.
DATA r_result TYPE REF TO z2mse_extr3_elements.
DATA: class_name_act TYPE seoclsname,
class_name_exp TYPE seoclsname,
is_found TYPE abap_bool,
new_element_id TYPE i.
TEST-INJECTION wdy_component.
found_wdy_component_name = 'WDY_COMP_A'.
END-TEST-INJECTION.
TEST-INJECTION wdy_controller_2.
class_components = VALUE #( ( component_name = 'WDY_COMP_A' controller_name = 'WDY_CONTR_1' ) ).
END-TEST-INJECTION.
TEST-INJECTION wdy_controller.
found_component_name = 'WDY_COMP_A'.
found_controller_name = 'WDY_CONTR_1'.
END-TEST-INJECTION.
f_cut->add( EXPORTING wdy_component_name = 'WDY_COMP_A'
IMPORTING is_added = is_found
new_element_id = new_element_id ).
cl_abap_unit_assert=>assert_equals( msg = 'Web Dynpro Component has to be found' exp = abap_true act = is_found ).
cl_abap_unit_assert=>assert_equals( msg = 'Web Dynpro Component has to have ID 1' exp = 1 act = new_element_id ).
" Add an existing class
f_cut->add( EXPORTING wdy_component_name = 'WDY_COMP_A'
IMPORTING is_added = is_found
new_element_id = new_element_id ).
cl_abap_unit_assert=>assert_equals( msg = 'Web Dynpro Component is to be found' exp = abap_true act = is_found ).
cl_abap_unit_assert=>assert_equals( msg = 'Web Dynpro Component has to have ID 1' exp = 1 act = new_element_id ).
f_cut->wdy_component_name( EXPORTING element_id = 1
IMPORTING wdy_component_name = class_name_act ).
class_name_exp = |WDY_COMP_A|.
cl_abap_unit_assert=>assert_equals( msg = 'Web Dynpro Component has to be stored internally' exp = class_name_exp act = class_name_act ).
r_result = element_manager->get_element( i_element_id = 1 ).
cl_abap_unit_assert=>assert_equals( msg = 'Expect a reference to an element of type web dynpro component'
exp = z2mse_extr3_elements=>web_dynpro_comps_type
act = r_result->type ).
" Now add parent package to check correct building of FAMIX element
DATA package TYPE REF TO z2mse_extr3_packages_mock.
DATA parent_package TYPE REF TO z2mse_extr3_parent_package.
package = z2mse_extr3_packages_mock=>get_mock_instance( i_element_manager = element_manager ).
package->add( EXPORTING package = |PACKAGE1|
IMPORTING new_element_id = new_element_id ).
parent_package = z2mse_extr3_parent_package=>get_instance( i_element_manager = element_manager ).
parent_package->add( EXPORTING element_id = 1
parent_element_id = new_element_id ).
" Test model
DATA: mse_model_act TYPE z2mse_model=>lines_type.
mse_model_act = element_manager->make_model( ).
DATA: equalized_harmonized_mse_act TYPE z2mse_mse_harmonize=>harmonized_mse,
equalized_harmonized_mse_exp TYPE z2mse_mse_harmonize=>harmonized_mse.
equalized_harmonized_mse_act = z2mse_mse_harmonize=>mse_2_harmonized( mse = mse_model_act ).
equalized_harmonized_mse_exp = VALUE #( ( |FAMIX.CustomSourceLanguage SAP| )
( |FAMIX.Class WDY_COMP_A modifiers ABAPWebDynproComponent| )
( |FAMIX.Class WDY_COMP_A parentPackage PACKAGE1| )
( |FAMIX.Method WDY_COMP_A>>WDY_CONTR_1 signature WDY_CONTR_1| )
( |FAMIX.Package PACKAGE1| )
).
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 = 'Expect mse with correct package' ).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
4871,
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,
25,
2746,
62,
38272,
220,
220,
41876,
4526,
37,
5390,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
19849,
62,
38272,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5002,
62,
37153,
41876,
4526,
37,
5390,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
30854,
62,
37153,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
62,
8968,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
12384,
62,
67,
2047,
1676,
62,
5589,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
2829,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
10619,
31631,
13,
628,
198,
31631,
300,
83,
565,
62,
4871,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
2746,
62,
38272,
796,
12682,
1303,
7,
6739,
198,
220,
220,
220,
2746,
62,
38272,
3784,
36733,
62,
49283,
62,
46981,
7,
6739,
198,
220,
220,
220,
5002,
62,
37153,
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,
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,
6739,
198,
220,
220,
220,
2746,
62,
38272,
3784,
36733,
1096,
7,
1312,
62,
30854,
62,
37153,
796,
5002,
62,
37153,
6739,
198,
220,
220,
220,
277,
62,
8968,
796,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
12384,
62,
67,
2047,
1676,
62,
5589,
14804,
1136,
62,
39098,
7,
5002,
62,
37153,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
2829,
13,
628,
220,
220,
220,
42865,
374,
62,
20274,
41876,
4526,
37,
5390,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
68,
3639,
13,
628,
220,
220,
220,
42865,
25,
1398,
62,
3672,
62,
529,
41876,
384,
420,
7278,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1398,
62,
3672,
62,
11201,
41876,
384,
420,
7278,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
9275,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
30854,
62,
312,
41876,
1312,
13,
628,
220,
220,
220,
43001,
12,
1268,
23680,
2849,
266,
9892,
62,
42895,
13,
198,
220,
220,
220,
220,
220,
1043,
62,
86,
9892,
62,
42895,
62,
3672,
796,
705,
22332,
56,
62,
9858,
47,
62,
32,
4458,
198,
220,
220,
220,
23578,
12,
51,
6465,
12,
1268,
23680,
2849,
13,
628,
220,
220,
220,
43001,
12,
1268,
23680,
2849,
266,
9892,
62,
36500,
62,
17,
13,
628,
220,
220,
220,
220,
220,
1398,
62,
5589,
3906,
796,
26173,
8924,
1303,
7,
357,
7515,
62,
3672,
796,
705,
22332,
56,
62,
9858,
47,
62,
32,
6,
10444,
62,
3672,
796,
705,
22332,
56,
62,
10943,
5446,
62,
16,
6,
1267,
6739,
628,
220,
220,
220,
23578,
12,
51,
6465,
12,
1268,
23680,
2849,
13,
628,
220,
220,
220,
43001,
12,
1268,
23680,
2849,
266,
9892,
62,
36500,
13,
198,
220,
220,
220,
220,
220,
1043,
62,
42895,
62,
3672,
796,
705,
22332,
56,
62,
9858,
47,
62,
32,
4458,
198,
220,
220,
220,
220,
220,
1043,
62,
36500,
62,
3672,
796,
705,
22332,
56,
62,
10943,
5446,
62,
16,
4458,
198,
220,
220,
220,
23578,
12,
51,
6465,
12,
1268,
23680,
2849,
13,
628,
220,
220,
220,
277,
62,
8968,
3784,
2860,
7,
7788,
15490,
2751,
266,
9892,
62,
42895,
62,
3672,
796,
705,
22332,
56,
62,
9858,
47,
62,
32,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
318,
62,
29373,
220,
220,
220,
220,
220,
220,
796,
318,
62,
9275,
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,
649,
62,
30854,
62,
312,
796,
649,
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,
13908,
39530,
1676,
35100,
468,
284,
307,
1043,
6,
1033,
796,
450,
499,
62,
7942,
719,
796,
318,
62,
9275,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
31456,
796,
705,
13908,
39530,
1676,
35100,
468,
284,
423,
4522,
352,
6,
1033,
796,
352,
719,
796,
649,
62,
30854,
62,
312,
6739,
628,
220,
220,
220,
366,
3060,
281,
4683,
1398,
628,
220,
220,
220,
277,
62,
8968,
3784,
2860,
7,
7788,
15490,
2751,
266,
9892,
62,
42895,
62,
3672,
796,
705,
22332,
56,
62,
9858,
47,
62,
32,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
318,
62,
29373,
220,
220,
220,
220,
220,
220,
796,
318,
62,
9275,
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,
649,
62,
30854,
62,
312,
796,
649,
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,
13908,
39530,
1676,
35100,
318,
284,
307,
1043,
6,
1033,
796,
450,
499,
62,
7942,
719,
796,
318,
62,
9275,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
31456,
796,
705,
13908,
39530,
1676,
35100,
468,
284,
423,
4522,
352,
6,
1033,
796,
352,
719,
796,
649,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
REPORT zst12_alv_layout_up_download.
********************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2021 Martin Preiss (PREISS Consulting)
*
* 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.
********************************************************************************
*------------------------------------------------------------------------------*
* Tool for free usage, by Martin Preiss / PREISS CONSULTING
* Version 1.0 01/2021
*
* Tested with releases
* - ERP 6.0 ( (SAP_APPL 6.05 and SAP_APPL 6.17)
* - S/4 HANA 2020 (S4CORE 105)
* should work for other releases as well.
* Implemented without any newer ABAP features so it should work
* with older and newer releases.
*
* Download / Upload ALV Layouts
*
* - user-independent Layouts
* - user-dependent Layouts
* - Layouts can be downloaded for a report and uploaded to the same
* or to a different report in the same or in a different system
*
* # Summary
* SAP standard allows to transport user independent ALV layouts from
* one system to another.
* This reports should can help when you do not have the
* possibility to transport. It enables you to download
* or upload ALV variants for a report. It works for user-independent or user-dependent layouts.
* You can use it to:
* - copy ALV layouts from one system to another system
* The system can have different release levels.
* - copy ALV layouts from one report to another
* - backup and restore ALV layouts
*
* # Selection Screen
* - Report Name
* - Local Directory for download / upload with F4 help
* - Choice: Download or Upload
*
* # DOWNLOAD
* Popup with all existing ALV layouts for the report
* (user-independent and user-dependent)
* Displays Report, Handle, Log Group, layout, Description (in login language)
* User can select one or multiple layouts for download
* Saved in a group of files (Header data + texts, Field Cat, Sort, Filer, Layout)
* with file name REPORT_HANDLE_VARIANT_USERNAME_YYYYMMDD_SYSID_XXXX.txt
* where XXXX
* = desc for LTDXT texts (all languages)
* = desc for Field catalog
* = sort for Sort criteria (if maintained)
* = filt for Filer criteria (if maintained)
* Special character '/' in the variant or handle is replaced by '#'
* in the file name.
*
* # UPLOAD
* Popup with all ALV layouts from download files
* in the specified local directory
* Displays Report, Handle, Log Group, layout, Description,
* Download date and system (derived from file name)
* User can select one or multiple layouts for upload
* ( user-independent and user-dependent)
* After succesful upload: Popup asking user if user independent layouts
* should be transported.
* If yes: standard dialog for customizing transport as in layout admin
*
* # Important Notes
* - Upload is done to the specified target report.
* No check if source and target report are equal( enables
* copying variants from one report to another )
* - Upload of user layout does not check user existence
* - No authority check (except the check in the used SAP functions)
* - No check at upload if layout already exists. It will be overwritten
*
* # Ideas for later improvements
* Upload:
* - Confirmation popup if layout already exists and will be overwritten ?
* - Check existence of user for user layouts ?
* - Check source vs. target report with confirmation popup if not equal ?
* - Target user parameter -> Would allow to copy User layouts to another user ?
* - existence check for report
*------------------------------------------------------------------------------*
" Target Report
PARAMETERS p_repid TYPE repid OBLIGATORY.
" Local Directory for download / upload
PARAMETERS p_pathn TYPE sefs_d_path OBLIGATORY.
" Choice: Download oder Uplaod
PARAMETERS download TYPE xfeld RADIOBUTTON GROUP r1 DEFAULT 'X'.
PARAMETERS upload TYPE xfeld RADIOBUTTON GROUP r1.
" TODO later?
" flag to explicitly allow/deny upload to different target report ?
" flag to explicitly allow/deny upload to different target user
" parameter for Target User ?
*-----------------------------------------------------------------------------*
* processing logic
*-----------------------------------------------------------------------------*
CLASS alv1 DEFINITION FINAL.
PUBLIC SECTION.
" our structure for ALV variant processing
TYPES BEGIN OF t_skeys.
TYPES selxx TYPE xfeld. " result of selection dialog
INCLUDE TYPE ltdxt. " Key and description in login language
TYPES filen TYPE string. " file name with Descriptions
TYPES aedat TYPE aedat. " download date
TYPES sortf TYPE i. " sort field
TYPES sysid TYPE sysid. " source system
" all descriptions, ( WITH EMPTY KEY just b/c non-generic table type needed)
TYPES ltdxt TYPE STANDARD TABLE OF ltdxt WITH DEFAULT KEY.
TYPES up_ok TYPE xfeld. " =X after succesful upload
TYPES END OF t_skeys.
TYPES tt_skeys TYPE STANDARD TABLE OF t_skeys. "our ALV variant table
CONSTANTS:
c_invalid_char TYPE char9 VALUE '<>:"\|?*#',
c_ftype TYPE char4 VALUE '.txt' ##NO_TEXT,
c_suffix_fcat TYPE char5 VALUE '_fcat' ##NO_TEXT,
c_suffix_sort TYPE char5 VALUE '_sort' ##NO_TEXT,
c_suffix_filt TYPE char5 VALUE '_filt' ##NO_TEXT,
c_suffix_layo TYPE char5 VALUE '_layo' ##NO_TEXT,
c_suffix_desc TYPE char5 VALUE '_desc' ##NO_TEXT.
CLASS-DATA:
gt_prot TYPE STANDARD TABLE OF sprot_u. "simple msg protocol
CLASS-METHODS:
main,
download
IMPORTING iv_repid TYPE repid
iv_pathn TYPE string,
upload
IMPORTING iv_repid TYPE repid
iv_pathn TYPE string,
download_file
IMPORTING iv_pathn TYPE string
iv_fname TYPE string
CHANGING ct_table TYPE STANDARD TABLE
cv_subrc TYPE sysubrc OPTIONAL,
upload_file
IMPORTING iv_pathn TYPE string
iv_fname TYPE string
CHANGING ct_table TYPE STANDARD TABLE
cv_subrc TYPE sysubrc OPTIONAL,
f4_path
CHANGING cv_path TYPE sefs_d_path,
dynval_get
IMPORTING iv_fname TYPE dynpread-fieldname
CHANGING cv_value TYPE any,
variants_select
IMPORTING iv_repid TYPE repid
iv_downl TYPE xfeld
CHANGING ct_skeys TYPE tt_skeys,
protocol_display,
msg_add.
ENDCLASS.
*-----------------------------------------------------------------------------*
CLASS alv1 IMPLEMENTATION.
METHOD main.
IF download EQ 'X'. "download ALV layouts to local files
download( iv_repid = p_repid
iv_pathn = p_pathn ).
ENDIF.
IF upload EQ 'X'. "upload ALV layouts from local files
upload( iv_repid = p_repid
iv_pathn = p_pathn ).
ENDIF.
protocol_display( ). " popup with messages
ENDMETHOD.
METHOD download.
*-----------------------------------------------------------------------------*
* download ALV layout to local files
*
* Popup with all existing ALV layouts for the report
* (user-independent and user-dependent)
* Displays Report, Handle, Log Group, layout, Description (in login language)
* User can select one or multiple layouts for download
* Saved in a group of files (Header data + texts, Field Cat, Sort, Filer, Layout)
* with file name REPORT_HANDLE_VARIANT_USERNAME_YYYYMMDD_SYSID_XXXX.txt
* where XXXX
* = desc for LTDXT texts (all languages)
* = desc for Field catalog
* = sort for Sort criteria (if maintained)
* = filt for Filer criteria (if maintained)
* Special character '/' in the variant or handle is replaced by '#'
* in the file name.
*-----------------------------------------------------------------------------*
DATA:
ls_varkey TYPE ltdxkey,
lt_skeys TYPE tt_skeys,
lt_dbfieldcat TYPE STANDARD TABLE OF ltdxdata,
lt_dbsortinfo TYPE STANDARD TABLE OF ltdxdata,
lt_dbfilter TYPE STANDARD TABLE OF ltdxdata,
lt_dblayout TYPE STANDARD TABLE OF ltdxdata,
lt_ltdxt_all TYPE SORTED TABLE OF ltdxt
WITH UNIQUE KEY handle log_group variant username type langu,
lt_ltdxt TYPE STANDARD TABLE OF ltdxt,
ls_ltdxt TYPE ltdxt,
lv_namef TYPE string,
lv_filen TYPE string,
lv_subrc TYPE sysubrc,
lv_msgtx TYPE msgtx ##NEEDED.
FIELD-SYMBOLS:
<skeys> TYPE t_skeys.
" get layout headers -> Key Table LT_SKEYS
SELECT * FROM ltdx
INTO CORRESPONDING FIELDS OF TABLE lt_skeys
WHERE relid EQ 'LT'
AND report EQ iv_repid
AND srtf2 EQ 0.
SORT lt_skeys BY log_group handle variant username.
" read all layout descriptions for the report layouts
SELECT * FROM ltdxt INTO TABLE lt_ltdxt_all
WHERE relid EQ 'LT'
AND report EQ iv_repid.
" build itab with layout and description in login language
LOOP AT lt_skeys ASSIGNING <skeys>.
MOVE-CORRESPONDING <skeys> TO ls_ltdxt.
ls_ltdxt-langu = sy-langu.
READ TABLE lt_ltdxt_all INTO ls_ltdxt FROM ls_ltdxt.
CHECK sy-subrc EQ 0.
<skeys>-langu = ls_ltdxt-langu.
<skeys>-text = ls_ltdxt-text.
ENDLOOP.
" let user select layouts for download
variants_select( EXPORTING iv_repid = iv_repid
iv_downl = 'X'
CHANGING ct_skeys = lt_skeys ).
READ TABLE lt_skeys TRANSPORTING NO FIELDS WITH KEY selxx = 'X'.
IF sy-subrc NE 0.
RETURN. "----------------------------------------> noting selected, exit
ENDIF.
" processing starts: set path into protocol
" Path: &
MESSAGE i160(ba) WITH iv_pathn INTO lv_msgtx.
msg_add( ).
" process selected layouts
LOOP AT lt_skeys ASSIGNING <skeys> WHERE selxx = 'X'.
CLEAR: lt_dbfieldcat, lt_dbsortinfo, lt_dbfilter, lt_dblayout,
lt_ltdxt, ls_varkey.
MOVE-CORRESPONDING <skeys> TO ls_varkey.
" read ALV variant data
CALL FUNCTION 'LT_DBDATA_READ_FROM_LTDX'
EXPORTING
is_varkey = ls_varkey " AlV layout key
TABLES
t_dbfieldcat = lt_dbfieldcat " field catalog (always)
t_dbsortinfo = lt_dbsortinfo " sort criteria (optional)
t_dbfilter = lt_dbfilter " filter criteria (optional)
t_dblayout = lt_dblayout " layout settings (optional)
EXCEPTIONS
not_found = 1
wrong_relid = 2
OTHERS = 3.
IF sy-subrc <> 0. "should never be
RETURN. "----------------------------------------------> exit method
ENDIF.
" get all language dependent descriptions for the variant
LOOP AT lt_ltdxt_all INTO ls_ltdxt
WHERE handle EQ ls_varkey-handle
AND variant EQ ls_varkey-variant
AND username EQ ls_varkey-username.
APPEND ls_ltdxt TO lt_ltdxt.
ENDLOOP.
* check for reserved characters for Windows filenames
*
* < (less than)
* > (greater than)
* : (colon)
* " (double quote)
* / (forward slash) -> used for user indep. variants -> we replace it by #
* \ (backslash)
* | (vertical bar or pipe)
* ? (question mark)
* * (asterisk)
*
* and # (collides with our replacement for / )
*
* We do not download layouts where the key contains any of these characters
IF ls_varkey-handle CA c_invalid_char.
" Invalid character &1 in &2
MESSAGE e169(ccms_grmg) WITH ls_varkey-handle+sy-fdpos(1) ls_varkey-handle INTO lv_msgtx.
msg_add( ).
CONTINUE. " skip entry
ENDIF.
IF ls_varkey-variant CA c_invalid_char.
" Invalid character &1 in &2
MESSAGE e169(ccms_grmg) WITH ls_varkey-variant+sy-fdpos(1) ls_varkey-variant INTO lv_msgtx.
msg_add( ).
CONTINUE. " skip entry
ENDIF.
IF ls_varkey-username CA c_invalid_char.
" Invalid character &1 in &2
MESSAGE e169(ccms_grmg) WITH ls_varkey-username+sy-fdpos(1) ls_varkey-username INTO lv_msgtx.
msg_add( ).
CONTINUE. " skip entry
ENDIF.
" build base file name as HANDLE_VARIANT_USERNAME_YYYYMMDD_SYSID
CONCATENATE ls_varkey-report
ls_varkey-handle
ls_varkey-variant
ls_varkey-username
sy-datlo
sy-sysid
INTO lv_namef SEPARATED BY '_'.
" '/' as prefix for variants is a reserved char. in file names
" -> replace it by #
REPLACE ALL OCCURRENCES OF '/' IN lv_namef WITH '#'.
" Download ALV layout
" separate files for FieldCat, Sort, Filter, Layout and Description data
IF lt_dbfieldcat IS NOT INITIAL.
" build file name = base file name + Suffix + .txt
lv_filen = lv_namef && c_suffix_fcat && c_ftype.
download_file( EXPORTING iv_pathn = iv_pathn
iv_fname = lv_filen
CHANGING ct_table = lt_dbfieldcat
cv_subrc = lv_subrc ).
IF lv_subrc NE 0.
RETURN. "---------------------------------> exit method
ENDIF.
ENDIF.
IF lt_dbsortinfo IS NOT INITIAL.
" build file name = base file name + Suffix + .txt
lv_filen = lv_namef && c_suffix_sort && c_ftype.
download_file( EXPORTING iv_pathn = iv_pathn
iv_fname = lv_filen
CHANGING ct_table = lt_dbsortinfo
cv_subrc = lv_subrc ).
IF lv_subrc NE 0.
RETURN. "---------------------------------> exit method
ENDIF.
ENDIF.
IF lt_dbfilter IS NOT INITIAL.
" build file name = base file name + Suffix + .txt
lv_filen = lv_namef && c_suffix_filt && c_ftype.
download_file( EXPORTING iv_pathn = iv_pathn
iv_fname = lv_filen
CHANGING ct_table = lt_dbfilter
cv_subrc = lv_subrc ).
IF lv_subrc NE 0.
RETURN. "---------------------------------> exit method
ENDIF.
ENDIF.
IF lt_dblayout IS NOT INITIAL.
" build file name = base file name + Suffix + .txt
lv_filen = lv_namef && c_suffix_layo && c_ftype.
download_file( EXPORTING iv_pathn = iv_pathn
iv_fname = lv_filen
CHANGING ct_table = lt_dblayout
cv_subrc = lv_subrc ).
IF lv_subrc NE 0.
RETURN. "---------------------------------> exit method
ENDIF.
ENDIF.
IF lt_ltdxt IS NOT INITIAL.
" build file name = base file name + Suffix + .txt
lv_filen = lv_namef && c_suffix_desc && c_ftype.
download_file( EXPORTING iv_pathn = iv_pathn
iv_fname = lv_filen
CHANGING ct_table = lt_ltdxt
cv_subrc = lv_subrc ).
IF lv_subrc NE 0.
RETURN. "---------------------------------> exit method
ENDIF.
ENDIF.
ENDLOOP. "at lt_skeys
ENDMETHOD.
METHOD download_file.
*-----------------------------------------------------------------------------*
* local download for internal table
*-----------------------------------------------------------------------------*
DATA:
lv_filen TYPE string,
lv_n TYPE i,
lv_msgtx TYPE msgtx ##NEEDED.
lv_n = strlen( iv_pathn ) - 1.
" build full filename, with path
IF iv_pathn+lv_n(1) = '\'.
lv_filen = iv_pathn && iv_fname.
ELSE.
lv_filen = iv_pathn && '\' && iv_fname.
ENDIF.
cl_gui_frontend_services=>gui_download(
EXPORTING
filename = lv_filen
filetype = 'ASC'
write_field_separator = 'X'
CHANGING
data_tab = ct_table
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
not_supported_by_gui = 22
error_no_gui = 23
OTHERS = 24
).
cv_subrc = sy-subrc.
IF sy-subrc <> 0.
" 165(SPRX) Error while downloading file '&1' &2
MESSAGE e165(sprx) WITH iv_fname sy-subrc INTO lv_msgtx.
ELSE.
" Download complete (file: &1)
MESSAGE s111(sr) WITH iv_fname INTO lv_msgtx.
ENDIF.
msg_add( ).
ENDMETHOD.
METHOD upload.
*-----------------------------------------------------------------------------*
* upload ALV layout from local files
*
* Popup with all ALV layouts from download files
* in the specified local directory
* Displays Report, Handle, Log Group, layout, Description,
* Download date and system (derived from file name)
* User can select one or multiple layouts for upload
* ( user-independent and user-dependent)
* After succesful upload: Popup asking user if user independent layouts
* should be transported.
* If yes: standard dialog for customizing transport as in layout admin
*
* # Important Notes
* - Upload is done to the specified target report.
* No check if source and target report are equal( enables
* copying variants from one report to another )
* - Upload of user layout does not check user existence
* - No authority check (except the check in the used SAP functions)
* - No check at upload if layout already exists. It will be overwritten
*-----------------------------------------------------------------------------*
DATA:
lt_dbfieldcat TYPE STANDARD TABLE OF ltdxdata,
lt_dbsortinfo TYPE STANDARD TABLE OF ltdxdata,
lt_dbfilter TYPE STANDARD TABLE OF ltdxdata,
lt_dblayout TYPE STANDARD TABLE OF ltdxdata,
lt_ltdxt TYPE STANDARD TABLE OF ltdxt,
ls_ltdxt TYPE ltdxt,
lt_ltdxkey TYPE STANDARD TABLE OF ltdxkey,
ls_ltdxkey TYPE ltdxkey,
lt_skeys TYPE tt_skeys,
ls_skeys TYPE t_skeys,
lv_subrc TYPE sysubrc,
lv_filter TYPE string,
lt_files TYPE STANDARD TABLE OF char255,
lv_file TYPE char255,
lv_text70 TYPE text70,
lv_count TYPE i,
lv_pos TYPE i,
lv_answer TYPE c,
lv_msgtx TYPE msgtx ##NEEDED,
lv_filen TYPE string.
FIELD-SYMBOLS:
<ltdxt> TYPE ltdxt,
<skeys> TYPE t_skeys.
lv_filter = '*' && c_suffix_desc && c_ftype.
" get list 'Main' ALV files (*_desc.txt) from direcoty
cl_gui_frontend_services=>directory_list_files(
EXPORTING
directory = iv_pathn
filter = lv_filter " *_desc.txt
files_only = 'X'
CHANGING
file_table = lt_files
count = lv_count
EXCEPTIONS
cntl_error = 1
directory_list_files_failed = 2
wrong_parameter = 3
error_no_gui = 4
not_supported_by_gui = 5
OTHERS = 6
).
IF sy-subrc NE 0.
" Method &1 was executed, sy-subrc = &2.
MESSAGE e174(strex) WITH 'DIRECTORY_LIST_FILES' sy-subrc. " into lv_msgtx.
ENDIF.
" process *_desc.txt files (each represents one downloaded ALV layout)
LOOP AT lt_files INTO lv_file.
CLEAR: ls_skeys, lt_ltdxt, ls_ltdxt.
" read keys and description from *_desc.txt file
lv_filen = lv_file.
upload_file( EXPORTING iv_pathn = iv_pathn
iv_fname = lv_filen
CHANGING ct_table = lt_ltdxt
cv_subrc = lv_subrc ).
IF lv_subrc NE 0.
" Error while uploading file '&1' &2
MESSAGE e164(sprx) WITH lv_filen lv_subrc.
msg_add( ).
CONTINUE.
ENDIF.
IF lt_ltdxt IS INITIAL.
" should never be
CONTINUE.
ENDIF.
" get Layout key and description
READ TABLE lt_ltdxt INTO ls_ltdxt WITH KEY langu = sy-langu.
IF sy-subrc NE 0.
" fallback: use first other language
READ TABLE lt_ltdxt INTO ls_ltdxt INDEX 1.
ENDIF.
MOVE-CORRESPONDING ls_ltdxt TO ls_skeys.
CHECK ls_skeys-variant IS NOT INITIAL. " should always be
" Keep Layout data in LT_SKEYS
ls_skeys-filen = lv_file.
" Keep descriptions
ls_skeys-ltdxt = lt_ltdxt.
" get upload data and source system from file name
IF lv_file CP '*_20++++++_+++_*'.
lv_pos = sy-fdpos + 1.
ls_skeys-aedat = lv_filen+lv_pos(8).
lv_pos = lv_pos + 9.
ls_skeys-sysid = lv_filen+lv_pos(3).
ENDIF.
IF ls_skeys-report EQ iv_repid.
ls_skeys-sortf = 1.
ELSE.
ls_skeys-sortf = 2.
ENDIF.
APPEND ls_skeys TO lt_skeys.
ENDLOOP. "at lt_files
" sort variants: target report first,
" variants with same key by download date (newest first)
SORT lt_skeys BY sortf report
log_group handle
variant username
aedat DESCENDING.
" let user select the layouts for upload (sets SELXX)
variants_select( EXPORTING iv_repid = iv_repid
iv_downl = ' ' "upload mode
CHANGING ct_skeys = lt_skeys ).
" process selected layouts
LOOP AT lt_skeys ASSIGNING <skeys> WHERE selxx = 'X'.
CLEAR: lt_dbfieldcat, lt_dbsortinfo, lt_dbfilter, lt_dblayout.
MOVE-CORRESPONDING <skeys> TO ls_ltdxkey.
" get variant keys from LTDXT-table (all descr. have same variant key)
READ TABLE <skeys>-ltdxt INTO ls_ltdxt INDEX 1.
MOVE-CORRESPONDING ls_ltdxt TO ls_ltdxkey.
" set target report ( we allow upload to different report)
ls_ltdxkey-report = iv_repid.
" adjust description keys
LOOP AT <skeys>-ltdxt ASSIGNING <ltdxt>.
<ltdxt>-report = iv_repid.
ENDLOOP.
" TODO later? check source = target report with confirmation popup
" TODO later? check user existence for user layout
lv_filen = <skeys>-filen.
REPLACE c_suffix_desc IN lv_filen WITH c_suffix_fcat.
upload_file( EXPORTING iv_pathn = iv_pathn
iv_fname = lv_filen
CHANGING ct_table = lt_dbfieldcat
cv_subrc = lv_subrc ).
IF lv_subrc <> 0. "Read Field catalog file ok? (always required)
" Method &1 was executed, sy-subrc = &2.
MESSAGE e174(strex) WITH 'GUI_UPLOAD' lv_subrc. " into lv_msgtx.
" and abort processing
ENDIF.
IF lt_dbfieldcat IS INITIAL.
" for safety, table should never be empty here
CONTINUE.
ENDIF.
" read sort criteria from *_sort.txt file
" ignore SUBRC, file doesnt need to exist
lv_filen = <skeys>-filen.
REPLACE c_suffix_desc IN lv_filen WITH c_suffix_sort.
upload_file( EXPORTING iv_pathn = iv_pathn
iv_fname = lv_filen
CHANGING ct_table = lt_dbsortinfo ).
" read filter criteria from *_filt.txt file
" ignore SUBRC, file doesnt need to exist
lv_filen = <skeys>-filen.
REPLACE c_suffix_desc IN lv_filen WITH c_suffix_filt.
upload_file( EXPORTING iv_pathn = iv_pathn
iv_fname = lv_filen
CHANGING ct_table = lt_dbfilter ).
" read layout setting from *_layo.txt file
" ignore SUBRC, file doesnt need to exist
lv_filen = <skeys>-filen.
REPLACE c_suffix_desc IN lv_filen WITH c_suffix_layo.
upload_file( EXPORTING iv_pathn = iv_pathn
iv_fname = lv_filen
CHANGING ct_table = lt_dblayout ).
" write layout to DB
CALL FUNCTION 'LT_DBDATA_WRITE_TO_LTDX'
EXPORTING
* I_TOOL = 'LT'
is_varkey = ls_ltdxkey
* IS_VARIANT = IS_VARIANT
TABLES
t_dbfieldcat = lt_dbfieldcat
t_dbsortinfo = lt_dbsortinfo
t_dbfilter = lt_dbfilter
t_dblayout = lt_dblayout
EXCEPTIONS
not_found = 1
wrong_relid = 2
OTHERS = 3.
CHECK sy-subrc EQ 0. "should always be
" insert/update descriptions to DB
MODIFY ltdxt FROM TABLE <skeys>-ltdxt.
" success message layout
CONCATENATE ls_ltdxkey-handle ls_ltdxkey-log_group
ls_ltdxkey-variant ls_ltdxkey-username
INTO lv_text70 SEPARATED BY space.
" Variant &1 saved
MESSAGE s116(coat) WITH lv_text70 INTO lv_msgtx.
msg_add( ).
<skeys>-up_ok = 'X'. "set success flag
ENDLOOP. " AT lt_skeys
" set up table for transport
LOOP AT lt_skeys INTO ls_skeys
WHERE up_ok = 'X'
AND username IS INITIAL. "user dependent varinats are not transportable
MOVE-CORRESPONDING ls_skeys TO ls_ltdxkey.
ls_ltdxkey-type = '*'. "needed for transport
APPEND ls_ltdxkey TO lt_ltdxkey.
ENDLOOP. "at lt_skey INTO ls_skeys WHERE up_ok = 'X'.
IF lt_ltdxkey IS INITIAL.
RETURN. "--------------------------------> exit method
ENDIF.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Transport Layouts'(020)
text_question = 'Do you want to transport the uploaded user independent layouts?'(021)
default_button = '2' "No
* display_cancel_button = 'X'
IMPORTING
answer = lv_answer " to hold the FM's return value
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO lv_msgtx.
msg_add( ).
ENDIF.
IF lv_answer NE '1'.
RETURN. "--------------------------------> exit method
ENDIF.
CALL FUNCTION 'LT_VARIANTS_TRANSPORT'
TABLES
t_variants = lt_ltdxkey
EXCEPTIONS
client_unknown = 1
no_transports_allowed = 2
variants_table_empty = 3
no_transport_order_selected = 4
OTHERS = 5.
IF sy-subrc EQ 1
OR sy-subrc EQ 2
OR sy-subrc EQ 5.
MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO lv_msgtx.
msg_add( ).
ENDIF.
ENDMETHOD. "upload.
METHOD upload_file.
*-----------------------------------------------------------------------------*
* upload local file to internal table
*-----------------------------------------------------------------------------*
DATA:
lv_filen TYPE string,
lv_n TYPE i.
lv_n = strlen( iv_pathn ) - 1.
" build full filename, with path
IF iv_pathn+lv_n(1) = '\'.
lv_filen = iv_pathn && iv_fname.
ELSE.
lv_filen = iv_pathn && '\' && iv_fname.
ENDIF.
" upload local file to internal table
cl_gui_frontend_services=>gui_upload(
EXPORTING
filename = lv_filen
filetype = 'ASC'
has_field_separator = 'X'
* has_field_separator = SPACE
* header_length = 0
* read_by_line = 'X'
* dat_mode = SPACE
* codepage = SPACE
* ignore_cerr = ABAP_TRUE
* replacement = '#'
* virus_scan_profile = virus_scan_profile
* IMPORTING
* filelength = filelength
* header = header
CHANGING
data_tab = ct_table
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
).
cv_subrc = sy-subrc.
* These messages might be useful:
* 240(ecatt) &1 uploaded successfully
* 164(SPRX) Error while uploading file '&1' &2
ENDMETHOD. "upload.
METHOD f4_path.
*-----------------------------------------------------------------------------*
* let user select a local directory from application server
*-----------------------------------------------------------------------------*
DATA:
lv_dir TYPE string.
cl_gui_frontend_services=>directory_browse(
EXPORTING initial_folder = cv_path
CHANGING selected_folder = lv_dir ).
IF lv_dir IS NOT INITIAL.
cv_path = lv_dir.
ENDIF.
ENDMETHOD. "f4_path.
METHOD dynval_get.
*-----------------------------------------------------------------------------*
* get fields from screen (important if
* F4 is called immediately without Enter
* after user changed screen values
*-----------------------------------------------------------------------------*
DATA:
ls_dynfd TYPE dynpread,
lt_dynfd TYPE STANDARD TABLE OF dynpread.
ls_dynfd-fieldname = iv_fname.
APPEND ls_dynfd TO lt_dynfd.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
* translate_to_upper = 'X'
TABLES
dynpfields = lt_dynfd
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
CHECK sy-subrc EQ 0.
LOOP AT lt_dynfd INTO ls_dynfd
WHERE fieldname = iv_fname.
cv_value = ls_dynfd-fieldvalue.
ENDLOOP.
* we use 'DYNP_VALUES_READ' in place of
* the shorter 'GET_DYNP_VALUE' to avoid
* UPPERCASE conversion.
* We want to see the file path in lowercase
*
* CALL FUNCTION 'GET_DYNP_VALUE'
* EXPORTING
* i_field = iv_fname
* i_repid = sy-repid
* i_dynnr = sy-dynnr
* CHANGING
* o_value = cv_value.
ENDMETHOD. "f4_path.
METHOD protocol_display.
*-----------------------------------------------------------------------------*
* protocol display (if not empty)
*-----------------------------------------------------------------------------*
IF NOT gt_prot IS INITIAL.
CALL FUNCTION 'SUSR_DISPLAY_LOG'
EXPORTING
display_in_popup = 'X'
TABLES
it_log_sprot = gt_prot
EXCEPTIONS
parameter_error = 0
OTHERS = 0.
ENDIF.
ENDMETHOD. "protocol_display
METHOD msg_add.
*-----------------------------------------------------------------------------*
* add message from sy fields to protocol
*-----------------------------------------------------------------------------*
DATA:
ls_msg TYPE sprot_u.
" message for Application Log
ls_msg-severity = sy-msgty.
ls_msg-ag = sy-msgid.
ls_msg-msgnr = sy-msgno.
ls_msg-var1 = sy-msgv1.
ls_msg-var2 = sy-msgv2.
ls_msg-var3 = sy-msgv3.
ls_msg-var4 = sy-msgv4.
" ls_msg-level =
" ... see structure SPROT_U
APPEND ls_msg TO gt_prot.
ENDMETHOD. "msg_add.
METHOD variants_select.
*-----------------------------------------------------------------------------*
* let user select ALV layouts from popup with a list of layouts
* different titles, field catalog and popup size for download/upload
*-----------------------------------------------------------------------------*
DATA:
ls_skeys TYPE t_skeys,
lt_fdcat TYPE slis_t_fieldcat_alv,
lv_endln TYPE i,
lv_endcl TYPE i,
lv_n TYPE i,
lv_max TYPE i,
lv_title TYPE text70.
FIELD-SYMBOLS:
<fdcat> TYPE slis_fieldcat_alv.
" initialize field catalog based on DDIC
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'DISVARIANT'
CHANGING
ct_fieldcat = lt_fdcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc NE 0. "should never be
MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
" get max lenght of reportname + 1
LOOP AT ct_skeys INTO ls_skeys.
lv_n = strlen( ls_skeys-report ) + 1.
IF lv_n GT lv_max.
lv_max = lv_n.
ENDIF.
ENDLOOP.
IF iv_downl EQ 'X'.
lv_title = ' - ' && iv_repid && ' - ' && 'Select Layouts for Download'(010).
" modify field cat, changed field sequence, hide fields
LOOP AT lt_fdcat ASSIGNING <fdcat>.
<fdcat>-col_pos = sy-tabix.
CASE <fdcat>-fieldname.
WHEN 'VARIANT'.
<fdcat>-col_pos = 1.
WHEN 'HANDLE'.
<fdcat>-col_pos = 2.
WHEN 'LOG_GROUP'.
<fdcat>-col_pos = 3.
WHEN 'USERNAME'.
<fdcat>-col_pos = 4.
WHEN 'TEXT'.
<fdcat>-col_pos = 5.
WHEN 'REPORT'.
" set display length of report name according to data
<fdcat>-outputlen = lv_max.
<fdcat>-col_pos = 6.
WHEN OTHERS.
<fdcat>-tech = 'X'.
ENDCASE.
ENDLOOP.
lv_endcl = 100.
ELSE. "upload
" Title with report name and text
lv_title = ' - ' && iv_repid && ' - ' && 'Select Layouts for Upload'(011).
" modify field cat, changed field sequence, hide fields
LOOP AT lt_fdcat ASSIGNING <fdcat>.
<fdcat>-col_pos = sy-tabix.
CASE <fdcat>-fieldname.
WHEN 'VARIANT'.
<fdcat>-col_pos = 1.
WHEN 'HANDLE'.
<fdcat>-col_pos = 2.
WHEN 'LOG_GROUP'.
<fdcat>-col_pos = 3.
WHEN 'USERNAME'.
<fdcat>-col_pos = 4.
WHEN 'TEXT'.
<fdcat>-col_pos = 5.
WHEN 'REPORT'.
" set display length of report name according to data
<fdcat>-outputlen = lv_max.
<fdcat>-col_pos = 6.
WHEN OTHERS.
<fdcat>-tech = 'X'.
ENDCASE.
ENDLOOP.
APPEND INITIAL LINE TO lt_fdcat ASSIGNING <fdcat>.
<fdcat>-fieldname = 'AEDAT'.
<fdcat>-datatype = 'DATS'.
<fdcat>-seltext_s =
<fdcat>-seltext_m =
<fdcat>-seltext_l = 'Downloaded'(012).
<fdcat>-col_pos = 7.
APPEND INITIAL LINE TO lt_fdcat ASSIGNING <fdcat>.
<fdcat>-fieldname = 'SYSID'.
<fdcat>-datatype = 'CHAR'.
<fdcat>-intlen = 3.
<fdcat>-outputlen = 3.
<fdcat>-seltext_s =
<fdcat>-seltext_m =
<fdcat>-seltext_l = 'Sys'(013).
<fdcat>-col_pos = 8.
lv_endcl = 115.
ENDIF.
" calculate number of lines to display
lv_endln = lines( ct_skeys ) + 3 + 3.
IF lv_endln GT 20.
lv_endln = 20.
ENDIF.
" Popup for select multiple lines
" we set start/end coordinates. Otherwise popup is too narrow
" and we have to scroll to see the full report name
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_title = lv_title
i_tabname = 'LT_SKEYS'
i_checkbox_fieldname = 'SELXX' "Checkbox field defined in the internal table
it_fieldcat = lt_fdcat
i_screen_start_column = 3
i_screen_start_line = 3
i_screen_end_column = lv_endcl "better for us than default
i_screen_end_line = lv_endln
TABLES
t_outtab = ct_skeys
EXCEPTIONS
OTHERS = 0.
ENDMETHOD. "variants_select.
ENDCLASS. "alv1
*-----------------------------------------------------------------------------*
* Selection Screen Events
*-----------------------------------------------------------------------------*
*-----------------------------------------------------------------------------*
INITIALIZATION.
*-----------------------------------------------------------------------------*
" set default path to SAP Gui work directory
cl_gui_frontend_services=>get_sapgui_workdir(
CHANGING sapworkdir = p_pathn
EXCEPTIONS OTHERS = 0 ).
*-----------------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_pathn.
*-----------------------------------------------------------------------------*
" field transport for F4 (important in case of change w/o Enter)
alv1=>dynval_get( EXPORTING iv_fname = 'P_PATHN'
CHANGING cv_value = p_pathn ).
" let user select a local directory from application server
alv1=>f4_path( CHANGING cv_path = p_pathn ).
*-----------------------------------------------------------------------------*
START-OF-SELECTION.
*-----------------------------------------------------------------------------*
alv1=>main( ).
| [
2200,
15490,
1976,
301,
1065,
62,
282,
85,
62,
39786,
62,
929,
62,
15002,
13,
198,
198,
17174,
17174,
8412,
198,
9,
383,
17168,
13789,
357,
36393,
8,
198,
9,
198,
9,
15069,
357,
66,
8,
33448,
5780,
3771,
747,
357,
46437,
16744,
41005,
8,
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,
9,
10097,
26171,
9,
198,
9,
16984,
329,
1479,
8748,
11,
416,
5780,
3771,
747,
1220,
22814,
16744,
39537,
16724,
2751,
198,
9,
10628,
352,
13,
15,
220,
5534,
14,
1238,
2481,
198,
9,
198,
9,
6208,
276,
351,
10050,
198,
9,
532,
13793,
47,
718,
13,
15,
220,
357,
220,
220,
220,
357,
50,
2969,
62,
2969,
6489,
718,
13,
2713,
290,
48323,
62,
2969,
6489,
718,
13,
1558,
8,
198,
9,
532,
311,
14,
19,
367,
31574,
12131,
357,
50,
19,
34,
6965,
13343,
8,
198,
9,
815,
670,
329,
584,
10050,
355,
880,
13,
198,
9,
1846,
1154,
12061,
1231,
597,
15064,
9564,
2969,
3033,
523,
340,
815,
670,
198,
9,
351,
4697,
290,
15064,
10050,
13,
198,
9,
198,
9,
10472,
1220,
36803,
8355,
53,
18881,
5269,
198,
9,
198,
9,
532,
2836,
12,
34750,
18881,
5269,
198,
9,
532,
2836,
12,
21186,
220,
220,
18881,
5269,
198,
9,
532,
18881,
5269,
460,
307,
15680,
329,
257,
989,
290,
19144,
284,
262,
976,
198,
9,
220,
220,
393,
284,
257,
1180,
989,
287,
262,
976,
393,
287,
257,
1180,
1080,
198,
9,
198,
9,
1303,
21293,
198,
9,
48323,
3210,
3578,
284,
4839,
2836,
4795,
8355,
53,
38489,
422,
198,
9,
530,
1080,
284,
1194,
13,
198,
9,
770,
3136,
815,
460,
1037,
618,
345,
466,
407,
423,
262,
198,
9,
5885,
284,
4839,
13,
632,
13536,
345,
284,
4321,
198,
9,
393,
9516,
8355,
53,
17670,
329,
257,
989,
13,
632,
2499,
329,
2836,
12,
34750,
393,
2836,
12,
21186,
38489,
13,
198,
9,
921,
460,
779,
340,
284,
25,
198,
9,
532,
4866,
8355,
53,
38489,
422,
530,
1080,
284,
1194,
1080,
198,
9,
220,
220,
383,
1080,
460,
423,
1180,
2650,
2974,
13,
198,
9,
532,
4866,
8355,
53,
38489,
422,
530,
989,
284,
1194,
198,
9,
532,
11559,
290,
11169,
8355,
53,
38489,
198,
9,
198,
9,
1303,
29538,
15216,
198,
9,
220,
532,
6358,
6530,
198,
9,
220,
532,
10714,
27387,
329,
4321,
1220,
9516,
351,
376,
19,
1037,
198,
9,
220,
532,
18502,
25,
10472,
393,
36803,
198,
9,
198,
9,
1303,
30320,
35613,
198,
9,
8099,
929,
351,
477,
4683,
8355,
53,
38489,
329,
262,
989,
198,
9,
357,
7220,
12,
34750,
290,
2836,
12,
21186,
8,
198,
9,
3167,
26024,
6358,
11,
33141,
11,
5972,
4912,
11,
12461,
11,
12489,
357,
259,
17594,
3303,
8,
198,
9,
11787,
460,
2922,
530,
393,
3294,
38489,
329,
4321,
198,
9,
8858,
276,
287,
257,
1448,
286,
3696,
357,
39681,
1366,
1343,
13399,
11,
7663,
5181,
11,
33947,
11,
376,
5329,
11,
47639,
8,
198,
9,
351,
2393,
1438,
39099,
62,
39,
6981,
2538,
62,
53,
33604,
8643,
62,
29904,
20608,
62,
26314,
26314,
12038,
16458,
62,
50,
16309,
2389,
62,
24376,
13,
14116,
198,
9,
220,
220,
810,
27713,
55,
198,
9,
220,
220,
220,
796,
1715,
329,
42513,
25010,
13399,
357,
439,
8950,
8,
198,
9,
220,
220,
220,
796,
1715,
329,
7663,
18388,
198,
9,
220,
220,
220,
796,
3297,
329,
33947,
9987,
357,
361,
9456,
8,
198,
9,
220,
220,
220,
796,
1226,
83,
329,
376,
5329,
9987,
357,
361,
9456,
8,
198,
9,
6093,
2095,
31051,
6,
287,
262,
15304,
393,
5412,
318,
6928,
416,
705,
2,
6,
198,
9,
287,
262,
2393,
1438,
13,
198,
9,
198,
9,
1303,
471,
6489,
41048,
198,
9,
8099,
929,
351,
477,
8355,
53,
38489,
422,
4321,
3696,
198,
9,
287,
262,
7368,
1957,
8619,
198,
9,
3167,
26024,
6358,
11,
33141,
11,
5972,
4912,
11,
12461,
11,
12489,
11,
198,
9,
10472,
3128,
290,
1080,
357,
34631,
422,
2393,
1438,
8,
198,
9,
11787,
460,
2922,
530,
393,
3294,
38489,
329,
9516,
198,
9,
357,
2836,
12,
34750,
290,
2836,
12,
21186,
8,
198,
9,
2293,
17458,
274,
913,
9516,
25,
8099,
929,
4737,
2836,
611,
2836,
4795,
38489,
198,
9,
815,
307,
18665,
13,
198,
9,
1002,
3763,
25,
3210,
17310,
329,
2183,
2890,
4839,
355,
287,
12461,
13169,
198,
9,
198,
9,
1303,
28511,
11822,
198,
9,
220,
532,
36803,
318,
1760,
284,
262,
7368,
2496,
989,
13,
198,
9,
220,
220,
220,
1400,
2198,
611,
2723,
290,
2496,
989,
389,
4961,
7,
13536,
198,
9,
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,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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
] |
*"* use this source file for your ABAP unit test classes
CLASS ltcl_structured_table DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PRIVATE SECTION.
TYPES: BEGIN OF ty_s_guglhupf,
number TYPE i,
text TYPE string,
END OF ty_s_guglhupf,
ty_t_guglhupf TYPE STANDARD TABLE OF ty_s_guglhupf.
DATA: data_reader TYPE REF TO if_sxml_reader,
data_element TYPE REF TO zif_yy_data_element,
expected_table TYPE ty_t_guglhupf.
METHODS:
setup RAISING cx_static_check,
validate_table FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_structured_table IMPLEMENTATION.
METHOD setup.
DATA: expected_line TYPE ty_s_guglhupf.
expected_line-number = 42.
expected_line-text = 'Gebäck'.
INSERT expected_line INTO TABLE expected_table.
expected_line-number = 23.
expected_line-text = 'Guzle'.
INSERT expected_line INTO TABLE expected_table.
DATA(json_writer) = cl_sxml_string_writer=>create( type = if_sxml=>co_xt_json ).
CALL TRANSFORMATION id SOURCE yy = expected_table RESULT XML json_writer.
DATA(json_code) = cl_abap_conv_codepage=>create_in( )->convert( source = json_writer->get_output( ) ).
data_reader = cl_sxml_string_reader=>create( input = json_writer->get_output( ) ).
data_reader->read_next_node( ).
data_reader->read_next_node( ).
ENDMETHOD.
METHOD validate_table.
DATA: my_value TYPE zif_yy_data_element=>ty_table,
table_element TYPE zif_yy_data_element=>ty_table.
data_element = zcl_yy_data_element_table=>create_instance( ).
cl_abap_unit_assert=>assert_bound( data_element ).
CAST zif_yy_data_element_builder( data_element )->build( i_data_reader = data_reader
i_element_name = 'GUGLHUPF' ).
data_element->get_value( IMPORTING e_value = my_value ).
DATA(my_descriptor) = data_element->get_descriptor( ).
cl_abap_unit_assert=>assert_equals( act = my_descriptor->get_name( ) exp = 'GUGLHUPF' ).
cl_abap_unit_assert=>assert_equals( act = my_descriptor->get_type( )->get_type_name( ) exp = zif_yy_data_element_type=>table ).
CAST zif_yy_data_element_builder( data_element )->build( i_data_reader = data_reader
i_element_name = 'GUGLHUPF' ).
data_element->get_value( IMPORTING e_value = my_value ).
cl_abap_unit_assert=>assert_initial( my_value ).
cl_abap_unit_assert=>assert_not_bound( data_element->get_descriptor( ) ).
ENDMETHOD.
ENDCLASS.
CLASS ltcl_simple_table DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PRIVATE SECTION.
DATA: data_reader TYPE REF TO if_sxml_reader,
data_element TYPE REF TO zif_yy_data_element,
expected_table TYPE STANDARD TABLE OF string WITH NON-UNIQUE DEFAULT KEY.
METHODS:
setup RAISING cx_static_check,
validate_table FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_simple_table IMPLEMENTATION.
METHOD setup.
DATA: expected_line TYPE string.
expected_line = 'Gebäck'.
INSERT expected_line INTO TABLE expected_table.
expected_line = 'Guzle'.
INSERT expected_line INTO TABLE expected_table.
DATA(json_writer) = cl_sxml_string_writer=>create( type = if_sxml=>co_xt_json ).
CALL TRANSFORMATION id SOURCE yy = expected_table RESULT XML json_writer.
DATA(json_code) = cl_abap_conv_codepage=>create_in( )->convert( source = json_writer->get_output( ) ).
data_reader = cl_sxml_string_reader=>create( input = json_writer->get_output( ) ).
data_reader->read_next_node( ).
data_reader->read_next_node( ).
ENDMETHOD.
METHOD validate_table.
DATA: my_value TYPE zif_yy_data_element=>ty_table,
table_element TYPE zif_yy_data_element=>ty_table.
data_element = zcl_yy_data_element_table=>create_instance( ).
cl_abap_unit_assert=>assert_bound( data_element ).
CAST zif_yy_data_element_builder( data_element )->build( i_data_reader = data_reader
i_element_name = 'GUGLHUPF' ).
data_element->get_value( IMPORTING e_value = my_value ).
DATA(my_descriptor) = data_element->get_descriptor( ).
" root-level tables don't get a name
cl_abap_unit_assert=>assert_equals( act = my_descriptor->get_name( ) exp = zif_yy_data_descriptor=>co_unnamed_object ).
cl_abap_unit_assert=>assert_equals( act = my_descriptor->get_type( )->get_type_name( ) exp = zif_yy_data_element_type=>table ).
ENDMETHOD.
ENDCLASS.
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
534,
9564,
2969,
4326,
1332,
6097,
198,
31631,
300,
83,
565,
62,
7249,
1522,
62,
11487,
5550,
20032,
17941,
7473,
43001,
2751,
45698,
42,
49277,
43638,
5805,
7597,
360,
4261,
6234,
6006,
9863,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
82,
62,
70,
1018,
75,
71,
929,
69,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1271,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2420,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
82,
62,
70,
1018,
75,
71,
929,
69,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1259,
62,
83,
62,
70,
1018,
75,
71,
929,
69,
41876,
49053,
9795,
43679,
3963,
1259,
62,
82,
62,
70,
1018,
75,
71,
929,
69,
13,
198,
220,
220,
220,
42865,
25,
1366,
62,
46862,
220,
220,
220,
41876,
4526,
37,
5390,
611,
62,
82,
19875,
62,
46862,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
30854,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
22556,
62,
7890,
62,
30854,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2938,
62,
11487,
41876,
1259,
62,
83,
62,
70,
1018,
75,
71,
929,
69,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
26571,
62,
11487,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
7249,
1522,
62,
11487,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
42865,
25,
2938,
62,
1370,
41876,
1259,
62,
82,
62,
70,
1018,
75,
71,
929,
69,
13,
198,
220,
220,
220,
2938,
62,
1370,
12,
17618,
796,
5433,
13,
198,
220,
220,
220,
2938,
62,
1370,
12,
5239,
220,
220,
796,
705,
38,
1765,
11033,
694,
4458,
198,
220,
220,
220,
29194,
17395,
2938,
62,
1370,
39319,
43679,
2938,
62,
11487,
13,
198,
220,
220,
220,
2938,
62,
1370,
12,
17618,
796,
2242,
13,
198,
220,
220,
220,
2938,
62,
1370,
12,
5239,
220,
220,
796,
705,
8205,
89,
293,
4458,
198,
220,
220,
220,
29194,
17395,
2938,
62,
1370,
39319,
43679,
2938,
62,
11487,
13,
198,
220,
220,
220,
42865,
7,
17752,
62,
16002,
8,
796,
537,
62,
82,
19875,
62,
8841,
62,
16002,
14804,
17953,
7,
2099,
796,
611,
62,
82,
19875,
14804,
1073,
62,
742,
62,
17752,
6739,
198,
220,
220,
220,
42815,
44069,
35036,
4686,
311,
31033,
331,
88,
796,
2938,
62,
11487,
15731,
16724,
23735,
33918,
62,
16002,
13,
198,
220,
220,
220,
42865,
7,
17752,
62,
8189,
8,
796,
537,
62,
397,
499,
62,
42946,
62,
19815,
538,
496,
14804,
17953,
62,
259,
7,
1267,
3784,
1102,
1851,
7,
2723,
796,
33918,
62,
16002,
3784,
1136,
62,
22915,
7,
1267,
6739,
198,
220,
220,
220,
1366,
62,
46862,
796,
537,
62,
82,
19875,
62,
8841,
62,
46862,
14804,
17953,
7,
5128,
796,
33918,
62,
16002,
3784,
1136,
62,
22915,
7,
1267,
6739,
198,
220,
220,
220,
1366,
62,
46862,
3784,
961,
62,
19545,
62,
17440,
7,
6739,
198,
220,
220,
220,
1366,
62,
46862,
3784,
961,
62,
19545,
62,
17440,
7,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
26571,
62,
11487,
13,
628,
220,
220,
220,
42865,
25,
616,
62,
8367,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
22556,
62,
7890,
62,
30854,
14804,
774,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3084,
62,
30854,
41876,
1976,
361,
62,
22556,
62,
7890,
62,
30854,
14804,
774,
62,
11487,
13,
628,
220,
220,
220,
1366,
62,
30854,
796,
1976,
565,
62,
22556,
62,
7890,
62,
30854,
62,
11487,
14804,
17953,
62,
39098,
7,
6739,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
7784,
7,
1366,
62,
30854,
6739,
198,
220,
220,
220,
327,
11262,
1976,
361,
62,
22556,
62,
7890,
62,
30854,
62,
38272,
7,
1366,
62,
30854,
1267,
3784,
11249,
7,
1312,
62,
7890,
62,
46862,
796,
1366,
62,
46862,
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,
1312,
62,
30854,
62,
3672,
796,
705,
38,
7340,
43,
39,
8577,
37,
6,
6739,
628,
220,
220,
220,
1366,
62,
30854,
3784,
1136,
62,
8367,
7,
30023,
9863,
2751,
304,
62,
8367,
796,
616,
62,
8367,
6739,
628,
220,
220,
220,
42865,
7,
1820,
62,
20147,
1968,
273,
8,
796,
1366,
62,
30854,
3784,
1136,
62,
20147,
1968,
273,
7,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
719,
796,
616,
62,
20147,
1968,
273,
3784,
1136,
62,
3672,
7,
1267,
1033,
796,
705,
38,
7340,
43,
39,
8577,
37,
6,
6739,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
719,
796,
616,
62,
20147,
1968,
273,
3784,
1136,
62,
4906,
7,
1267,
3784,
1136,
62,
4906,
62,
3672,
7,
1267,
1033,
796,
1976,
361,
62,
22556,
62,
7890,
62,
30854,
62,
4906,
14804,
11487,
6739,
628,
220,
220,
220,
327,
11262,
1976,
361,
62,
22556,
62,
7890,
62,
30854,
62,
38272,
7,
1366,
62,
30854,
1267,
3784,
11249,
7,
1312,
62,
7890,
62,
46862,
796,
1366,
62,
46862,
198,
220,
220,
220,
220,
220,
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
] |
CLASS zcl_http_simple_rest_api DEFINITION
INHERITING FROM zcl_http_rest_api
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS post
IMPORTING
!iv_body TYPE string OPTIONAL
!iv_content_type TYPE string OPTIONAL
RETURNING
VALUE(ro_self) TYPE REF TO zcl_http_rest_api .
METHODS get
IMPORTING
!iv_body TYPE string OPTIONAL
!iv_content_type TYPE string OPTIONAL
RETURNING
VALUE(ro_self) TYPE REF TO zcl_http_rest_api .
METHODS put
IMPORTING
!iv_body TYPE string OPTIONAL
!iv_content_type TYPE string OPTIONAL
RETURNING
VALUE(ro_self) TYPE REF TO zcl_http_rest_api .
METHODS delete
IMPORTING
!iv_body TYPE string OPTIONAL
!iv_content_type TYPE string OPTIONAL
RETURNING
VALUE(ro_self) TYPE REF TO zcl_http_rest_api .
METHODS add_header REDEFINITION.
METHODS: set_json_body
IMPORTING
ir_any_data TYPE any
RETURNING VALUE(ro_ref) TYPE REF TO zcl_http_rest_api.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_http_simple_rest_api IMPLEMENTATION.
METHOD add_header.
" Add a header value
super->add_header(
EXPORTING
iv_name = iv_name
iv_value = iv_value
).
ENDMETHOD.
METHOD get.
" Call Get Method
me->set_body(
iv_method_type = 'GET'
iv_body = iv_body
iv_content_type = iv_content_type
).
ENDMETHOD.
METHOD post.
" Call Post Method
me->set_body(
iv_method_type = 'POST'
iv_body = iv_body
iv_content_type = iv_content_type
).
ENDMETHOD.
METHOD put.
" Call Put Method
me->set_body(
iv_method_type = 'PUT'
iv_body = iv_body
iv_content_type = iv_content_type
).
ENDMETHOD.
METHOD delete.
" Set Method Type
me->set_body(
iv_method_type = 'DELETE'
iv_body = iv_body
iv_content_type = iv_content_type
).
ENDMETHOD.
METHOD set_json_body.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
4023,
62,
36439,
62,
2118,
62,
15042,
5550,
20032,
17941,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
4023,
62,
2118,
62,
15042,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
1281,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
2618,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
11299,
62,
4906,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
944,
8,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
4023,
62,
2118,
62,
15042,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
2618,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
11299,
62,
4906,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
944,
8,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
4023,
62,
2118,
62,
15042,
764,
628,
220,
220,
220,
337,
36252,
50,
1234,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
2618,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
11299,
62,
4906,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
944,
8,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
4023,
62,
2118,
62,
15042,
764,
628,
220,
220,
220,
337,
36252,
50,
12233,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
2618,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
11299,
62,
4906,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
944,
8,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
4023,
62,
2118,
62,
15042,
764,
628,
220,
220,
220,
337,
36252,
50,
751,
62,
25677,
23848,
36,
20032,
17941,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
900,
62,
17752,
62,
2618,
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,
4173,
62,
1092,
62,
7890,
220,
220,
41876,
597,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
305,
62,
5420,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
4023,
62,
2118,
62,
15042,
13,
628,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
4023,
62,
36439,
62,
2118,
62,
15042,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
751,
62,
25677,
13,
198,
220,
220,
220,
366,
3060,
257,
13639,
1988,
198,
220,
220,
220,
2208,
3784,
2860,
62,
25677,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3672,
220,
796,
21628,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
8367,
796,
21628,
62,
8367,
198,
220,
220,
220,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
13,
198,
220,
220,
220,
366,
4889,
3497,
11789,
198,
220,
220,
220,
502,
3784,
2617,
62,
2618,
7,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
24396,
62,
4906,
220,
796,
705,
18851,
6,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
2618,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
2618,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
11299,
62,
4906,
796,
21628,
62,
11299,
62,
4906,
198,
220,
220,
220,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1281,
13,
198,
220,
220,
220,
366,
4889,
2947,
11789,
198,
220,
220,
220,
502,
3784,
2617,
62,
2618,
7,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
24396,
62,
4906,
220,
796,
705,
32782,
6,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
2618,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
2618,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
11299,
62,
4906,
796,
21628,
62,
11299,
62,
4906,
198,
220,
220,
220,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1234,
13,
198,
220,
220,
220,
366,
4889,
5930,
11789,
198,
220,
220,
220,
502,
3784,
2617,
62,
2618,
7,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
24396,
62,
4906,
220,
796,
705,
30076,
6,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
2618,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
2618,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
11299,
62,
4906,
796,
21628,
62,
11299,
62,
4906,
198,
220,
220,
220,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
12233,
13,
198,
220,
220,
220,
366,
5345,
11789,
5994,
198,
220,
220,
220,
502,
3784,
2617,
62,
2618,
7,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
24396,
62,
4906,
220,
796,
705,
7206,
2538,
9328,
6,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
2618,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
2618,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
11299,
62,
4906,
796,
21628,
62,
11299,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_object_cmod DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_objects_super
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_object .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_CMOD IMPLEMENTATION.
METHOD zif_abapgit_object~changed_by.
SELECT SINGLE anam FROM modattr INTO rv_user WHERE name = ms_item-obj_name.
IF sy-subrc <> 0.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA lv_name TYPE modact-name.
lv_name = ms_item-obj_name.
CALL FUNCTION 'MOD_KUN_ACTIVATE'
EXPORTING
activate = abap_false
deactivate = abap_true
modname = lv_name
EXCEPTIONS
call_error = 1
generate_error = 2
modattr_status = 3
mod_active = 4
mod_enqueued = 5
not_activated = 6
no_modification = 7
permission_failure = 8
OTHERS = 9.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
CALL FUNCTION 'MOD_KUN_DELETE'
EXPORTING
modname = lv_name
screen = abap_false
EXCEPTIONS
attr_enqueued = 1
mod_active = 2
mod_enqueued = 3
text_enqueued = 4
permission_failure = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_name TYPE modact-name,
lt_modact TYPE TABLE OF modact,
lt_modtext TYPE TABLE OF modtext,
lt_modattr TYPE TABLE OF modattr.
lv_name = ms_item-obj_name.
DELETE FROM modact WHERE name = lv_name.
DELETE FROM modtext WHERE name = lv_name.
DELETE FROM modattr WHERE name = lv_name.
io_xml->read( EXPORTING iv_name = 'MODACT'
CHANGING cg_data = lt_modact ).
io_xml->read( EXPORTING iv_name = 'MODTEXT'
CHANGING cg_data = lt_modtext ).
io_xml->read( EXPORTING iv_name = 'MODATTR'
CHANGING cg_data = lt_modattr ).
INSERT modact FROM TABLE lt_modact.
INSERT modtext FROM TABLE lt_modtext.
INSERT modattr FROM TABLE lt_modattr.
tadir_insert( iv_package ).
CALL FUNCTION 'MOD_KUN_ACTIVATE'
EXPORTING
activate = abap_true
deactivate = abap_false
modname = lv_name
EXCEPTIONS
call_error = 1
generate_error = 2
modattr_status = 3
mod_active = 4
mod_enqueued = 5
not_activated = 6
no_modification = 7
permission_failure = 8
OTHERS = 9.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_name TYPE modact-name.
SELECT SINGLE name FROM modact INTO lv_name WHERE name = 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-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.
zcx_abapgit_exception=>raise( |Jump to CMOD is not supported| ).
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lt_modact TYPE TABLE OF modact,
lt_modtext TYPE TABLE OF modtext,
lt_modattr TYPE TABLE OF modattr.
FIELD-SYMBOLS: <ls_modattr> TYPE modattr.
IF zif_abapgit_object~exists( ) = abap_false.
RETURN.
ENDIF.
SELECT * FROM modact INTO TABLE lt_modact WHERE name = ms_item-obj_name.
IF sy-subrc = 0.
io_xml->add( iv_name = 'MODACT'
ig_data = lt_modact ).
ENDIF.
SELECT * FROM modtext INTO TABLE lt_modtext WHERE name = ms_item-obj_name AND sprsl = mv_language.
IF sy-subrc = 0.
io_xml->add( iv_name = 'MODTEXT'
ig_data = lt_modtext ).
ENDIF.
SELECT * FROM modattr INTO TABLE lt_modattr WHERE name = ms_item-obj_name.
IF sy-subrc = 0.
LOOP AT lt_modattr ASSIGNING <ls_modattr>.
CLEAR:
<ls_modattr>-cnam, <ls_modattr>-cdat,
<ls_modattr>-unam, <ls_modattr>-udat,
<ls_modattr>-anam, <ls_modattr>-adat,
<ls_modattr>-fnam, <ls_modattr>-fdat.
ENDLOOP.
io_xml->add( iv_name = 'MODATTR'
ig_data = lt_modattr ).
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
66,
4666,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
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,
397,
499,
18300,
62,
15252,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
24187,
3727,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
40985,
62,
1525,
13,
628,
220,
220,
220,
33493,
311,
2751,
2538,
281,
321,
16034,
953,
35226,
39319,
374,
85,
62,
7220,
33411,
1438,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
7220,
796,
269,
62,
7220,
62,
34680,
13,
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,
33678,
13,
628,
220,
220,
220,
42865,
300,
85,
62,
3672,
41876,
953,
529,
12,
3672,
13,
628,
220,
220,
220,
300,
85,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
33365,
62,
42,
4944,
62,
10659,
3824,
6158,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
15155,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
220,
220,
390,
39022,
220,
220,
220,
220,
220,
220,
220,
220,
796,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
220,
220,
953,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
3672,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
869,
62,
18224,
220,
220,
220,
220,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
7716,
62,
18224,
220,
220,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
953,
35226,
62,
13376,
220,
220,
220,
220,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
953,
62,
5275,
220,
220,
220,
220,
220,
220,
220,
220,
796,
604,
198,
220,
220,
220,
220,
220,
220,
220,
953,
62,
268,
4188,
1739,
220,
220,
220,
220,
220,
220,
796,
642,
198,
220,
220,
220,
220,
220,
220,
220,
407,
62,
33106,
220,
220,
220,
220,
220,
796,
718,
198,
220,
220,
220,
220,
220,
220,
220,
645,
62,
4666,
2649,
220,
220,
220,
796,
767,
198,
220,
220,
220,
220,
220,
220,
220,
7170,
62,
32165,
495,
796,
807,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
860,
13,
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,
62,
83,
3064,
7,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
33365,
62,
42,
4944,
62,
7206,
2538,
9328,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
953,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
3159,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
708,
81,
62,
268,
4188,
1739,
220,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
953,
62,
5275,
220,
220,
220,
220,
220,
220,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
953,
62,
268,
4188,
1739,
220,
220,
220,
220,
220,
220,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
62,
268,
4188,
1739,
220,
220,
220,
220,
220,
796,
604,
198,
220,
220,
220,
220,
220,
220,
220,
7170,
62,
32165,
495,
796,
642,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
718,
13,
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,
62,
83,
3064,
7,
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,
8906,
48499,
1096,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
3672,
220,
220,
220,
41876,
953,
529,
12,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
4666,
529,
220,
41876,
43679,
3963,
953,
529,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
4666,
5239,
41876,
43679,
3963,
953,
5239,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
4666,
35226,
41876,
43679,
3963,
953,
35226,
13,
628,
220,
220,
220,
300,
85,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
5550,
2538,
9328,
16034,
953,
529,
33411,
1438,
796,
300,
85,
62,
3672,
13,
198,
220,
220,
220,
5550,
2538,
9328,
16034,
953,
5239,
33411,
1438,
796,
300,
85,
62,
3672,
13,
198,
220,
220,
220,
5550,
2538,
9328,
16034,
953,
35226,
33411,
1438,
796,
300,
85,
62,
3672,
13,
628,
220,
220,
220,
33245,
62,
19875,
3784,
961,
7,
7788,
15490,
2751,
21628,
62,
3672,
796,
705,
33365,
10659,
6,
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,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FINITION .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_csr_euc_jp IMPLEMENTATION.
METHOD get_language.
language = 'ja'.
ENDMETHOD.
METHOD get_name.
ENDMETHOD.
METHOD match.
ENDMETHOD.
ENDCLASS.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
23984,
79,
29,
198,
40484,
198,
31631,
1976,
565,
62,
6359,
81,
62,
68,
1229,
62,
34523,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
6359,
81,
62,
2022,
6359,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
16129,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
2872,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
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,
6359,
81,
62,
68,
1229,
62,
34523,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
651,
62,
16129,
13,
628,
220,
220,
220,
3303,
796,
705,
6592,
4458,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
3672,
13,
628,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
2872,
13,
628,
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
] |
CLASS ltcl_test DEFINITION DEFERRED.
CLASS zunitdemo_barc2017_6 DEFINITION LOCAL FRIENDS ltcl_test.
CLASS ltcl_test DEFINITION FINAL FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
DATA: f_cut TYPE REF TO zunitdemo_barc2017_6.
METHODS:
setup,
first_test FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_test IMPLEMENTATION.
METHOD setup.
TEST-INJECTION sy_datum.
cl_abap_unit_assert=>fail( msg = 'Redefine me' ).
end-TEST-INJECTION.
ENDMETHOD.
METHOD first_test.
f_cut = NEW #( ).
DATA: actual_day TYPE sy-datum.
TEST-INJECTION sy_datum.
r_result = |20171114|.
end-test-INJECTION.
actual_day = f_cut->actual_day( ).
cl_abap_unit_assert=>assert_equals( msg = 'Return actual date'
exp = |20171114| act = actual_day ).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
9288,
5550,
20032,
17941,
23449,
1137,
22083,
13,
198,
31631,
1976,
20850,
9536,
78,
62,
65,
5605,
5539,
62,
21,
5550,
20032,
17941,
37347,
1847,
48167,
1677,
5258,
300,
83,
565,
62,
9288,
13,
198,
198,
31631,
300,
83,
565,
62,
9288,
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,
25,
277,
62,
8968,
41876,
4526,
37,
5390,
1976,
20850,
9536,
78,
62,
65,
5605,
5539,
62,
21,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
717,
62,
9288,
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,
9058,
13,
198,
220,
220,
220,
43001,
12,
1268,
23680,
2849,
827,
62,
19608,
388,
13,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
31456,
796,
705,
7738,
891,
500,
502,
6,
6739,
198,
220,
220,
220,
886,
12,
51,
6465,
12,
1268,
23680,
2849,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
717,
62,
9288,
13,
198,
220,
220,
220,
277,
62,
8968,
796,
12682,
1303,
7,
6739,
198,
220,
220,
220,
42865,
25,
4036,
62,
820,
41876,
827,
12,
19608,
388,
13,
198,
220,
220,
220,
43001,
12,
1268,
23680,
2849,
827,
62,
19608,
388,
13,
198,
220,
220,
220,
220,
220,
374,
62,
20274,
796,
930,
5539,
1157,
1415,
91,
13,
198,
220,
220,
220,
886,
12,
9288,
12,
1268,
23680,
2849,
13,
198,
220,
220,
220,
4036,
62,
820,
796,
277,
62,
8968,
3784,
50039,
62,
820,
7,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
31456,
796,
705,
13615,
4036,
3128,
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,
1033,
796,
930,
5539,
1157,
1415,
91,
719,
796,
4036,
62,
820,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_ssfo 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:
ty_string_range TYPE RANGE OF string .
CLASS-DATA gt_range_node_codes TYPE ty_string_range .
CONSTANTS attrib_abapgit_leadig_spaces TYPE string VALUE 'abapgit-leadig-spaces' ##NO_TEXT.
METHODS fix_ids
IMPORTING
!ii_xml_doc TYPE REF TO if_ixml_document .
METHODS handle_attrib_leading_spaces
IMPORTING
!iv_name TYPE string
!ii_node TYPE REF TO if_ixml_node
CHANGING
!cv_within_code_section TYPE abap_bool .
METHODS get_range_node_codes
RETURNING
VALUE(rt_range_node_codes) TYPE ty_string_range .
METHODS code_item_section_handling
IMPORTING
!iv_name TYPE string
!ii_node TYPE REF TO if_ixml_node
EXPORTING
!ei_code_item_element TYPE REF TO if_ixml_element
CHANGING
!cv_within_code_section TYPE abap_bool
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS zcl_abapgit_object_ssfo IMPLEMENTATION.
METHOD code_item_section_handling.
CONSTANTS: lc_node_item TYPE string VALUE 'item'.
CONSTANTS: lc_node_text TYPE string VALUE '#text'.
IF iv_name IN get_range_node_codes( ).
cv_within_code_section = abap_true.
ENDIF.
IF cv_within_code_section = abap_true.
IF iv_name = lc_node_item.
TRY.
ei_code_item_element ?= ii_node.
RETURN.
CATCH cx_sy_move_cast_error ##no_handler.
ENDTRY.
ELSEIF iv_name NOT IN get_range_node_codes( ) AND
iv_name <> lc_node_text.
cv_within_code_section = abap_false.
ENDIF.
ENDIF.
RAISE EXCEPTION TYPE zcx_abapgit_exception.
ENDMETHOD.
METHOD fix_ids.
" makes sure ID and IDREF values are the same values for each serialization run
" the standard code has a counter that keeps increasing values.
"
" It is important that IDs and IDREFs which are the same before the fix
" are also the same after the fix.
TYPES:
BEGIN OF ty_id_mapping,
old TYPE string,
new TYPE string,
END OF ty_id_mapping,
ty_id_mappings TYPE HASHED TABLE OF ty_id_mapping
WITH UNIQUE KEY old.
DATA: lv_name TYPE string,
li_idref TYPE REF TO if_ixml_node,
li_node TYPE REF TO if_ixml_node,
li_attr TYPE REF TO if_ixml_named_node_map,
li_iterator TYPE REF TO if_ixml_node_iterator,
lt_id_mapping TYPE ty_id_mappings,
ls_id_mapping LIKE LINE OF lt_id_mapping.
li_iterator = ii_xml_doc->create_iterator( ).
li_node = li_iterator->get_next( ).
WHILE NOT li_node IS INITIAL.
lv_name = li_node->get_name( ).
IF lv_name = 'NODE' OR lv_name = 'WINDOW'.
li_idref = li_node->get_attributes( )->get_named_item( 'IDREF' ).
IF li_idref IS BOUND.
ls_id_mapping-old = li_idref->get_value( ).
READ TABLE lt_id_mapping WITH KEY old = ls_id_mapping-old
INTO ls_id_mapping.
IF sy-subrc <> 0.
lv_name = lines( lt_id_mapping ) + 1.
ls_id_mapping-new = condense( lv_name ).
INSERT ls_id_mapping INTO TABLE lt_id_mapping.
ENDIF.
li_idref->set_value( |{ ls_id_mapping-new }| ).
ENDIF.
ENDIF.
li_node = li_iterator->get_next( ).
ENDWHILE.
li_iterator = ii_xml_doc->create_iterator( ).
li_node = li_iterator->get_next( ).
WHILE NOT li_node IS INITIAL.
lv_name = li_node->get_name( ).
IF lv_name = 'NODE' OR lv_name = 'WINDOW'.
li_idref = li_node->get_attributes( )->get_named_item( 'ID' ).
IF li_idref IS BOUND.
ls_id_mapping-old = li_idref->get_value( ).
READ TABLE lt_id_mapping WITH KEY old = ls_id_mapping-old
INTO ls_id_mapping.
IF sy-subrc = 0.
li_idref->set_value( |{ ls_id_mapping-new }| ).
ELSE.
li_attr = li_node->get_attributes( ).
li_attr->remove_named_item( 'ID' ).
ENDIF.
ENDIF.
ENDIF.
li_node = li_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD get_range_node_codes.
DATA: ls_range_node_code TYPE LINE OF ty_string_range.
IF gt_range_node_codes IS INITIAL.
ls_range_node_code-sign = 'I'.
ls_range_node_code-option = 'EQ'.
ls_range_node_code-low = 'CODE'.
INSERT ls_range_node_code INTO TABLE gt_range_node_codes.
ls_range_node_code-low = 'GTYPES'.
INSERT ls_range_node_code INTO TABLE gt_range_node_codes.
ls_range_node_code-low = 'GCODING'.
INSERT ls_range_node_code INTO TABLE gt_range_node_codes.
ls_range_node_code-low = 'FCODING'.
INSERT ls_range_node_code INTO TABLE gt_range_node_codes.
ENDIF.
rt_range_node_codes = gt_range_node_codes.
ENDMETHOD.
METHOD handle_attrib_leading_spaces.
DATA li_element TYPE REF TO if_ixml_element.
DATA lv_leading_spaces TYPE string.
DATA lv_coding_line TYPE string.
TRY.
code_item_section_handling( EXPORTING iv_name = iv_name
ii_node = ii_node
IMPORTING ei_code_item_element = li_element
CHANGING cv_within_code_section = cv_within_code_section ).
* for downwards compatibility, this code can be removed sometime in the future
lv_leading_spaces = li_element->get_attribute_ns( name = attrib_abapgit_leadig_spaces ).
lv_coding_line = li_element->get_value( ).
IF strlen( lv_coding_line ) >= 1 AND lv_coding_line(1) <> | |.
SHIFT lv_coding_line RIGHT BY lv_leading_spaces PLACES.
li_element->set_value( lv_coding_line ).
ENDIF.
CATCH zcx_abapgit_exception ##no_handler.
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
SELECT SINGLE lastuser FROM stxfadm INTO rv_user
WHERE formname = ms_item-obj_name.
IF sy-subrc <> 0.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_formname TYPE tdsfname.
lv_formname = ms_item-obj_name.
CALL FUNCTION 'FB_DELETE_FORM'
EXPORTING
i_formname = lv_formname
i_with_dialog = abap_false
i_with_confirm_dialog = abap_false
EXCEPTIONS
no_form = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
* see function module FB_UPLOAD_FORM
DATA: li_node TYPE REF TO if_ixml_node,
lv_formname TYPE tdsfname,
lv_name TYPE string,
li_iterator TYPE REF TO if_ixml_node_iterator,
lo_sf TYPE REF TO cl_ssf_fb_smart_form,
lo_res TYPE REF TO cl_ssf_fb_smart_form,
lx_error TYPE REF TO cx_ssf_fb,
lv_text TYPE string,
lv_within_code_section TYPE abap_bool.
lo_sf = NEW #( ).
* set "created by" and "changed by" to current user
li_iterator = io_xml->get_raw( )->get_root_element( )->create_iterator( ).
li_node = li_iterator->get_next( ).
WHILE NOT li_node IS INITIAL.
lv_name = li_node->get_name( ).
CASE lv_name.
WHEN 'LASTDATE'.
li_node->set_value( sy-datum(4) && '-' && sy-datum+4(2) && '-' && sy-datum+6(2) ).
WHEN 'LASTTIME'.
li_node->set_value( sy-uzeit(2) && ':' && sy-uzeit+2(2) && ':' && sy-uzeit+4(2) ).
WHEN 'FIRSTUSER' OR 'LASTUSER'.
li_node->set_value( sy-uname && '' ).
ENDCASE.
handle_attrib_leading_spaces( EXPORTING iv_name = lv_name
ii_node = li_node
CHANGING cv_within_code_section = lv_within_code_section ).
li_node = li_iterator->get_next( ).
ENDWHILE.
tadir_insert( iv_package ).
lv_formname = ms_item-obj_name.
TRY.
lo_sf->enqueue( suppress_corr_check = space
master_language = mv_language
mode = 'INSERT'
formname = lv_formname ).
lo_sf->xml_upload( EXPORTING dom = io_xml->get_raw( )->get_root_element( )
formname = lv_formname
language = mv_language
CHANGING sform = lo_res ).
lo_res->store( im_formname = lo_res->header-formname
im_language = mv_language
im_active = abap_true ).
lo_sf->dequeue( lv_formname ).
CATCH cx_ssf_fb INTO lx_error.
lv_text = lx_error->get_text( ).
zcx_abapgit_exception=>raise( |{ ms_item-obj_type } { ms_item-obj_name }: { lv_text } | ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_formname TYPE stxfadm-formname.
SELECT SINGLE formname FROM stxfadm INTO lv_formname
WHERE formname = ms_item-obj_name.
rv_bool = xsdbool( 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( ).
rs_metadata-delete_tadir = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
DATA: lv_ssfo_formname TYPE tdsfname.
lv_ssfo_formname = ms_item-obj_name.
CALL FUNCTION 'SSF_STATUS_INFO'
EXPORTING
i_formname = lv_ssfo_formname
IMPORTING
o_inactive = ms_item-inactive.
rv_active = xsdbool( ms_item-inactive = abap_false ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'E_SMFORM'
iv_argument = |{ ms_item-obj_name }| ).
ENDMETHOD.
METHOD zif_abapgit_object~jump.
DATA: lt_bdcdata TYPE TABLE OF bdcdata,
lv_formtype TYPE stxfadm-formtype.
FIELD-SYMBOLS: <ls_bdcdata> LIKE LINE OF lt_bdcdata.
APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>.
<ls_bdcdata>-program = 'SAPMSSFO'.
<ls_bdcdata>-dynpro = '0100'.
<ls_bdcdata>-dynbegin = abap_true.
SELECT SINGLE formtype FROM stxfadm INTO lv_formtype
WHERE formname = ms_item-obj_name.
IF lv_formtype = cssf_formtype_text.
APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>.
<ls_bdcdata>-fnam = 'RB_TX'.
<ls_bdcdata>-fval = abap_true.
APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>.
<ls_bdcdata>-fnam = 'BDC_OKCODE'.
<ls_bdcdata>-fval = '=RB'.
APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>.
<ls_bdcdata>-program = 'SAPMSSFO'.
<ls_bdcdata>-dynpro = '0100'.
<ls_bdcdata>-dynbegin = abap_true.
APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>.
<ls_bdcdata>-fnam = 'SSFSCREEN-TNAME'.
<ls_bdcdata>-fval = ms_item-obj_name.
ELSE.
APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>.
<ls_bdcdata>-fnam = 'SSFSCREEN-FNAME'.
<ls_bdcdata>-fval = ms_item-obj_name.
ENDIF.
APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>.
<ls_bdcdata>-fnam = 'BDC_OKCODE'.
<ls_bdcdata>-fval = '=DISPLAY'.
CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
STARTING NEW TASK 'GIT'
EXPORTING
tcode = 'SMARTFORMS'
mode_val = 'E'
TABLES
using_tab = lt_bdcdata
EXCEPTIONS
OTHERS = 1
##fm_subrc_ok. "#EC CI_SUBRC
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
* see function module FB_DOWNLOAD_FORM
DATA: lo_sf TYPE REF TO cl_ssf_fb_smart_form,
lv_name TYPE string,
li_node TYPE REF TO if_ixml_node,
li_element TYPE REF TO if_ixml_element,
li_iterator TYPE REF TO if_ixml_node_iterator,
lv_formname TYPE tdsfname,
li_ixml TYPE REF TO if_ixml,
li_xml_doc TYPE REF TO if_ixml_document.
li_ixml = cl_ixml=>create( ).
li_xml_doc = li_ixml->create_document( ).
lo_sf = NEW #( ).
lv_formname = ms_item-obj_name. " convert type
TRY.
lo_sf->load( im_formname = lv_formname
im_language = '' ).
CATCH cx_ssf_fb.
* the smartform is not present in system, or other error occured
RETURN.
ENDTRY.
lo_sf->xml_download( EXPORTING parent = li_xml_doc
CHANGING document = li_xml_doc ).
li_iterator = li_xml_doc->create_iterator( ).
li_node = li_iterator->get_next( ).
WHILE NOT li_node IS INITIAL.
lv_name = li_node->get_name( ).
IF lv_name = 'DEVCLASS'
OR lv_name = 'LASTDATE'
OR lv_name = 'LASTTIME'.
li_node->set_value( '' ).
ENDIF.
IF lv_name = 'FIRSTUSER'
OR lv_name = 'LASTUSER'.
li_node->set_value( 'DUMMY' ).
ENDIF.
li_node = li_iterator->get_next( ).
ENDWHILE.
fix_ids( li_xml_doc ).
li_element = li_xml_doc->get_root_element( ).
li_element->set_attribute(
name = 'sf'
namespace = 'xmlns'
value = 'urn:sap-com:SmartForms:2000:internal-structure' ).
li_element->set_attribute(
name = 'xmlns'
value = 'urn:sap-com:sdixml-ifr:2000' ).
io_xml->set_raw( li_xml_doc->get_root_element( ) ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
824,
6513,
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,
1259,
62,
8841,
62,
9521,
41876,
371,
27746,
3963,
4731,
764,
628,
220,
220,
220,
42715,
12,
26947,
308,
83,
62,
9521,
62,
17440,
62,
40148,
41876,
1259,
62,
8841,
62,
9521,
764,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
708,
822,
62,
397,
499,
18300,
62,
28230,
328,
62,
2777,
2114,
41876,
4731,
26173,
8924,
705,
397,
499,
18300,
12,
28230,
328,
12,
2777,
2114,
6,
22492,
15285,
62,
32541,
13,
628,
220,
220,
220,
337,
36252,
50,
4259,
62,
2340,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
19875,
62,
15390,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
22897,
764,
198,
220,
220,
220,
337,
36252,
50,
5412,
62,
1078,
822,
62,
12294,
62,
2777,
2114,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
220,
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,
4178,
62,
17440,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
17440,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
33967,
62,
33479,
62,
8189,
62,
5458,
41876,
450,
499,
62,
30388,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
9521,
62,
17440,
62,
40148,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
9521,
62,
17440,
62,
40148,
8,
41876,
1259,
62,
8841,
62,
9521,
764,
198,
220,
220,
220,
337,
36252,
50,
2438,
62,
9186,
62,
5458,
62,
4993,
1359,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
220,
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,
4178,
62,
17440,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
17440,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
20295,
62,
8189,
62,
9186,
62,
30854,
220,
220,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
33967,
62,
33479,
62,
8189,
62,
5458,
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,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
824,
6513,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
2438,
62,
9186,
62,
5458,
62,
4993,
1359,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
300,
66,
62,
17440,
62,
9186,
41876,
4731,
26173,
8924,
705,
9186,
4458,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
300,
66,
62,
17440,
62,
5239,
41876,
4731,
26173,
8924,
705,
2,
5239,
4458,
628,
220,
220,
220,
16876,
21628,
62,
3672,
3268,
651,
62,
9521,
62,
17440,
62,
40148,
7,
6739,
198,
220,
220,
220,
220,
220,
269,
85,
62,
33479,
62,
8189,
62,
5458,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
16876,
269,
85,
62,
33479,
62,
8189,
62,
5458,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
16876,
21628,
62,
3672,
796,
300,
66,
62,
17440,
62,
9186,
13,
198,
220,
220,
220,
220,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
304,
72,
62,
8189,
62,
9186,
62,
30854,
5633,
28,
21065,
62,
17440,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
1837,
62,
21084,
62,
2701,
62,
18224,
22492,
3919,
62,
30281,
13,
198,
220,
220,
220,
220,
220,
220,
220,
23578,
40405,
13,
628,
220,
220,
220,
220,
220,
17852,
5188,
5064,
21628,
62,
3672,
5626,
3268,
651,
62,
9521,
62,
17440,
62,
40148,
7,
1267,
5357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3672,
1279,
29,
300,
66,
62,
17440,
62,
5239,
13,
198,
220,
220,
220,
220,
220,
220,
220,
269,
85,
62,
33479,
62,
8189,
62,
5458,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
17926,
24352,
7788,
42006,
2849,
41876,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
4259,
62,
2340,
13,
628,
220,
220,
220,
366,
1838,
1654,
4522,
290,
4522,
31688,
3815,
389,
262,
976,
3815,
329,
1123,
11389,
1634,
1057,
198,
220,
220,
220,
366,
262,
3210,
2438,
468,
257,
3753,
326,
7622,
3649,
3815,
13,
198,
220,
220,
220,
366,
198,
220,
220,
220,
366,
632,
318,
1593,
326,
32373,
290,
4522,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_repo DEFINITION
PUBLIC
ABSTRACT
CREATE PUBLIC .
PUBLIC SECTION.
DATA ms_data TYPE zif_abapgit_persistence=>ty_repo READ-ONLY.
METHODS bind_listener
IMPORTING
!ii_listener TYPE REF TO zif_abapgit_repo_listener .
METHODS deserialize_checks
RETURNING
VALUE(rs_checks) TYPE zif_abapgit_definitions=>ty_deserialize_checks
RAISING
zcx_abapgit_exception .
METHODS delete_checks
RETURNING
VALUE(rs_checks) TYPE zif_abapgit_definitions=>ty_delete_checks
RAISING
zcx_abapgit_exception .
METHODS constructor
IMPORTING
!is_data TYPE zif_abapgit_persistence=>ty_repo .
METHODS get_key
RETURNING
VALUE(rv_key) TYPE zif_abapgit_persistence=>ty_value .
METHODS get_name
RETURNING
VALUE(rv_name) TYPE string
RAISING
zcx_abapgit_exception .
METHODS get_files_local
IMPORTING
!ii_log TYPE REF TO zif_abapgit_log OPTIONAL
RETURNING
VALUE(rt_files) TYPE zif_abapgit_definitions=>ty_files_item_tt
RAISING
zcx_abapgit_exception .
METHODS get_local_checksums_per_file
RETURNING
VALUE(rt_checksums) TYPE zif_abapgit_definitions=>ty_file_signatures_tt .
METHODS get_files_remote
RETURNING
VALUE(rt_files) TYPE zif_abapgit_definitions=>ty_files_tt
RAISING
zcx_abapgit_exception .
METHODS get_package
RETURNING
VALUE(rv_package) TYPE zif_abapgit_persistence=>ty_repo-package .
METHODS get_dot_abapgit
RETURNING
VALUE(ro_dot_abapgit) TYPE REF TO zcl_abapgit_dot_abapgit .
METHODS set_dot_abapgit
IMPORTING
!io_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit
RAISING
zcx_abapgit_exception .
METHODS get_dot_apack
RETURNING
VALUE(ro_dot_apack) TYPE REF TO zcl_abapgit_apack_reader .
METHODS get_data_config
RETURNING
VALUE(ri_config) TYPE REF TO zif_abapgit_data_config
RAISING
zcx_abapgit_exception .
METHODS deserialize
IMPORTING
!is_checks TYPE zif_abapgit_definitions=>ty_deserialize_checks
!ii_log TYPE REF TO zif_abapgit_log
RAISING
zcx_abapgit_exception .
METHODS refresh
IMPORTING
!iv_drop_cache TYPE abap_bool DEFAULT abap_false
!iv_drop_log TYPE abap_bool DEFAULT abap_true
PREFERRED PARAMETER iv_drop_cache
RAISING
zcx_abapgit_exception .
METHODS update_local_checksums
IMPORTING
!it_files TYPE zif_abapgit_definitions=>ty_file_signatures_tt
RAISING
zcx_abapgit_exception .
METHODS rebuild_local_checksums
RAISING
zcx_abapgit_exception .
METHODS find_remote_dot_abapgit
RETURNING
VALUE(ro_dot) TYPE REF TO zcl_abapgit_dot_abapgit
RAISING
zcx_abapgit_exception .
METHODS is_offline
RETURNING
VALUE(rv_offline) TYPE abap_bool .
METHODS set_files_remote
IMPORTING
!it_files TYPE zif_abapgit_definitions=>ty_files_tt .
METHODS get_local_settings
RETURNING
VALUE(rs_settings) TYPE zif_abapgit_persistence=>ty_repo-local_settings .
METHODS set_local_settings
IMPORTING
!is_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings
RAISING
zcx_abapgit_exception .
METHODS has_remote_source
ABSTRACT
RETURNING
VALUE(rv_yes) TYPE abap_bool .
METHODS status
IMPORTING
!ii_log TYPE REF TO zif_abapgit_log OPTIONAL
RETURNING
VALUE(rt_results) TYPE zif_abapgit_definitions=>ty_results_tt
RAISING
zcx_abapgit_exception .
METHODS switch_repo_type
IMPORTING
!iv_offline TYPE abap_bool
RAISING
zcx_abapgit_exception .
METHODS create_new_log
IMPORTING
!iv_title TYPE string OPTIONAL
RETURNING
VALUE(ri_log) TYPE REF TO zif_abapgit_log .
METHODS get_log
RETURNING
VALUE(ri_log) TYPE REF TO zif_abapgit_log .
METHODS refresh_local_object
IMPORTING
!iv_obj_type TYPE tadir-object
!iv_obj_name TYPE tadir-obj_name
RAISING
zcx_abapgit_exception .
METHODS refresh_local_objects
RAISING
zcx_abapgit_exception .
METHODS reset_status .
METHODS get_unsupported_objects_local
RETURNING
VALUE(rt_objects) TYPE zif_abapgit_definitions=>ty_items_tt
RAISING
zcx_abapgit_exception .
PROTECTED SECTION.
DATA mt_local TYPE zif_abapgit_definitions=>ty_files_item_tt .
DATA mt_remote TYPE zif_abapgit_definitions=>ty_files_tt .
DATA mv_request_local_refresh TYPE abap_bool .
DATA mv_request_remote_refresh TYPE abap_bool .
DATA mt_status TYPE zif_abapgit_definitions=>ty_results_tt .
DATA mi_log TYPE REF TO zif_abapgit_log .
DATA mi_listener TYPE REF TO zif_abapgit_repo_listener .
DATA mo_apack_reader TYPE REF TO zcl_abapgit_apack_reader .
DATA mi_data_config TYPE REF TO zif_abapgit_data_config .
METHODS find_remote_dot_apack
RETURNING
VALUE(ro_dot) TYPE REF TO zcl_abapgit_apack_reader
RAISING
zcx_abapgit_exception .
METHODS set_dot_apack
IMPORTING
!io_dot_apack TYPE REF TO zcl_abapgit_apack_reader
RAISING
zcx_abapgit_exception .
METHODS set
IMPORTING
!it_checksums TYPE zif_abapgit_persistence=>ty_local_checksum_tt OPTIONAL
!iv_url TYPE zif_abapgit_persistence=>ty_repo-url OPTIONAL
!iv_branch_name TYPE zif_abapgit_persistence=>ty_repo-branch_name OPTIONAL
!iv_selected_commit TYPE zif_abapgit_persistence=>ty_repo-selected_commit OPTIONAL
!iv_head_branch TYPE zif_abapgit_persistence=>ty_repo-head_branch OPTIONAL
!iv_offline TYPE zif_abapgit_persistence=>ty_repo-offline OPTIONAL
!is_dot_abapgit TYPE zif_abapgit_persistence=>ty_repo-dot_abapgit OPTIONAL
!is_local_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings OPTIONAL
!iv_deserialized_at TYPE zif_abapgit_persistence=>ty_repo-deserialized_at OPTIONAL
!iv_deserialized_by TYPE zif_abapgit_persistence=>ty_repo-deserialized_by OPTIONAL
!iv_switched_origin TYPE zif_abapgit_persistence=>ty_repo-switched_origin OPTIONAL
RAISING
zcx_abapgit_exception .
METHODS reset_remote .
PRIVATE SECTION.
METHODS get_local_checksums
RETURNING
VALUE(rt_checksums) TYPE zif_abapgit_persistence=>ty_local_checksum_tt .
METHODS notify_listener
IMPORTING
!is_change_mask TYPE zif_abapgit_persistence=>ty_repo_meta_mask
RAISING
zcx_abapgit_exception .
METHODS update_last_deserialize
RAISING
zcx_abapgit_exception .
METHODS check_for_restart .
METHODS check_write_protect
RAISING
zcx_abapgit_exception .
METHODS check_language
RAISING
zcx_abapgit_exception .
METHODS remove_non_code_related_files
CHANGING
!ct_local_files TYPE zif_abapgit_definitions=>ty_files_item_tt .
METHODS compare_with_remote_checksum
IMPORTING
!it_remote_files TYPE zif_abapgit_definitions=>ty_files_tt
!is_local_file TYPE zif_abapgit_definitions=>ty_file_item-file
CHANGING
!cs_checksum TYPE zif_abapgit_persistence=>ty_local_checksum .
ENDCLASS.
CLASS zcl_abapgit_repo IMPLEMENTATION.
METHOD bind_listener.
mi_listener = ii_listener.
ENDMETHOD.
METHOD check_for_restart.
CONSTANTS:
lc_abapgit_prog TYPE progname VALUE `ZABAPGIT`.
" If abapGit was used to update itself, then restart to avoid LOAD_PROGRAM_&_MISMATCH dumps
" because abapGit code was changed at runtime
IF zcl_abapgit_ui_factory=>get_gui_functions( )->gui_is_available( ) = abap_true AND
zcl_abapgit_url=>is_abapgit_repo( ms_data-url ) = abap_true AND
sy-batch = abap_false AND
sy-cprog = lc_abapgit_prog.
IF zcl_abapgit_persist_factory=>get_settings( )->read( )->get_show_default_repo( ) = abap_false.
MESSAGE 'abapGit was updated and will restart itself' TYPE 'I'.
ENDIF.
SUBMIT (sy-cprog).
ENDIF.
ENDMETHOD.
METHOD check_language.
DATA lv_main_language TYPE spras.
" assumes find_remote_dot_abapgit has been called before
lv_main_language = get_dot_abapgit( )->get_main_language( ).
IF lv_main_language <> sy-langu.
zcx_abapgit_exception=>raise( |Current login language |
&& |'{ zcl_abapgit_convert=>conversion_exit_isola_output( sy-langu ) }'|
&& | does not match main language |
&& |'{ zcl_abapgit_convert=>conversion_exit_isola_output( lv_main_language ) }'.|
&& | Select 'Advanced' > 'Open in Main Language'| ).
ENDIF.
ENDMETHOD.
METHOD check_write_protect.
IF get_local_settings( )-write_protected = abap_true.
zcx_abapgit_exception=>raise( 'Cannot deserialize. Local code is write-protected by repo config' ).
ENDIF.
ENDMETHOD.
METHOD compare_with_remote_checksum.
FIELD-SYMBOLS: <ls_remote_file> LIKE LINE OF it_remote_files,
<ls_file_sig> LIKE LINE OF cs_checksum-files.
READ TABLE it_remote_files ASSIGNING <ls_remote_file>
WITH KEY path = is_local_file-path filename = is_local_file-filename
BINARY SEARCH.
IF sy-subrc <> 0. " Ignore new local ones
RETURN.
ENDIF.
APPEND INITIAL LINE TO cs_checksum-files ASSIGNING <ls_file_sig>.
MOVE-CORRESPONDING is_local_file TO <ls_file_sig>.
" If hashes are equal -> local sha1 is OK
" Else if R-branch is ahead -> assume changes were remote, state - local sha1
" Else (branches equal) -> assume changes were local, state - remote sha1
IF is_local_file-sha1 <> <ls_remote_file>-sha1.
<ls_file_sig>-sha1 = <ls_remote_file>-sha1.
ENDIF.
ENDMETHOD.
METHOD constructor.
ASSERT NOT is_data-key IS INITIAL.
ms_data = is_data.
mv_request_remote_refresh = abap_true.
ENDMETHOD.
METHOD create_new_log.
CREATE OBJECT mi_log TYPE zcl_abapgit_log.
mi_log->set_title( iv_title ).
ri_log = mi_log.
ENDMETHOD.
METHOD delete_checks.
DATA: li_package TYPE REF TO zif_abapgit_sap_package.
li_package = zcl_abapgit_factory=>get_sap_package( get_package( ) ).
rs_checks-transport-required = li_package->are_changes_recorded_in_tr_req( ).
ENDMETHOD.
METHOD deserialize.
DATA: lt_updated_files TYPE zif_abapgit_definitions=>ty_file_signatures_tt,
lt_result TYPE zif_abapgit_data_deserializer=>ty_results,
lx_error TYPE REF TO zcx_abapgit_exception.
find_remote_dot_abapgit( ).
find_remote_dot_apack( ).
check_write_protect( ).
check_language( ).
IF is_checks-requirements-met = zif_abapgit_definitions=>c_no AND is_checks-requirements-decision IS INITIAL.
zcx_abapgit_exception=>raise( 'Requirements not met and undecided' ).
ENDIF.
IF is_checks-dependencies-met = zif_abapgit_definitions=>c_no.
zcx_abapgit_exception=>raise( 'APACK dependencies not met' ).
ENDIF.
IF is_checks-transport-required = abap_true AND is_checks-transport-transport IS INITIAL.
zcx_abapgit_exception=>raise( |No transport request was supplied| ).
ENDIF.
" Deserialize objects
TRY.
lt_updated_files = zcl_abapgit_objects=>deserialize(
io_repo = me
is_checks = is_checks
ii_log = ii_log ).
CATCH zcx_abapgit_exception INTO lx_error.
* ensure to reset default transport request task
zcl_abapgit_default_transport=>get_instance( )->reset( ).
RAISE EXCEPTION lx_error.
ENDTRY.
APPEND get_dot_abapgit( )->get_signature( ) TO lt_updated_files.
update_local_checksums( lt_updated_files ).
" Deserialize data (no save to database, just test for now)
lt_result = zcl_abapgit_data_factory=>get_deserializer( )->deserialize(
ii_config = get_data_config( )
it_files = get_files_remote( ) ).
CLEAR: mt_local.
update_last_deserialize( ).
reset_status( ).
COMMIT WORK AND WAIT.
check_for_restart( ).
ENDMETHOD.
METHOD deserialize_checks.
DATA: lt_requirements TYPE zif_abapgit_dot_abapgit=>ty_requirement_tt,
lt_dependencies TYPE zif_abapgit_apack_definitions=>ty_dependencies.
find_remote_dot_abapgit( ).
find_remote_dot_apack( ).
check_write_protect( ).
check_language( ).
rs_checks = zcl_abapgit_objects=>deserialize_checks( me ).
lt_requirements = get_dot_abapgit( )->get_data( )-requirements.
rs_checks-requirements-met = zcl_abapgit_requirement_helper=>is_requirements_met( lt_requirements ).
lt_dependencies = get_dot_apack( )->get_manifest_descriptor( )-dependencies.
rs_checks-dependencies-met = zcl_abapgit_apack_helper=>are_dependencies_met( lt_dependencies ).
ENDMETHOD.
METHOD find_remote_dot_abapgit.
FIELD-SYMBOLS: <ls_remote> LIKE LINE OF mt_remote.
get_files_remote( ).
READ TABLE mt_remote ASSIGNING <ls_remote>
WITH KEY file_path
COMPONENTS path = zif_abapgit_definitions=>c_root_dir
filename = zif_abapgit_definitions=>c_dot_abapgit.
IF sy-subrc = 0.
ro_dot = zcl_abapgit_dot_abapgit=>deserialize( <ls_remote>-data ).
set_dot_abapgit( ro_dot ).
COMMIT WORK AND WAIT. " to release lock
ENDIF.
ENDMETHOD.
METHOD find_remote_dot_apack.
FIELD-SYMBOLS: <ls_remote> LIKE LINE OF mt_remote.
get_files_remote( ).
READ TABLE mt_remote ASSIGNING <ls_remote>
WITH KEY file_path
COMPONENTS path = zif_abapgit_definitions=>c_root_dir
filename = zif_abapgit_apack_definitions=>c_dot_apack_manifest.
IF sy-subrc = 0.
ro_dot = zcl_abapgit_apack_reader=>deserialize( iv_package_name = ms_data-package
iv_xstr = <ls_remote>-data ).
set_dot_apack( ro_dot ).
ENDIF.
ENDMETHOD.
METHOD get_data_config.
FIELD-SYMBOLS: <ls_remote> LIKE LINE OF mt_remote.
IF mi_data_config IS BOUND.
ri_config = mi_data_config.
RETURN.
ENDIF.
get_files_remote( ).
CREATE OBJECT ri_config TYPE zcl_abapgit_data_config.
mi_data_config = ri_config.
READ TABLE mt_remote ASSIGNING <ls_remote>
WITH KEY file_path
COMPONENTS path = zif_abapgit_data_config=>c_default_path.
IF sy-subrc = 0.
ri_config->from_json( mt_remote ).
ENDIF.
ENDMETHOD.
METHOD get_dot_abapgit.
CREATE OBJECT ro_dot_abapgit
EXPORTING
is_data = ms_data-dot_abapgit.
ENDMETHOD.
METHOD get_dot_apack.
IF mo_apack_reader IS NOT BOUND.
mo_apack_reader = zcl_abapgit_apack_reader=>create_instance( ms_data-package ).
ENDIF.
ro_dot_apack = mo_apack_reader.
ENDMETHOD.
METHOD get_files_local.
DATA lo_serialize TYPE REF TO zcl_abapgit_serialize.
" Serialization happened before and no refresh request
IF lines( mt_local ) > 0 AND mv_request_local_refresh = abap_false.
rt_files = mt_local.
RETURN.
ENDIF.
CREATE OBJECT lo_serialize
EXPORTING
io_dot_abapgit = get_dot_abapgit( )
is_local_settings = get_local_settings( ).
rt_files = lo_serialize->files_local(
iv_package = get_package( )
ii_data_config = get_data_config( )
ii_log = ii_log ).
mt_local = rt_files.
mv_request_local_refresh = abap_false. " Fulfill refresh
ENDMETHOD.
METHOD get_files_remote.
rt_files = mt_remote.
ENDMETHOD.
METHOD get_key.
rv_key = ms_data-key.
ENDMETHOD.
METHOD get_local_checksums.
rt_checksums = ms_data-local_checksums.
ENDMETHOD.
METHOD get_local_checksums_per_file.
FIELD-SYMBOLS <ls_object> LIKE LINE OF ms_data-local_checksums.
LOOP AT ms_data-local_checksums ASSIGNING <ls_object>.
APPEND LINES OF <ls_object>-files TO rt_checksums.
ENDLOOP.
ENDMETHOD.
METHOD get_local_settings.
rs_settings = ms_data-local_settings.
ENDMETHOD.
METHOD get_log.
ri_log = mi_log.
ENDMETHOD.
METHOD get_name.
rv_name = ms_data-local_settings-display_name.
ENDMETHOD.
METHOD get_package.
rv_package = ms_data-package.
ENDMETHOD.
METHOD get_unsupported_objects_local.
DATA: lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt,
lt_supported_types TYPE zcl_abapgit_objects=>ty_types_tt.
FIELD-SYMBOLS: <ls_tadir> LIKE LINE OF lt_tadir,
<ls_object> LIKE LINE OF rt_objects.
lt_tadir = zcl_abapgit_factory=>get_tadir( )->read(
iv_package = ms_data-package
iv_ignore_subpackages = ms_data-local_settings-ignore_subpackages
iv_only_local_objects = ms_data-local_settings-only_local_objects
io_dot = get_dot_abapgit( ) ).
lt_supported_types = zcl_abapgit_objects=>supported_list( ).
LOOP AT lt_tadir ASSIGNING <ls_tadir>.
READ TABLE lt_supported_types WITH KEY table_line = <ls_tadir>-object TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
APPEND INITIAL LINE TO rt_objects ASSIGNING <ls_object>.
MOVE-CORRESPONDING <ls_tadir> TO <ls_object>.
<ls_object>-obj_type = <ls_tadir>-object.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD is_offline.
rv_offline = ms_data-offline.
ENDMETHOD.
METHOD notify_listener.
DATA ls_meta_slug TYPE zif_abapgit_persistence=>ty_repo_xml.
IF mi_listener IS BOUND.
MOVE-CORRESPONDING ms_data TO ls_meta_slug.
mi_listener->on_meta_change(
iv_key = ms_data-key
is_meta = ls_meta_slug
is_change_mask = is_change_mask ).
ENDIF.
ENDMETHOD.
METHOD rebuild_local_checksums.
DATA:
lt_remote TYPE zif_abapgit_definitions=>ty_files_tt,
lt_local TYPE zif_abapgit_definitions=>ty_files_item_tt,
ls_last_item TYPE zif_abapgit_definitions=>ty_item,
lt_checksums TYPE zif_abapgit_persistence=>ty_local_checksum_tt.
FIELD-SYMBOLS:
<ls_checksum> LIKE LINE OF lt_checksums,
<ls_local> LIKE LINE OF lt_local.
lt_local = get_files_local( ).
remove_non_code_related_files( CHANGING ct_local_files = lt_local ).
lt_remote = get_files_remote( ).
SORT lt_remote BY path filename.
LOOP AT lt_local ASSIGNING <ls_local>.
IF ls_last_item <> <ls_local>-item OR sy-tabix = 1. " First or New item reached ?
APPEND INITIAL LINE TO lt_checksums ASSIGNING <ls_checksum>.
<ls_checksum>-item = <ls_local>-item.
ls_last_item = <ls_local>-item.
ENDIF.
compare_with_remote_checksum( EXPORTING
it_remote_files = lt_remote
is_local_file = <ls_local>-file
CHANGING
cs_checksum = <ls_checksum> ).
ENDLOOP.
set( it_checksums = lt_checksums ).
reset_status( ).
ENDMETHOD.
METHOD refresh.
mv_request_local_refresh = abap_true.
reset_remote( ).
IF iv_drop_log = abap_true.
CLEAR mi_log.
ENDIF.
IF iv_drop_cache = abap_true.
CLEAR mt_local.
ENDIF.
ENDMETHOD.
METHOD refresh_local_object.
DATA:
ls_tadir TYPE zif_abapgit_definitions=>ty_tadir,
lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt,
lt_new_local_files TYPE zif_abapgit_definitions=>ty_files_item_tt,
lo_serialize TYPE REF TO zcl_abapgit_serialize.
lt_tadir = zcl_abapgit_factory=>get_tadir( )->read(
iv_package = ms_data-package
io_dot = get_dot_abapgit( ) ).
DELETE mt_local WHERE item-obj_type = iv_obj_type
AND item-obj_name = iv_obj_name.
READ TABLE lt_tadir INTO ls_tadir
WITH KEY object = iv_obj_type
obj_name = iv_obj_name.
IF sy-subrc <> 0 OR ls_tadir-delflag = abap_true.
" object doesn't exist anymore, nothing todo here
RETURN.
ENDIF.
CLEAR lt_tadir.
INSERT ls_tadir INTO TABLE lt_tadir.
CREATE OBJECT lo_serialize.
lt_new_local_files = lo_serialize->serialize( lt_tadir ).
INSERT LINES OF lt_new_local_files INTO TABLE mt_local.
ENDMETHOD.
METHOD refresh_local_objects.
mv_request_local_refresh = abap_true.
get_files_local( ).
ENDMETHOD.
METHOD remove_non_code_related_files.
DELETE ct_local_files
WHERE item IS INITIAL
AND NOT ( file-path = zif_abapgit_definitions=>c_root_dir
AND file-filename = zif_abapgit_definitions=>c_dot_abapgit ).
SORT ct_local_files BY item.
ENDMETHOD.
METHOD reset_remote.
CLEAR mt_remote.
mv_request_remote_refresh = abap_true.
reset_status( ).
ENDMETHOD.
METHOD reset_status.
CLEAR mt_status.
ENDMETHOD.
METHOD set.
* TODO: refactor, maybe use zcl_abapgit_string_map ?
DATA: ls_mask TYPE zif_abapgit_persistence=>ty_repo_meta_mask.
ASSERT it_checksums IS SUPPLIED
OR iv_url IS SUPPLIED
OR iv_branch_name IS SUPPLIED
OR iv_selected_commit IS SUPPLIED
OR iv_head_branch IS SUPPLIED
OR iv_offline IS SUPPLIED
OR is_dot_abapgit IS SUPPLIED
OR is_local_settings IS SUPPLIED
OR iv_deserialized_by IS SUPPLIED
OR iv_deserialized_at IS SUPPLIED
OR iv_switched_origin IS SUPPLIED.
IF it_checksums IS SUPPLIED.
ms_data-local_checksums = it_checksums.
ls_mask-local_checksums = abap_true.
ENDIF.
IF iv_url IS SUPPLIED.
ms_data-url = iv_url.
ls_mask-url = abap_true.
ENDIF.
IF iv_branch_name IS SUPPLIED.
ms_data-branch_name = iv_branch_name.
ls_mask-branch_name = abap_true.
ENDIF.
IF iv_selected_commit IS SUPPLIED.
ms_data-selected_commit = iv_selected_commit.
ls_mask-selected_commit = abap_true.
ENDIF.
IF iv_head_branch IS SUPPLIED.
ms_data-head_branch = iv_head_branch.
ls_mask-head_branch = abap_true.
ENDIF.
IF iv_offline IS SUPPLIED.
ms_data-offline = iv_offline.
ls_mask-offline = abap_true.
ENDIF.
IF is_dot_abapgit IS SUPPLIED.
ms_data-dot_abapgit = is_dot_abapgit.
ls_mask-dot_abapgit = abap_true.
ENDIF.
IF is_local_settings IS SUPPLIED.
ms_data-local_settings = is_local_settings.
ls_mask-local_settings = abap_true.
ENDIF.
IF iv_deserialized_at IS SUPPLIED OR iv_deserialized_by IS SUPPLIED.
ms_data-deserialized_at = iv_deserialized_at.
ms_data-deserialized_by = iv_deserialized_by.
ls_mask-deserialized_at = abap_true.
ls_mask-deserialized_by = abap_true.
ENDIF.
IF iv_switched_origin IS SUPPLIED.
ms_data-switched_origin = iv_switched_origin.
ls_mask-switched_origin = abap_true.
ENDIF.
notify_listener( ls_mask ).
ENDMETHOD.
METHOD set_dot_abapgit.
set( is_dot_abapgit = io_dot_abapgit->get_data( ) ).
ENDMETHOD.
METHOD set_dot_apack.
get_dot_apack( ).
mo_apack_reader->set_manifest_descriptor( io_dot_apack->get_manifest_descriptor( ) ).
ENDMETHOD.
METHOD set_files_remote.
mt_remote = it_files.
mv_request_remote_refresh = abap_false.
ENDMETHOD.
METHOD set_local_settings.
set( is_local_settings = is_settings ).
ENDMETHOD.
METHOD status.
IF lines( mt_status ) = 0.
mt_status = zcl_abapgit_file_status=>status(
io_repo = me
ii_log = ii_log ).
ENDIF.
rt_results = mt_status.
ENDMETHOD.
METHOD switch_repo_type.
IF iv_offline = ms_data-offline.
zcx_abapgit_exception=>raise( |Cannot switch_repo_type, offline already = "{ ms_data-offline }"| ).
ENDIF.
IF iv_offline = abap_true. " On-line -> OFFline
set( iv_url = zcl_abapgit_url=>name( ms_data-url )
iv_branch_name = ''
iv_selected_commit = ''
iv_head_branch = ''
iv_offline = abap_true ).
ELSE. " OFFline -> On-line
set( iv_offline = abap_false ).
ENDIF.
ENDMETHOD.
METHOD update_last_deserialize.
DATA: lv_deserialized_at TYPE zif_abapgit_persistence=>ty_repo-deserialized_at,
lv_deserialized_by TYPE zif_abapgit_persistence=>ty_repo-deserialized_by.
GET TIME STAMP FIELD lv_deserialized_at.
lv_deserialized_by = sy-uname.
set( iv_deserialized_at = lv_deserialized_at
iv_deserialized_by = lv_deserialized_by ).
ENDMETHOD.
METHOD update_local_checksums.
" ASSUMTION: SHA1 in param is actual and correct.
" Push fills it from local files before pushing, deserialize from remote
" If this is not true that there is an error somewhere but not here
DATA: lt_checksums TYPE zif_abapgit_persistence=>ty_local_checksum_tt,
lt_files_idx TYPE zif_abapgit_definitions=>ty_file_signatures_tt,
lt_local TYPE zif_abapgit_definitions=>ty_files_item_tt,
lv_chks_row TYPE i,
lv_file_row TYPE i.
FIELD-SYMBOLS: <ls_checksum> LIKE LINE OF lt_checksums,
<ls_file> LIKE LINE OF <ls_checksum>-files,
<ls_local> LIKE LINE OF lt_local,
<ls_new_state> LIKE LINE OF it_files.
lt_checksums = get_local_checksums( ).
lt_files_idx = it_files.
SORT lt_files_idx BY path filename. " Sort for binary search
" Loop through current chacksum state, update sha1 for common files
LOOP AT lt_checksums ASSIGNING <ls_checksum>.
lv_chks_row = sy-tabix.
LOOP AT <ls_checksum>-files ASSIGNING <ls_file>.
lv_file_row = sy-tabix.
READ TABLE lt_files_idx ASSIGNING <ls_new_state>
WITH KEY path = <ls_file>-path filename = <ls_file>-filename
BINARY SEARCH.
CHECK sy-subrc = 0. " Missing in param table, skip
IF <ls_new_state>-sha1 IS INITIAL. " Empty input sha1 is a deletion marker
DELETE <ls_checksum>-files INDEX lv_file_row.
ELSE.
<ls_file>-sha1 = <ls_new_state>-sha1. " Update sha1
CLEAR <ls_new_state>-sha1. " Mark as processed
ENDIF.
ENDLOOP.
IF lines( <ls_checksum>-files ) = 0. " Remove empty objects
DELETE lt_checksums INDEX lv_chks_row.
ENDIF.
ENDLOOP.
DELETE lt_files_idx WHERE sha1 IS INITIAL. " Remove processed
IF lines( lt_files_idx ) > 0.
lt_local = get_files_local( ).
SORT lt_local BY file-path file-filename. " Sort for binary search
ENDIF.
" Add new files - not deleted and not marked as processed above
LOOP AT lt_files_idx ASSIGNING <ls_new_state>.
READ TABLE lt_local ASSIGNING <ls_local>
WITH KEY file-path = <ls_new_state>-path file-filename = <ls_new_state>-filename
BINARY SEARCH.
IF sy-subrc <> 0.
* if the deserialization fails, the local file might not be there
CONTINUE.
ENDIF.
READ TABLE lt_checksums ASSIGNING <ls_checksum> " TODO Optimize
WITH KEY item = <ls_local>-item.
IF sy-subrc > 0.
APPEND INITIAL LINE TO lt_checksums ASSIGNING <ls_checksum>.
<ls_checksum>-item = <ls_local>-item.
ENDIF.
APPEND <ls_new_state> TO <ls_checksum>-files.
ENDLOOP.
SORT lt_checksums BY item.
set( it_checksums = lt_checksums ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
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,
42865,
13845,
62,
7890,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
20832,
12,
1340,
11319,
13,
628,
220,
220,
220,
337,
36252,
50,
11007,
62,
4868,
877,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
4868,
877,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
62,
4868,
877,
764,
198,
220,
220,
220,
337,
36252,
50,
748,
48499,
1096,
62,
42116,
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,
337,
36252,
50,
12233,
62,
42116,
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,
33678,
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,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
7890,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
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,
2539,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
8367,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
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,
3672,
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,
337,
36252,
50,
651,
62,
16624,
62,
12001,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
6404,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
16624,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
62,
9186,
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,
337,
36252,
50,
651,
62,
12001,
62,
42116,
5700,
62,
525,
62,
7753,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
42116,
5700,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
7753,
62,
12683,
6691,
62,
926,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
16624,
62,
47960,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
16624,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
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,
337,
36252,
50,
651,
62,
26495,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
26495,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
26495,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
26518,
62,
397,
499,
18300,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
26518,
62,
397,
499,
18300,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
764,
198,
220,
220,
220,
337,
36252,
50,
900,
62,
26518,
62,
397,
499,
18300,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
26518,
62,
397,
499,
18300,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
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,
651,
62,
26518,
62,
499,
441,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
26518,
62,
499,
441,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
499,
441,
62,
46862,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
7890,
62,
11250,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
11250,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
7890,
62,
11250,
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
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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25261,
7473,
9348,
7801,
12861,
1581,
3963,
1976,
66,
310,
62,
72,
62,
7442,
7753,
13,
198,
10619,
31631,
13,
198,
198,
31631,
1976,
565,
62,
66,
310,
62,
72,
62,
7442,
7753,
30023,
2538,
10979,
6234,
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
] |
CLASS zcl_abapgit_object_ddls 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.
METHODS open_adt_stob
IMPORTING iv_ddls_name TYPE tadir-obj_name
RAISING zcx_abapgit_exception.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_DDLS IMPLEMENTATION.
METHOD open_adt_stob.
DATA: lr_data TYPE REF TO data,
lo_ddl TYPE REF TO object,
lx_error TYPE REF TO cx_root.
FIELD-SYMBOLS: <lt_ddnames> TYPE STANDARD TABLE.
FIELD-SYMBOLS: <lt_entity_view> TYPE STANDARD TABLE.
FIELD-SYMBOLS: <lg_ddnames> TYPE any.
FIELD-SYMBOLS: <lg_entity_view> TYPE any.
FIELD-SYMBOLS: <lg_ddname> TYPE any.
FIELD-SYMBOLS: <lg_ddlname> TYPE any.
TRY.
CREATE DATA lr_data TYPE ('IF_DD_DDL_TYPES=>TY_T_DDOBJ').
ASSIGN lr_data->* TO <lt_ddnames>.
CREATE DATA lr_data LIKE LINE OF <lt_ddnames>.
ASSIGN lr_data->* TO <lg_ddnames>.
CREATE DATA lr_data TYPE ('IF_DD_DDL_TYPES=>TY_T_ENTITY_OF_VIEW').
ASSIGN lr_data->* TO <lt_entity_view>.
CREATE DATA lr_data LIKE LINE OF <lt_entity_view>.
ASSIGN lr_data->* TO <lg_entity_view>.
CLEAR <lt_ddnames>.
ASSIGN COMPONENT 'NAME' OF STRUCTURE <lg_ddnames> TO <lg_ddname>.
<lg_ddname> = iv_ddls_name.
INSERT <lg_ddnames> INTO TABLE <lt_ddnames>.
CALL METHOD ('CL_DD_DDL_HANDLER_FACTORY')=>('CREATE')
RECEIVING
handler = lo_ddl.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~GET_VIEWNAME_FROM_ENTITYNAME')
EXPORTING
ddnames = <lt_ddnames>
IMPORTING
view_of_entity = <lt_entity_view>.
READ TABLE <lt_entity_view> ASSIGNING <lg_entity_view> INDEX 1.
IF sy-subrc = 0.
ASSIGN COMPONENT 'DDLNAME' OF STRUCTURE <lg_entity_view> TO <lg_ddlname>.
jump_adt( iv_obj_name = <lg_ddlname>
iv_obj_type = 'DDLS' ).
ENDIF.
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise( iv_text = lx_error->get_text( )
ix_previous = lx_error ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
DATA: lo_ddl TYPE REF TO object,
lr_data TYPE REF TO data,
lx_error TYPE REF TO cx_root.
FIELD-SYMBOLS: <lg_data> TYPE any,
<lg_field> TYPE any.
CREATE DATA lr_data TYPE ('DDDDLSRCV').
ASSIGN lr_data->* TO <lg_data>.
CALL METHOD ('CL_DD_DDL_HANDLER_FACTORY')=>('CREATE')
RECEIVING
handler = lo_ddl.
TRY.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~READ')
EXPORTING
name = ms_item-obj_name
get_state = 'A'
IMPORTING
ddddlsrcv_wa = <lg_data>.
ASSIGN COMPONENT 'AS4USER' OF STRUCTURE <lg_data> TO <lg_field>.
IF sy-subrc = 0.
rv_user = <lg_field>.
ENDIF.
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise( iv_text = lx_error->get_text( )
ix_previous = lx_error ).
ENDTRY.
IF rv_user IS INITIAL.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lo_ddl TYPE REF TO object,
lx_error TYPE REF TO cx_root.
CALL METHOD ('CL_DD_DDL_HANDLER_FACTORY')=>('CREATE')
RECEIVING
handler = lo_ddl.
TRY.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~DELETE')
EXPORTING
name = ms_item-obj_name.
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise(
iv_text = |DDLS, { ms_item-obj_name } { lx_error->get_text( ) }|
ix_previous = lx_error ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lo_ddl TYPE REF TO object,
lr_data TYPE REF TO data,
lx_error TYPE REF TO cx_root.
FIELD-SYMBOLS: <lg_data> TYPE any,
<lg_field> TYPE any.
CREATE DATA lr_data TYPE ('DDDDLSRCV').
ASSIGN lr_data->* TO <lg_data>.
io_xml->read( EXPORTING iv_name = 'DDLS'
CHANGING cg_data = <lg_data> ).
ASSIGN COMPONENT 'SOURCE' OF STRUCTURE <lg_data> TO <lg_field>.
ASSERT sy-subrc = 0.
<lg_field> = mo_files->read_string( 'asddls' ) ##no_text.
CALL METHOD ('CL_DD_DDL_HANDLER_FACTORY')=>('CREATE')
RECEIVING
handler = lo_ddl.
TRY.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~SAVE')
EXPORTING
name = ms_item-obj_name
put_state = 'N'
ddddlsrcv_wa = <lg_data>.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~WRITE_TADIR')
EXPORTING
objectname = ms_item-obj_name
devclass = iv_package
prid = 0.
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise( iv_text = lx_error->get_text( )
ix_previous = lx_error ).
ENDTRY.
zcl_abapgit_objects_activation=>add_item( ms_item ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_state TYPE objstate,
lo_ddl TYPE REF TO object.
CALL METHOD ('CL_DD_DDL_HANDLER_FACTORY')=>('CREATE')
RECEIVING
handler = lo_ddl.
TRY.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~READ')
EXPORTING
name = ms_item-obj_name
get_state = 'A'
IMPORTING
got_state = lv_state.
IF lv_state IS INITIAL.
rv_bool = abap_false.
ELSE.
rv_bool = abap_true.
ENDIF.
CATCH cx_root.
rv_bool = abap_false.
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
DATA: ls_meta TYPE zif_abapgit_definitions=>ty_metadata.
ls_meta = get_metadata( ).
IF ls_meta-late_deser = abap_true.
APPEND zif_abapgit_object=>gc_step_id-late TO rt_steps.
ELSEIF ls_meta-ddic = abap_true.
APPEND zif_abapgit_object=>gc_step_id-ddic TO rt_steps.
ELSE.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-ddic = abap_true.
rs_metadata-delete_tadir = 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.
DATA: lv_typename TYPE typename.
DATA: lv_ddtypekind TYPE ddtypekind.
lv_typename = ms_item-obj_name.
CALL FUNCTION 'DDIF_TYPEINFO_GET'
EXPORTING
typename = lv_typename
IMPORTING
typekind = lv_ddtypekind.
CASE lv_ddtypekind.
WHEN 'STOB'.
me->open_adt_stob( ms_item-obj_name ).
WHEN OTHERS.
zcx_abapgit_exception=>raise( 'DDLS Jump Error' ).
ENDCASE.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lo_ddl TYPE REF TO object,
lr_data TYPE REF TO data,
lt_clr_comps TYPE STANDARD TABLE OF fieldname WITH DEFAULT KEY,
lx_error TYPE REF TO cx_root.
FIELD-SYMBOLS: <lg_data> TYPE any,
<lg_field> TYPE any,
<lv_comp> LIKE LINE OF lt_clr_comps.
CREATE DATA lr_data TYPE ('DDDDLSRCV').
ASSIGN lr_data->* TO <lg_data>.
CALL METHOD ('CL_DD_DDL_HANDLER_FACTORY')=>('CREATE')
RECEIVING
handler = lo_ddl.
TRY.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~READ')
EXPORTING
name = ms_item-obj_name
get_state = 'A'
IMPORTING
ddddlsrcv_wa = <lg_data>.
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise( iv_text = lx_error->get_text( )
ix_previous = lx_error ).
ENDTRY.
APPEND 'AS4USER' TO lt_clr_comps.
APPEND 'AS4DATE' TO lt_clr_comps.
APPEND 'AS4TIME' TO lt_clr_comps.
APPEND 'ACTFLAG' TO lt_clr_comps.
APPEND 'CHGFLAG' TO lt_clr_comps.
LOOP AT lt_clr_comps ASSIGNING <lv_comp>.
ASSIGN COMPONENT <lv_comp> OF STRUCTURE <lg_data> TO <lg_field>.
IF sy-subrc = 0.
CLEAR <lg_field>.
ENDIF.
ENDLOOP.
ASSIGN COMPONENT 'SOURCE' OF STRUCTURE <lg_data> TO <lg_field>.
ASSERT sy-subrc = 0.
mo_files->add_string( iv_ext = 'asddls'
iv_string = <lg_field> ) ##no_text.
CLEAR <lg_field>.
io_xml->add( iv_name = 'DDLS'
ig_data = <lg_data> ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
1860,
7278,
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,
220,
220,
337,
36252,
50,
1280,
62,
324,
83,
62,
301,
672,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
1860,
7278,
62,
3672,
41876,
36264,
343,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
16458,
6561,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1280,
62,
324,
83,
62,
301,
672,
13,
628,
220,
220,
220,
42865,
25,
300,
81,
62,
7890,
220,
41876,
4526,
37,
5390,
1366,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
1860,
75,
220,
220,
41876,
4526,
37,
5390,
2134,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
87,
62,
18224,
41876,
4526,
37,
5390,
43213,
62,
15763,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
2528,
62,
1860,
14933,
29,
220,
220,
220,
220,
41876,
49053,
9795,
43679,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
2528,
62,
26858,
62,
1177,
29,
41876,
49053,
9795,
43679,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
75,
70,
62,
1860,
14933,
29,
220,
220,
220,
220,
41876,
597,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
75,
70,
62,
26858,
62,
1177,
29,
41876,
597,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
75,
70,
62,
1860,
3672,
29,
220,
220,
220,
220,
220,
41876,
597,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
75,
70,
62,
1860,
75,
3672,
29,
220,
220,
220,
220,
41876,
597,
13,
628,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
42865,
300,
81,
62,
7890,
41876,
19203,
5064,
62,
16458,
62,
16458,
43,
62,
9936,
47,
1546,
14804,
9936,
62,
51,
62,
16458,
9864,
41,
27691,
198,
220,
220,
220,
220,
220,
220,
220,
24994,
16284,
300,
81,
62,
7890,
3784,
9,
5390,
1279,
2528,
62,
1860,
14933,
28401,
628,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
42865,
300,
81,
62,
7890,
34178,
48920,
3963,
1279,
2528,
62,
1860,
14933,
28401,
198,
220,
220,
220,
220,
220,
220,
220,
24994,
16284,
300,
81,
62,
7890,
3784,
9,
5390,
1279,
75,
70,
62,
1860,
14933,
28401,
628,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
42865,
300,
81,
62,
7890,
41876,
19203,
5064,
62,
16458,
62,
16458,
43,
62,
9936,
47,
1546,
14804,
9936,
62,
51,
62,
3525,
9050,
62,
19238,
62,
28206,
27691,
198,
220,
220,
220,
220,
220,
220,
220,
24994,
16284,
300,
81,
62,
7890,
3784,
9,
5390,
1279,
2528,
62,
26858,
62,
1177,
28401,
628,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
42865,
300,
81,
62,
7890,
34178,
48920,
3963,
1279,
2528,
62,
26858,
62,
1177,
28401,
198,
220,
220,
220,
220,
220,
220,
220,
24994,
16284,
300,
81,
62,
7890,
3784,
9,
5390,
1279,
75,
70,
62,
26858,
62,
1177,
28401,
628,
220,
220,
220,
220,
220,
220,
220,
30301,
1503,
1279,
2528,
62,
1860,
14933,
28401,
198,
220,
220,
220,
220,
220,
220,
220,
24994,
16284,
24301,
1340,
3525,
705,
20608,
6,
3963,
19269,
18415,
11335,
1279,
75,
70,
62,
1860,
14933,
29,
5390,
1279,
75,
70,
62,
1860,
3672,
28401,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
75,
70,
62,
1860,
3672,
29,
796,
21628,
62,
1860,
7278,
62,
3672,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29194,
17395,
1279,
75,
70,
62,
1860,
14933,
29,
39319,
43679,
1279,
2528,
62,
1860,
14933,
28401,
628,
220,
220,
220,
220,
220,
220,
220,
42815,
337,
36252,
19203,
5097,
62,
16458,
62,
16458,
43,
62,
39,
6981,
39878,
62,
37,
10659,
15513,
11537,
14804,
10786,
43387,
6158,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19644,
36,
3824,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21360,
796,
2376,
62,
1860,
75,
13,
628,
220,
220,
220,
220,
220,
220,
220,
42815,
337,
36252,
2376,
62,
1860,
75,
3784,
10786,
5064,
62,
16458,
62,
16458,
43,
62,
39,
6981,
39878,
93,
18851,
62,
28206,
20608,
62,
10913,
2662,
62,
3525,
9050,
20608,
11537,
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,
49427,
14933,
220,
220,
220,
220,
220,
220,
220,
796,
1279,
2528,
62,
1860,
14933,
29,
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,
1570,
62,
1659,
62,
26858,
796,
1279,
2528,
62,
26858,
62,
1177,
28401,
628,
220,
220,
220,
220,
220,
220,
220,
20832,
43679,
1279,
2528,
62,
26858,
62,
1177,
29,
24994,
3528,
15871,
1279,
75,
70,
62,
26858,
62,
1177,
29,
24413,
6369,
352,
13,
198,
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,
24994,
16284,
24301,
1340,
3525,
705,
16458,
43,
20608,
6,
3963,
19269,
18415,
11335,
1279,
75,
70,
62,
26858,
62,
1177,
29,
5390,
1279,
75,
70,
62,
1860,
75,
3672,
28401,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4391,
62,
324,
83,
7,
21628,
62,
26801,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS ltcl_test DEFINITION FINAL FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
DATA: f_cut2 TYPE REF TO zunitdemo_table_no_mock,
read_data2_act TYPE STANDARD TABLE OF zunitdemo_table1 WITH DEFAULT KEY,
read_data2_exp TYPE STANDARD TABLE OF zunitdemo_table1 WITH DEFAULT KEY.
METHODS:
setup,
_prepare_test_data
IMPORTING
key TYPE string
field TYPE string,
_test
IMPORTING
message TYPE string,
get_data FOR TESTING RAISING cx_static_check,
get_data2 FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_test IMPLEMENTATION.
METHOD setup.
TEST-INJECTION is_test.
g_is_test = |X|.
END-TEST-INJECTION.
f_cut2 = NEW #( ).
ENDMETHOD.
METHOD get_data.
f_cut2 = NEW #( ).
DELETE FROM zunitdemo_table1 WHERE test = 'X'.
DATA: new_data TYPE STANDARD TABLE OF zunitdemo_table1 WITH DEFAULT KEY.
new_data = VALUE #( ( test = |X|
key_a = |A|
field_1 = |C| ) ).
INSERT zunitdemo_table1 FROM TABLE new_data.
COMMIT WORK. " Required in case the data shall really be stored or deleted
DATA: read_data_act TYPE STANDARD TABLE OF zunitdemo_table1 WITH DEFAULT KEY,
read_data_exp TYPE STANDARD TABLE OF zunitdemo_table1 WITH DEFAULT KEY.
read_data_act = f_cut2->get_data( ).
read_data_exp = VALUE #( (
mandt = sy-mandt
test = |X|
key_a = |A|
field_1 = |C| ) ).
cl_abap_unit_assert=>assert_equals( msg = 'Expect correct data' exp = read_data_exp act = read_data_act ).
ENDMETHOD.
METHOD get_data2.
" Version of test method get_data which is easier to read
_prepare_test_data( key = |A| field = |C| ).
read_data2_exp = VALUE #( ( mandt = sy-mandt
test = |X|
key_a = |A|
field_1 = |C| ) ).
_test( message = |Expect correct data| ).
ENDMETHOD.
METHOD _prepare_test_data.
" Prepare test data
DELETE FROM zunitdemo_table1 WHERE test = 'X'.
DATA: new_data TYPE STANDARD TABLE OF zunitdemo_table1 WITH DEFAULT KEY.
new_data = VALUE #( ( test = |X|
key_a = |{ key }|
field_1 = |{ field }| ) ).
INSERT zunitdemo_table1 FROM TABLE new_data.
COMMIT WORK. " Required in case the data shall really be stored or deleted
ENDMETHOD.
METHOD _test.
" Test
read_data2_act = f_cut2->get_data( ).
cl_abap_unit_assert=>assert_equals( msg = message exp = read_data2_exp act = read_data2_act ).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
9288,
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,
25,
277,
62,
8968,
17,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
20850,
9536,
78,
62,
11487,
62,
3919,
62,
76,
735,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1100,
62,
7890,
17,
62,
529,
41876,
49053,
9795,
43679,
3963,
1976,
20850,
9536,
78,
62,
11487,
16,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1100,
62,
7890,
17,
62,
11201,
41876,
49053,
9795,
43679,
3963,
1976,
20850,
9536,
78,
62,
11487,
16,
13315,
5550,
38865,
35374,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
4808,
46012,
533,
62,
9288,
62,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1994,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2214,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
4808,
9288,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3275,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
651,
62,
7890,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
651,
62,
7890,
17,
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,
9058,
13,
628,
220,
220,
220,
43001,
12,
1268,
23680,
2849,
318,
62,
9288,
13,
198,
220,
220,
220,
220,
220,
308,
62,
271,
62,
9288,
796,
930,
55,
91,
13,
198,
220,
220,
220,
23578,
12,
51,
6465,
12,
1268,
23680,
2849,
13,
628,
220,
220,
220,
277,
62,
8968,
17,
796,
12682,
1303,
7,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
7890,
13,
628,
220,
220,
220,
277,
62,
8968,
17,
796,
12682,
1303,
7,
6739,
628,
220,
220,
220,
5550,
2538,
9328,
16034,
1976,
20850,
9536,
78,
62,
11487,
16,
33411,
1332,
796,
705,
55,
4458,
198,
220,
220,
220,
42865,
25,
649,
62,
7890,
41876,
49053,
9795,
43679,
3963,
1976,
20850,
9536,
78,
62,
11487,
16,
13315,
5550,
38865,
35374,
13,
198,
220,
220,
220,
649,
62,
7890,
796,
26173,
8924,
1303,
7,
357,
1332,
796,
930,
55,
91,
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,
1994,
62,
64,
796,
930,
32,
91,
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,
2214,
62,
16,
796,
930,
34,
91,
1267,
6739,
628,
220,
220,
220,
29194,
17395,
1976,
20850,
9536,
78,
62,
11487,
16,
16034,
43679,
649,
62,
7890,
13,
198,
220,
220,
220,
22240,
2043,
30936,
13,
366,
20906,
287,
1339,
262,
1366,
2236,
1107,
307,
8574,
393,
13140,
628,
220,
220,
220,
42865,
25,
1100,
62,
7890,
62,
529,
41876,
49053,
9795,
43679,
3963,
1976,
20850,
9536,
78,
62,
11487,
16,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1100,
62,
7890,
62,
11201,
41876,
49053,
9795,
43679,
3963,
1976,
20850,
9536,
78,
62,
11487,
16,
13315,
5550,
38865,
35374,
13,
628,
220,
220,
220,
1100,
62,
7890,
62,
529,
796,
277,
62,
8968,
17,
3784,
1136,
62,
7890,
7,
6739,
628,
220,
220,
220,
1100,
62,
7890,
62,
11201,
796,
26173,
8924,
1303,
7,
357,
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,
6855,
83,
796,
827,
12,
22249,
83,
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,
1332,
796,
930,
55,
91,
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,
1994,
62,
64,
796,
930,
32,
91,
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,
2214,
62,
16,
796,
930,
34,
91,
1267,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
31456,
796,
705,
3109,
806,
3376,
1366,
6,
1033,
796,
1100,
62,
7890,
62,
11201,
719,
796,
1100,
62,
7890,
62,
529,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
7890,
17,
13,
628,
220,
220,
220,
366,
10628,
286,
1332,
2446,
651,
62,
7890,
543,
318,
4577,
284,
1100,
628,
220,
220,
220,
4808,
46012,
533,
62,
9288,
62,
7890,
7,
1994,
796,
930,
32,
91,
2214,
796,
930,
34,
91,
6739,
628,
220,
220,
220,
1100,
62,
7890,
17,
62,
11201,
796,
26173,
8924,
1303,
7,
357,
6855,
83,
796,
827,
12,
22249,
83,
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,
1332,
796,
930,
55,
91,
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,
1994,
62,
64,
796,
930,
32,
91,
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,
2214,
62,
16,
796,
930,
34,
91,
1267,
6739,
628,
220,
220,
220,
4808
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
INTERFACE lif_data_generator.
CLASS-METHODS:
create
IMPORTING out TYPE REF TO if_oo_adt_classrun_out OPTIONAL.
ENDINTERFACE.
CLASS lcl_agency_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: tt_agency TYPE STANDARD TABLE OF /dmo/agency15 WITH KEY agency_id.
CLASS-METHODS: get_data
RETURNING VALUE(rt_data) TYPE tt_agency.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS lcl_agency_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
IF out IS BOUND. out->write( '--> Delete Content.' ). ENDIF.
DELETE FROM /dmo/agency15. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
DATA(lt_data) = get_data( ).
IF out IS BOUND. out->write( '--> Insert Content.' ). ENDIF.
INSERT /dmo/agency15 FROM TABLE @lt_data.
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD get_data.
rt_data = VALUE tt_agency(
( agency_id = '070001'
name = 'Sunshine Travel'
street = '134 West Street '
postal_code = '54323 '
city = 'Rochester '
country_code = 'US '
phone_number = '+1 901-632-5620 '
web_address = 'http://www.sunshine-travel.sap '
email_address = '[email protected] '
)
( agency_id = '070002'
name = 'Fly High'
street = 'Berliner Allee 11 '
postal_code = '40880 '
city = 'Duesseldorf '
country_code = 'DE '
phone_number = '+49 2102 69555 '
web_address = 'http://www.flyhigh.sap '
email_address = '[email protected] '
)
( agency_id = '070003'
name = 'Happy Hopping'
street = 'Calvinstr. 36 '
postal_code = '13467 '
city = 'Berlin '
country_code = 'DE '
phone_number = '+49 30-8853-0 '
web_address = 'http://www.haphop.sap '
email_address = '[email protected] '
)
( agency_id = '070004'
name = 'Pink Panther'
street = 'Auf der Schanz 54 '
postal_code = '65936 '
city = 'Frankfurt '
country_code = 'DE '
phone_number = '+49 69-467653-0 '
web_address = 'http://www.pinkpanther.sap'
email_address = '[email protected] '
)
( agency_id = '070005'
name = 'Your Choice'
street = 'Gustav-Jung-Str. 425 '
postal_code = '90455'
city = 'Nuernberg'
country_code = 'DE'
phone_number = '+49 9256-4548-0'
web_address = 'http://www.yc.sap'
email_address = '[email protected]'
)
( agency_id = '070006'
name = 'Bella Italia'
street = 'Via Marconi 123'
postal_code = '00139'
city = 'Roma'
country_code = 'IT'
phone_number = '+39 6 893546721'
web_address = 'http://www.tours.it/Adventure/'
email_address = '[email protected]/Adventure/'
)
( agency_id = '070007'
name = 'Hot Socks Travel'
street = '224 Balnagask Rd '
postal_code = '8053 '
city = 'Sydney'
country_code = 'AU '
phone_number = '+61 2 2004 5000 '
web_address = 'http://www.hst.co.au'
email_address = '[email protected]'
)
( agency_id = '070008'
name = 'Burns Nuclear'
street = '14 Science Park Drive'
postal_code = '118228'
city = 'Singapore'
country_code = 'SG'
phone_number = '+65 777-5566'
web_address = 'http://www.burns-burns-burns.sg'
email_address = '[email protected]'
)
( agency_id = '070009'
name = 'Honauer Reisen GmbH'
street = 'Baumgarten 8'
postal_code = '4212'
city = 'Neumarkt'
country_code = 'AT'
phone_number = '+43 7941 8903'
web_address = 'http://www.honauer.at'
email_address = '[email protected]'
)
( agency_id = '070010'
name = 'Travel from Walldorf'
street = 'Altonaer Str. 24 '
postal_code = '10557 '
city = 'Berlin '
country_code = 'DE '
phone_number = '+49 30-622860 '
web_address = 'http://www.travel-from-walldorf'
email_address = 'info@travel-from-walldorf'
)
( agency_id = '070011'
name = 'Voyager Enterprises'
street = 'Gustavslundsvaegen 151'
postal_code = '70563 '
city = 'Stockholm '
country_code = 'SE '
phone_number = '+46 8/ 587 70000'
web_address = 'http://www.starfleet.ufp'
email_address = '[email protected]'
)
( agency_id = '070012'
name = 'Ben McCloskey Ltd.'
street = '74 Court Oak Rd'
postal_code = 'B17 9TN'
city = 'Birmingham'
country_code = 'GB'
phone_number = '+44 121 365-2251 '
web_address = 'http://www.ben-mcCloskey.co.uk'
email_address = '[email protected]'
)
( agency_id = '070013'
name = 'Pillepalle Trips'
street = 'Gorki Park 4 '
postal_code = '8008 '
city = 'Zuerich '
country_code = 'CH '
phone_number = '+41 1 345-5321 '
web_address = 'http://www.pi-pa-tri.sap'
email_address = '[email protected]'
)
( agency_id = '070014'
name = 'Kangeroos'
street = 'Lancaster drive 435 '
postal_code = '20001 '
city = 'London '
country_code = 'GB '
phone_number = '+44 171-2937638 '
web_address = 'http://www.hopp.sap '
email_address = '[email protected] '
)
( agency_id = '070015'
name = 'Bavarian Castle'
street = 'Pilnizerstr. 241 '
postal_code = '01069 '
city = 'Dresden '
country_code = 'DE '
phone_number = '+49 98-32832732 '
web_address = 'http://www.neu.schwanstein.sap '
email_address = '[email protected] '
)
( agency_id = '070016'
name = 'Ali''s Bazar'
street = '45, Mac Arthur Boulevard '
postal_code = '19113 '
city = 'Boston '
country_code = 'US '
phone_number = '+1 508-692-5200 '
web_address = 'http://www.ali.sap '
email_address = '[email protected] '
)
( agency_id = '070017'
name = 'Super Agency'
street = '50 Cranworth St'
postal_code = 'G12 8AG'
city = 'Glasgow'
country_code = 'GB'
phone_number = '+44 141 711-5643'
web_address = 'http://www.super.sap'
email_address = '[email protected]'
)
( agency_id = '070018'
name = 'Wang Chong'
street = 'Gagarine Park '
postal_code = '150021 '
city = 'Moscow '
country_code = 'RU '
phone_number = '+7 3287-213321 '
web_address = 'http://www.wang.chong.sap'
email_address = '[email protected]'
)
( agency_id = '070019'
name = 'Around the World'
street = 'An der Breiten Wiese 122 '
postal_code = '30625 '
city = 'Hannover '
country_code = 'DE '
phone_number = '+49 511-347589-0 '
web_address = 'http://www.atw.sap'
email_address = '[email protected]'
)
( agency_id = '070020'
name = 'No Return'
street = 'Wahnheider Str. 57 '
postal_code = '51105 '
city = 'Koeln '
country_code = 'DE '
phone_number = '+49 221-5689-100 '
web_address = 'http://www.bye-bye.sap '
email_address = '[email protected] '
)
( agency_id = '070021'
name = 'Special Agency Peru'
street = 'Triberger Str. 42 '
postal_code = '70569 '
city = 'Stuttgart '
country_code = 'DE '
phone_number = '+49 711-7100 '
web_address = 'http://www.sap.com '
email_address = '[email protected] '
)
( agency_id = '070022'
name = 'Caribian Dreams'
street = 'Deichstrasse 45 '
postal_code = '26721 '
city = 'Emden '
country_code = 'DE '
phone_number = '+49 2670-8560-0 '
web_address = 'http://www.cuba-libre.sap '
email_address = '[email protected] '
)
( agency_id = '070023'
name = 'Asia By Plane'
street = '6-9 Iidabashi 7-chome'
postal_code = '102-0072'
city = 'Tokyo '
country_code = 'JP'
phone_number = '+81 3-3239-3501 '
web_address = 'http://www.asia-by-plane.co.jp'
email_address = '[email protected]'
)
( agency_id = '070024'
name = 'Everywhere'
street = 'Regensburger Platz 23 '
postal_code = '81679 '
city = 'Muenchen '
country_code = 'DE '
phone_number = '+49 89-2499239 '
web_address = 'http://www.everywhere.sap'
email_address = '[email protected]'
)
( agency_id = '070025'
name = 'Happy Holiday'
street = 'Rastenburger Str. 12'
postal_code = '28779 '
city = 'Bremen '
country_code = 'DE '
phone_number = '+49 3266-288817 '
web_address = 'http://www.haphol.sap'
email_address = '[email protected]'
)
( agency_id = '070026'
name = 'No Name'
street = 'Schwalbenweg 43 '
postal_code = '52078 '
city = 'Aachen '
country_code = 'DE '
phone_number = '+49 241-77729 '
web_address = 'http://www.nn.sap'
email_address = '[email protected]'
)
( agency_id = '070027'
name = 'Fly Low'
street = 'Chemnitzer Str. 42 '
postal_code = '01187 '
city = 'Dresden '
country_code = 'DE '
phone_number = '+49 351-5423-00 '
web_address = 'http://www.fly-low.sap'
email_address = '[email protected]'
)
( agency_id = '070028'
name = 'Aussie Travel'
street = 'Queens Road '
postal_code = 'M8 7RYP '
city = 'Manchester '
country_code = 'GB '
phone_number = '+44 161 2052000 '
web_address = 'http://www.down-under.sap'
email_address = '[email protected]'
)
( agency_id = '070029'
name = 'Up ''n'' Away'
street = 'Nackenbergerstr. 92 '
postal_code = '30625 '
city = 'Hannover '
country_code = 'DE '
phone_number = '+49 511 403266-0 '
web_address = 'http://www.una.sap '
email_address = '[email protected] '
)
( agency_id = '070030'
name = 'Trans World Travel'
street = '100 Industrial Drive '
postal_code = '60804 '
city = 'Chicago '
country_code = 'US '
phone_number = '+1 708-454-8723 '
web_address = 'http://www.twt.sap '
email_address = '[email protected] '
)
( agency_id = '070031'
name = 'Bright Side of Life'
street = '340 State Street '
postal_code = '30432 '
city = 'San Francisco '
country_code = 'US '
phone_number = '+1 415-454-9877 '
web_address = 'http://www.ruebennase.sap '
email_address = '[email protected] '
)
( agency_id = '070032'
name = 'Sunny, Sunny, Sunny'
street = '1300 State Street '
postal_code = '19003 '
city = 'Philadelphia '
country_code = 'US '
phone_number = '+1 215-090-7659 '
web_address = 'http://www.s3.sap '
email_address = '[email protected] '
)
( agency_id = '070033'
name = 'Fly & Smile'
street = 'Zeppelinstr. 17 '
postal_code = '60318 '
city = 'Frankfurt '
country_code = 'DE '
phone_number = '+49 69-99-0 '
web_address = 'http://www.fly-and-smile.sap '
email_address = '[email protected] '
)
( agency_id = '070034'
name = 'Supercheap'
street = '1400, Washington Circle '
postal_code = '30439 '
city = 'Los Angeles '
country_code = 'US '
phone_number = '+1 251-369-2510 '
web_address = 'http://www.supercheap.sap '
email_address = '[email protected] '
)
( agency_id = '070035'
name = 'Hitchhiker'
street = '21 Rue de Moselle '
postal_code = '92132 '
city = 'Issy-les-Moulineaux '
country_code = 'FR '
phone_number = '+33 1-405-555-888 '
web_address = 'http://www.42.sap '
email_address = '[email protected] '
)
( agency_id = '070036'
name = 'Fly Now, Pay Later'
street = '100 Madison '
postal_code = '11012 '
city = 'New York '
country_code = 'US '
phone_number = '+1 512 343-8543 '
web_address = 'http://www.fn-pl.sap '
email_address = '[email protected] '
)
( agency_id = '070037'
name = 'Real Weird Vacation'
street = '949 5th Street '
postal_code = 'V6T 1Z4'
city = 'Vancouver'
country_code = 'CA '
phone_number = '+1 604 827-8024'
web_address = 'http://www.reweva.sap '
email_address = '[email protected] '
)
( agency_id = '070038'
name = 'Cap Travels Ltd.'
street = '10 Mandela St'
postal_code = '2128'
city = 'Johannesburg'
country_code = 'ZA'
phone_number = '+27 11 886-8981'
web_address = 'http://www.cap-travels.co.za'
email_address = '[email protected]'
)
( agency_id = '070039'
name = 'Rainy, Stormy, Cloudy'
street = 'Lindenstr. 462 '
postal_code = '70563 '
city = 'Stuttgart '
country_code = 'DE '
phone_number = '+49 711-7992-00 '
web_address = 'http://www.windy.sap/rsc/ '
email_address = '[email protected]/rsc/ '
)
( agency_id = '070040'
name = 'Women only'
street = 'Kirchstr. 53 '
postal_code = '55124 '
city = 'Mainz '
country_code = 'DE '
phone_number = '+49 6131-543-00 '
web_address = 'http://www.women-only.sap '
email_address = '[email protected] '
)
( agency_id = '070041'
name = 'Maxitrip'
street = 'Flugfeld 17'
postal_code = '65128'
city = 'Wiesbaden'
country_code = 'DE'
phone_number = '+49 611-55 66 77'
web_address = 'http://www.maxitrip.sap'
email_address = '[email protected]'
)
( agency_id = '070042'
name = 'The Ultimate Answer'
street = 'Manchester Rd 20 '
postal_code = 'AB1 1SA '
city = 'Avon '
country_code = 'GB '
phone_number = '+44 934-66799 '
web_address = 'http://www.thulan.sap '
email_address = '[email protected] '
)
( agency_id = '070043'
name = 'Intertravel'
street = 'Michigan Ave '
postal_code = '60154 '
city = 'Chicago '
country_code = 'US '
phone_number = '+1 788 798-6555 '
web_address = 'http://www.intertravel.sap '
email_address = '[email protected] '
)
( agency_id = '070044'
name = 'Ultimate Goal'
street = '300 Peach tree street Sou'
postal_code = '01069 '
city = 'Atlanta '
country_code = 'US '
phone_number = '+1 874-654-6686'
web_address = 'http://www.ultimate-goal.sap '
email_address = '[email protected] '
)
( agency_id = '070045'
name = 'Submit and Return'
street = '20890 East Central Ave '
postal_code = '30987 '
city = 'Palo Alto '
country_code = 'US '
phone_number = '+1 652 645-5236 '
web_address = 'http://www.sar.sap '
email_address = '[email protected] '
)
( agency_id = '070046'
name = 'Hendrik''s'
street = '1200 Industrial Drive '
postal_code = '60153 '
city = 'Chicago '
country_code = 'US '
phone_number = '+1 08-924-9884 '
web_address = 'http://www.essen.sap/150596 '
email_address = '[email protected]/150596 '
)
( agency_id = '070047'
name = 'All British Air Planes'
street = '224 Tomato Lane '
postal_code = '08965 '
city = 'Vineland '
country_code = 'US '
phone_number = '+44 609-896-Moore '
web_address = 'http://www.abap.sap '
email_address = '[email protected] '
)
( agency_id = '070048'
name = 'Rocky Horror Tours'
street = '789 Santa Monica Blvd. '
postal_code = '08934 '
city = 'Santa Monica '
country_code = 'US '
phone_number = '+1 64351-6455-654 '
web_address = 'http://www.frank.furter.sap '
email_address = '[email protected] '
)
( agency_id = '070049'
name = 'Miles and More'
street = '777 Arlington Blvd. '
postal_code = '46515 '
city = 'Elkhart '
country_code = 'US '
phone_number = '+1 646 867-6888 '
web_address = 'http://www.mam.sap'
email_address = '[email protected]'
)
( agency_id = '070050'
name = 'Not Only By Bike'
street = 'Saalburgstr. 765 '
postal_code = '60385 '
city = 'Frankfurt '
country_code = 'DE '
phone_number = '+49 69 465789-0'
web_address = 'http://www.nobb.sap'
email_address = '[email protected]'
)
).
ENDMETHOD.
ENDCLASS.
CLASS lcl_airport_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: tt_airport TYPE STANDARD TABLE OF /dmo/airport15 WITH KEY airport_id.
CLASS-METHODS: get_data
RETURNING VALUE(rt_data) TYPE lcl_airport_data_generator=>tt_airport.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS lcl_airport_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
IF out IS BOUND. out->write( '--> Delete Content.' ). ENDIF.
DELETE FROM /dmo/airport15. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
DATA(lt_data) = get_data( ).
IF out IS BOUND. out->write( '--> Insert Content.' ). ENDIF.
INSERT /dmo/airport15 FROM TABLE @lt_data.
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD get_data.
rt_data = VALUE tt_airport(
" Europe
( airport_id = 'FRA' name = 'Frankfurt Airport' city = 'Frankfurt/Main' country = 'DE' )
( airport_id = 'HAM' name = 'Hamburg Airport' city = 'Hamburg' country = 'DE' )
( airport_id = 'MUC' name = 'Munich Airport' city = 'Munich' country = 'DE' )
( airport_id = 'SXF' name = 'Berlin Schönefeld Airport' city = 'Berlin' country = 'DE' )
( airport_id = 'THF' name = 'Berlin Tempelhof Airport' city = 'Berlin' country = 'DE' )
( airport_id = 'TXL' name = 'Berlin Tegel Airport' city = 'Berlin' country = 'DE' )
( airport_id = 'CDG' name = 'Charles de Gaulle Airport' city = 'Paris' country = 'FR' )
( airport_id = 'ORY' name = 'Orly Airport' city = 'Paris' country = 'FR' )
( airport_id = 'VIE' name = 'Vienna International Airport' city = 'Vienna' country = 'AT' )
( airport_id = 'ZRH' name = 'Zürich Airport' city = 'Zurich' country = 'CH' )
( airport_id = 'RTM' name = 'Rotterdam The Hague Airport' city = 'Rotterdam' country = 'NL' )
( airport_id = 'FCO' name = 'Leonardo da Vinci–Fiumicino Airport' city = 'Rome' country = 'IT' )
( airport_id = 'VCE' name = 'Venice Marco Polo Airport' city = 'Venice' country = 'IT' )
( airport_id = 'LCY' name = 'London City Airport' city = 'London' country = 'UK' )
( airport_id = 'LGW' name = 'Gatwick Airport' city = 'London' country = 'UK' )
( airport_id = 'LHR' name = 'Heathrow Airport' city = 'London' country = 'UK' )
( airport_id = 'MAD' name = 'Adolfo Suárez Madrid–Barajas Airport' city = 'Madrid' country = 'ES' )
( airport_id = 'VKO' name = 'Vnukovo International Airport' city = 'Moscow' country = 'RU' )
( airport_id = 'SVO' name = 'Sheremetyevo International Airport' city = 'Moscow' country = 'RU' )
" America
( airport_id = 'JFK' name = 'John F. Kennedy International Airport' city = 'New York City, New York' country = 'US' )
( airport_id = 'BNA' name = 'Nashville International Airport' city = 'Nashville, Tennessee' country = 'US' )
( airport_id = 'BOS' name = 'Logan International Airport' city = 'Boston, Massachusetts' country = 'US' )
( airport_id = 'ELP' name = 'El Paso International Airport' city = 'El Paso, Texas' country = 'US' )
( airport_id = 'DEN' name = 'Denver International Airport' city = 'Denver, Colorado' country = 'US' )
( airport_id = 'HOU' name = 'William P. Hobby Airport' city = 'Houston, Texas' country = 'US' )
( airport_id = 'LAS' name = 'McCarran International Airport' city = 'Las Vegas, Nevada' country = 'US' )
( airport_id = 'LAX' name = 'Los Angeles International Airport' city = 'Los Angeles, California' country = 'US' )
( airport_id = 'MCI' name = 'Kansas City International Airport' city = 'Kansas City, Missouri' country = 'US' )
( airport_id = 'MIA' name = 'Miami International Airport' city = 'Miami, Florida' country = 'US' )
( airport_id = 'SFO' name = 'San Francisco International Airport' city = 'San Francisco, California' country = 'US' )
( airport_id = 'EWR' name = 'Newark Liberty International Airport' city = 'Newark, New Jersey' country = 'US' )
( airport_id = 'YOW' name = 'Ottawa Macdonald–Cartier Int. Airport' city = 'Ottawa, Ontario' country = 'CA' )
( airport_id = 'ACA' name = 'General Juan N. Álvarez Int. Airport' city = 'Acapulco, Guerrero' country = 'MX' )
( airport_id = 'GIG' name = 'Rio de Janeiro–Galeão Int. Airport' city = 'Rio de Janeiro' country = 'BR' )
( airport_id = 'HAV' name = 'José Martí International Airport' city = 'Havana' country = 'CU' )
" Australia
( airport_id = 'ASP' name = 'Alice Springs Airport' city = 'Alice Springs, Northern Territory' country = 'AU' )
" Africa
( airport_id = 'ACE' name = 'Lanzarote Airport' city = 'Lanzarote, Canary Islands' country = 'ES' )
( airport_id = 'HRE' name = 'Harare International Airport' city = 'Harare' country = 'ZW' )
( airport_id = 'GCJ' name = 'Grand Central Airport' city = 'Johannesburg' country = 'SA' )
" Asia
( airport_id = 'NRT' name = 'Narita International Airport' city = 'Tokyo, Honshu' country = 'JP' )
( airport_id = 'ITM' name = 'Osaka International Airport' city = 'Osaka, Honshu' country = 'JP' )
( airport_id = 'KIX' name = 'Kansai International Airport' city = 'Osaka, Honshu' country = 'JP' )
( airport_id = 'HIJ' name = 'Hiroshima Airport' city = 'Hiroshima, Honshu' country = 'JP' )
( airport_id = 'SIN' name = 'Singapore Changi Airport' city = 'Singapore' country = 'SG' )
( airport_id = 'KUL' name = 'Kuala Lumpur International Airport' city = 'Kuala Lumpur' country = 'MY' )
( airport_id = 'HKG' name = 'Hong Kong International Airport' city = 'Hongkong' country = 'CN' )
( airport_id = 'BKK' name = 'Suvarnabhumi Airport' city = 'Bangkok' country = 'TH' )
).
ENDMETHOD.
ENDCLASS.
CLASS lcl_carrier_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: tt_carrier TYPE STANDARD TABLE OF /dmo/carrier15 WITH KEY carrier_id.
CLASS-METHODS: get_data
RETURNING
VALUE(rt_data) TYPE tt_carrier.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS lcl_carrier_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
IF out IS BOUND. out->write( '--> Delete Content.' ). ENDIF.
DELETE FROM /dmo/carrier15. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
DATA(lt_data) = get_data( ).
IF out IS BOUND. out->write( '--> Insert Content.' ). ENDIF.
INSERT /dmo/carrier15 FROM TABLE @lt_data.
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD get_data.
rt_data = VALUE tt_carrier(
( carrier_id = 'AA' name = 'American Airlines Inc.' currency_code = 'USD' )
( carrier_id = 'AC' name = 'Air Canada' currency_code = 'CAD' )
( carrier_id = 'AF' name = 'Air France' currency_code = 'EUR' )
( carrier_id = 'AZ' name = 'Alitalia Societa Aerea Italiana S.p.A.' currency_code = 'EUR' )
( carrier_id = 'BA' name = 'British Airways p.l.c.' currency_code = 'GBP' )
( carrier_id = 'FJ' name = 'Air Pacific Limited t/a Fiji Airway' currency_code = 'USD' )
( carrier_id = 'CO' name = 'Cobaltair Ltd. dba Cobalt' currency_code = 'USD' )
( carrier_id = 'DL' name = 'Delta Air Lines, Inc.' currency_code = 'USD' )
( carrier_id = 'LH' name = 'Deutsche Lufthansa AG' currency_code = 'EUR' )
( carrier_id = 'NG' name = 'AL-Naser Wings' currency_code = 'EUR' )
( carrier_id = 'JL' name = 'Japan Airlines Co., Ltd.' currency_code = 'JPY' )
( carrier_id = 'QF' name = 'Qantas Airways Ltd.' currency_code = 'AUD' )
( carrier_id = 'SA' name = 'South African Airways' currency_code = 'ZAR' )
( carrier_id = 'SQ' name = 'Singapore Airlines Limited' currency_code = 'SGD' )
( carrier_id = 'SR' name = 'Sundair GmbH' currency_code = 'CHF' )
( carrier_id = 'UA' name = 'United Airlines, Inc.' currency_code = 'USD' )
).
ENDMETHOD.
ENDCLASS.
CLASS lcl_connection_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: tt_connection TYPE STANDARD TABLE OF /dmo/connecti_15 WITH KEY carrier_id connection_id.
TYPES:
"! Structure for additional information for generation. <br/>
"! <em>weekday</em> '1' means Monday, '7' is Sunday
BEGIN OF ty_connection_additional_info.
INCLUDE TYPE /dmo/connecti_15.
TYPES: weekday TYPE i,
END OF ty_connection_additional_info.
TYPES: tt_connection_additional_info TYPE STANDARD TABLE OF ty_connection_additional_info WITH KEY connection_id.
CLASS-METHODS: get_data "provide data public
RETURNING VALUE(rt_data) TYPE tt_connection_additional_info.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS lcl_connection_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
IF out IS BOUND. out->write( '--> Delete Content.' ). ENDIF.
DELETE FROM /dmo/connecti_15. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
DATA(lt_data) = get_data( ).
DATA(lt_data_db) = CORRESPONDING tt_connection( lt_data ).
IF out IS BOUND. out->write( '--> Insert Content.' ). ENDIF.
INSERT /dmo/connecti_15 FROM TABLE @lt_data.
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD get_data.
rt_data = VALUE tt_connection_additional_info(
( carrier_id = 'SQ' connection_id = '0001' airport_from_id = 'SFO' airport_to_id = 'SIN' departure_time = '011500' arrival_time = '115000' distance = 13523 distance_unit = 'KM' weekday = 3 ) "1-7
( carrier_id = 'SQ' connection_id = '0002' airport_from_id = 'SIN' airport_to_id = 'SFO' departure_time = '063000' arrival_time = '091500' distance = 13523 distance_unit = 'KM' weekday = 4 ) "1-7
( carrier_id = 'SQ' connection_id = '0011' airport_from_id = 'NRT' airport_to_id = 'SIN' departure_time = '145500' arrival_time = '205000' distance = 5363 distance_unit = 'KM' weekday = 4 ) "1-7
( carrier_id = 'SQ' connection_id = '0012' airport_from_id = 'SIN' airport_to_id = 'NRT' departure_time = '095300' arrival_time = '175400' distance = 5363 distance_unit = 'KM' weekday = 6 ) "1-7
( carrier_id = 'UA' connection_id = '0058' airport_from_id = 'SFO' airport_to_id = 'FRA' departure_time = '134500' arrival_time = '095500' distance = 9608 distance_unit = 'KM' weekday = 1 ) "1-7
( carrier_id = 'UA' connection_id = '0059' airport_from_id = 'FRA' airport_to_id = 'SFO' departure_time = '135500' arrival_time = '163000' distance = 9608 distance_unit = 'KM' weekday = 2 ) "1-7
( carrier_id = 'UA' connection_id = '1537' airport_from_id = 'EWR' airport_to_id = 'MIA' departure_time = '215600' arrival_time = '004700' distance = 1752 distance_unit = 'KM' weekday = 5 ) "1-7
( carrier_id = 'AA' connection_id = '0322' airport_from_id = 'MIA' airport_to_id = 'EWR' departure_time = '201700' arrival_time = '231900' distance = 1752 distance_unit = 'KM' weekday = 7 ) "1-7
( carrier_id = 'AA' connection_id = '0017' airport_from_id = 'MIA' airport_to_id = 'HAV' departure_time = '071900' arrival_time = '080300' distance = 520 distance_unit = 'KM' weekday = 3 ) "1-7
( carrier_id = 'AA' connection_id = '2678' airport_from_id = 'HAV' airport_to_id = 'MIA' departure_time = '061500' arrival_time = '103000' distance = 520 distance_unit = 'KM' weekday = 6 ) "1-7
( carrier_id = 'AA' connection_id = '0015' airport_from_id = 'JFK' airport_to_id = 'SFO' departure_time = '071300' arrival_time = '100400' distance = 4156 distance_unit = 'KM' weekday = 5 ) "1-7
( carrier_id = 'AA' connection_id = '0018' airport_from_id = 'SFO' airport_to_id = 'JFK' departure_time = '064000' arrival_time = '150600' distance = 4156 distance_unit = 'KM' weekday = 4 ) "1-7
( carrier_id = 'LH' connection_id = '0400' airport_from_id = 'FRA' airport_to_id = 'JFK' departure_time = '101000' arrival_time = '113400' distance = 6162 distance_unit = 'KM' weekday = 6 ) "1-7
( carrier_id = 'LH' connection_id = '0401' airport_from_id = 'JFK' airport_to_id = 'FRA' departure_time = '183000' arrival_time = '074500' distance = 6162 distance_unit = 'KM' weekday = 5 ) "1-7
( carrier_id = 'LH' connection_id = '0402' airport_from_id = 'FRA' airport_to_id = 'EWR' departure_time = '133000' arrival_time = '153500' distance = 6217 distance_unit = 'KM' weekday = 1 ) "1-7
( carrier_id = 'LH' connection_id = '0403' airport_from_id = 'EWR' airport_to_id = 'FRA' departure_time = '180900' arrival_time = '073000' distance = 6217 distance_unit = 'KM' weekday = 1 ) "1-7
( carrier_id = 'JL' connection_id = '0407' airport_from_id = 'NRT' airport_to_id = 'FRA' departure_time = '132300' arrival_time = '155600' distance = 9379 distance_unit = 'KM' weekday = 5 ) "1-7
( carrier_id = 'JL' connection_id = '0408' airport_from_id = 'FRA' airport_to_id = 'NRT' departure_time = '202500' arrival_time = '154000' distance = 9379 distance_unit = 'KM' weekday = 6 ) "1-7
( carrier_id = 'AZ' connection_id = '0788' airport_from_id = 'VCE' airport_to_id = 'NRT' departure_time = '132500' arrival_time = '101300' distance = 9595 distance_unit = 'KM' weekday = 6 )
( carrier_id = 'AZ' connection_id = '0789' airport_from_id = 'NRT' airport_to_id = 'VCE' departure_time = '142600' arrival_time = '213100' distance = 9595 distance_unit = 'KM' weekday = 5 )
).
ENDMETHOD.
ENDCLASS.
CLASS lcl_flight_data_generator DEFINITION DEFERRED.
CLASS /dmo/cl_flight_data_generat_15 DEFINITION LOCAL FRIENDS lcl_flight_data_generator.
CLASS lcl_flight_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: tt_flights TYPE STANDARD TABLE OF /dmo/flight15
WITH KEY carrier_id connection_id flight_date
WITH NON-UNIQUE SORTED KEY key_sorted_seats COMPONENTS seats_occupied
WITH NON-UNIQUE SORTED KEY key_sorted_date COMPONENTS connection_id flight_date.
CLASS-METHODS: get_data
RETURNING VALUE(rt_data) TYPE tt_flights.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES: BEGIN OF ty_plane_type,
id TYPE /dmo/plane_type_id15,
seats_max TYPE /dmo/plane_seats_max15,
long_distance TYPE abap_bool,
index TYPE int1,
END OF ty_plane_type,
BEGIN OF ty_flight_info,
id TYPE /dmo/plane_type_id15,
long_distance TYPE abap_bool,
seats_max TYPE /dmo/plane_seats_max15,
seats_occupied TYPE /dmo/plane_seats_occupied15,
price TYPE /dmo/flight_price15,
END OF ty_flight_info,
BEGIN OF ty_connection_recurrency,
id TYPE /dmo/connection_id15,
recurrency TYPE STANDARD TABLE OF /dmo/flight_date15 WITH EMPTY KEY,
END OF ty_connection_recurrency.
TYPES: tt_plane_type TYPE STANDARD TABLE OF ty_plane_type WITH KEY id,
tt_connection_recurrency TYPE STANDARD TABLE OF ty_connection_recurrency WITH KEY id.
CONSTANTS: cv_random_offset TYPE i VALUE 25,
cv_random_percent TYPE i VALUE 70.
CLASS-DATA: gt_connections TYPE lcl_connection_data_generator=>tt_connection,
gt_carrier TYPE lcl_carrier_data_generator=>tt_carrier,
gt_plane_types TYPE tt_plane_type,
go_random_int_distance_long TYPE REF TO cl_abap_random_int,
go_random_int_distance_short TYPE REF TO cl_abap_random_int,
gv_plane_distance_long TYPE i,
gv_plane_distance_short TYPE i,
gt_connection_recurrency TYPE lcl_flight_data_generator=>tt_connection_recurrency,
gt_flights TYPE lcl_flight_data_generator=>tt_flights,
go_random_seats TYPE REF TO cl_abap_random_int.
CLASS-METHODS: build_dependent_content,
get_flight_info
IMPORTING
iv_connection_id TYPE /dmo/connection_id15
RETURNING
VALUE(rs_plane_info) TYPE ty_flight_info,
build_plane_types
RETURNING
VALUE(rt_data) TYPE lcl_flight_data_generator=>tt_plane_type,
build_connection_recurrency
RETURNING
VALUE(rt_data) TYPE lcl_flight_data_generator=>tt_connection_recurrency,
calc_next_monday
IMPORTING
iv_date TYPE d
RETURNING
VALUE(rv_date) TYPE d.
ENDCLASS.
CLASS lcl_flight_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
IF out IS BOUND. out->write( '--> Delete Content.' ). ENDIF.
DELETE FROM /dmo/flight15. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Dependent Content.' ). ENDIF.
build_dependent_content( ).
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
get_data( ).
IF out IS BOUND. out->write( '--> Insert Content.' ). ENDIF.
INSERT /dmo/flight15 FROM TABLE @gt_flights.
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD get_data.
DATA: lt_flights TYPE tt_flights,
ls_flight TYPE lcl_flight_data_generator=>ty_flight_info.
IF gt_flights IS NOT INITIAL.
rt_data = gt_flights.
EXIT.
ENDIF.
LOOP AT gt_connections INTO DATA(ls_connection).
LOOP AT gt_connection_recurrency[ id = ls_connection-connection_id ]-recurrency INTO DATA(lv_flight_date).
ls_flight = get_flight_info( ls_connection-connection_id ).
APPEND VALUE /dmo/flight15(
carrier_id = ls_connection-carrier_id
connection_id = ls_connection-connection_id
flight_date = lv_flight_date
price = ls_flight-price
currency_code = VALUE /dmo/flight15-currency_code(
gt_carrier[ carrier_id = ls_connection-carrier_id ]-currency_code
DEFAULT 'EUR' )
plane_type_id = ls_flight-id
seats_max = ls_flight-seats_max
seats_occupied = ls_flight-seats_occupied
) TO gt_flights.
ENDLOOP.
rt_data = gt_flights.
ENDLOOP.
ENDMETHOD.
METHOD build_dependent_content.
gt_connections = CORRESPONDING #( lcl_connection_data_generator=>get_data( ) ).
gt_carrier = lcl_carrier_data_generator=>get_data( ).
gt_plane_types = build_plane_types( ).
go_random_seats = cl_abap_random_int=>create(
min = cv_random_percent - cv_random_offset
max = cv_random_percent + cv_random_offset
).
gt_connection_recurrency = build_connection_recurrency( ).
ENDMETHOD.
METHOD get_flight_info.
DATA: lv_count TYPE i,
lo_random TYPE REF TO cl_abap_random_int.
DATA(lt_connections) = lcl_connection_data_generator=>get_data( ).
DATA(lv_is_long_distance) = COND abap_bool( WHEN lt_connections[ connection_id = iv_connection_id ]-distance > 3000
THEN abap_true
ELSE abap_false ).
IF lv_is_long_distance = abap_true.
IF gv_plane_distance_long IS INITIAL.
SELECT COUNT(*) FROM @gt_plane_types AS planes WHERE long_distance = @lv_is_long_distance INTO @gv_plane_distance_long.
ENDIF.
lv_count = gv_plane_distance_long.
IF go_random_int_distance_long IS NOT BOUND.
go_random_int_distance_long = cl_abap_random_int=>create( seed = 1337 min = 1 max = gv_plane_distance_long ).
ENDIF.
lo_random = go_random_int_distance_long.
ELSE.
IF gv_plane_distance_short IS INITIAL.
SELECT COUNT(*) FROM @gt_plane_types AS planes WHERE long_distance = @lv_is_long_distance INTO @gv_plane_distance_short.
ENDIF.
lv_count = gv_plane_distance_short.
IF go_random_int_distance_short IS NOT BOUND.
go_random_int_distance_short = cl_abap_random_int=>create( seed = 1337 min = 1 max = gv_plane_distance_short ).
ENDIF.
lo_random = go_random_int_distance_short.
ENDIF.
DATA(ls_plane_type) = gt_plane_types[
long_distance = lv_is_long_distance
index = lo_random->get_next( )
].
DATA(lv_seats_occupied_percent) = go_random_seats->get_next( ).
rs_plane_info = VALUE ty_flight_info(
id = ls_plane_type-id
long_distance = ls_plane_type-long_distance
seats_max = ls_plane_type-seats_max
seats_occupied = ls_plane_type-seats_max * lv_seats_occupied_percent DIV 100
price = /dmo/cl_flight_data_generat_15=>calculate_flight_price(
iv_seats_occupied_percent = lv_seats_occupied_percent
iv_flight_distance = lt_connections[ connection_id = iv_connection_id ]-distance
)
).
ENDMETHOD.
METHOD build_plane_types.
rt_data = VALUE tt_plane_type(
( id = 'A320-200' seats_max = 130 long_distance = ' ' index = 1 )
( id = 'A321-200' seats_max = 150 long_distance = ' ' index = 2 )
( id = '737-800' seats_max = 140 long_distance = ' ' index = 3 )
( id = 'A319-100' seats_max = 120 long_distance = ' ' index = 4 )
( id = '747-400' seats_max = 385 long_distance = 'X' index = 1 )
( id = '767-200' seats_max = 260 long_distance = 'X' index = 2 )
( id = 'A340-600' seats_max = 330 long_distance = 'X' index = 3 )
( id = 'A380-800' seats_max = 475 long_distance = 'X' index = 4 )
).
ENDMETHOD.
METHOD build_connection_recurrency.
CONSTANTS:
cv_days_between_test TYPE i VALUE 300,
cv_days_between_8weeks TYPE i VALUE 56,
cv_days_between_4weeks TYPE i VALUE 28,
cv_days_between_2weeks TYPE i VALUE 14,
cv_days_between_1weeks TYPE i VALUE 7.
DATA:
flight_date_max TYPE d,
flight_date_min TYPE d.
DATA(lv_days_between) = cv_days_between_test.
GET TIME STAMP FIELD DATA(current_timestamp).
DATA(tmp) = CONV string( current_timestamp ).
DATA lv_datum TYPE d.
lv_datum = tmp(8).
" flight_date_max is a Monday 8 months in the future
flight_date_max = calc_next_monday( CONV /dmo/flight_date15( lv_datum + 217 ) ).
" flight_date_min is a Monday 5 months in the past
flight_date_min = calc_next_monday( CONV /dmo/flight_date15( lv_datum - 148 ) ).
LOOP AT lcl_connection_data_generator=>get_data( ) INTO DATA(ls_connection).
APPEND VALUE ty_connection_recurrency(
id = ls_connection-connection_id
recurrency = VALUE ty_connection_recurrency-recurrency(
FOR flightdate = flight_date_max + ls_connection-weekday - 1
THEN flightdate - lv_days_between
UNTIL flightdate < flight_date_min + ls_connection-weekday - 1
( CONV /dmo/flight_date15( flightdate ) )
)
) TO rt_data.
ENDLOOP.
ENDMETHOD.
METHOD calc_next_monday.
* 01.01.1900 was a Saturday.
DATA(lv_weekday) = iv_date MOD 7.
* Therefore 0 is a Saturday, 1 for Sunday, etc.. and will be mapped to 1 for Monday, 2 for Tuesday, etc..
IF lv_weekday > 1.
lv_weekday = lv_weekday - 1.
ELSE.
lv_weekday = lv_weekday + 6.
ENDIF.
rv_date = iv_date - lv_weekday + 8.
ENDMETHOD.
ENDCLASS.
CLASS lcl_customer_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: BEGIN OF ty_last_name,
last_name TYPE /dmo/last_name15,
END OF ty_last_name.
TYPES: tt_customer TYPE STANDARD TABLE OF /dmo/customer15 WITH KEY customer_id,
tt_last_name TYPE STANDARD TABLE OF ty_last_name WITH KEY last_name.
CLASS-METHODS: get_data
RETURNING VALUE(rt_data) TYPE tt_customer,
build_last_names
RETURNING
VALUE(rt_data) TYPE tt_last_name.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
" Names
BEGIN OF ty_first_name,
first_name TYPE /dmo/first_name15,
gender TYPE c LENGTH 1,
END OF ty_first_name,
BEGIN OF ty_name,
first_name TYPE /dmo/first_name15,
last_name TYPE /dmo/last_name15,
title TYPE /dmo/title15,
END OF ty_name,
" Addresses
BEGIN OF ty_city,
country TYPE land1,
postal_code TYPE /dmo/postal_code15,
city TYPE /dmo/city15,
END OF ty_city,
tt_street_per_country TYPE STANDARD TABLE OF /dmo/street15 WITH EMPTY KEY,
BEGIN OF ty_street,
country TYPE land1,
streets TYPE tt_street_per_country,
END OF ty_street,
BEGIN OF ty_address,
country TYPE land1,
postal_code TYPE /dmo/postal_code15,
city TYPE /dmo/city15,
street TYPE /dmo/street15,
phone_number TYPE /dmo/phone_number15,
email_address TYPE /dmo/email_address15,
END OF ty_address.
TYPES:
" Names
tt_first_name TYPE STANDARD TABLE OF ty_first_name WITH KEY first_name,
tt_name TYPE STANDARD TABLE OF ty_name WITH KEY first_name last_name,
" Addresses
tt_city TYPE STANDARD TABLE OF ty_city WITH KEY country city,
tt_street TYPE STANDARD TABLE OF ty_street WITH KEY country,
tt_address TYPE STANDARD TABLE OF ty_address WITH KEY country city street.
CONSTANTS cv_email_host TYPE string VALUE `flight.example` ##NO_TEXT.
CONSTANTS cv_phone_number_seperator TYPE string VALUE `-` ##NO_TEXT.
CONSTANTS cv_phone_number_min TYPE int8 VALUE 1234567890.
CONSTANTS cv_phone_number_max TYPE int8 VALUE 9999999999.
CLASS-DATA gt_data TYPE lcl_customer_data_generator=>tt_customer.
CLASS-METHODS:
" Names
generate_names
RETURNING
VALUE(rt_data) TYPE tt_name,
build_first_names
RETURNING
VALUE(rt_data) TYPE tt_first_name,
" Adresses
generate_addresses
RETURNING
VALUE(rt_data) TYPE tt_address,
build_city
RETURNING
VALUE(rt_data) TYPE tt_city,
build_street
RETURNING
VALUE(rt_data) TYPE tt_street.
ENDCLASS.
CLASS lcl_customer_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
IF out IS BOUND. out->write( '--> Delete Content.' ). ENDIF.
DELETE FROM /dmo/customer15. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
DATA(lt_data) = get_data( ).
IF out IS BOUND. out->write( '--> Insert Content.' ). ENDIF.
INSERT /dmo/customer15 FROM TABLE @lt_data.
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD build_first_names.
rt_data = VALUE tt_first_name(
( first_name = 'Simon' gender = 'M')
( first_name = 'Harish' gender = 'M')
( first_name = 'Volker' gender = 'M')
( first_name = 'Jasmin' gender = 'F')
( first_name = 'Felix' gender = 'M')
( first_name = 'Kristina' gender = 'F')
( first_name = 'Thilo' gender = 'M')
( first_name = 'Andrej' gender = 'M')
( first_name = 'Anna' gender = 'F')
( first_name = 'Johannes' gender = 'M')
( first_name = 'Johann' gender = 'M')
( first_name = 'Christoph' gender = 'M')
( first_name = 'Andreas' gender = 'M')
( first_name = 'Stephen' gender = 'M')
( first_name = 'Mathilde' gender = 'F')
( first_name = 'August' gender = 'M')
( first_name = 'Illya' gender = 'M')
( first_name = 'Georg' gender = 'M')
( first_name = 'Gisela' gender = 'F')
( first_name = 'Christa' gender = 'F')
( first_name = 'Holm' gender = 'M')
( first_name = 'Irmtraut' gender = 'F')
( first_name = 'Ludwig' gender = 'M')
( first_name = 'Laura' gender = 'F')
( first_name = 'Kurt' gender = 'M')
( first_name = 'Guenther' gender = 'M')
( first_name = 'Horst' gender = 'M')
( first_name = 'Matthias' gender = 'M')
( first_name = 'Amelie' gender = 'F')
( first_name = 'Walter' gender = 'M')
( first_name = 'Sophie' gender = 'F')
( first_name = 'Claire' gender = 'F')
( first_name = 'Chantal' gender = 'F')
( first_name = 'Jean' gender = 'M')
( first_name = 'Cindy' gender = 'F')
( first_name = 'Pierre' gender = 'M')
( first_name = 'Irene' gender = 'F')
( first_name = 'Adam' gender = 'M')
( first_name = 'Fabio' gender = 'M')
( first_name = 'Lothar' gender = 'M')
( first_name = 'Annemarie' gender = 'F')
( first_name = 'Ida' gender = 'F')
( first_name = 'Roland' gender = 'M')
( first_name = 'Achim' gender = 'M')
( first_name = 'Allen' gender = 'M')
( first_name = 'Lee' gender = 'M')
( first_name = 'Guillermo' gender = 'M')
( first_name = 'Florian' gender = 'M')
( first_name = 'Ulla' gender = 'F')
( first_name = 'Juan' gender = 'M')
( first_name = 'Marta' gender = 'F')
( first_name = 'Salvador' gender = 'M')
( first_name = 'Christine' gender = 'F')
( first_name = 'Dominik' gender = 'M')
( first_name = 'Astrid' gender = 'F')
( first_name = 'Ruth' gender = 'F')
( first_name = 'Theresia' gender = 'F')
( first_name = 'Thomas' gender = 'M')
( first_name = 'Friedrich' gender = 'M')
( first_name = 'Anneliese' gender = 'F')
( first_name = 'Peter' gender = 'M')
( first_name = 'Anne-Marie' gender = 'F')
( first_name = 'James' gender = 'M')
( first_name = 'Jean-Luc' gender = 'M')
( first_name = 'Benjamin' gender = 'M')
( first_name = 'Hendrik' gender = 'M')
( first_name = 'Uli' gender = 'F')
( first_name = 'Siegfried' gender = 'M')
( first_name = 'Max' gender = 'M')
).
ENDMETHOD.
METHOD build_last_names.
rt_data = VALUE tt_last_name(
( last_name = 'Buchholm')
( last_name = 'Vrsic')
( last_name = 'Jeremias')
( last_name = 'Gutenberg')
( last_name = 'Fischmann')
( last_name = 'Columbo')
( last_name = 'Neubasler')
( last_name = 'Martin')
( last_name = 'Detemple')
( last_name = 'Barth')
( last_name = 'Benz')
( last_name = 'Hansmann')
( last_name = 'Koslowski')
( last_name = 'Wohl')
( last_name = 'Koller')
( last_name = 'Hoffen')
( last_name = 'Dumbach')
( last_name = 'Goelke')
( last_name = 'Waldmann')
( last_name = 'Mechler')
( last_name = 'Buehler')
( last_name = 'Heller')
( last_name = 'Simonen')
( last_name = 'Henry')
( last_name = 'Marshall')
( last_name = 'Legrand')
( last_name = 'Jacqmain')
( last_name = 'D´Oultrement')
( last_name = 'Hunter')
( last_name = 'Delon')
( last_name = 'Kreiss')
( last_name = 'Trensch')
( last_name = 'Cesari')
( last_name = 'Matthaeus')
( last_name = 'Babilon')
( last_name = 'Zimmermann')
( last_name = 'Kramer')
( last_name = 'Illner')
( last_name = 'Pratt')
( last_name = 'Gahl')
( last_name = 'Benjamin')
( last_name = 'Miguel')
( last_name = 'Weiss')
( last_name = 'Sessler')
( last_name = 'Montero')
( last_name = 'Domenech')
( last_name = 'Moyano')
( last_name = 'Sommer')
( last_name = 'Schneider')
( last_name = 'Eichbaum')
( last_name = 'Gueldenpfennig')
( last_name = 'Sudhoff')
( last_name = 'Lautenbach')
( last_name = 'Ryan')
( last_name = 'Prinz')
( last_name = 'Deichgraeber')
( last_name = 'Pan')
( last_name = 'Lindwurm')
( last_name = 'Kirk')
( last_name = 'Picard')
( last_name = 'Sisko')
( last_name = 'Madeira')
( last_name = 'Meier')
( last_name = 'Rahn')
( last_name = 'Leisert')
( last_name = 'Müller')
( last_name = 'Mustermann')
( last_name = 'Becker')
( last_name = 'Fischer')
).
ENDMETHOD.
METHOD get_data.
IF gt_data IS NOT INITIAL.
rt_data = gt_data.
EXIT.
ENDIF.
DATA(lt_names) = generate_names( ).
DATA(lt_addresses) = generate_addresses( ).
DATA(lo_random_phone_number) = cl_abap_random_int8=>create( min = cv_phone_number_min
max = cv_phone_number_max ).
DATA(lo_random_city) = cl_abap_random_int=>create( min = 1 max = lines( lt_addresses ) ).
DATA(lo_random_street_number) = cl_abap_random_int=>create( min = 1 max = 100 ).
gt_data = VALUE tt_customer(
FOR i = 1 THEN i + 1 WHILE i <= lines( lt_names ) LET j = lo_random_city->get_next( ) IN
(
customer_id = i
first_name = lt_names[ i ]-first_name
last_name = lt_names[ i ]-last_name
title = lt_names[ i ]-title
street = lt_addresses[ j ]-street && ` ` && lo_random_street_number->get_next( )
postal_code = lt_addresses[ j ]-postal_code
city = lt_addresses[ j ]-city
country_code = lt_addresses[ j ]-country
phone_number = '+' && COND string(
WHEN lt_addresses[ j ]-country = 'AT' THEN '43'
WHEN lt_addresses[ j ]-country = 'BE' THEN '32'
WHEN lt_addresses[ j ]-country = 'CH' THEN '41'
WHEN lt_addresses[ j ]-country = 'DE' THEN '49'
WHEN lt_addresses[ j ]-country = 'ES' THEN '34'
WHEN lt_addresses[ j ]-country = 'FR' THEN '33'
WHEN lt_addresses[ j ]-country = 'IT' THEN '39'
WHEN lt_addresses[ j ]-country = 'SI' THEN '386'
WHEN lt_addresses[ j ]-country = 'US' THEN '1'
ELSE '89'
)
&& cv_phone_number_seperator
&& |{ replace( val = lo_random_phone_number->get_next( ) off = 3 len = 1 with = cv_phone_number_seperator ) }|
email_address = to_lower( lt_names[ i ]-first_name && `.` && lt_names[ i ]-last_name && `@` && cv_email_host && `.` && lt_addresses[ j ]-country )
)
).
rt_data = gt_data.
ENDMETHOD.
METHOD generate_names.
DATA: lo_random_counter TYPE REF TO cl_abap_random_int,
lo_random_first_name TYPE REF TO cl_abap_random_int,
lo_random_title TYPE REF TO cl_abap_random_int,
ls_first_name TYPE lcl_customer_data_generator=>ty_first_name.
DATA(lt_first_names) = build_first_names( ).
lo_random_counter = cl_abap_random_int=>create( min = 5 max = 15 ).
lo_random_first_name = cl_abap_random_int=>create( min = 1 max = lines( lt_first_names ) ).
LOOP AT build_last_names( ) INTO DATA(ls_last_name).
DO lo_random_counter->get_next( ) TIMES.
ls_first_name = lt_first_names[ lo_random_first_name->get_next( ) ].
APPEND VALUE ty_name(
first_name = ls_first_name-first_name
last_name = ls_last_name-last_name
title = COND /dmo/title15( WHEN ls_first_name-gender = 'M' THEN 'Mr.'
WHEN ls_first_name-gender = 'F' THEN 'Mrs.'
ELSE 'Martian' )
) TO rt_data.
ENDDO.
ENDLOOP.
ENDMETHOD.
METHOD build_city.
rt_data = VALUE tt_city(
( country = 'DE' postal_code = '23496' city = 'Dielheim')
( country = 'SI' postal_code = '1000' city = 'Ljubljana')
( country = 'DE' postal_code = '86343' city = 'Koenigsbrunn')
( country = 'DE' postal_code = '55128' city = 'Mainz')
( country = 'DE' postal_code = '11111' city = 'Berlin')
( country = 'US' postal_code = '17844' city = 'Washington')
( country = 'AT' postal_code = '4020' city = 'Linz')
( country = 'DE' postal_code = '68723' city = 'Schwetzingen')
( country = 'DE' postal_code = '68789' city = 'St. Leon-Rot')
( country = 'DE' postal_code = '66464' city = 'Homburg')
( country = 'DE' postal_code = '69231' city = 'Rauenberg')
( country = 'DE' postal_code = '69190' city = 'Walldorf')
( country = 'DE' postal_code = '58332' city = 'Schwelm')
( country = 'DE' postal_code = '64342' city = 'Seeheim-Jugenheim')
( country = 'DE' postal_code = '69121' city = 'Heidelberg')
( country = 'DE' postal_code = '63150' city = 'Heusenstamm')
( country = 'DE' postal_code = '64283' city = 'Darmstadt')
( country = 'DE' postal_code = '69207' city = 'Kurt')
( country = 'DE' postal_code = '79104' city = 'Freiburg')
( country = 'DE' postal_code = '79312' city = 'Emmendingen')
( country = 'DE' postal_code = '68753' city = 'Amelie')
( country = 'DE' postal_code = '68163' city = 'Mannheim')
( country = 'DE' postal_code = '67105' city = 'Schifferstadt')
( country = 'DE' postal_code = '68163' city = 'Mannheim-Lindenhof')
( country = 'FR' postal_code = '78140' city = 'Vélizy')
( country = 'CH' postal_code = '1211' city = 'Genève')
( country = 'BE' postal_code = 'B - 1030' city = 'Bruxelles')
( country = 'US' postal_code = '76018' city = 'Arlington')
( country = 'FR' postal_code = '06130' city = 'Grasse')
( country = 'DE' postal_code = '27299' city = 'Langwedel')
( country = 'DE' postal_code = '69483' city = 'Wald-Michelbach')
( country = 'IT' postal_code = '00195' city = 'Roma')
( country = 'DE' postal_code = '81375' city = 'Muenchen')
( country = 'DE' postal_code = '67663' city = 'Kaiserslautern')
( country = 'DE' postal_code = '66386' city = 'St. Ingbert')
( country = 'DE' postal_code = '79761' city = 'Waldshut')
( country = 'DE' postal_code = '76137' city = 'Karlsruhe')
( country = 'US' postal_code = '07666' city = 'Teaneck')
( country = 'US' postal_code = '17758' city = 'N. Massapequa')
( country = 'US' postal_code = '09765' city = 'Boulder')
( country = 'ES' postal_code = '28020' city = 'Madrid')
( country = 'DE' postal_code = '69180' city = 'Wiesloch')
( country = 'ES' postal_code = '08014' city = 'Barcelona')
( country = 'ES' postal_code = '41006' city = 'Sevilla')
( country = 'DE' postal_code = '75305' city = 'Neuenburg')
( country = 'DE' postal_code = '41466' city = 'Neuss')
( country = 'DE' postal_code = '71116' city = 'Gaertringen')
( country = 'US' postal_code = '60657' city = 'Chicago')
( country = 'DE' postal_code = '63263' city = 'Neu-Isenburg')
( country = 'DE' postal_code = '23056' city = 'Buxtehude')
( country = 'DE' postal_code = '16233' city = 'Potsdam')
( country = 'DE' postal_code = '90419' city = 'Nuernberg')
( country = 'US' postal_code = '22334' city = 'San Francisco')
( country = 'FR' postal_code = '75839' city = 'Paris')
( country = 'US' postal_code = '63728' city = 'New Orleans')
( country = 'DE' postal_code = '75757' city = 'Elsenz')
( country = 'DE' postal_code = '70111' city = 'Reutlingen')
( country = 'DE' postal_code = '15344' city = 'Strausberg')
).
ENDMETHOD.
METHOD generate_addresses.
TYPES: BEGIN OF ty_random_street,
country TYPE land1,
random TYPE REF TO cl_abap_random_int,
END OF ty_random_street,
tt_random_street TYPE STANDARD TABLE OF ty_random_street WITH KEY country.
DATA: lo_random_counter TYPE REF TO cl_abap_random_int,
lo_random_city TYPE REF TO cl_abap_random_int,
lt_random_street TYPE tt_random_street,
lo_phone_number TYPE REF TO cl_abap_random_int.
DATA(lt_street) = build_street( ).
lo_random_counter = cl_abap_random_int=>create( min = 5 max = 15 ).
lo_phone_number = cl_abap_random_int=>create( min = 1 max = 100 ).
LOOP AT lt_street INTO DATA(ls_street).
APPEND VALUE ty_random_street(
country = ls_street-country
random = cl_abap_random_int=>create( min = 1 max = lines( ls_street-streets ) )
) TO lt_random_street.
ENDLOOP.
LOOP AT build_city( ) INTO DATA(ls_city).
DO lo_random_counter->get_next( ) TIMES.
APPEND VALUE ty_address(
country = ls_city-country
postal_code = ls_city-postal_code
city = ls_city-city
street = |{ lt_street[
country = ls_city-country
]-streets[
lt_random_street[ country = ls_city-country ]-random->get_next( )
] }|
) TO rt_data.
ENDDO.
ENDLOOP.
ENDMETHOD.
METHOD build_street.
rt_data = VALUE tt_street(
( country = 'AT' streets = VALUE tt_street_per_country( ( 'Hasnerstrasse' ) ) )
( country = 'BE' streets = VALUE tt_street_per_country( ( 'rue Voltaire' ) ) )
( country = 'CH' streets = VALUE tt_street_per_country( ( 'rue de Moillebeau' ) ) )
( country = 'DE' streets = VALUE tt_street_per_country( ( 'Akazienweg' )
( 'Albert-Schweitzer-Str.' )
( 'Alte Reichsstr.' )
( 'Am Deich' )
( 'Arionweg' )
( 'Arndtstrasse' )
( 'Auf dem Huegel' )
( 'Ausfallstr.' )
( 'Ausserhalb' )
( 'Carl-Metz Strasse' )
( 'Caspar-David-Friedrich-Str.' )
( 'Dudweilerstr.' )
( 'Elzstrasse' )
( 'Emil-Heckel-Str.' )
( 'Erlengrund' )
( 'Franz-Marc-Str.' )
( 'Friedensallee' )
( 'Froschstr.' )
( 'Gartenstr.' )
( 'Gemeindestr.' )
( 'Goeckinghofstr.' )
( 'Gruenlingweg' )
( 'Hauptstr.' )
( 'Heidelberger Str.' )
( 'Im Warmet' )
( 'Jacobistrasse' )
( 'Karl-Marx-Allee' )
( 'Karl-Schwaner-Str.' )
( 'Leichhof' )
( 'Lerchenstr.' )
( 'Marktplatz' )
( 'Max-Planck-Str.' )
( 'Meerfeldstr.' )
( 'Melissenstr.' )
( 'Muehltalstr.' )
( 'Mutterstadter Str.' )
( 'N7,' )
( 'Rankestr.' )
( 'Raupelsweg' )
( 'Schillerstr.' )
( 'Stauboernchenstrasse' )
( 'Stiftsbogen' )
( 'Waldmann' )
( 'Wilhelminentr.' )
( 'Zwischergasse' ) ) )
( country = 'ES' streets = VALUE tt_street_per_country( ( 'Camelias' )
( 'Fuenlabrada' )
( 'Piedad' )
( 'Pza. Pablo Ruiz Picasso' ) ) )
( country = 'FR' streets = VALUE tt_street_per_country( ( 'Rue Balzac' )
( 'route de Pégomas' )
( 'rue Nieuport' ) ) )
( country = 'IT' streets = VALUE tt_street_per_country( ( 'Via Giulio Cesare' ) ) )
( country = 'SI' streets = VALUE tt_street_per_country( ( 'Poklukarjeva' ) ) )
( country = 'US' streets = VALUE tt_street_per_country( ( '17th St.' )
( 'Federal Avenue' )
( 'Golden Gate Drive' )
( 'Lake Shore Drive' )
( 'Oak Street' )
( 'Sagamore St.' )
( 'Voodoo Avenue' )
( 'Windstone Drive' ) ) )
).
ENDMETHOD.
ENDCLASS.
CLASS lcl_supplement_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: tt_supplement TYPE STANDARD TABLE OF /dmo/suppleme_15 WITH KEY supplement_id,
tt_supplement_text TYPE STANDARD TABLE OF /dmo/suppl_te_15 WITH KEY supplement_id.
" Merged types
TYPES BEGIN OF ty_supplement_complete.
INCLUDE TYPE /dmo/suppleme_15.
TYPES language_code TYPE spras.
TYPES description TYPE /dmo/description15.
TYPES END OF ty_supplement_complete.
TYPES tt_supplement_complete TYPE STANDARD TABLE OF ty_supplement_complete WITH KEY supplement_id.
CLASS-METHODS: get_data
RETURNING VALUE(rt_data) TYPE tt_supplement_complete.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS lcl_supplement_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
IF out IS BOUND. out->write( '--> Delete Content.' ). ENDIF.
DELETE FROM /dmo/suppleme_15. "#EC CI_NOWHERE
DELETE FROM /dmo/suppl_te_15. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
DATA(lt_data) = get_data( ).
IF out IS BOUND. out->write( '--> Insert Content.' ). ENDIF.
INSERT /dmo/suppleme_15 FROM TABLE @( CORRESPONDING tt_supplement( lt_data ) ).
INSERT /dmo/suppl_te_15 FROM TABLE @( CORRESPONDING tt_supplement_text( lt_data ) ).
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD get_data.
" BV = beverage
" ML = meal
" LU = luggage
" EX = extra
rt_data = VALUE tt_supplement_complete(
( supplement_id = 'BV-0001' price = '2.30' currency_code = 'EUR' language_code = 'E' description = 'Hot Chocolate' )
( supplement_id = 'BV-0002' price = '7.50' currency_code = 'EUR' language_code = 'E' description = 'Alcohol free Champagne' )
( supplement_id = 'BV-0003' price = '3.50' currency_code = 'EUR' language_code = 'E' description = 'Cola' )
( supplement_id = 'BV-0004' price = '3.50' currency_code = 'EUR' language_code = 'E' description = 'Orange Limonade' )
( supplement_id = 'BV-0005' price = '3.50' currency_code = 'EUR' language_code = 'E' description = 'Apple Juice' )
( supplement_id = 'BV-0006' price = '3.50' currency_code = 'EUR' language_code = 'E' description = 'Pear Juice' )
( supplement_id = 'BV-0007' price = '3.50' currency_code = 'EUR' language_code = 'E' description = 'Mango Juice' )
( supplement_id = 'BV-0008' price = '3.50' currency_code = 'EUR' language_code = 'E' description = 'Lemon Limonade' )
( supplement_id = 'BV-0009' price = '4.50' currency_code = 'EUR' language_code = 'E' description = 'Tomato Juice' )
( supplement_id = 'ML-0001' price = '3.00' currency_code = 'EUR' language_code = 'E' description = 'Black Forest Cake' )
( supplement_id = 'ML-0002' price = '2.00' currency_code = 'EUR' language_code = 'E' description = 'Chocolate Cake' )
( supplement_id = 'ML-0003' price = '1.50' currency_code = 'EUR' language_code = 'E' description = 'Apple Pie' )
( supplement_id = 'ML-0004' price = '1.50' currency_code = 'EUR' language_code = 'E' description = 'Pear Pie' )
( supplement_id = 'ML-0005' price = '8.00' currency_code = 'EUR' language_code = 'E' description = 'Nice Salad')
( supplement_id = 'ML-0006' price = '9.00' currency_code = 'EUR' language_code = 'E' description = 'Paris Salad')
( supplement_id = 'ML-0007' price = '12.00' currency_code = 'EUR' language_code = 'E' description = 'Hamburg Salad with Eggs' )
( supplement_id = 'ML-0008' price = '25.00' currency_code = 'EUR' language_code = 'E' description = 'Quail with French Salad and Black Forest Cake')
( supplement_id = 'ML-0009' price = '13.00' currency_code = 'EUR' language_code = 'E' description = 'Duck on Lettuce' )
( supplement_id = 'ML-0010' price = '5.00' currency_code = 'EUR' language_code = 'E' description = 'Carpaccio')
( supplement_id = 'ML-0011' price = '7.00' currency_code = 'EUR' language_code = 'E' description = 'Seasonal Salad')
( supplement_id = 'ML-0012' price = '16.00' currency_code = 'EUR' language_code = 'E' description = 'Hamburg Salad with Fresh Shrimps')
( supplement_id = 'ML-0013' price = '17.00' currency_code = 'EUR' language_code = 'E' description = 'Quail')
( supplement_id = 'ML-0014' price = '14.00' currency_code = 'EUR' language_code = 'E' description = 'Wiener Schnitzel')
( supplement_id = 'ML-0015' price = '13.00' currency_code = 'EUR' language_code = 'E' description = 'Pork Schnitzel')
( supplement_id = 'ML-0016' price = '14.00' currency_code = 'EUR' language_code = 'E' description = 'Schnitzel with Pepper Sauce')
( supplement_id = 'ML-0017' price = '11.00' currency_code = 'EUR' language_code = 'E' description = 'Chicken and French Fries')
( supplement_id = 'ML-0018' price = '12.00' currency_code = 'EUR' language_code = 'E' description = 'Turkey Steak')
( supplement_id = 'ML-0019' price = '15.00' currency_code = 'EUR' language_code = 'E' description = 'Bavarian Duck')
( supplement_id = 'ML-0020' price = '14.00' currency_code = 'EUR' language_code = 'E' description = 'Knuckle of Pork')
( supplement_id = 'ML-0021' price = '22.00' currency_code = 'EUR' language_code = 'E' description = 'Fillet of Beef')
( supplement_id = 'ML-0022' price = '21.00' currency_code = 'EUR' language_code = 'E' description = 'Trout Au Bleu')
( supplement_id = 'ML-0023' price = '20.00' currency_code = 'EUR' language_code = 'E' description = 'Trout Meuniere')
( supplement_id = 'ML-0024' price = '17.00' currency_code = 'EUR' language_code = 'E' description = 'Monkfish')
( supplement_id = 'ML-0025' price = '12.00' currency_code = 'EUR' language_code = 'E' description = 'Sole')
( supplement_id = 'ML-0026' price = '6.00' currency_code = 'EUR' language_code = 'E' description = 'Mini Fried Sole')
( supplement_id = 'ML-0027' price = '14.00' currency_code = 'EUR' language_code = 'E' description = 'Salmon in a Bearnaise Sauce')
( supplement_id = 'ML-0028' price = '15.00' currency_code = 'EUR' language_code = 'E' description = 'Salmon Lasagne')
( supplement_id = 'ML-0029' price = '3.00' currency_code = 'EUR' language_code = 'E' description = 'Chocolate Ice Cream')
( supplement_id = 'ML-0030' price = '2.50' currency_code = 'EUR' language_code = 'E' description = 'Vanilla Ice Cream')
( supplement_id = 'ML-0031' price = '4.50' currency_code = 'EUR' language_code = 'E' description = 'Vanilla Ice Cream with Hot Cherries')
( supplement_id = 'ML-0032' price = '4.50' currency_code = 'EUR' language_code = 'E' description = 'Vanilla Ice Cream with Hot Raspberries')
( supplement_id = 'ML-0033' price = '4.00' currency_code = 'EUR' language_code = 'E' description = 'Apple Strudel')
( supplement_id = 'ML-0034' price = '4.00' currency_code = 'EUR' language_code = 'E' description = 'Raspberry Sorbet')
( supplement_id = 'ML-0035' price = '4.00' currency_code = 'EUR' language_code = 'E' description = 'Strawberry Sorbet')
( supplement_id = 'LU-0001' price = '40.00' currency_code = 'EUR' language_code = 'E' description = 'Extra baggage 5 kgs')
( supplement_id = 'LU-0002' price = '15.00' currency_code = 'EUR' language_code = 'E' description = 'Luggage transfer from airport to hotel')
( supplement_id = 'LU-0003' price = '75.00' currency_code = 'EUR' language_code = 'E' description = 'Luggage pickup from home and return ' )
( supplement_id = 'LU-0004' price = '80.00' currency_code = 'EUR' language_code = 'E' description = 'Bulky goods like sports equipment' )
) .
ENDMETHOD.
ENDCLASS.
CLASS lcl_travel_data_generator DEFINITION DEFERRED.
CLASS /dmo/cl_flight_data_generat_15 DEFINITION LOCAL FRIENDS lcl_travel_data_generator.
CLASS lcl_travel_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: tt_travel TYPE STANDARD TABLE OF /dmo/travel15 WITH KEY travel_id,
tt_bookings TYPE STANDARD TABLE OF /dmo/booking15 WITH KEY travel_id booking_id,
tt_booking_supplements TYPE STANDARD TABLE OF /dmo/book_sup_15 WITH KEY travel_id booking_id booking_supplement_id.
" Build nested tables
TYPES BEGIN OF ty_booking_complete.
INCLUDE TYPE /dmo/booking15.
TYPES booking_supplements TYPE tt_booking_supplements.
TYPES END OF ty_booking_complete.
TYPES tt_booking_complete TYPE STANDARD TABLE OF ty_booking_complete WITH KEY travel_id booking_id.
TYPES BEGIN OF ty_travel_complete.
INCLUDE TYPE /dmo/travel15.
TYPES bookings TYPE tt_booking_complete.
TYPES END OF ty_travel_complete.
"! <em>Travel</em> structure <br/>
"! <em>Bookings</em> table <br/>
"! --> <em>Booking</em> structure <br/>
"! --> <em>Booking Supplement</em> table <br/>
"! -----> <em>Booking Supplement</em> structure
TYPES tt_travel_complete TYPE STANDARD TABLE OF ty_travel_complete WITH KEY travel_id.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES: BEGIN OF ty_countryname,
country TYPE i_countrytext-country,
countryname TYPE i_countrytext-countryname,
END OF ty_countryname.
CONSTANTS: cv_travel_group_amount_max TYPE i VALUE 3,
cv_trip_length_center TYPE i VALUE 3,
cv_trip_length_offset TYPE i VALUE 2,
cv_booking_date_min TYPE i VALUE 0,
cv_booking_date_max TYPE i VALUE 20,
cv_travel_create_dat_befor_min TYPE i VALUE 0,
cv_travel_create_dat_befor_max TYPE i VALUE 40,
cv_travel_change_date_min TYPE i VALUE 0,
cv_travel_change_date_max TYPE i VALUE 10,
cv_booking_supplement_amount TYPE i VALUE 5,
cv_booking_days_before TYPE i VALUE 15.
CLASS-DATA:
go_random_seats TYPE REF TO cl_abap_random_int,
gt_flights_seats_decrease TYPE lcl_flight_data_generator=>tt_flights,
go_ran_travel_group_amount TYPE REF TO cl_abap_random_int,
go_ran_trip_length TYPE REF TO cl_abap_random_int,
go_ran_customer TYPE REF TO cl_abap_random_int,
gt_agency TYPE lcl_agency_data_generator=>tt_agency,
gt_customer TYPE lcl_customer_data_generator=>tt_customer,
gt_flights_final TYPE lcl_flight_data_generator=>tt_flights,
go_ran_booking_date TYPE REF TO cl_abap_random_int,
go_ran_agency TYPE REF TO cl_abap_random_int,
gt_connections TYPE lcl_connection_data_generator=>tt_connection_additional_info,
go_ran_booking_supplement_id TYPE REF TO cl_abap_random_int,
go_ran_booking_supplement_amnt TYPE REF TO cl_abap_random_int,
gt_supplements TYPE lcl_supplement_data_generator=>tt_supplement_complete,
go_ran_travel_description TYPE REF TO cl_abap_random_int,
go_ran_travel_create_dat_befor TYPE REF TO cl_abap_random_int,
go_ran_travel_change_date TYPE REF TO cl_abap_random_int,
go_ran_hour TYPE REF TO cl_abap_random_int,
go_ran_min_sec TYPE REF TO cl_abap_random_int,
gt_airports TYPE lcl_airport_data_generator=>tt_airport,
gt_countryname TYPE STANDARD TABLE OF ty_countryname WITH KEY country,
go_ran_status_description TYPE REF TO cl_abap_random_int,
gt_last_names TYPE lcl_customer_data_generator=>tt_last_name,
go_ran_last_name TYPE REF TO cl_abap_random_int,
go_ran_customer_travel TYPE REF TO cl_abap_random_int,
mv_datum TYPE d.
CLASS-METHODS:
get_data
RETURNING
VALUE(rt_data) TYPE tt_travel_complete,
build_booking
IMPORTING
iv_travel_id TYPE /dmo/booking15-travel_id
RETURNING
VALUE(rt_bookings) TYPE tt_booking_complete,
build_dependend_content,
find_next_fitting_flight
IMPORTING
iv_seats_required TYPE i
is_flight_previous TYPE /dmo/flight15 OPTIONAL
RETURNING
VALUE(rs_flight) TYPE /dmo/flight15,
generate_booking_supplements
IMPORTING
iv_travel_id TYPE /dmo/booking15-travel_id
iv_booking_id TYPE /dmo/booking15-booking_id
RETURNING
VALUE(rt_data) TYPE tt_booking_supplements,
generate_description
IMPORTING
it_bookings TYPE lcl_travel_data_generator=>tt_booking_complete
RETURNING
VALUE(rv_description) TYPE /dmo/travel15-description,
generate_random_time
RETURNING
VALUE(r_result) TYPE i,
calculate_booking_fee
IMPORTING
it_bookings TYPE lcl_travel_data_generator=>tt_booking_complete
RETURNING
VALUE(rv_booking_fee) TYPE /dmo/travel15-booking_fee,
generate_travel_customer_id
IMPORTING
it_bookings TYPE lcl_travel_data_generator=>tt_booking_complete
RETURNING
VALUE(rv_customer_id) TYPE /dmo/travel15-customer_id,
set_today,
calc_days_before_book_or_today
IMPORTING
iv_booking_date TYPE lcl_travel_data_generator=>ty_booking_complete-booking_date
RETURNING
VALUE(rv_travel_create_date_dats) TYPE d
RAISING
cx_parameter_invalid_range
cx_parameter_invalid_type .
ENDCLASS.
CLASS lcl_travel_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
DATA: lt_travels TYPE tt_travel,
lt_bookings TYPE tt_bookings,
lt_booking_supplements TYPE tt_booking_supplements.
IF out IS BOUND. out->write( '--> Delete Travel Content.' ). ENDIF.
DELETE FROM /dmo/travel15. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Delete Booking Content.' ). ENDIF.
DELETE FROM /dmo/booking15. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Delete Booking Supplement Content.' ). ENDIF.
DELETE FROM /dmo/book_sup_15. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
DATA(lt_data) = get_data( ).
IF out IS BOUND. out->write( '--> Convert Content to Table Format' ). ENDIF.
LOOP AT lt_data INTO DATA(ls_travel).
APPEND CORRESPONDING /dmo/travel15( ls_travel ) TO lt_travels.
LOOP AT ls_travel-bookings INTO DATA(ls_booking).
APPEND CORRESPONDING /dmo/booking15( ls_booking ) TO lt_bookings.
APPEND LINES OF ls_booking-booking_supplements TO lt_booking_supplements.
ENDLOOP.
ENDLOOP.
IF out IS BOUND. out->write( '--> Insert Travel Content' ). ENDIF.
INSERT /dmo/travel15 FROM TABLE @lt_travels.
IF out IS BOUND. out->write( '--> Insert Booking Content' ). ENDIF.
INSERT /dmo/booking15 FROM TABLE @lt_bookings.
IF out IS BOUND. out->write( '--> Insert Booking Supplement Content' ). ENDIF.
INSERT /dmo/book_sup_15 FROM TABLE @lt_booking_supplements.
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD get_data.
DATA: lv_travel_id TYPE /dmo/booking15-travel_id.
build_dependend_content( ).
set_today( ).
lv_travel_id = 1.
DATA(lt_bookings) = build_booking( lv_travel_id ).
WHILE lt_bookings IS NOT INITIAL.
DATA(lv_travel_create_date_dats) = calc_days_before_book_or_today( lt_bookings[ 1 ]-booking_date ).
DATA(lv_booking_fee) = calculate_booking_fee( lt_bookings ).
DATA(lastchanged_date) = lv_travel_create_date_dats.
lastchanged_date = lastchanged_date + go_ran_travel_change_date->get_next( ).
DATA(lastchangedat_stamp) = CONV timestampl( ( CONV string( lastchanged_date ) * 1000000 ) ).
lastchangedat_stamp = lastchangedat_stamp + generate_random_time( ).
APPEND VALUE ty_travel_complete(
travel_id = lv_travel_id
agency_id = gt_agency[ go_ran_agency->get_next( ) ]-agency_id
customer_id = generate_travel_customer_id( lt_bookings )
begin_date = lt_bookings[ 1 ]-flight_date
end_date = lt_bookings[ lines( lt_bookings ) ]-flight_date
booking_fee = lv_booking_fee
total_price = lv_booking_fee + REDUCE /dmo/travel15-total_price( INIT sum = 0
FOR booking IN lt_bookings
NEXT
sum = sum
+ booking-flight_price
+ REDUCE /dmo/flight_price15( INIT sum_supplement = 0
FOR booking_supplement IN booking-booking_supplements
NEXT sum_supplement = sum_supplement + booking_supplement-price )
)
currency_code = lt_bookings[ 1 ]-currency_code
description = generate_description( lt_bookings )
status = SWITCH /dmo/travel15-status( go_ran_status_description->get_next( )
WHEN 1 OR 2 THEN /dmo/if_flight_legacy15=>travel_status-new
WHEN 3 THEN /dmo/if_flight_legacy15=>travel_status-booked
WHEN 4 THEN /dmo/if_flight_legacy15=>travel_status-planned )
createdby = gt_last_names[ go_ran_last_name->get_next( ) ]-last_name
createdat = CONV timestampl( CONV string( lv_travel_create_date_dats ) * 1000000 + generate_random_time( ) )
lastchangedby = gt_last_names[ go_ran_last_name->get_next( ) ]-last_name
lastchangedat = lastchangedat_stamp
bookings = lt_bookings
) TO rt_data.
lv_travel_id = lv_travel_id + 1.
lt_bookings = build_booking( lv_travel_id ).
ENDWHILE.
ENDMETHOD.
METHOD calc_days_before_book_or_today.
cl_abap_tstmp=>td_add(
EXPORTING
date = COND d( WHEN mv_datum > iv_booking_date
THEN iv_booking_date
ELSE mv_datum )
time = CONV t( 0 )
secs = -86400 * cv_booking_days_before
IMPORTING
res_date = rv_travel_create_date_dats ).
ENDMETHOD.
METHOD set_today.
GET TIME STAMP FIELD DATA(current_timestamp).
DATA(tmp) = CONV string( current_timestamp ).
mv_datum = tmp(8).
mv_datum = mv_datum - 1.
ENDMETHOD.
METHOD generate_random_time.
r_result = go_ran_hour->get_next( ) * 10000 + go_ran_min_sec->get_next( ) * 100 + go_ran_min_sec->get_next( ).
ENDMETHOD.
METHOD build_dependend_content.
go_ran_hour = cl_abap_random_int=>create( min = 0 max = 23 ).
go_ran_min_sec = cl_abap_random_int=>create( min = 0 max = 59 ).
gt_agency = lcl_agency_data_generator=>get_data( ).
go_ran_agency = cl_abap_random_int=>create( min = 1 max = lines( gt_agency ) ).
gt_customer = lcl_customer_data_generator=>get_data( ).
go_ran_customer = cl_abap_random_int=>create( min = 1 max = lines( gt_customer ) ).
gt_last_names = lcl_customer_data_generator=>build_last_names( ).
go_ran_last_name = cl_abap_random_int=>create( min = 1 max = lines( gt_last_names ) ).
go_ran_customer_travel = cl_abap_random_int=>create( min = 1 max = 4 ).
gt_connections = lcl_connection_data_generator=>get_data( ).
gt_airports = lcl_airport_data_generator=>get_data( ).
SELECT FROM i_countrytext FIELDS country, countryname WHERE language = 'E' INTO TABLE @gt_countryname.
gt_flights_final = lcl_flight_data_generator=>get_data( ).
SORT gt_flights_final BY flight_date ASCENDING.
gt_flights_seats_decrease = lcl_flight_data_generator=>get_data( ).
SORT gt_flights_seats_decrease BY flight_date ASCENDING.
go_ran_travel_group_amount = cl_abap_random_int=>create( min = 1 max = cv_travel_group_amount_max ).
go_ran_trip_length = cl_abap_random_int=>create( min = cv_trip_length_center - cv_trip_length_offset max = cv_trip_length_center + cv_trip_length_offset ).
go_ran_booking_date = cl_abap_random_int=>create( min = cv_booking_date_min max = cv_booking_date_max ).
go_ran_travel_create_dat_befor = cl_abap_random_int=>create( min = cv_booking_date_min max = cv_booking_date_max ).
go_ran_travel_change_date = cl_abap_random_int=>create( min = cv_booking_date_min max = cv_booking_date_max ).
gt_supplements = lcl_supplement_data_generator=>get_data( ).
go_ran_booking_supplement_id = cl_abap_random_int=>create( min = 1 max = lines( lcl_supplement_data_generator=>get_data( ) ) ).
go_ran_booking_supplement_amnt = cl_abap_random_int=>create( min = 0 max = cv_booking_supplement_amount ).
go_ran_status_description = cl_abap_random_int=>create( min = 1 max = 4 ).
go_ran_travel_description = cl_abap_random_int=>create( min = 0 max = 9 ).
ENDMETHOD.
METHOD build_booking.
TYPES: tt_customer_id TYPE TABLE OF /dmo/customer15-customer_id WITH EMPTY KEY.
DATA: lv_booking_id TYPE /dmo/booking15-booking_id,
lt_customer_id TYPE tt_customer_id,
lv_customer_amount TYPE i.
DATA(lv_trip_length) = go_ran_trip_length->get_next( ).
lt_customer_id = VALUE tt_customer_id(
FOR i = 1 THEN i + 1 WHILE i <= go_ran_travel_group_amount->get_next( )
LET j = go_ran_customer->get_next( ) IN
( gt_customer[ j ]-customer_id )
).
lt_customer_id = CORRESPONDING tt_customer_id( lt_customer_id DISCARDING DUPLICATES ).
lv_customer_amount = lines( lt_customer_id ).
lv_booking_id = 0.
DATA(ls_flight) = find_next_fitting_flight( iv_seats_required = lv_customer_amount ).
CHECK ls_flight IS NOT INITIAL.
DO lv_trip_length TIMES.
READ TABLE gt_flights_seats_decrease
WITH KEY key_sorted_date
COMPONENTS
carrier_id = ls_flight-carrier_id
connection_id = ls_flight-connection_id
flight_date = ls_flight-flight_date
ASSIGNING FIELD-SYMBOL(<flight>).
DATA(lv_booking_date) = CONV /dmo/booking15-booking_date( <flight>-flight_date - go_ran_booking_date->get_next( ) ).
DATA(lv_price) = /dmo/cl_flight_data_generat_15=>calculate_flight_price(
iv_flight_distance = gt_connections[ carrier_id = <flight>-carrier_id connection_id = <flight>-connection_id ]-distance
iv_seats_occupied_percent = ( gt_flights_final[ KEY primary_key ##PRIMKEY[KEY_SORTED_DATE]
carrier_id = <flight>-carrier_id
connection_id = <flight>-connection_id
flight_date = <flight>-flight_date
]-seats_occupied
- <flight>-seats_occupied
) * 100 DIV <flight>-seats_max
).
<flight>-seats_occupied = <flight>-seats_occupied - lv_customer_amount.
APPEND LINES OF VALUE tt_booking_complete(
FOR i = 1 THEN i + 1 WHILE i <= lines( lt_customer_id )
(
travel_id = iv_travel_id
booking_id = lv_booking_id + i
booking_date = lv_booking_date
customer_id = lt_customer_id[ i ]
carrier_id = <flight>-carrier_id
connection_id = <flight>-connection_id
flight_date = <flight>-flight_date
flight_price = lv_price
currency_code = <flight>-currency_code
booking_supplements = generate_booking_supplements( iv_travel_id = iv_travel_id iv_booking_id = CONV /dmo/booking15-booking_id( lv_booking_id + i ) )
)
) TO rt_bookings.
lv_booking_id = lv_booking_id + lines( lt_customer_id ).
ls_flight = find_next_fitting_flight(
iv_seats_required = lv_customer_amount
is_flight_previous = <flight>
).
IF ls_flight IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDMETHOD.
METHOD find_next_fitting_flight.
DATA(lt_flights_filtered) = FILTER lcl_flight_data_generator=>tt_flights(
gt_flights_seats_decrease
USING KEY key_sorted_seats
WHERE seats_occupied >= iv_seats_required
).
CHECK lt_flights_filtered IS NOT INITIAL.
IF is_flight_previous IS SUPPLIED.
DATA(lv_connection_id_new) = VALUE /dmo/connecti_15-connection_id( gt_connections[
airport_from_id = gt_connections[
connection_id = is_flight_previous-connection_id
]-airport_to_id
]-connection_id
OPTIONAL ).
CHECK lv_connection_id_new IS NOT INITIAL.
DATA(lt_flights_filtered2) = FILTER lcl_flight_data_generator=>tt_flights(
lt_flights_filtered
USING KEY key_sorted_date
WHERE connection_id = lv_connection_id_new
AND flight_date >= is_flight_previous-flight_date
).
CHECK lt_flights_filtered2 IS NOT INITIAL.
rs_flight = lt_flights_filtered2[ 1 ].
ELSE.
rs_flight = lt_flights_filtered[ 1 ].
ENDIF.
ENDMETHOD.
METHOD generate_booking_supplements.
rt_data = VALUE tt_booking_supplements(
FOR i = 1
THEN i + 1
WHILE i <= go_ran_booking_supplement_amnt->get_next( )
LET j = go_ran_booking_supplement_id->get_next( ) IN
( travel_id = iv_travel_id
booking_id = iv_booking_id
booking_supplement_id = i
supplement_id = gt_supplements[ j ]-supplement_id
price = gt_supplements[ j ]-price
currency_code = gt_supplements[ j ]-currency_code )
).
ENDMETHOD.
METHOD generate_description.
TYPES: tt_customers TYPE SORTED TABLE OF /dmo/customer15 WITH UNIQUE KEY customer_id.
rv_description = SWITCH /dmo/travel15-description(
go_ran_travel_description->get_next( )
WHEN 1 THEN `Business Trip for ` &&
REDUCE /dmo/travel15-description(
LET travelers = CORRESPONDING tt_customers( it_bookings DISCARDING DUPLICATES MAPPING customer_id = customer_id ) IN
INIT s = `` i = 1
FOR traveler IN travelers
NEXT s = s && gt_customer[ customer_id = traveler-customer_id ]-first_name
&& COND /dmo/travel15-description( WHEN i < lines( it_bookings ) THEN `, ` )
i = i + 1 )
WHEN 2 THEN `Vacation for ` &&
REDUCE /dmo/travel15-description(
LET travelers2 = CORRESPONDING tt_customers( it_bookings DISCARDING DUPLICATES MAPPING customer_id = customer_id ) IN
INIT s = `` i = 1
FOR traveler IN travelers2
NEXT s = s && gt_customer[ customer_id = traveler-customer_id ]-first_name
&& COND /dmo/travel15-description( WHEN i < lines( it_bookings ) THEN `, ` )
i = i + 1 )
WHEN 3 THEN `Business Trip to ` &&
gt_countryname[
country = gt_airports[
airport_id = gt_connections[
carrier_id = it_bookings[ 1 ]-carrier_id connection_id = it_bookings[ 1 ]-connection_id
]-airport_to_id
]-country
]-countryname
WHEN 4 THEN `Vacation to ` &&
gt_countryname[
country = gt_airports[
airport_id = gt_connections[
carrier_id = it_bookings[ 1 ]-carrier_id connection_id = it_bookings[ 1 ]-connection_id
]-airport_to_id
]-country
]-countryname
WHEN 5 THEN `Sightseeing in ` && gt_airports[
airport_id = gt_connections[
carrier_id = it_bookings[ 1 ]-carrier_id connection_id = it_bookings[ 1 ]-connection_id
]-airport_to_id
]-city
WHEN 6 THEN `Visiting ` && gt_customer[ go_ran_customer->get_next( ) ]-first_name
WHEN 7 THEN `Business Trip`
ELSE `Vacation`
).
ENDMETHOD.
METHOD calculate_booking_fee.
rv_booking_fee = 10 * lines( it_bookings ).
ENDMETHOD.
METHOD generate_travel_customer_id.
rv_customer_id = COND /dmo/travel15-customer_id(
WHEN go_ran_customer_travel->get_next( ) = 1
THEN gt_customer[ go_ran_customer->get_next( ) ]-customer_id
ELSE it_bookings[ 1 ]-customer_id
).
ENDMETHOD.
ENDCLASS.
| [
41358,
49836,
3868,
62,
7890,
62,
8612,
1352,
13,
198,
220,
42715,
12,
49273,
50,
25,
198,
220,
220,
220,
2251,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
503,
41876,
4526,
37,
5390,
611,
62,
2238,
62,
324,
83,
62,
4871,
5143,
62,
448,
39852,
2849,
1847,
13,
198,
10619,
41358,
49836,
13,
198,
198,
31631,
300,
565,
62,
40955,
62,
7890,
62,
8612,
1352,
5550,
20032,
17941,
29244,
6158,
4810,
3824,
6158,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
3868,
62,
7890,
62,
8612,
1352,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
256,
83,
62,
40955,
41876,
49053,
9795,
43679,
3963,
1220,
67,
5908,
14,
40955,
1314,
13315,
35374,
4086,
62,
312,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
25,
651,
62,
7890,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
7890,
8,
41876,
256,
83,
62,
40955,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
565,
62,
40955,
62,
7890,
62,
8612,
1352,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
3868,
62,
7890,
62,
8612,
1352,
93,
17953,
13,
198,
220,
220,
220,
16876,
503,
3180,
347,
15919,
13,
220,
503,
3784,
13564,
7,
705,
46904,
23520,
14041,
2637,
6739,
220,
23578,
5064,
13,
198,
220,
220,
220,
5550,
2538,
9328,
16034,
1220,
67,
5908,
14,
40955,
1314,
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,
14514,
62,
45669,
39,
9338,
628,
220,
220,
220,
16876,
503,
3180,
347,
15919,
13,
220,
503,
3784,
13564,
7,
705,
46904,
10934,
14041,
2637,
6739,
23578,
5064,
13,
198,
220,
220,
220,
42865,
7,
2528,
62,
7890,
8,
796,
651,
62,
7890,
7,
6739,
628,
220,
220,
220,
16876,
503,
3180,
347,
15919,
13,
220,
503,
3784,
13564,
7,
705,
46904,
35835,
14041,
2637,
6739,
23578,
5064,
13,
198,
220,
220,
220,
29194,
17395,
1220,
67,
5908,
14,
40955,
1314,
16034,
43679,
2488,
2528,
62,
7890,
13,
628,
220,
220,
220,
16876,
503,
3180,
347,
15919,
13,
220,
503,
3784,
13564,
7,
705,
46904,
24429,
2637,
6739,
23578,
5064,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
7890,
13,
198,
220,
220,
220,
374,
83,
62,
7890,
796,
26173,
8924,
256,
83,
62,
40955,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
4086,
62,
312,
796,
705,
2998,
18005,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
796,
705,
16012,
19489,
13524,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4675,
220,
220,
220,
796,
705,
19880,
2688,
3530,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30793,
62,
8189,
220,
796,
705,
20,
3559,
1954,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1748,
220,
220,
220,
220,
220,
796,
705,
49,
420,
19593,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1499,
62,
8189,
220,
220,
796,
705,
2937,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3072,
62,
17618,
796,
705,
10,
16,
860,
486,
12,
21,
2624,
12,
3980,
1238,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3992,
62,
21975,
220,
220,
220,
220,
220,
220,
796,
705,
4023,
1378,
2503,
13,
19155,
19489,
12,
35927,
13,
82,
499,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3053,
62,
21975,
796,
705,
10951,
31,
19155,
19489,
12,
35927,
13,
82,
499,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
4086,
62,
312,
796,
705,
2998,
34215,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
796,
705,
33771,
3334,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4675,
220,
220,
220,
796,
705,
24814,
24683,
978,
7197,
1367,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30793,
62,
8189,
220,
796,
705,
26200,
1795,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1748,
220,
220,
220,
220,
220,
796,
705,
35,
947,
325,
335,
24263,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1499,
62,
8189,
220,
220,
796,
705,
7206,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3072,
62,
17618,
796,
705,
10,
2920,
362,
15377,
8644,
31046,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3992,
62,
21975,
220,
220,
220,
220,
220,
220,
796,
705,
4023,
1378,
2503,
13,
12254,
8929,
13,
82,
499,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3053,
62,
21975,
796,
705,
10951,
31,
12254,
8929,
13,
82
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
*&------------------------------------------------------------------------*
*& Report ZTEST_DIKSHA_SELECT1
*&------------------------------------------------------------------------*
*& Author: Diksha
*& Retrieve data from existing table USR02 using PARAMETER (sinlge input)
*&------------------------------------------------------------------------*
REPORT ZTEST_DIKSHA_SELECT1.
TABLES USR02.
DATA: IT_TAB1 LIKE USR02 OCCURS 0 WITH HEADER LINE.
PARAMETERS: P_BNAME LIKE USR02-BNAME.
"SELECT-OPTIONS: S_BNAME FOR USR02-BNAME.
SELECT * FROM USR02 INTO CORRESPONDING FIELDS OF TABLE IT_TAB1 WHERE BNAME IN S_BNAME.
LOOP AT IT_TAB1 .
WRITE : IT_TAB1-BNAME , ' ' , IT_TAB1-GLTGV.
NEW-LINE.
ENDLOOP. | [
9,
5,
10097,
982,
9,
201,
198,
9,
5,
6358,
220,
1168,
51,
6465,
62,
17931,
27015,
7801,
62,
46506,
16,
201,
198,
9,
5,
10097,
982,
9,
201,
198,
9,
5,
6434,
25,
6031,
591,
3099,
201,
198,
9,
5,
4990,
30227,
1366,
422,
4683,
3084,
1294,
49,
2999,
1262,
29463,
2390,
2767,
1137,
357,
31369,
75,
469,
5128,
8,
201,
198,
9,
5,
10097,
982,
9,
201,
198,
201,
198,
2200,
15490,
220,
1168,
51,
6465,
62,
17931,
27015,
7801,
62,
46506,
16,
13,
201,
198,
201,
198,
5603,
9148,
1546,
1294,
49,
2999,
13,
201,
198,
201,
198,
26947,
25,
7283,
62,
5603,
33,
16,
34178,
1294,
49,
2999,
440,
4093,
4261,
50,
657,
13315,
39837,
1137,
48920,
13,
201,
198,
201,
198,
27082,
2390,
2767,
4877,
25,
350,
62,
15766,
10067,
34178,
1294,
49,
2999,
12,
15766,
10067,
13,
201,
198,
201,
198,
1,
46506,
12,
3185,
51,
11053,
25,
311,
62,
15766,
10067,
7473,
1294,
49,
2999,
12,
15766,
10067,
13,
201,
198,
201,
198,
46506,
1635,
16034,
1294,
49,
2999,
39319,
23929,
19535,
47,
18672,
2751,
18930,
3698,
5258,
3963,
43679,
7283,
62,
5603,
33,
16,
33411,
347,
20608,
3268,
311,
62,
15766,
10067,
13,
201,
198,
220,
17579,
3185,
5161,
7283,
62,
5603,
33,
16,
764,
201,
198,
220,
220,
220,
44423,
1058,
7283,
62,
5603,
33,
16,
12,
15766,
10067,
837,
705,
705,
837,
7283,
62,
5603,
33,
16,
12,
8763,
35990,
53,
13,
201,
198,
13965,
12,
24027,
13,
201,
198,
201,
198,
10619,
21982,
3185,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 any type declarations (class
*"* definitions, interfaces or data types) you need for method
*"* implementation or private method's signature
TYPES: BEGIN OF ty_container,
main TYPE REF TO cl_gui_container,
tool TYPE REF TO cl_gui_container,
cust TYPE REF TO cl_gui_container,
tbar type ref to cl_gui_toolbar,
END OF ty_container.
TYPES ty_container_table TYPE STANDARD TABLE
OF ty_container WITH DEFAULT KEY.
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
597,
2099,
31713,
357,
4871,
198,
9,
1,
9,
17336,
11,
20314,
393,
1366,
3858,
8,
345,
761,
329,
2446,
198,
9,
1,
9,
7822,
393,
2839,
2446,
338,
9877,
628,
198,
9936,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
34924,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
1388,
41876,
4526,
37,
5390,
537,
62,
48317,
62,
34924,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
2891,
41876,
4526,
37,
5390,
537,
62,
48317,
62,
34924,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
9378,
41876,
4526,
37,
5390,
537,
62,
48317,
62,
34924,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
256,
5657,
2099,
1006,
284,
537,
62,
48317,
62,
25981,
5657,
11,
198,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
34924,
13,
198,
9936,
47,
1546,
1259,
62,
34924,
62,
11487,
41876,
49053,
9795,
43679,
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,
3963,
1259,
62,
34924,
13315,
5550,
38865,
35374,
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
] |
CLASS zcl_aoc_check_62 DEFINITION
PUBLIC
INHERITING FROM zcl_aoc_super
CREATE PUBLIC.
PUBLIC SECTION.
METHODS constructor.
METHODS check
REDEFINITION.
METHODS get_message_text
REDEFINITION.
PROTECTED SECTION.
METHODS check_continue
IMPORTING
!is_statement TYPE ty_statement
!is_next TYPE ty_statement
!is_next_next TYPE ty_statement
RETURNING
VALUE(rv_code) TYPE sci_errc .
METHODS check_delete
IMPORTING
!is_statement TYPE ty_statement
!is_next TYPE ty_statement
RETURNING
VALUE(rv_code) TYPE sci_errc .
METHODS check_lines
IMPORTING
!is_statement TYPE ty_statement
!is_next TYPE ty_statement
RETURNING
VALUE(rv_code) TYPE sci_errc .
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_AOC_CHECK_62 IMPLEMENTATION.
METHOD check.
* abapOpenChecks
* https://github.com/larshp/abapOpenChecks
* MIT License
DATA: lt_statements TYPE ty_statements,
lv_index TYPE i,
lv_code TYPE sci_errc.
FIELD-SYMBOLS: <ls_statement> LIKE LINE OF lt_statements,
<ls_next> LIKE LINE OF lt_statements,
<ls_next_next> LIKE LINE OF lt_statements.
lt_statements = build_statements(
it_tokens = it_tokens
it_statements = it_statements ).
LOOP AT lt_statements ASSIGNING <ls_statement>.
lv_index = sy-tabix + 1.
READ TABLE lt_statements INDEX lv_index ASSIGNING <ls_next>.
IF sy-subrc <> 0 OR <ls_next>-include <> <ls_statement>-include.
CONTINUE.
ENDIF.
lv_index = lv_index + 1.
READ TABLE lt_statements INDEX lv_index ASSIGNING <ls_next_next>.
IF sy-subrc <> 0 OR <ls_next_next>-include <> <ls_statement>-include.
CONTINUE.
ENDIF.
lv_code = check_delete(
is_statement = <ls_statement>
is_next = <ls_next> ).
IF lv_code IS INITIAL.
lv_code = check_continue(
is_statement = <ls_statement>
is_next = <ls_next>
is_next_next = <ls_next_next> ).
ENDIF.
IF lv_code IS INITIAL.
lv_code = check_lines(
is_statement = <ls_statement>
is_next = <ls_next> ).
ENDIF.
IF NOT lv_code IS INITIAL.
inform( p_sub_obj_type = c_type_include
p_sub_obj_name = <ls_statement>-include
p_line = <ls_statement>-start-row
p_kind = mv_errty
p_test = myname
p_code = lv_code ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD check_continue.
* this is a limited check, but it covers the examples I typically see implemented
IF is_statement-str = 'CONTINUE'
AND ( is_next-str = 'ENDDO'
OR is_next-str = 'ENDLOOP'
OR is_next-str = 'ENDWHILE' ).
rv_code = '002'.
ENDIF.
IF is_statement-str = 'CONTINUE'
AND ( is_next-str = 'ENDIF'
OR is_next-str = 'ENDTRY' )
AND ( is_next_next-str = 'ENDDO'
OR is_next_next-str = 'ENDLOOP'
OR is_next_next-str = 'ENDWHILE' ).
rv_code = '002'.
ENDIF.
ENDMETHOD.
METHOD check_delete.
DATA: lv_target TYPE string,
lv_source TYPE string.
IF is_statement-str CP 'LOOP AT *'.
FIND REGEX ' (\w+) ASSIGNING (<\w+>)' IN is_statement-str
SUBMATCHES lv_source lv_target ##NO_TEXT.
IF sy-subrc <> 0.
FIND REGEX ' (\w+) INTO DATA\((\w+)\)' IN is_statement-str
SUBMATCHES lv_source lv_target ##NO_TEXT.
ENDIF.
IF sy-subrc <> 0.
FIND REGEX ' (\w+) ASSIGNING FIELD-SYMBOL\((<\w+>)\)' IN is_statement-str
SUBMATCHES lv_source lv_target ##NO_TEXT.
ENDIF.
IF sy-subrc <> 0.
FIND REGEX ' (\w+) INTO (\w+)' IN is_statement-str
SUBMATCHES lv_source lv_target ##NO_TEXT.
ENDIF.
IF sy-subrc <> 0.
RETURN.
ENDIF.
IF is_next-str = |DELETE { lv_source } FROM { lv_target }|.
rv_code = '001'.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD check_lines.
DATA: lv_table TYPE string.
FIND REGEX '^IF NOT (\w+) IS INITIAL$' IN is_statement-str SUBMATCHES lv_table ##NO_TEXT.
IF sy-subrc <> 0.
FIND REGEX '^IF (\w+) IS NOT INITIAL$' IN is_statement-str SUBMATCHES lv_table ##NO_TEXT.
ENDIF.
IF sy-subrc <> 0.
* assuming LINES method is not overwritten by custom method
FIND REGEX '^IF LINES\( (\w+) \) > 0$' IN is_statement-str SUBMATCHES lv_table ##NO_TEXT.
ENDIF.
IF sy-subrc <> 0.
RETURN.
ENDIF.
lv_table = |^LOOP AT { lv_table } |.
FIND REGEX lv_table IN is_next-str.
IF sy-subrc = 0.
rv_code = '003'.
ENDIF.
ENDMETHOD.
METHOD constructor.
super->constructor( ).
version = '001'.
position = '062'.
has_attributes = abap_true.
attributes_ok = abap_true.
enable_rfc( ).
mv_errty = c_error.
ENDMETHOD. "CONSTRUCTOR
METHOD get_message_text.
CLEAR p_text.
CASE p_code.
WHEN '001'.
p_text = 'Use DELETE WHERE instead'. "#EC NOTEXT
WHEN '002'.
p_text = 'CONTINUE as last statement in loop'. "#EC NOTEXT
WHEN '003'.
p_text = 'Checking for lines before looping'. "#EC NOTEXT
WHEN OTHERS.
super->get_message_text( EXPORTING p_test = p_test
p_code = p_code
IMPORTING p_text = p_text ).
ENDCASE.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
64,
420,
62,
9122,
62,
5237,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
64,
420,
62,
16668,
198,
220,
29244,
6158,
44731,
13,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
23772,
13,
628,
220,
220,
220,
337,
36252,
50,
2198,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
20500,
62,
5239,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
2198,
62,
43043,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
26090,
220,
41876,
1259,
62,
26090,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
19545,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
26090,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
19545,
62,
19545,
220,
41876,
1259,
62,
26090,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8189,
8,
41876,
20681,
62,
263,
6015,
764,
198,
220,
220,
220,
337,
36252,
50,
2198,
62,
33678,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
26090,
220,
41876,
1259,
62,
26090,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
19545,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
26090,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8189,
8,
41876,
20681,
62,
263,
6015,
764,
198,
220,
220,
220,
337,
36252,
50,
2198,
62,
6615,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
26090,
220,
41876,
1259,
62,
26090,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
19545,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
26090,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8189,
8,
41876,
20681,
62,
263,
6015,
764,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
32,
4503,
62,
50084,
62,
5237,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
2198,
13,
198,
198,
9,
450,
499,
11505,
7376,
4657,
198,
9,
3740,
1378,
12567,
13,
785,
14,
75,
5406,
79,
14,
397,
499,
11505,
7376,
4657,
198,
9,
17168,
13789,
628,
220,
220,
220,
42865,
25,
300,
83,
62,
14269,
3196,
41876,
1259,
62,
14269,
3196,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
9630,
220,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
8189,
220,
220,
220,
220,
220,
220,
41876,
20681,
62,
263,
6015,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
26090,
29,
34178,
48920,
3963,
300,
83,
62,
14269,
3196,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7278,
62,
19545,
29,
220,
220,
220,
220,
220,
34178,
48920,
3963,
300,
83,
62,
14269,
3196,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7278,
62,
19545,
62,
19545,
29,
34178,
48920,
3963,
300,
83,
62,
14269,
3196,
13,
628,
198,
220,
220,
220,
300,
83,
62,
14269,
3196,
796,
1382,
62,
14269,
3196,
7,
198,
220,
220,
220,
220,
220,
340,
62,
83,
482,
641,
220,
220,
220,
220,
796,
340,
62,
83,
482,
641,
198,
220,
220,
220,
220,
220,
340,
62,
14269,
3196,
796,
340,
62,
14269,
3196,
6739,
628,
220,
220,
220,
17579,
3185,
5161,
300,
83,
62,
14269,
3196,
24994,
3528,
15871,
1279,
7278,
62,
26090,
28401,
198,
220,
220,
220,
220,
220,
300,
85,
62,
9630,
796,
827,
12,
8658,
844,
1343,
352,
13,
198,
220,
220,
220,
220,
220,
20832,
43679,
300,
83,
62,
14269,
3196,
24413,
6369,
300,
85,
62,
9630,
24994,
3528,
15871,
1279,
7278,
62,
19545,
28401,
198,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
6375,
1279,
7278,
62,
19545,
29,
12,
17256,
1279,
29,
1279,
7278,
62,
26090,
29,
12,
17256,
13,
198,
220,
220,
220,
220,
220,
220,
220,
43659,
8924,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
220,
220,
300,
85,
62,
9630,
796,
300,
85,
62,
9630,
1343,
352,
13,
198,
220,
220,
220,
220,
220,
20832,
43679,
300,
83,
62,
14269,
3196,
24413,
6369,
300,
85,
62,
9630,
24994,
3528,
15871,
1279,
7278,
62,
19545,
62,
19545,
28401,
198,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
6375,
1279,
7278,
62,
19545,
62,
19545,
29,
12,
17256,
1279,
29,
1279,
7278,
62,
26090,
29,
12,
17256,
13,
198,
220,
220,
220,
220,
220,
220,
220,
43659,
8924,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
220,
220,
300,
85,
62,
8189,
796,
2198,
62,
33678,
7,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
26090,
796,
1279,
7278,
62,
26090,
29,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
19545,
220,
220,
220,
220,
220,
796,
1279,
7278,
62,
19545,
29,
6739,
628,
220,
220,
220,
220,
220,
16876,
300,
85,
62,
8189,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
8189,
796,
2198,
62,
43043,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
26090,
796,
1279,
7278,
62,
26090,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
19545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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*"* components of interface /OOP/IF_COLLECTION
interface /OOP/IF_COLLECTION
public .
type-pools ABAP .
methods ADD
importing
!ELEMENT type ref to /OOP/CL_OBJECT
returning
value(RETURNING) type ABAP_BOOL .
methods ADDALL
importing
!COLLECTION type ref to /OOP/IF_COLLECTION
returning
value(RETURNING) type ABAP_BOOL .
methods CLEAR .
methods CONTAINS
importing
!OBJECT type ref to /OOP/CL_OBJECT
returning
value(RETURNING) type ABAP_BOOL .
methods CONTAINSALL
importing
!COLLECTION type ref to /OOP/IF_COLLECTION
returning
value(RETURNING) type ABAP_BOOL .
methods ISEMPTY
returning
value(RETURNING) type ABAP_BOOL .
methods ITERATOR
returning
value(RETURNING) type ref to /OOP/IF_ITERATOR .
methods REMOVE
importing
!OBJECT type ref to /OOP/CL_OBJECT
returning
value(RETURNING) type ABAP_BOOL .
methods REMOVEALL
importing
!COLLECTION type ref to /OOP/IF_COLLECTION
returning
value(RETURNING) type ABAP_BOOL .
methods RETAINALL
importing
!COLLECTION type ref to /OOP/IF_COLLECTION
returning
value(RETURNING) type ABAP_BOOL .
methods SIZE
returning
value(RETURNING) type I .
methods TOARRAY
returning
value(RETURNING) type /OOP/ARRAY .
endinterface.
| [
9,
1,
9,
6805,
286,
7071,
1220,
46,
3185,
14,
5064,
62,
25154,
16779,
2849,
201,
198,
39994,
1220,
46,
3185,
14,
5064,
62,
25154,
16779,
2849,
201,
198,
220,
1171,
764,
201,
198,
201,
198,
201,
198,
220,
2099,
12,
7742,
82,
9564,
2969,
764,
201,
198,
220,
5050,
27841,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
36,
2538,
10979,
2099,
1006,
284,
1220,
46,
3185,
14,
5097,
62,
9864,
23680,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
9564,
2969,
62,
8202,
3535,
764,
201,
198,
220,
5050,
27841,
7036,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
25154,
16779,
2849,
2099,
1006,
284,
1220,
46,
3185,
14,
5064,
62,
25154,
16779,
2849,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
9564,
2969,
62,
8202,
3535,
764,
201,
198,
220,
5050,
30301,
1503,
764,
201,
198,
220,
5050,
7102,
5603,
20913,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
9864,
23680,
2099,
1006,
284,
1220,
46,
3185,
14,
5097,
62,
9864,
23680,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
9564,
2969,
62,
8202,
3535,
764,
201,
198,
220,
5050,
7102,
5603,
20913,
7036,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
25154,
16779,
2849,
2099,
1006,
284,
1220,
46,
3185,
14,
5064,
62,
25154,
16779,
2849,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
9564,
2969,
62,
8202,
3535,
764,
201,
198,
220,
5050,
3180,
39494,
9936,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
9564,
2969,
62,
8202,
3535,
764,
201,
198,
220,
5050,
314,
5781,
25633,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
1006,
284,
1220,
46,
3185,
14,
5064,
62,
2043,
1137,
25633,
764,
201,
198,
220,
5050,
22657,
46,
6089,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
9864,
23680,
2099,
1006,
284,
1220,
46,
3185,
14,
5097,
62,
9864,
23680,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
9564,
2969,
62,
8202,
3535,
764,
201,
198,
220,
5050,
22657,
46,
6089,
7036,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
25154,
16779,
2849,
2099,
1006,
284,
1220,
46,
3185,
14,
5064,
62,
25154,
16779,
2849,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
9564,
2969,
62,
8202,
3535,
764,
201,
198,
220,
5050,
371,
20892,
1268,
7036,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
25154,
16779,
2849,
2099,
1006,
284,
1220,
46,
3185,
14,
5064,
62,
25154,
16779,
2849,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
9564,
2969,
62,
8202,
3535,
764,
201,
198,
220,
5050,
311,
35400,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
314,
764,
201,
198,
220,
5050,
5390,
1503,
30631,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
1220,
46,
3185,
14,
1503,
30631,
764,
201,
198,
437,
39994,
13,
201,
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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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
] |
*"* use this source file for your ABAP unit test classes
CLASS ltc_get_distinct_count DEFINITION FINAL FOR TESTING
DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS: setup.
METHODS: empty_input FOR TESTING.
METHODS: general_input FOR TESTING.
METHODS: error_input FOR TESTING.
ENDCLASS.
CLASS ltc_get_distinct_count IMPLEMENTATION.
METHOD setup.
ENDMETHOD.
METHOD empty_input.
DATA: test_table TYPE STANDARD TABLE OF sflight.
DATA(count) = zcl_afl_utilities=>get_distinct_count( tab_data = test_table field_name = 'CARRID' ).
cl_abap_unit_assert=>assert_equals(
act = count
exp = 0
msg = |exp: 0, act:{ count }|
).
ENDMETHOD.
METHOD general_input.
DATA: test_table TYPE STANDARD TABLE OF sflight.
test_table = VALUE #(
( seatsmax = '1' )
( seatsmax = '55332' )
( seatsmax = '3' )
( seatsmax = '4' )
( seatsmax = '5' )
( seatsmax = '6' )
( seatsmax = '7' )
( seatsmax = '8' )
( seatsmax = '9' )
( seatsmax = '5' )
( seatsmax = '5' )
( seatsmax = '2' )
( seatsmax = '5' )
( seatsmax = '1' )
( seatsmax = '9' )
( seatsmax = '9' )
( seatsmax = '6' )
).
DATA(count) = zcl_afl_utilities=>get_distinct_count( tab_data = test_table field_name = 'SEATSMAX' ).
cl_abap_unit_assert=>assert_equals(
act = count
exp = 10
msg = |exp: 10, act:{ count }|
).
ENDMETHOD.
METHOD error_input.
DATA: test_table TYPE STANDARD TABLE OF sflight.
DATA(count) = zcl_afl_utilities=>get_distinct_count( tab_data = test_table field_name = 'XCARRID' ).
cl_abap_unit_assert=>assert_equals(
act = count
exp = 0
msg = |exp: 0, act:{ count }|
).
ENDMETHOD.
ENDCLASS.
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
534,
9564,
2969,
4326,
1332,
6097,
198,
31631,
300,
23047,
62,
1136,
62,
17080,
4612,
62,
9127,
5550,
20032,
17941,
25261,
7473,
43001,
2751,
198,
35,
4261,
6234,
6006,
9863,
45698,
42,
49277,
43638,
5805,
7597,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
9058,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
6565,
62,
15414,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
2276,
62,
15414,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
4049,
62,
15414,
7473,
43001,
2751,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
23047,
62,
1136,
62,
17080,
4612,
62,
9127,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
9058,
13,
628,
220,
23578,
49273,
13,
198,
220,
337,
36252,
6565,
62,
15414,
13,
628,
220,
220,
220,
42865,
25,
1332,
62,
11487,
41876,
49053,
9795,
43679,
3963,
264,
22560,
13,
628,
220,
220,
220,
42865,
7,
9127,
8,
796,
1976,
565,
62,
1878,
75,
62,
315,
2410,
14804,
1136,
62,
17080,
4612,
62,
9127,
7,
7400,
62,
7890,
796,
1332,
62,
11487,
2214,
62,
3672,
796,
705,
20034,
49,
2389,
6,
6739,
198,
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,
954,
198,
220,
220,
220,
220,
220,
1033,
796,
657,
198,
220,
220,
220,
220,
220,
31456,
796,
930,
11201,
25,
657,
11,
719,
29164,
954,
1782,
91,
198,
220,
220,
220,
6739,
628,
220,
23578,
49273,
13,
198,
220,
337,
36252,
2276,
62,
15414,
13,
628,
220,
220,
220,
42865,
25,
1332,
62,
11487,
41876,
49053,
9795,
43679,
3963,
264,
22560,
13,
628,
220,
220,
220,
1332,
62,
11487,
796,
26173,
8924,
1303,
7,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
16,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
2816,
32148,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
18,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
19,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
20,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
21,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
22,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
23,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
24,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
20,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
20,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
17,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
20,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
16,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
24,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
24,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
8632,
9806,
796,
705,
21,
6,
1267,
198,
220,
220,
220,
6739,
628,
220,
220,
220,
42865,
7,
9127,
8,
796,
1976,
565,
62,
1878,
75,
62,
315,
2410,
14804,
1136,
62,
17080,
4612,
62,
9127,
7,
7400,
62,
7890,
796,
1332,
62,
11487,
2214,
62,
3672,
796,
705,
5188,
33586,
22921,
6,
6739,
198,
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,
954,
198,
220,
220,
220,
220,
220,
1033,
796,
838,
198,
220,
220,
220,
220,
220,
31456,
796,
930,
11201,
25,
838,
11,
719,
29164,
954,
1782,
91,
198,
220,
220,
220,
6739,
628,
220,
23578,
49273,
13,
198,
220,
337,
36252,
4049,
62,
15414,
13,
628,
220,
220,
220,
42865,
25,
1332,
62,
11487,
41876,
49053,
9795,
43679,
3963,
264,
22560,
13,
628,
220,
220,
220,
42865,
7,
9127,
8,
796,
1976,
565,
62,
1878,
75,
62,
315,
2410,
14804,
1136,
62,
17080,
4612,
62,
9127,
7,
7400,
62,
7890,
796,
1332,
62,
11487,
2214,
62,
3672,
796,
705,
55,
20034,
49,
2389,
6,
6739,
198,
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,
954,
198,
220,
220,
220,
220,
220,
1033,
796,
657,
198,
220,
220,
220,
220,
220,
31456,
796,
930,
11201,
25,
657,
11,
719,
29164,
954,
1782,
91,
198,
220,
220,
220,
6739,
628,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198
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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
] |
FUNCTION /GAL/RFC_CFW_CHECK_AUTH.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(RFC_ROUTE_INFO) TYPE /GAL/RFC_ROUTE_INFO OPTIONAL
*" REFERENCE(AUTH_CONFIG) TYPE /GAL/CFW_AUTH_DEFS
*" REFERENCE(USER) TYPE SYUNAME
*" EXPORTING
*" REFERENCE(FORBIDDEN) TYPE ABAP_BOOL
*" EXCEPTIONS
*" RFC_EXCEPTION
*"----------------------------------------------------------------------
DATA: l_auth_fieldval1 TYPE /gal/cfw_auth_field_val,
l_auth_fieldval2 TYPE /gal/cfw_auth_field_val,
l_auth_fieldval3 TYPE /gal/cfw_auth_field_val,
l_auth_fieldval4 TYPE /gal/cfw_auth_field_val,
l_auth_fieldval5 TYPE /gal/cfw_auth_field_val,
l_auth_fieldval6 TYPE /gal/cfw_auth_field_val,
l_auth_fieldval7 TYPE /gal/cfw_auth_field_val,
l_auth_fieldval8 TYPE /gal/cfw_auth_field_val,
l_auth_fieldval9 TYPE /gal/cfw_auth_field_val,
l_auth_fieldval10 TYPE /gal/cfw_auth_field_val,
l_field_name(16) TYPE c,
l_count TYPE i.
FIELD-SYMBOLS: <l_imp_sched_auth> TYPE /gal/cfw_auth_def,
<l_auth_fieldval> TYPE /gal/cfw_auth_field_val,
<l_auth_fieldval_x> TYPE /gal/cfw_auth_field_val.
forbidden = abap_false.
cfw_follow_rfc_route rfc_route_info.
cfw_pass_exception rfc_exception.
cfw_remote_coding.
IF auth_config IS INITIAL.
forbidden = abap_true.
RETURN.
ENDIF.
LOOP AT auth_config ASSIGNING <l_imp_sched_auth>.
IF <l_imp_sched_auth>-object IS INITIAL.
forbidden = abap_true.
RETURN.
ENDIF.
l_count = 0.
LOOP AT <l_imp_sched_auth>-fields ASSIGNING <l_auth_fieldval>.
l_count = l_count + 1.
WRITE l_count TO l_field_name.
CONDENSE l_field_name.
CONCATENATE 'L_AUTH_FIELDVAL' l_field_name INTO l_field_name.
ASSIGN (l_field_name) TO <l_auth_fieldval_x>.
IF sy-subrc <> 0.
forbidden = abap_true.
RETURN.
ELSE.
<l_auth_fieldval_x> = <l_auth_fieldval>.
ENDIF.
ENDLOOP.
CASE l_count.
WHEN 1.
AUTHORITY-CHECK OBJECT <l_imp_sched_auth>-object
FOR USER user
ID l_auth_fieldval1-id FIELD l_auth_fieldval1-field.
WHEN 2.
AUTHORITY-CHECK OBJECT <l_imp_sched_auth>-object
FOR USER user
ID l_auth_fieldval1-id FIELD l_auth_fieldval1-field
ID l_auth_fieldval2-id FIELD l_auth_fieldval2-field.
WHEN 3.
AUTHORITY-CHECK OBJECT <l_imp_sched_auth>-object
FOR USER user
ID l_auth_fieldval1-id FIELD l_auth_fieldval1-field
ID l_auth_fieldval2-id FIELD l_auth_fieldval2-field
ID l_auth_fieldval3-id FIELD l_auth_fieldval3-field.
WHEN 4.
AUTHORITY-CHECK OBJECT <l_imp_sched_auth>-object
FOR USER user
ID l_auth_fieldval1-id FIELD l_auth_fieldval1-field
ID l_auth_fieldval2-id FIELD l_auth_fieldval2-field
ID l_auth_fieldval3-id FIELD l_auth_fieldval3-field
ID l_auth_fieldval4-id FIELD l_auth_fieldval4-field.
WHEN 5.
AUTHORITY-CHECK OBJECT <l_imp_sched_auth>-object
FOR USER user
ID l_auth_fieldval1-id FIELD l_auth_fieldval1-field
ID l_auth_fieldval2-id FIELD l_auth_fieldval2-field
ID l_auth_fieldval3-id FIELD l_auth_fieldval3-field
ID l_auth_fieldval4-id FIELD l_auth_fieldval4-field
ID l_auth_fieldval5-id FIELD l_auth_fieldval5-field.
WHEN 6.
AUTHORITY-CHECK OBJECT <l_imp_sched_auth>-object
FOR USER user
ID l_auth_fieldval1-id FIELD l_auth_fieldval1-field
ID l_auth_fieldval2-id FIELD l_auth_fieldval2-field
ID l_auth_fieldval3-id FIELD l_auth_fieldval3-field
ID l_auth_fieldval4-id FIELD l_auth_fieldval4-field
ID l_auth_fieldval5-id FIELD l_auth_fieldval5-field
ID l_auth_fieldval6-id FIELD l_auth_fieldval6-field.
WHEN 7.
AUTHORITY-CHECK OBJECT <l_imp_sched_auth>-object
FOR USER user
ID l_auth_fieldval1-id FIELD l_auth_fieldval1-field
ID l_auth_fieldval2-id FIELD l_auth_fieldval2-field
ID l_auth_fieldval3-id FIELD l_auth_fieldval3-field
ID l_auth_fieldval4-id FIELD l_auth_fieldval4-field
ID l_auth_fieldval5-id FIELD l_auth_fieldval5-field
ID l_auth_fieldval6-id FIELD l_auth_fieldval6-field
ID l_auth_fieldval7-id FIELD l_auth_fieldval7-field.
WHEN 8.
AUTHORITY-CHECK OBJECT <l_imp_sched_auth>-object
FOR USER user
ID l_auth_fieldval1-id FIELD l_auth_fieldval1-field
ID l_auth_fieldval2-id FIELD l_auth_fieldval2-field
ID l_auth_fieldval3-id FIELD l_auth_fieldval3-field
ID l_auth_fieldval4-id FIELD l_auth_fieldval4-field
ID l_auth_fieldval5-id FIELD l_auth_fieldval5-field
ID l_auth_fieldval6-id FIELD l_auth_fieldval6-field
ID l_auth_fieldval7-id FIELD l_auth_fieldval7-field
ID l_auth_fieldval8-id FIELD l_auth_fieldval8-field.
WHEN 9.
AUTHORITY-CHECK OBJECT <l_imp_sched_auth>-object
FOR USER user
ID l_auth_fieldval1-id FIELD l_auth_fieldval1-field
ID l_auth_fieldval2-id FIELD l_auth_fieldval2-field
ID l_auth_fieldval3-id FIELD l_auth_fieldval3-field
ID l_auth_fieldval4-id FIELD l_auth_fieldval4-field
ID l_auth_fieldval5-id FIELD l_auth_fieldval5-field
ID l_auth_fieldval6-id FIELD l_auth_fieldval6-field
ID l_auth_fieldval7-id FIELD l_auth_fieldval7-field
ID l_auth_fieldval8-id FIELD l_auth_fieldval8-field
ID l_auth_fieldval9-id FIELD l_auth_fieldval9-field.
WHEN 10.
AUTHORITY-CHECK OBJECT <l_imp_sched_auth>-object
FOR USER user
ID l_auth_fieldval1-id FIELD l_auth_fieldval1-field
ID l_auth_fieldval2-id FIELD l_auth_fieldval2-field
ID l_auth_fieldval3-id FIELD l_auth_fieldval3-field
ID l_auth_fieldval4-id FIELD l_auth_fieldval4-field
ID l_auth_fieldval5-id FIELD l_auth_fieldval5-field
ID l_auth_fieldval6-id FIELD l_auth_fieldval6-field
ID l_auth_fieldval7-id FIELD l_auth_fieldval7-field
ID l_auth_fieldval8-id FIELD l_auth_fieldval8-field
ID l_auth_fieldval9-id FIELD l_auth_fieldval9-field
ID l_auth_fieldval10-id FIELD l_auth_fieldval10-field.
WHEN OTHERS.
forbidden = abap_true.
RETURN.
ENDCASE.
IF sy-subrc <> 0.
forbidden = abap_true.
RETURN.
ENDIF.
ENDLOOP.
ENDFUNCTION.
| [
42296,
4177,
2849,
1220,
38,
1847,
14,
41150,
62,
22495,
54,
62,
50084,
62,
32,
24318,
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,
41150,
62,
49,
2606,
9328,
62,
10778,
8,
41876,
220,
1220,
38,
1847,
14,
41150,
62,
49,
2606,
9328,
62,
10778,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
32,
24318,
62,
10943,
16254,
8,
41876,
220,
1220,
38,
1847,
14,
22495,
54,
62,
32,
24318,
62,
7206,
10652,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
29904,
8,
41876,
220,
19704,
4944,
10067,
198,
9,
1,
220,
7788,
15490,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
13775,
33,
2389,
41819,
8,
41876,
220,
9564,
2969,
62,
8202,
3535,
198,
9,
1,
220,
7788,
42006,
11053,
198,
9,
1,
220,
220,
220,
220,
220,
30978,
62,
6369,
42006,
2849,
198,
9,
1,
10097,
23031,
198,
220,
42865,
25,
300,
62,
18439,
62,
3245,
2100,
16,
220,
41876,
1220,
13528,
14,
12993,
86,
62,
18439,
62,
3245,
62,
2100,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
62,
18439,
62,
3245,
2100,
17,
220,
41876,
1220,
13528,
14,
12993,
86,
62,
18439,
62,
3245,
62,
2100,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
62,
18439,
62,
3245,
2100,
18,
220,
41876,
1220,
13528,
14,
12993,
86,
62,
18439,
62,
3245,
62,
2100,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
62,
18439,
62,
3245,
2100,
19,
220,
41876,
1220,
13528,
14,
12993,
86,
62,
18439,
62,
3245,
62,
2100,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
62,
18439,
62,
3245,
2100,
20,
220,
41876,
1220,
13528,
14,
12993,
86,
62,
18439,
62,
3245,
62,
2100,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
62,
18439,
62,
3245,
2100,
21,
220,
41876,
1220,
13528,
14,
12993,
86,
62,
18439,
62,
3245,
62,
2100,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
62,
18439,
62,
3245,
2100,
22,
220,
41876,
1220,
13528,
14,
12993,
86,
62,
18439,
62,
3245,
62,
2100,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
62,
18439,
62,
3245,
2100,
23,
220,
41876,
1220,
13528,
14,
12993,
86,
62,
18439,
62,
3245,
62,
2100,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
62,
18439,
62,
3245,
2100,
24,
220,
41876,
1220,
13528,
14,
12993,
86,
62,
18439,
62,
3245,
62,
2100,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
62,
18439,
62,
3245,
2100,
940,
41876,
1220,
13528,
14,
12993,
86,
62,
18439,
62,
3245,
62,
2100,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
62,
3245,
62,
3672,
7,
1433,
8,
220,
41876,
269,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
62,
9127,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
13,
628,
198,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
75,
62,
11011,
62,
1416,
704,
62,
18439,
29,
220,
41876,
1220,
13528,
14,
12993,
86,
62,
18439,
62,
4299,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
75,
62,
18439,
62,
3245,
2100,
29,
220,
220,
41876,
1220,
13528,
14,
12993,
86,
62,
18439,
62,
3245,
62,
2100,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
75,
62,
18439,
62,
3245,
2100,
62,
87,
29,
41876,
1220,
13528,
14,
12993,
86,
62,
18439,
62,
3245,
62,
2100,
13,
628,
198,
220,
19467,
796,
450,
499,
62,
9562,
13,
628,
220,
30218,
86,
62,
27780,
62,
81,
16072,
62,
38629,
374,
16072,
62,
38629,
62,
10951,
13,
198,
220,
30218,
86,
62,
6603,
62,
1069,
4516,
374,
16072,
62,
1069,
4516,
13,
198,
220,
30218,
86,
62,
47960,
62,
66,
7656,
13,
628,
220,
16876,
6284,
62,
11250,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
19467,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
30826,
27064,
13,
198,
220,
23578,
5064,
13,
628,
220,
17579,
3185,
5161,
6284,
62,
11250,
24994,
3528,
15871,
1279,
75,
62,
11011,
62,
1416,
704,
62,
18439,
28401,
198,
220,
220,
220,
16876,
1279,
75,
62,
11011,
62,
1416,
704,
62,
18439,
29,
12,
15252,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
19467,
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,
300,
62,
9127,
796,
657,
13,
198,
220,
220,
220,
17579,
3185,
5161,
1279,
75,
62,
11011,
62,
1416,
704,
62,
18439,
29,
12,
25747,
24994,
3528,
15871,
1279,
75,
62,
18439,
62,
3245,
2100,
28401,
198,
220,
220,
220,
220,
220,
300,
62,
9127,
796,
300,
62,
9127,
1343,
352,
13,
198,
220,
220,
220,
220,
220,
44423,
300,
62,
9127,
5390,
300,
62,
3245,
62,
3672,
13,
198,
220,
220,
220,
220,
220,
7102,
35,
24290,
300,
62,
3245,
62,
3672,
13,
198,
220,
220,
220,
220,
220,
39962,
1404,
1677,
6158,
705,
43,
62,
32,
24318,
62,
44603,
23428,
6,
300,
62,
3245,
62,
3672,
39319,
300,
62,
3245,
62,
3672,
13,
198,
220,
220,
220,
220,
220,
24994,
16284,
357,
75,
62,
3245,
62,
3672,
8,
5390,
1279,
75,
62,
18439,
62,
3245,
2100,
62,
87,
28401,
198,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
19467,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
75,
62,
18439,
62,
3245,
2100,
62,
87,
29,
796,
1279,
75,
62,
18439,
62,
3245,
2100,
28401,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class /HEC1/CL_CONFIG_ACTION_INTERN definition
public
final
create private
global friends /HEC1/CL_CONFIG_DET_GENERAL .
public section.
interfaces /HEC1/IF_CONFIG_ACTION_INTERN .
PROTECTED SECTION.
private section.
aliases COPY_NODE
for /HEC1/IF_CONFIG_ACTION_INTERN~COPY_NODE .
aliases CREATE_APP_NODE
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_APP_NODE .
aliases CREATE_APP_SERVER
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_APP_SERVER .
aliases CREATE_APP_SERVER_PC
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_APP_SERVER_PC .
aliases CREATE_APP_STORAGE
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_APP_STORAGE .
aliases CREATE_APP_STORAGE_AMOUNT
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_APP_STORAGE_AMOUNT .
aliases CREATE_APP_STORAGE_BACKUP
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_APP_STORAGE_BACKUP .
aliases CREATE_DB_NODE
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_DB_NODE .
aliases CREATE_DB_SERVER
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_DB_SERVER .
aliases CREATE_DB_SERVER_PC
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_DB_SERVER_PC .
aliases CREATE_DB_STORAGE
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_DB_STORAGE .
aliases CREATE_DB_STORAGE_AMOUNT
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_DB_STORAGE_AMOUNT .
aliases CREATE_DB_STORAGE_BACKUP
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_DB_STORAGE_BACKUP .
aliases CREATE_DELIVERY_UNIT
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_DELIVERY_UNIT .
aliases CREATE_INSTANCE_DB
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_INSTANCE_DB .
aliases CREATE_MAN_SERV_BASELINE
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_MAN_SERV_BASELINE .
aliases CREATE_MATERIAL
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_MATERIAL .
aliases CREATE_PHASE
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_PHASE .
aliases CREATE_SERVER_INSTANCE
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_SERVER_INSTANCE .
aliases CREATE_SOFTWARE_ITEM
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_SOFTWARE_ITEM .
aliases CREATE_TIER
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_TIER .
aliases CREATE_TIER_SLA
for /HEC1/IF_CONFIG_ACTION_INTERN~CREATE_TIER_SLA .
aliases DELETE_NODE
for /HEC1/IF_CONFIG_ACTION_INTERN~DELETE_NODE .
aliases INHERIT_PHASE_ASSIGNMENT
for /HEC1/IF_CONFIG_ACTION_INTERN~INHERIT_PHASE_ASSIGNMENT .
aliases SET_SUCCESSOR_PREDECESSOR
for /HEC1/IF_CONFIG_ACTION_INTERN~SET_SUCCESSOR_PREDECESSOR .
aliases UPDATE_ADDITIONAL_SERVICE
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_ADDITIONAL_SERVICE .
aliases UPDATE_APP_NODE
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_APP_NODE .
aliases UPDATE_APP_SERVER
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_APP_SERVER .
aliases UPDATE_APP_SERVER_PERF_CAT
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_APP_SERVER_PERF_CAT .
aliases UPDATE_APP_STORAGE
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_APP_STORAGE .
aliases UPDATE_APP_STORAGE_AMOUNT
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_APP_STORAGE_AMOUNT .
aliases UPDATE_APP_STORAGE_BACKUP
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_APP_STORAGE_BACKUP .
aliases UPDATE_CONNECTIVITY
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_CONNECTIVITY .
aliases UPDATE_DATACENTER
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_DATACENTER .
aliases UPDATE_DB_NODE
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_DB_NODE .
aliases UPDATE_DB_SERVER
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_DB_SERVER .
aliases UPDATE_DB_SERVER_INSTANCE
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_DB_SERVER_INSTANCE .
aliases UPDATE_DB_SERVER_PERF_CAT
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_DB_SERVER_PERF_CAT .
aliases UPDATE_DB_STORAGE
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_DB_STORAGE .
aliases UPDATE_DB_STORAGE_AMOUNT
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_DB_STORAGE_AMOUNT .
aliases UPDATE_DB_STORAGE_BACKUP
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_DB_STORAGE_BACKUP .
aliases UPDATE_DELIVERY_UNIT
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_DELIVERY_UNIT .
aliases UPDATE_IF_BASELINE
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_IF_BASELINE .
aliases UPDATE_INSTANCE_DB
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_INSTANCE_DB .
aliases UPDATE_LANDSCAPE
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_LANDSCAPE .
aliases UPDATE_MAN_SERV_BASELINE
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_MAN_SERV_BASELINE .
aliases UPDATE_PHASE
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_PHASE .
aliases UPDATE_SOLUTION
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_SOLUTION .
aliases UPDATE_STORAGE_BACKUP_PRICE
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_STORAGE_BACKUP_PRICE .
aliases UPDATE_TIER
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_TIER .
aliases UPDATE_TIER_ADD_SERVICE
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_TIER_ADD_SERVICE .
aliases UPDATE_TIER_FROM_LANDSCAPE
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_TIER_FROM_LANDSCAPE .
aliases UPDATE_TIER_LT_BACKUP
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_TIER_LT_BACKUP .
aliases UPDATE_TIER_SOFTWARE
for /HEC1/IF_CONFIG_ACTION_INTERN~UPDATE_TIER_SOFTWARE .
class-data MO_INSTANCE type ref to /HEC1/CL_CONFIG_ACTION_INTERN .
data MR_ACT_PARAM type ref to DATA .
data MR_ACT_PARAM_MATERIAL_ADD type ref to DATA .
data MR_ACT_PARAM_SW_ITEM_ADD type ref to DATA .
data MR_ACT_PARAM_DELETE type ref to DATA .
class-methods GET_INSTANCE
returning
value(RO_INSTANCE) type ref to /HEC1/IF_CONFIG_ACTION_INTERN .
methods CONSTRUCTOR .
ENDCLASS.
CLASS /HEC1/CL_CONFIG_ACTION_INTERN IMPLEMENTATION.
METHOD /hec1/if_config_action_intern~delete_node.
" This method allows the deletion of multiple nodes.
" It should only be used inside the application
" If a node is deleted through a user-action (e.g. pressing a button) the action DELETE_NODE on the root-node should be used.
DATA: lt_modification TYPE /bobf/t_frw_modification,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_tier TYPE /hec1/t_data_tier_ct,
lt_db_serv_inst TYPE /hec1/t_data_db_server_inst_ct,
lt_instance_db TYPE /hec1/t_data_db_inst_ct,
lt_db_node TYPE /hec1/t_data_db_node_ct,
lt_db_serv_pc TYPE /hec1/t_data_db_serv_pc_ct,
lt_db_storage_qty TYPE /hec1/t_data_db_storage_qty_ct,
lt_db_server TYPE /hec1/t_data_db_serv_ct,
lt_db_storage TYPE /hec1/t_data_db_storage_ct,
lt_db_backup TYPE /hec1/t_data_db_backup_ct,
lt_app_serv_inst TYPE /hec1/t_data_app_serv_inst_ct,
lt_app_node TYPE /hec1/t_data_app_node_ct,
lt_app_serv_pc TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_storage_qty 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_app_backup TYPE /hec1/t_data_app_backup_ct.
FIELD-SYMBOLS: <fs_param> TYPE /bobf/t_frw_node.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_param>.
IF <fs_param> IS NOT ASSIGNED.
RETURN. ">>>>>>
ENDIF.
" Check for generated phases. Those phases need to be deleted with the objects
lt_modification = /hec1/cl_config_helper=>delete_generated_phases( iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
it_param_child_list = <fs_param> ).
"-----------------------------------
" Add input parameters to modification table
"-----------------------------------
LOOP AT <fs_param> ASSIGNING FIELD-SYMBOL(<fs_param_line>).
INSERT VALUE #( node = <fs_param_line>-node
change_mode = /bobf/if_frw_c=>sc_modify_delete
key = <fs_param_line>-key ) INTO TABLE lt_modification.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
" **************************************************************************************************************************************************
" 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
" Switch to FBI, this part can be deleted
LOOP AT lt_modification INTO DATA(ls_modification).
/hec1/cl_bopf_config_ui_tree_h=>get_instance( )->/hec1/if_bopf_config_ui_tree_h~delete( iv_node_key = ls_modification-key ).
ENDLOOP.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~inherit_phase_assignment.
" ***************************************************************************
" In this method we inherit the phase assignment. If a phase is cleared, the
" empty phase assignment is passed on. Phases are either inherited to the
" children, or the successors get the successor phase assigned.
"
" In addition, this method defines whether a phase can be assigned on the nodes.
" If a phase is assigned automatically, it usually cannot be changed by the user.
" ***************************************************************************
DATA: lt_tier TYPE /hec1/t_data_tier_ct,
lt_tier_sla TYPE /hec1/t_data_tier_sla_ct,
lt_tier_all TYPE /hec1/t_data_tier_ct,
lt_material TYPE /hec1/t_data_material_ct,
lt_software_item TYPE /hec1/t_data_sw_item_ct,
lt_app_si TYPE /hec1/t_data_app_serv_inst_ct,
lt_db_si TYPE /hec1/t_data_db_server_inst_ct,
lt_instance_db TYPE /hec1/t_data_db_inst_ct,
lt_db_node TYPE /hec1/t_data_db_node_ct,
lt_db_server TYPE /hec1/t_data_db_serv_ct,
lt_db_server_all TYPE /hec1/t_data_db_serv_ct,
lt_db_storage TYPE /hec1/t_data_db_storage_ct,
lt_db_backup TYPE /hec1/t_data_db_backup_ct,
lt_db_backup_all TYPE /hec1/t_data_db_backup_ct,
lt_db_serv_pc TYPE /hec1/t_data_db_serv_pc_ct,
lt_db_serv_pc_all TYPE /hec1/t_data_db_serv_pc_ct,
lt_db_storage_qty TYPE /hec1/t_data_db_storage_qty_ct,
lt_db_storage_qty_all TYPE /hec1/t_data_db_storage_qty_ct,
lt_app_node TYPE /hec1/t_data_app_node_ct,
lt_app_serv_pc TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_serv_pc_all TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_storage_qty TYPE /hec1/t_data_app_storageqty_ct,
lt_app_storage_qty_all TYPE /hec1/t_data_app_storageqty_ct,
lt_app_server TYPE /hec1/t_data_app_serv_ct,
lt_app_server_all TYPE /hec1/t_data_app_serv_ct,
lt_app_storage TYPE /hec1/t_data_app_storage_ct,
lt_app_storage_all TYPE /hec1/t_data_app_storage_ct,
lt_app_backup TYPE /hec1/t_data_app_backup_ct,
lt_app_backup_all TYPE /hec1/t_data_app_backup_ct,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_phase_successor TYPE /hec1/t_data_phase_ct,
lt_parameter TYPE /hec1/t_act_phase_inherit,
lt_modification TYPE /bobf/t_frw_modification.
CLEAR: eo_message,
et_failed_key.
"is parameter will contain new PHASE_GUID and old PHASE_GUID
ASSIGN ir_parameter->* TO FIELD-SYMBOL(<fs_parameter>).
lt_parameter = <fs_parameter>.
SORT lt_parameter ASCENDING BY hec_bopf_key.
DELETE ADJACENT DUPLICATES FROM lt_parameter.
" ***************************************************************************
" Get Data
" Get all the data outside any loops
" ***************************************************************************
io_read->get_root_key( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_target_key = DATA(lt_root_key) ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = lt_root_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase ).
CASE is_ctx-node_key.
"-----------------------------------
" Tier
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-tier.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
IMPORTING et_data = lt_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-tier-material
IMPORTING et_data = lt_material ).
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-tier-tier_sla
IMPORTING et_data = lt_tier_sla ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-tier
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-tier-app_server_instance
IMPORTING et_data = lt_app_si ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-tier
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-tier-db_server_instance
IMPORTING et_data = lt_db_si ).
IF line_exists( lt_tier[ hec_related_stack = abap_true ] ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-solution
it_key = VALUE #( FOR wa IN lt_tier
( key = wa-parent_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-solution-tier
IMPORTING et_data = lt_tier_all ).
ENDIF.
"-----------------------------------
" Material
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-material.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_material ).
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-material-software_item
IMPORTING et_data = lt_software_item ).
"-----------------------------------
" DB Server Instance
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-db_server_instance.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_db_si ).
" get db 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-db_server_instance-instance_db
IMPORTING et_data = lt_instance_db ).
"-----------------------------------
" Instance DB
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-instance_db.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_instance_db ).
" get db 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-instance_db-db_node
IMPORTING et_data = lt_db_node ).
"-----------------------------------
" DB Node
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-db_node.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_db_node ).
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_association = /hec1/if_configuration_c=>sc_association-db_node-db_server_perform_cat
iv_fill_data = abap_true
IMPORTING et_data = lt_db_serv_pc ).
"-----------------------------------
" DB Server Performance Category
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-db_server_perform_cat.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_db_serv_pc ).
" Get all other db server pc; the successor/predecessor link is created through the node-attribute and not the bopf key !!!
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
it_key = it_key
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-db_server_perform_cat-to_parent
IMPORTING et_target_key = DATA(lt_db_node_key) ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_node
it_key = lt_db_node_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_node-db_server_perform_cat
IMPORTING et_data = lt_db_serv_pc_all ) .
"get all db storage quantity
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_server_perform_cat-db_storage_amount
IMPORTING et_data = lt_db_storage_qty_all ).
"get all db server
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_server_perform_cat-db_server
IMPORTING et_data = lt_db_server_all ).
"-----------------------------------
" DB Storage Amount
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-db_storage_amount.
" get db storage amount
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_db_storage_qty ).
" get db server performance category (parent)
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_storage_amount
it_key = it_key
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-db_storage_amount-to_parent
IMPORTING et_target_key = DATA(lt_db_serv_pc_key) ).
" get db server
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
it_key = lt_db_serv_pc_key
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-db_server_perform_cat-db_server
IMPORTING et_target_key = DATA(lt_db_server_key) ).
" get db storage
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server
it_key = lt_db_server_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_server-db_storage
IMPORTING et_data = lt_db_storage ).
" Get all other db storage qtys; the successor/predecessor link is created through the node-attribute and not the bopf key !!!
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
it_key = lt_db_serv_pc_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_server_perform_cat-db_storage_amount
IMPORTING et_data = lt_db_storage_qty_all ) .
"-----------------------------------
" DB Storage
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-db_storage.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_db_storage ).
"change db storage 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-db_storage-db_storage_backup
IMPORTING et_data = lt_db_backup ).
"-----------------------------------
" DB Backup
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-db_storage_backup.
" get db backup
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_db_backup ).
" get db storage (parent)
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_storage_backup
it_key = it_key
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-db_storage_backup-to_parent
IMPORTING et_target_key = DATA(lt_db_storage_key) ).
" Get all other db backups; the successor/predecessor link is created through the node-attribute and not the bopf key !!!
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_storage
it_key = lt_db_storage_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_storage-db_storage_backup
IMPORTING et_data = lt_db_backup_all ).
"-----------------------------------
" App Server Instance
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-app_server_instance.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_si ).
" get app 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_server_instance-app_node
IMPORTING et_data = lt_app_node ).
"-----------------------------------
" App Node
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-app_node.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_node ).
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_node-app_server_perform_cat
iv_fill_data = abap_true
IMPORTING et_data = lt_app_serv_pc ).
"-----------------------------------
" App Server Performance Category
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-app_server_perform_cat.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_serv_pc ).
" Get all other db server pc; the successor/predecessor link is created through the node-attribute and not the bopf key !!!
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
it_key = it_key
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-to_parent
IMPORTING et_target_key = DATA(lt_app_node_key) ).
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-app_server_perform_cat
IMPORTING et_data = lt_app_serv_pc_all ) .
"get all db storage quantity
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
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_all ).
"get all db server
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
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_all ).
"-----------------------------------
" App Storage Amount
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-app_storage_amount.
" get app storage amount
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 = /hec1/if_configuration_c=>sc_node-app_storage_amount
it_key = it_key
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-app_storage_amount-to_parent
IMPORTING et_target_key = DATA(lt_app_serv_pc_key) ).
" get app server
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_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-app_server
IMPORTING et_target_key = DATA(lt_app_server_key) ).
" get app storage
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server
it_key = lt_app_server_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 all other app storage qtys; the successor/predecessor link is created through the node-attribute and not the bopf 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_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_all ) .
"-----------------------------------
" App Storage
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-app_storage.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_storage ).
"change app storage 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 ).
"-----------------------------------
" App Backup
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-app_storage_backup.
" get app backup
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_backup ).
" get app storage (parent)
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_storage_backup
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) ).
" Get all other db backups; the successor/predecessor link is created through the node-attribute and not the bopf key !!!
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_storage
it_key = lt_app_storage_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_all ).
ENDCASE. "is_ctx-node_key
" ***************************************************************************
" Update Phases
" ***************************************************************************
LOOP AT lt_parameter ASSIGNING FIELD-SYMBOL(<fs_phase_parameter>).
IF <fs_phase_parameter>-hec_phase_guid_new IS INITIAL
AND <fs_phase_parameter>-hec_phase_guid_old IS INITIAL.
RETURN. ">>>>
ENDIF.
"-----------------------------------
" get old and new phase
"-----------------------------------
TRY.
" phase guid needs to be converted to raw value to be able to read the bopf-node directly
" phase_guid and phase-key contain the same converted value
IF <fs_phase_parameter>-hec_phase_guid_old IS NOT INITIAL.
DATA(lr_phase_old) = NEW /hec1/s_data_phase_cs( lt_phase[ hec_node_phase = <fs_phase_parameter>-hec_phase_guid_old ] ).
ENDIF.
IF <fs_phase_parameter>-hec_phase_guid_new IS NOT INITIAL.
DATA(lr_phase_new) = NEW /hec1/s_data_phase_cs( lt_phase[ hec_node_phase = <fs_phase_parameter>-hec_phase_guid_new ] ).
ENDIF.
"-----------------------------------
" Update new phase
"-----------------------------------
IF lr_phase_new IS NOT INITIAL.
lr_phase_new->hec_phase_assigned = abap_true.
lr_phase_new->hec_phase_assigned_qty = lr_phase_new->hec_phase_assigned_qty + 1.
INSERT VALUE #( data = lr_phase_new
node = /hec1/if_configuration_c=>sc_node-phase
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_phase_new->key ) INTO TABLE lt_modification.
ENDIF.
"-----------------------------------
" Update old phase
"-----------------------------------
IF lr_phase_old IS NOT INITIAL.
lr_phase_old->hec_phase_assigned = COND #( WHEN lr_phase_old->hec_phase_assigned_qty = 1
THEN abap_false
ELSE abap_true ).
lr_phase_old->hec_phase_assigned_qty = lr_phase_old->hec_phase_assigned_qty - 1.
INSERT VALUE #( data = lr_phase_old
node = /hec1/if_configuration_c=>sc_node-phase
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_phase_old->key ) INTO TABLE lt_modification.
ENDIF.
CATCH cx_uuid_error.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
" ***************************************************************************
" Pass on Phase assignment
" ***************************************************************************
CASE is_ctx-node_key.
"-----------------------------------
" Tier
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-tier.
LOOP AT lt_tier ASSIGNING FIELD-SYMBOL(<fs_tier>) WHERE hec_related_stack = abap_true.
TRY.
DATA(lr_tier) = NEW /hec1/s_data_tier_cs( lt_tier_all[ hec_related_stack = <fs_tier>-hec_related_stack ] ).
lr_tier->hec_phase_guid = <fs_phase_parameter>-hec_phase_guid_new.
lr_tier->hec_phase_assign_allowed = abap_true.
INSERT VALUE #( data = lr_tier
node = /hec1/if_configuration_c=>sc_node-tier
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_tier->key ) INTO TABLE lt_modification.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDLOOP. "lt_tier
CLEAR lr_tier.
"-----------------------------------
"change Tier SLA
"-----------------------------------
LOOP AT lt_tier_sla REFERENCE INTO DATA(lr_tier_sla).
" set phase
lr_tier_sla->hec_phase_guid = <fs_phase_parameter>-hec_phase_guid_new.
lr_tier_sla->hec_phase_assign_allowed = abap_false.
INSERT VALUE #( data = lr_tier_sla
node = /hec1/if_configuration_c=>sc_node-tier_sla
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_tier_sla->key ) INTO TABLE lt_modification.
ENDLOOP. "lt_tier_sla
CLEAR lr_tier_sla.
"-----------------------------------
"change material
"-----------------------------------
LOOP AT lt_material REFERENCE INTO DATA(lr_material).
" set phase
lr_material->hec_phase_guid = <fs_phase_parameter>-hec_phase_guid_new.
lr_material->hec_phase_assign_allowed = COND #( WHEN <fs_phase_parameter>-hec_phase_guid_new IS INITIAL
OR lr_material->hec_material_rel_value = /hec1/if_config_constants=>gc_material_rel-mandatory
THEN abap_false
ELSE abap_true ).
INSERT VALUE #( data = lr_material
node = /hec1/if_configuration_c=>sc_node-material
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_material->key ) INTO TABLE lt_modification.
ENDLOOP. "lt_material
CLEAR lr_material.
"-----------------------------------
"change app server instance
"-----------------------------------
LOOP AT lt_app_si REFERENCE INTO DATA(lr_app_si).
lr_app_si->hec_phase_guid = <fs_phase_parameter>-hec_phase_guid_new.
"for the default app server the phasing is fixed and set by the system
lr_app_si->hec_phase_assign_allowed = COND #( WHEN <fs_phase_parameter>-hec_phase_guid_new IS NOT INITIAL
OR lr_app_si->hec_default_app_server_inst = abap_true
THEN abap_false
ELSE abap_true ).
INSERT VALUE #( data = lr_app_si
node = /hec1/if_configuration_c=>sc_node-app_server_instance
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_si->key ) INTO TABLE lt_modification.
ENDLOOP. "lt_app_si
CLEAR lr_app_si.
"-----------------------------------
"change db server instance
"-----------------------------------
LOOP AT lt_db_si REFERENCE INTO DATA(lr_db_si).
lr_db_si->hec_phase_guid = <fs_phase_parameter>-hec_phase_guid_new.
lr_db_si->hec_phase_assign_allowed = COND #( WHEN <fs_phase_parameter>-hec_phase_guid_new IS NOT INITIAL
OR lr_db_si->hec_default_db_server_inst = abap_true
THEN abap_false
ELSE abap_true ).
* lr_db_si->hec_phase_changed = abap_true.
INSERT VALUE #( data = lr_db_si
node = /hec1/if_configuration_c=>sc_node-db_server_instance
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_si->key ) INTO TABLE lt_modification.
ENDLOOP. "lt_db_si
CLEAR lr_db_si.
"-----------------------------------
" Material
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-material.
LOOP AT lt_software_item REFERENCE INTO DATA(lr_software_item).
" set phase
lr_software_item->hec_phase_guid = <fs_phase_parameter>-hec_phase_guid_new.
"description is retrieved in the object's determination
lr_software_item->hec_phase_assign_allowed = COND #( WHEN <fs_phase_parameter>-hec_phase_guid_new IS NOT INITIAL
OR lr_software_item->hec_sw_item_mat_rel_value = /hec1/if_config_constants=>gc_material_rel-mandatory "01
THEN abap_false
ELSE abap_true ).
INSERT VALUE #( data = lr_software_item
node = /hec1/if_configuration_c=>sc_node-software_item
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_software_item->key ) INTO TABLE lt_modification.
ENDLOOP. "lt_software_item
CLEAR lr_software_item.
"-----------------------------------
" DB Server Instance
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-db_server_instance.
LOOP AT lt_db_si ASSIGNING FIELD-SYMBOL(<fs_db_si>).
" !!!!!! Later we will have to differentiate between allocation types.
" !!!!!! If a container is used the container's phase is dependant on the Tenants' phases.
* WHERE hec_db_allocation_value = /hec1/if_config_constants=>gc_db_allocation-internal
* OR hec_db_allocation_value = /hec1/if_config_constants=>gc_db_allocation-separate_db
* OR hec_db_allocation_value = /hec1/if_config_constants=>gc_db_allocation-other_tier.
LOOP AT lt_instance_db REFERENCE INTO DATA(lr_instance_db).
lr_instance_db->hec_phase_guid = <fs_phase_parameter>-hec_phase_guid_new.
lr_instance_db->hec_phase_assign_allowed = abap_false. "this never changes
INSERT VALUE #( data = lr_instance_db
node = /hec1/if_configuration_c=>sc_node-instance_db
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_instance_db->key ) INTO TABLE lt_modification.
ENDLOOP. "lt_instance_db
CLEAR lr_instance_db.
ENDLOOP. "lt_db_si
"-----------------------------------
" Instance DB
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-instance_db.
LOOP AT lt_db_node REFERENCE INTO DATA(lr_db_node)
WHERE hec_db_clust_node_type_value = /hec1/if_config_constants=>gc_db_clust_node_type-master.
lr_db_node->hec_phase_guid = <fs_phase_parameter>-hec_phase_guid_new.
lr_db_node->hec_phase_assign_allowed = COND #( WHEN <fs_phase_parameter>-hec_phase_guid_new IS INITIAL
OR lr_db_node->hec_db_clust_node_type_value = /hec1/if_config_constants=>gc_db_clust_node_type-master
THEN abap_false
ELSE abap_true ).
INSERT VALUE #( data = lr_db_node
node = /hec1/if_configuration_c=>sc_node-db_node
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_node->key ) INTO TABLE lt_modification.
ENDLOOP. "lt_db_node
CLEAR lr_db_node.
"-----------------------------------
" DB Node
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-db_node.
LOOP AT lt_db_serv_pc REFERENCE INTO DATA(lr_db_serv_pc).
ASSIGN lt_db_node[ key = lr_db_serv_pc->parent_key ] TO FIELD-SYMBOL(<fs_db_node>).
IF <fs_db_node> IS ASSIGNED.
IF <fs_db_node>-hec_db_srv_perf_cat_qty = 1.
lr_db_serv_pc->hec_phase_guid = <fs_phase_parameter>-hec_phase_guid_new.
ENDIF.
lr_db_serv_pc->hec_phase_assign_allowed = COND #( WHEN <fs_phase_parameter>-hec_phase_guid_new IS INITIAL
OR lr_db_serv_pc->hec_db_clust_node_type_value = /hec1/if_config_constants=>gc_db_clust_node_type-master
OR lr_db_serv_pc->hec_predecessor_guid IS NOT INITIAL "this means that this node is the first node in the chain
THEN abap_false
ELSE abap_true ).
INSERT VALUE #( data = lr_db_serv_pc
node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_serv_pc->key ) INTO TABLE lt_modification.
ENDIF. "<fs_db_node> is assigned.
ENDLOOP. "lt_db_serv_pc
CLEAR lr_db_serv_pc.
"-----------------------------------
" DB Server Performance Category
" (Successor / Predecessor)
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-db_server_perform_cat.
"change db server performance category (if there are successor/predecessor nodes)
LOOP AT lt_db_serv_pc ASSIGNING FIELD-SYMBOL(<fs_db_serv_pc>).
IF <fs_db_serv_pc>-hec_has_successor = abap_true.
TRY.
DATA(lr_db_serv_pc_successor) = NEW /hec1/s_data_db_serv_pc_cs( lt_db_serv_pc_all[ key = <fs_db_serv_pc>-hec_successor_guid ] ).
" Get successor
IF lr_phase_new IS NOT INITIAL.
DATA(ls_phase_successor) = lt_phase[ key = lr_phase_new->hec_phase_successor_guid ].
lr_db_serv_pc_successor->hec_phase_guid = ls_phase_successor-hec_node_phase.
lr_db_serv_pc_successor->hec_phase_assign_allowed = abap_false. "only the first object in the chain may have a manual phase assignment. At this point we are definately at the 2nd or later object
INSERT VALUE #( data = lr_db_serv_pc_successor
node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_serv_pc_successor->key ) INTO TABLE lt_modification.
CLEAR lr_db_serv_pc_successor.
ELSE.
CLEAR: lr_db_serv_pc_successor->hec_phase_guid.
lr_db_serv_pc_successor->hec_phase_assign_allowed = abap_false.
ENDIF. " IF lr_phase_new IS NOT INITIAL.
CATCH cx_sy_itab_line_not_found.
CATCH cx_uuid_error.
ENDTRY.
ENDIF. "has successor
lt_db_storage_qty = VALUE #( FOR db_storage_qty IN lt_db_storage_qty_all
WHERE ( parent_key = <fs_db_serv_pc>-key )
( db_storage_qty ) ).
IF lines( lt_db_storage_qty ) = 1.
" the storage amount gets the same phase as the server performance category, only if there is just one entry. otherwise, successor predecessor need to be assigned
TRY.
DATA(lr_db_storage_qty) = NEW /hec1/s_data_db_storage_qty_cs( lt_db_storage_qty[ 1 ] ).
lr_db_storage_qty->hec_phase_guid = <fs_db_serv_pc>-hec_phase_guid.
lr_db_storage_qty->hec_phase_assign_allowed = abap_false.
INSERT VALUE #( data = lr_db_storage_qty
node = /hec1/if_configuration_c=>sc_node-db_storage_amount
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_storage_qty->key ) INTO TABLE lt_modification.
CLEAR lr_db_storage_qty.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ELSE.
" clear phasing for all storage quantities
LOOP AT lt_db_storage_qty ASSIGNING FIELD-SYMBOL(<fs_db_storage_qty>). "REFERENCE INTO lr_db_storage_qty.
lr_db_storage_qty = NEW #( <fs_db_storage_qty> ).
CLEAR: lr_db_storage_qty->hec_phase_guid.
lr_db_storage_qty->hec_phase_assign_allowed = COND #( WHEN lr_db_storage_qty->hec_predecessor_guid IS NOT INITIAL
OR <fs_phase_parameter>-hec_phase_guid_new IS INITIAL
OR lr_db_storage_qty->hec_db_clust_node_type_value = /hec1/if_config_constants=>gc_db_clust_node_type-master
THEN abap_false
ELSE abap_true ).
INSERT VALUE #( data = lr_db_storage_qty
node = /hec1/if_configuration_c=>sc_node-db_storage_amount
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_storage_qty->key ) INTO TABLE lt_modification.
CLEAR lr_db_storage_qty.
ENDLOOP. "lt_db_storage_qty
ENDIF. "lines( lt_db_storage_qty ) = 1.
" Set Phasing for Server
" there is only always 1 server
TRY.
DATA(lr_db_server) = NEW /hec1/s_data_db_serv_cs( lt_db_server_all[ parent_key = <fs_db_serv_pc>-key ] ).
lr_db_server->hec_phase_guid = <fs_db_serv_pc>-hec_phase_guid.
lr_db_server->hec_phase_assign_allowed = abap_false.
INSERT VALUE #( data = lr_db_server
node = /hec1/if_configuration_c=>sc_node-db_server
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_server->key ) INTO TABLE lt_modification.
CLEAR: lr_db_server.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDLOOP. "lt_db_serv_pc
"-----------------------------------
" DB Storage Amount
" (Successor / Predecessor)
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-db_storage_amount.
"change db storage qty (successor/predecessor)
LOOP AT lt_db_storage_qty ASSIGNING <fs_db_storage_qty>.
IF <fs_db_storage_qty>-hec_has_successor = abap_true.
TRY.
DATA(lr_db_storage_qty_successor) = NEW /hec1/s_data_db_storage_qty_cs( lt_db_storage_qty_all[ key = <fs_db_storage_qty>-hec_successor_guid ] ).
" Get successor
IF lr_phase_new IS NOT INITIAL.
ls_phase_successor = lt_phase[ key = lr_phase_new->hec_phase_successor_guid ].
lr_db_storage_qty_successor->hec_phase_guid = ls_phase_successor-hec_node_phase.
lr_db_storage_qty_successor->hec_phase_assign_allowed = abap_false. "the successor is never allowed to have a phasing assignment
INSERT VALUE #( data = lr_db_storage_qty_successor
node = /hec1/if_configuration_c=>sc_node-db_storage_amount "db_server_perform_cat
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_storage_qty_successor->key ) INTO TABLE lt_modification.
CLEAR lr_db_storage_qty_successor.
ELSE.
CLEAR: lr_db_storage_qty_successor->hec_phase_guid.
lr_db_storage_qty_successor->hec_phase_assign_allowed = abap_false.
ENDIF. "if lr_phase_new is not initial
CATCH cx_sy_itab_line_not_found.
CATCH cx_uuid_error.
ENDTRY.
ENDIF. "has successor
* " the storage gets the same phase as the storage quantity
TRY.
DATA(lr_db_storage) = NEW /hec1/s_data_db_storage_cs( lt_db_storage[ hec_storage_qty_ref_guid = <fs_db_storage_qty>-hec_node_db_storage_qty ] ).
lr_db_storage->hec_phase_guid = <fs_db_storage_qty>-hec_phase_guid.
lr_db_storage->hec_phase_assign_allowed = abap_false. "the storage cannot have a different phase assigned as the storage quantity
INSERT VALUE #( data = lr_db_storage
node = /hec1/if_configuration_c=>sc_node-db_storage
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_storage->key ) INTO TABLE lt_modification.
CLEAR lr_db_storage.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDLOOP. "lt_db_serv_pc
"-----------------------------------
" DB Storage
" (Successor / Predecessor)
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-db_storage.
LOOP AT lt_db_backup ASSIGNING FIELD-SYMBOL(<fs_db_backup>)
GROUP BY <fs_db_backup>-parent_key .
DATA(lt_db_backup_filter) = VALUE /hec1/t_data_db_backup_ct( FOR backup IN lt_db_backup
WHERE ( parent_key = <fs_db_backup>-parent_key )
( backup ) ).
IF lines( lt_db_backup_filter ) = 1.
TRY.
DATA(lr_db_backup) = NEW /hec1/s_data_db_backup_cs( lt_db_backup_filter[ 1 ] ).
lr_db_backup->hec_phase_guid = <fs_phase_parameter>-hec_phase_guid_new.
lr_db_backup->hec_phase_assign_allowed = abap_false. "the successors cannot have a manual phase assignment
INSERT VALUE #( data = lr_db_backup
node = /hec1/if_configuration_c=>sc_node-db_storage_backup
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_backup->key ) INTO TABLE lt_modification.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. "lines( lt_db_backup ) = 1.
ENDLOOP. "lt_db_backup
CLEAR lr_db_backup.
"if there are multiple lines, successor/predecessor needs to be used and set by the user
"-----------------------------------
" DB Backup
" (Successor / Predecessor)
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-db_storage_backup.
"change db backup (successor/predecessor)
LOOP AT lt_db_backup ASSIGNING <fs_db_backup>.
IF <fs_db_backup>-hec_has_successor = abap_true.
TRY.
DATA(lr_db_backup_successor) = NEW /hec1/s_data_db_backup_cs( lt_db_backup_all[ key = <fs_db_backup>-hec_successor_guid ] ).
" Get successor
IF lr_phase_new IS NOT INITIAL.
ls_phase_successor = lt_phase[ key = lr_phase_new->hec_phase_successor_guid ].
lr_db_backup_successor->hec_phase_guid = ls_phase_successor-hec_node_phase.
lr_db_backup_successor->hec_phase_assign_allowed = abap_false. "the successor cannot have a manual phase assignment
INSERT VALUE #( data = lr_db_backup_successor
node = /hec1/if_configuration_c=>sc_node-db_storage_backup
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_backup_successor->key ) INTO TABLE lt_modification.
CLEAR lr_db_backup_successor.
ELSE.
CLEAR: lr_db_backup_successor->hec_phase_guid.
lr_db_backup_successor->hec_phase_assign_allowed = abap_false.
ENDIF. " if lr_phase_new is not initial.
CATCH cx_sy_itab_line_not_found.
CATCH cx_uuid_error.
ENDTRY.
ENDIF. "has successor
ENDLOOP. "lt_app_backup
"-----------------------------------
" App Server Instance
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-app_server_instance.
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_phase_guid = <fs_phase_parameter>-hec_phase_guid_new.
lr_app_node->hec_phase_assign_allowed = abap_false.
INSERT VALUE #( data = lr_app_node
node = /hec1/if_configuration_c=>sc_node-app_node
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_node->key ) INTO TABLE lt_modification.
ENDLOOP. "lt_app_node
CLEAR lr_app_node.
"-----------------------------------
" App Node
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-app_node.
LOOP AT lt_app_serv_pc REFERENCE INTO DATA(lr_app_serv_pc).
ASSIGN lt_app_node[ key = lr_app_serv_pc->parent_key ] TO FIELD-SYMBOL(<fs_app_node>).
IF <fs_app_node> IS ASSIGNED.
IF <fs_app_node>-hec_app_srv_perf_cat_qty = 1.
lr_app_serv_pc->hec_phase_guid = <fs_phase_parameter>-hec_phase_guid_new.
ENDIF.
lr_app_serv_pc->hec_phase_assign_allowed = COND #( WHEN <fs_phase_parameter>-hec_phase_guid_new IS INITIAL
OR lr_app_serv_pc->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master
OR lr_app_serv_pc->hec_predecessor_guid IS NOT INITIAL "this means that this node is the first node in the chain
THEN abap_false
ELSE abap_true ).
INSERT VALUE #( data = lr_app_serv_pc
node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_serv_pc->key ) INTO TABLE lt_modification.
ENDIF. "<fs_app_node> is assigned.
ENDLOOP. "lt_app_serv_pc
CLEAR lr_app_serv_pc.
"-----------------------------------
" App Server Performance Category
" (Successor / Predecessor)
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-app_server_perform_cat.
"change db server performance category (if there are successor/predecessor nodes)
LOOP AT lt_app_serv_pc ASSIGNING FIELD-SYMBOL(<fs_app_serv_pc>).
IF <fs_app_serv_pc>-hec_has_successor = abap_true.
TRY.
DATA(lr_app_serv_pc_successor) = NEW /hec1/s_data_app_serv_pc_cs( lt_app_serv_pc_all[ key = <fs_app_serv_pc>-hec_successor_guid ] ).
" Get successor
IF lr_phase_new IS NOT INITIAL.
ls_phase_successor = lt_phase[ key = lr_phase_new->hec_phase_successor_guid ].
lr_app_serv_pc_successor->hec_phase_guid = ls_phase_successor-hec_node_phase.
lr_app_serv_pc_successor->hec_phase_assign_allowed = abap_false. "the successor does not allow manual phase assignment
INSERT VALUE #( data = lr_app_serv_pc_successor
node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_serv_pc_successor->key ) INTO TABLE lt_modification.
CLEAR lr_app_serv_pc_successor.
ELSE.
CLEAR: lr_app_serv_pc_successor->hec_phase_guid.
lr_app_serv_pc_successor->hec_phase_assign_allowed = abap_false.
ENDIF. "if lr_phase_new is not initial
CATCH cx_sy_itab_line_not_found.
CATCH cx_uuid_error.
ENDTRY.
ENDIF. "has successor
lt_app_storage_qty = VALUE #( FOR app_storage_qty IN lt_app_storage_qty_all
WHERE ( parent_key = <fs_app_serv_pc>-key )
( app_storage_qty ) ).
IF lines( lt_app_storage_qty ) = 1.
" the storage amount gets the same phase as the server performance category, only if there is just one entry. otherwise, successor predecessor need to be assigned
TRY.
DATA(lr_app_storage_qty) = NEW /hec1/s_data_app_storageqty_cs( lt_app_storage_qty[ 1 ] ).
lr_app_storage_qty->hec_phase_guid = <fs_app_serv_pc>-hec_phase_guid.
lr_app_storage_qty->hec_phase_assign_allowed = abap_false.
INSERT VALUE #( data = lr_app_storage_qty
node = /hec1/if_configuration_c=>sc_node-app_storage_amount
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_storage_qty->key ) INTO TABLE lt_modification.
CLEAR lr_app_storage_qty.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ELSE.
" clear phasing for all storage quantities
LOOP AT lt_app_storage_qty ASSIGNING FIELD-SYMBOL(<fs_app_storage_qty>).
lr_app_storage_qty = NEW #( <fs_app_storage_qty> ).
CLEAR: lr_app_storage_qty->hec_phase_guid.
lr_app_storage_qty->hec_phase_assign_allowed = COND #( WHEN lr_app_storage_qty->hec_predecessor_guid IS NOT INITIAL
OR <fs_phase_parameter>-hec_phase_guid_new IS INITIAL
OR lr_app_storage_qty->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_db_clust_node_type-master
THEN abap_false
ELSE abap_true ).
INSERT VALUE #( data = lr_app_storage_qty
node = /hec1/if_configuration_c=>sc_node-app_storage_amount
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_storage_qty->key ) INTO TABLE lt_modification.
CLEAR lr_app_storage_qty.
ENDLOOP. "lt_app_storage_qty
ENDIF. "lines( lt_app_storage_qty ) = 1.
" Set Phasing for Server
" there is only always 1 server
TRY.
DATA(lr_app_server) = NEW /hec1/s_data_app_serv_cs( lt_app_server_all[ parent_key = <fs_app_serv_pc>-key ] ).
lr_app_server->hec_phase_guid = <fs_app_serv_pc>-hec_phase_guid.
lr_app_server->hec_phase_assign_allowed = abap_false.
INSERT VALUE #( data = lr_app_server
node = /hec1/if_configuration_c=>sc_node-app_server
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_server->key ) INTO TABLE lt_modification.
CLEAR lr_app_server.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDLOOP. "lt_app_serv_pc
"-----------------------------------
" App Storage Amount
" (Successor / Predecessor)
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-app_storage_amount.
"change app storage qty (successor/predecessor)
LOOP AT lt_app_storage_qty ASSIGNING <fs_app_storage_qty>.
IF <fs_app_storage_qty>-hec_has_successor = abap_true.
TRY.
DATA(lr_app_storage_qty_successor) = NEW /hec1/s_data_app_storageqty_cs( lt_app_storage_qty_all[ key = <fs_app_storage_qty>-hec_successor_guid ] ).
" Get successor
IF lr_phase_new IS NOT INITIAL.
ls_phase_successor = lt_phase[ key = lr_phase_new->hec_phase_successor_guid ].
lr_app_storage_qty_successor->hec_phase_guid = ls_phase_successor-hec_node_phase.
lr_app_storage_qty_successor->hec_phase_assign_allowed = abap_false. "the successor does not allow manual phase assignment
INSERT VALUE #( data = lr_app_storage_qty_successor
node = /hec1/if_configuration_c=>sc_node-app_storage_amount "server_perform_cat
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_storage_qty_successor->key ) INTO TABLE lt_modification.
CLEAR lr_app_storage_qty_successor.
ELSE.
CLEAR: lr_app_storage_qty_successor->hec_phase_guid.
lr_app_storage_qty_successor->hec_phase_assign_allowed = abap_false.
ENDIF. "lr_phase is not initial
CATCH cx_sy_itab_line_not_found.
CATCH cx_uuid_error.
ENDTRY.
ENDIF. "has successor
* " the storage gets the same phase as the storage quantity
TRY.
DATA(lr_app_storage) = NEW /hec1/s_data_app_storage_cs( lt_app_storage[ hec_storage_qty_ref_guid = <fs_app_storage_qty>-hec_node_app_storage_qty ] ).
lr_app_storage->hec_phase_guid = <fs_app_storage_qty>-hec_phase_guid.
lr_app_storage->hec_phase_assign_allowed = abap_false. "the storage cannot have a different phase assigned as the storage quantity
INSERT VALUE #( data = lr_app_storage
node = /hec1/if_configuration_c=>sc_node-app_storage
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_storage->key ) INTO TABLE lt_modification.
CLEAR lr_app_storage.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDLOOP. "lt_app_serv_pc
"-----------------------------------
" App Storage
" (Successor / Predecessor)
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-app_storage.
LOOP AT lt_app_backup ASSIGNING FIELD-SYMBOL(<fs_app_backup>)
GROUP BY <fs_app_backup>-parent_key .
DATA(lt_app_backup_filter) = VALUE /hec1/t_data_app_backup_ct( FOR app_backup IN lt_app_backup
WHERE ( parent_key = <fs_app_backup>-parent_key )
( app_backup ) ).
IF lines( lt_app_backup_filter ) = 1.
TRY.
DATA(lr_app_backup) = NEW /hec1/s_data_app_backup_cs( lt_app_backup_filter[ 1 ] ).
lr_app_backup->hec_phase_guid = <fs_phase_parameter>-hec_phase_guid_new.
lr_app_backup->hec_phase_assign_allowed = abap_false. "the successors cannot have a manual phase assignment
INSERT VALUE #( data = lr_app_backup
node = /hec1/if_configuration_c=>sc_node-app_storage_backup
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_backup->key ) INTO TABLE lt_modification.
CLEAR lr_app_backup.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. "lines( lt_app_backup ) = 1.
ENDLOOP. "lt_app_backup
CLEAR lr_app_backup.
"if there are multiple lines, successor/predecessor needs to be used and set by the user
"-----------------------------------
" App Backup
" (Successor / Predecessor)
"-----------------------------------
WHEN /hec1/if_configuration_c=>sc_node-app_storage_backup.
"change app backup (successor/predecessor)
LOOP AT lt_app_backup ASSIGNING <fs_app_backup>.
IF <fs_app_backup>-hec_has_successor = abap_true.
TRY.
DATA(lr_app_backup_successor) = NEW /hec1/s_data_app_backup_cs( lt_app_backup_all[ key = <fs_app_backup>-hec_successor_guid ] ).
" Get successor
IF lr_phase_new IS NOT INITIAL.
ls_phase_successor = lt_phase[ key = lr_phase_new->hec_phase_successor_guid ].
lr_app_backup_successor->hec_phase_guid = ls_phase_successor-hec_node_phase.
lr_app_backup_successor->hec_phase_assign_allowed = abap_false. "the successor does not allow manual phase assignment
INSERT VALUE #( data = lr_app_backup_successor
node = /hec1/if_configuration_c=>sc_node-app_storage_backup
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_backup_successor->key ) INTO TABLE lt_modification.
CLEAR lr_app_backup_successor.
ELSE.
CLEAR: lr_app_backup_successor->hec_phase_guid.
lr_app_backup_successor->hec_phase_assign_allowed = abap_false.
ENDIF. " if lr_phase_new is not initial.
CATCH cx_sy_itab_line_not_found.
CATCH cx_uuid_error.
ENDTRY.
ENDIF. "has successor
ENDLOOP. "lt_app_backup
ENDCASE. "is_ctx-node_key
CLEAR: lr_phase_new,
lr_phase_old.
ENDLOOP.
"-----------------------------------
" Change Instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~set_successor_predecessor.
DATA: lr_data_table TYPE REF TO data,
lr_data TYPE REF TO data,
lv_predecessor TYPE /bobf/conf_key,
lt_succ_predec TYPE /hec1/t_config_succes_predec,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_data_table> TYPE INDEX TABLE,
<fs_act_param> TYPE /hec1/t_act_set_success_predec.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
IF <fs_act_param> IS ASSIGNED.
TRY.
DATA(lo_config) = /bobf/cl_frw_factory=>get_configuration( is_ctx-bo_key ).
" Get node with depending structure type
lo_config->get_assoc( EXPORTING iv_assoc_key = is_ctx-assoc_key " Association Key
iv_node_key = is_ctx-node_key " Node Key
IMPORTING es_assoc = DATA(ls_assoc) ). " Configuration: Link
lo_config->get_node( EXPORTING iv_node_key = ls_assoc-target_node_key
IMPORTING es_node = DATA(ls_node_conf) ).
" Create retrieve structure
CREATE DATA lr_data_table TYPE (ls_node_conf-data_table_type).
ASSIGN lr_data_table->* TO <fs_data_table>.
IF <fs_data_table> IS ASSIGNED.
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
iv_association = is_ctx-assoc_key
IMPORTING et_data = <fs_data_table>
et_target_key = DATA(lt_key)
et_key_link = DATA(lt_key_link)
et_failed_key = et_failed_key ).
LOOP AT <fs_data_table> ASSIGNING FIELD-SYMBOL(<fs_data>).
TRY.
ASSIGN COMPONENT 'KEY'
OF STRUCTURE <fs_data>
TO FIELD-SYMBOL(<fs_key>).
ASSIGN COMPONENT 'PARENT_KEY'
OF STRUCTURE <fs_data>
TO FIELD-SYMBOL(<fs_parent_key>).
ASSIGN COMPONENT 'CREA_DATE_TIME'
OF STRUCTURE <fs_data>
TO FIELD-SYMBOL(<fs_crea_date_time>).
IF <fs_key> IS ASSIGNED AND
<fs_parent_key> IS ASSIGNED AND
<fs_crea_date_time> IS ASSIGNED.
INSERT VALUE #( key = <fs_key>
parent_key = <fs_parent_key>
crea_date_time = <fs_crea_date_time> ) INTO TABLE lt_succ_predec.
ENDIF.
UNASSIGN: <fs_key>,
<fs_parent_key>,
<fs_crea_date_time>.
CATCH cx_root.
ENDTRY.
ENDLOOP.
SORT lt_succ_predec ASCENDING BY crea_date_time.
LOOP AT lt_succ_predec
INTO DATA(ls_succ_predec)
GROUP BY ls_succ_predec-parent_key
ASCENDING
ASSIGNING FIELD-SYMBOL(<group>).
DATA(lt_filter) = VALUE /hec1/t_config_succes_predec( FOR wa IN lt_succ_predec
WHERE ( parent_key = <group> )
( wa ) ).
LOOP AT GROUP <group>
ASSIGNING FIELD-SYMBOL(<fs_group>).
DATA(lv_tabix) = sy-tabix.
" Get successor
TRY.
DATA(ls_succ) = lt_filter[ lv_tabix + 1 ].
<fs_group>-hec_successor_guid = ls_succ-key.
<fs_group>-hec_has_successor = abap_true.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
" Get predecessor
TRY.
DATA(ls_predec) = lt_filter[ lv_tabix - 1 ].
<fs_group>-hec_predecessor_guid = ls_predec-key.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
CLEAR: ls_succ,
ls_predec.
ENDLOOP. " LOOP AT GROUP <group>
CLEAR: lv_tabix,
lt_filter.
ENDLOOP. " LOOP AT lt_succ_predec...
LOOP AT <fs_data_table> ASSIGNING <fs_data>.
TRY.
ASSIGN COMPONENT 'KEY'
OF STRUCTURE <fs_data>
TO <fs_key>.
ASSIGN COMPONENT 'PARENT_KEY'
OF STRUCTURE <fs_data>
TO <fs_parent_key>.
ASSIGN COMPONENT 'HEC_HAS_SUCCESSOR'
OF STRUCTURE <fs_data>
TO FIELD-SYMBOL(<fs_has_successor>).
ASSIGN COMPONENT 'HEC_SUCCESSOR_GUID'
OF STRUCTURE <fs_data>
TO FIELD-SYMBOL(<fs_successor_guid>).
ASSIGN COMPONENT 'HEC_PREDECESSOR_GUID'
OF STRUCTURE <fs_data>
TO FIELD-SYMBOL(<fs_predecessor_guid>).
IF <fs_key> IS ASSIGNED AND
<fs_has_successor> IS ASSIGNED AND
<fs_successor_guid> IS ASSIGNED AND
<fs_predecessor_guid> IS ASSIGNED.
TRY.
ls_succ_predec = lt_succ_predec[ key = <fs_key> ].
<fs_has_successor> = ls_succ_predec-hec_has_successor.
<fs_successor_guid> = ls_succ_predec-hec_successor_guid.
<fs_predecessor_guid> = ls_succ_predec-hec_predecessor_guid.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
DATA(lo_strucdescr) = CAST cl_abap_structdescr( cl_abap_structdescr=>describe_by_name( ls_node_conf-data_type ) ).
CREATE DATA lr_data TYPE HANDLE lo_strucdescr.
lr_data = REF #( <fs_data> ).
INSERT VALUE #( data = lr_data
node = ls_assoc-target_node_key
source_node = is_ctx-node_key
association = is_ctx-assoc_key
source_key = <fs_parent_key>
change_mode = /bobf/if_frw_c=>sc_modify_update
key = <fs_key> ) INTO TABLE lt_modification.
CLEAR: lo_strucdescr,
lr_data.
UNASSIGN: <fs_key>,
<fs_parent_key>,
<fs_has_successor>,
<fs_successor_guid>,
<fs_predecessor_guid>.
CATCH cx_root.
ENDTRY.
ENDLOOP.
ENDIF.
CATCH /bobf/cx_frw. " BOPF Exception Class
ENDTRY.
ENDIF. " IF <fs_act_param> IS ASSIGNED.
"-----------------------------------
" Update instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_additional_service.
DATA: lt_dlvy_unit TYPE /hec1/t_data_dlvy_unit_ct,
lt_add_service TYPE /hec1/t_data_add_services_ct,
lt_datacenter TYPE /hec1/t_data_datacenter_ct,
lt_modification TYPE /bobf/t_frw_modification.
CLEAR: eo_message,
et_failed_key.
"it_key contains the datacenter key.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_datacenter ).
/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_failed_key = et_failed_key ).
"-----------------------------------
" Get additional services
"-----------------------------------
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( ( key = lr_landscape->key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-add_service
IMPORTING et_data = lt_add_service ).
LOOP AT lt_datacenter ASSIGNING FIELD-SYMBOL(<fs_datacenter>).
LOOP AT lt_add_service REFERENCE INTO DATA(lr_add_service).
SELECT SINGLE *
FROM /hec1/i_addserviceclasslbbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_inf_provider_guid = @lr_dlvy_unit->hec_inf_provider_guid AND
hec_sec_datacenter_guid = @<fs_datacenter>-hec_datacenter_guid AND
hec_as_class_guid = @lr_add_service->hec_as_class_guid
INTO @DATA(ls_service_data).
" Get pricing
SELECT SINGLE * FROM /hec1/c_cbp_lb "#EC CI_ALL_FIELDS_NEEDED
INTO @DATA(ls_pricing)
WHERE hec_price_lb = @ls_service_data-hec_cb_pricing_lb_guid.
"-----------------------------------
" update additional service
"-----------------------------------
lr_add_service->* = VALUE #( BASE CORRESPONDING #( lr_add_service->* )
hec_as_datacenter_guid = <fs_datacenter>-hec_node_datacenter
hec_as_datacenter_descr = <fs_datacenter>-hec_datacenter_descr
hec_as_quota = ls_service_data-hec_as_quota
hec_as_tier_uplift_perc = ls_service_data-hec_as_upflift_percent
hec_price_lb = ls_service_data-hec_cb_pricing_lb_guid
hec_tree_descr = |{ lr_add_service->hec_as_class_descr } - { <fs_datacenter>-hec_datacenter_descr } : {
lr_add_service->hec_as_class_descr_ext }|
price = CORRESPONDING #( ls_pricing ) ).
INSERT VALUE #( data = lr_add_service
node = /hec1/if_configuration_c=>sc_node-add_service
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_add_service->key ) INTO TABLE lt_modification.
CLEAR: ls_service_data,
ls_pricing.
ENDLOOP. "lt_additional_service
ENDLOOP.
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_app_node.
DATA: lt_app_node TYPE /hec1/t_data_app_node_ct,
lt_ha_node TYPE /hec1/t_data_app_node_ct,
lt_app_serv_pc TYPE /hec1/t_data_app_serv_pc_ct,
lt_node_key TYPE /bobf/t_frw_key,
lt_ha_key TYPE /bobf/t_frw_key,
lt_act_param_succ TYPE /hec1/t_act_set_success_predec,
lt_act_param_del_node TYPE /bobf/t_frw_node,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_update_app_node.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
IF <fs_act_param> IS ASSIGNED.
DATA(lt_act_parameter) = <fs_act_param>.
LOOP AT lt_act_parameter ASSIGNING FIELD-SYMBOL(<fs_act_paramter>)
WHERE do_release_ha_node = abap_true OR
do_delete_ha_subnode = abap_true.
IF NOT line_exists( lt_ha_key[ key = <fs_act_paramter>-key ] ).
/hec1/cl_bopf_config_validat_h=>check_standby_node_is_released( EXPORTING iv_is_app_server = abap_true
iv_check_rule = /hec1/if_bopf_constants=>gc_check_rule-node
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( ( key = <fs_act_paramter>-key ) )
io_read = io_read
IMPORTING et_node_key = lt_node_key ).
APPEND LINES OF lt_node_key TO lt_ha_key.
CLEAR lt_node_key.
ENDIF.
ENDLOOP.
" Get standby node
IF lt_ha_key IS NOT INITIAL.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = lt_ha_key
IMPORTING et_data = lt_ha_node ).
" Get standby node: server performance category
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = lt_ha_key
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-app_node-app_server_perform_cat
IMPORTING et_key_link = DATA(lt_ha_spc_key_link) ).
ENDIF.
ENDIF. " IF <fs_act_param> IS ASSIGNED.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_node ).
" 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_node-app_server_perform_cat
IMPORTING et_data = lt_app_serv_pc ).
LOOP AT lt_app_node REFERENCE INTO DATA(lr_app_node).
"-----------------------------------
" Release standby node for selection
" or delete subnodes of standby node
"-----------------------------------
IF line_exists( lt_act_parameter[ key = lr_app_node->key
do_release_ha_node = abap_true ] ) OR
line_exists( lt_act_parameter[ key = lr_app_node->key
do_delete_ha_subnode = abap_true ] ).
" 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 = CORRESPONDING #( is_ctx )
it_key = VALUE #( ( key = lr_app_node->key ) )
io_read = io_read ).
LOOP AT lt_ha_node
REFERENCE INTO DATA(lr_ha_node)
WHERE parent_key = lr_app_node->parent_key.
IF lr_ha_node->hec_row_selectable <> lv_complete.
lr_ha_node->hec_row_selectable = lv_complete.
DATA(lv_data_changed) = abap_true.
ENDIF.
IF line_exists( lt_act_parameter[ key = lr_app_node->key
do_delete_ha_subnode = abap_true ] ).
CLEAR: lr_ha_node->hec_phase_guid,
lr_ha_node->hec_app_srv_perf_cat_qty.
lv_data_changed = abap_true.
ENDIF.
IF lv_data_changed = abap_true.
INSERT VALUE #( data = lr_ha_node
node = is_ctx-node_key
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_ha_node->key ) INTO TABLE lt_modification.
ENDIF.
CLEAR lv_data_changed.
ENDLOOP.
"-----------------------------------
" Fill action table for delete
" standby node subnodes
"-----------------------------------
IF line_exists( lt_act_parameter[ key = lr_app_node->key
do_delete_ha_subnode = abap_true ] ) AND
lt_ha_spc_key_link IS NOT INITIAL.
lt_act_param_del_node = VALUE #( FOR wa IN lt_ha_spc_key_link
( node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
key = wa-target_key ) ).
ENDIF. " IF line_exists( lt_act_parameter[ key = lr_app_node->key...
EXIT. ">>>>>>
ENDIF.
"-----------------------------------
" Update Serv PC Quantities
"-----------------------------------
DATA(lv_lines) = lines( VALUE /hec1/t_data_app_serv_pc_ct( FOR serv_pc IN lt_app_serv_pc
WHERE ( parent_key = lr_app_node->key )
( serv_pc ) ) ).
IF lr_app_node->hec_app_srv_perf_cat_qty > lv_lines.
lr_app_node->hec_app_srv_perf_cat_qty = lv_lines.
" Add line to adjust successor/predecessor
INSERT VALUE #( key = lr_app_node->key
parent_key = lr_app_node->parent_key
hec_no_children_node = lv_lines ) INTO TABLE lt_act_param_succ.
ENDIF.
INSERT VALUE #( data = lr_app_node
node = is_ctx-node_key
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_node->key ) INTO TABLE lt_modification.
ENDLOOP.
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message) ).
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_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 delete node action
" to GENERAL
"-----------------------------------
IF lt_act_param_del_node IS NOT INITIAL.
CLEAR me->mr_act_param_delete.
me->mr_act_param_delete = NEW /bobf/t_frw_node( lt_act_param_del_node ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_key IN lt_act_param_del_node
( key = wa_key-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-delete_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_delete ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_app_server_perf_cat.
DATA: lt_app_serv_pc TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_serv_pc_all TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_storage_qty TYPE /hec1/t_data_app_storageqty_ct,
lt_app_node TYPE /hec1/t_data_app_node_ct,
lt_act_param_succ TYPE /hec1/t_act_set_success_predec,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_param> TYPE /hec1/t_act_update_app_serv_pc.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_param>.
CHECK <fs_param> IS ASSIGNED.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_serv_pc ).
" DB 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_data = lt_app_node
et_target_key = DATA(lt_app_node_key) ).
" Get all DB Server Performance Categories
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-app_server_perform_cat
IMPORTING et_data = lt_app_serv_pc_all ).
" 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 ).
LOOP AT lt_app_serv_pc REFERENCE INTO DATA(lr_app_serv_pc).
"-----------------------------------
" UPDATE pricing for NODES
"-----------------------------------
IF line_exists( <fs_param>[ do_update_pricing = abap_true
key = lr_app_serv_pc->key ] ).
IF lr_app_serv_pc->hec_effort_required = abap_true.
DATA(ls_node_pricing) = /hec1/cl_config_helper=>do_price_validation( iv_node_key = is_ctx-node_key
it_key = VALUE #( ( key = lr_app_serv_pc->key ) )
io_read = io_read
iv_effort_bb_guid = lr_app_serv_pc->hec_timebased_effort_bb_guid
iv_tier_is_dr_node = lr_app_serv_pc->hec_tier_is_dr_node
iv_dr_operating_mode = lr_app_serv_pc->hec_dr_oper_mode_value ).
lr_app_serv_pc->price = CORRESPONDING #( ls_node_pricing ).
CLEAR ls_node_pricing.
ENDIF.
ENDIF. "do_update_pricing
"-----------------------------------
" Update Storage Quantities
"-----------------------------------
IF line_exists( <fs_param>[ do_update_storage_qty = abap_true
key = lr_app_serv_pc->key ] ).
DATA(lv_lines) = lines( VALUE /hec1/t_data_app_storageqty_ct( FOR storage_qty IN lt_app_storage_qty
WHERE ( parent_key = lr_app_serv_pc->key )
( storage_qty ) ) ).
IF lr_app_serv_pc->hec_storage_qty > lv_lines.
lr_app_serv_pc->hec_storage_qty = lv_lines.
" Add line to adjust successor/predecessor
INSERT VALUE #( key = lr_app_serv_pc->key
parent_key = lr_app_serv_pc->parent_key
hec_no_children_node = lv_lines
) INTO TABLE lt_act_param_succ.
ENDIF.
ENDIF. "do_update_storage_qty
"-----------------------------------
" Clear Phasing
"-----------------------------------
IF line_exists( <fs_param>[ do_clear_phasing = abap_true
key = lr_app_serv_pc->key ] ).
IF lines( lt_app_serv_pc_all ) = 1.
DATA(ls_app_node) = lt_app_node[ key = lr_app_serv_pc->parent_key ].
lr_app_serv_pc->hec_phase_guid = ls_app_node-hec_phase_guid.
lr_app_serv_pc->hec_phase_assign_allowed = abap_false.
lr_app_serv_pc->hec_phase_changed = abap_true.
lr_app_serv_pc->hec_phase_fixed = abap_true.
ELSE.
CLEAR: lr_app_serv_pc->hec_phase_guid,
lr_app_serv_pc->hec_phase_fixed.
lr_app_serv_pc->hec_phase_changed = abap_true.
ENDIF. " lines(lt_app_serv_pc) = 1
ENDIF. "do_clear_phasing
INSERT VALUE #( data = lr_app_serv_pc
node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_serv_pc->key
) INTO TABLE lt_modification.
ENDLOOP. "LOOP AT lt_app_serv_pc REFERENCE INTO DATA(lr_app_serv_pc).
"-----------------------------------
" 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.
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_app_storage.
DATA: lt_app_server TYPE /hec1/t_data_app_serv_ct,
lt_app_serv_pc TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_storage_qty TYPE /hec1/t_data_app_storageqty_ct,
lt_app_backup TYPE /hec1/t_data_app_backup_ct,
lt_app_storage TYPE /hec1/t_data_app_storage_ct,
lt_modification TYPE /bobf/t_frw_modification.
CLEAR: eo_message,
et_failed_key.
"-----------------------------------
" this action can be triggered
" from app server or app storage amount
" or from app storage
"-----------------------------------
CHECK is_ctx-node_key = /hec1/if_configuration_c=>sc_node-app_storage.
" 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 ).
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
IMPORTING et_data = lt_app_storage ).
" get backup (children)
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 ).
" get 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
et_target_key = DATA(lt_app_server_key) ).
" get storage qty (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_app_storage_amount
IMPORTING et_data = lt_app_storage_qty ).
"-----------------------------------
" Update app Storage
"-----------------------------------
LOOP AT lt_app_server ASSIGNING FIELD-SYMBOL(<fs_app_server>).
LOOP AT lt_app_storage REFERENCE INTO DATA(lr_app_storage) WHERE parent_key = <fs_app_server>-key.
TRY.
DATA(ls_app_storage_qty) = lt_app_storage_qty[ hec_node_app_storage_qty = lr_app_storage->hec_storage_qty_ref_guid ]. "#EC CI_SORTSEQ
lr_app_storage->hec_has_successor = ls_app_storage_qty-hec_has_successor.
lr_app_storage->hec_successor_guid = ls_app_storage_qty-hec_successor_guid.
lr_app_storage->hec_predecessor_guid = ls_app_storage_qty-hec_predecessor_guid.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
"-----------------------------------
" Update App Storage
"-----------------------------------
lr_app_storage->hec_storage_quantity = COND #( WHEN <fs_app_server>-hec_srv_main_storage_qty IS NOT INITIAL
THEN <fs_app_server>-hec_srv_main_storage_qty + ls_app_storage_qty-hec_asq_additional_stor_qty
ELSE ls_app_storage_qty-hec_asq_main_stor_qty_virtual + ls_app_storage_qty-hec_asq_additional_stor_qty ).
IF <fs_app_server>-hec_ip_server_guid IS NOT INITIAL AND
lr_app_storage->hec_ip_storage_guid IS INITIAL.
SELECT *
FROM /hec1/i_storagelbbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_sec_datacenter_guid = @<fs_app_server>-hec_sec_datacenter_guid AND
hec_infra_provider_guid = @lr_dlvy_unit->hec_inf_provider_guid
INTO TABLE @DATA(lt_storage).
IF lines( lt_storage ) = 1.
TRY.
lr_app_storage->hec_ip_storage_guid = lt_storage[ 1 ]-hec_ip_storage_guid.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
ENDIF. " IF <fs_app_server>-hec_ip_server_guid IS NOT INITIAL AND
"-----------------------------------
" Update Backup Qty
"-----------------------------------
lr_app_storage->hec_backup_qty = lines( VALUE /hec1/t_data_app_backup_ct( FOR backup IN lt_app_backup
WHERE ( parent_key = lr_app_storage->key )
( backup ) ) ).
INSERT VALUE #( data = lr_app_storage
node = /hec1/if_configuration_c=>sc_node-app_storage
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_storage->key ) INTO TABLE lt_modification.
CLEAR lt_storage.
ENDLOOP. "lt_app_storage
ENDLOOP. "lt_app_server
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_app_storage_amount.
DATA: lt_app_storage_qty TYPE /hec1/t_data_app_storageqty_ct,
lt_app_serv_pc TYPE /hec1/t_data_app_serv_pc_ct,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_param> TYPE /hec1/t_act_update_app_strgqty.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_param>.
CHECK <fs_param> IS ASSIGNED.
io_read->retrieve( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
it_key = VALUE #( FOR param IN <fs_param>
( key = param-parent_key ) )
IMPORTING et_data = lt_app_serv_pc ).
" App Storage Amount (child)
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
it_key = VALUE #( FOR param IN <fs_param>
( key = param-parent_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 ).
LOOP AT lt_app_storage_qty REFERENCE INTO DATA(lr_app_storage_qty).
"-----------------------------------
" Clear Phasing
"-----------------------------------
IF line_exists( <fs_param>[ do_clear_phasing = abap_true
key = lr_app_storage_qty->key ] ).
IF lines( lt_app_storage_qty ) = 1.
" Get Parent Phase
TRY.
DATA(ls_app_serv_pc) = lt_app_serv_pc[ key = lr_app_storage_qty->parent_key ].
lr_app_storage_qty->hec_phase_guid = ls_app_serv_pc-hec_phase_guid.
lr_app_storage_qty->hec_phase_assign_allowed = abap_false.
lr_app_storage_qty->hec_phase_changed = abap_true.
lr_app_storage_qty->hec_phase_fixed = abap_true.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ELSE.
CLEAR: lr_app_storage_qty->hec_phase_guid,
lr_app_storage_qty->hec_phase_fixed.
lr_app_storage_qty->hec_phase_changed = abap_true.
ENDIF. "lines(lt_db_storage_qty) = 1.
ENDIF. "do_clear_phasing
INSERT VALUE #( data = lr_app_storage_qty
node = /hec1/if_configuration_c=>sc_node-app_storage_amount
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_storage_qty->key
) INTO TABLE lt_modification.
ENDLOOP.
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_datacenter.
DATA: lv_datacenter_guid TYPE /hec1/datacenter_fdt_guid,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_update_datacenter.
CLEAR: eo_message,
et_failed_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 ).
"-----------------------------------
" Get data center, data center type
"-----------------------------------
SELECT *
FROM /hec1/i_datacentertypebasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid
INTO TABLE @DATA(lt_datacenter_type).
SELECT *
FROM /hec1/i_datacenterbasic
WHERE hec_infra_provider_guid = @lr_dlvy_unit->hec_inf_provider_guid
INTO TABLE @DATA(lt_data_center).
IF is_ctx-node_key = /hec1/if_configuration_c=>sc_node-root.
" ***************************************************************************
" Update is triggered from Landscape
" ***************************************************************************
IF lines( lt_datacenter ) = 1.
TRY.
DATA(lr_datacenter) = NEW /hec1/s_data_datacenter_cs( lt_datacenter[ 1 ] ).
DATA(ls_datacenter_type) = lt_datacenter_type[ hec_datacenter_type_value = /hec1/if_config_constants=>gc_datacenter_type_primary ].
lr_datacenter->hec_datacenter_type_value = ls_datacenter_type-hec_datacenter_type_value.
lr_datacenter->hec_datacenter_type_descr = ls_datacenter_type-hec_datacenter_type_descr.
IF lr_datacenter->hec_datacenter_guid IS INITIAL. "only inherit the delivery regions if no datacenter is set yet
lr_datacenter->hec_dlvy_region_l1_guid = lr_landscape->hec_dlvy_region_l1_guid.
lr_datacenter->hec_dlvy_region_l1_descr = lr_landscape->hec_dlvy_region_l1_descr.
lr_datacenter->hec_dlvy_region_l2_guid = lr_landscape->hec_dlvy_region_l2_guid.
lr_datacenter->hec_dlvy_region_l2_descr = lr_landscape->hec_dlvy_region_l2_descr.
lr_datacenter->hec_datacenter_country = lr_landscape->hec_country_key.
lr_datacenter->hec_datacenter_country_descr = lr_landscape->hec_country_descr.
ENDIF.
INSERT VALUE #( data = lr_datacenter
node = /hec1/if_configuration_c=>sc_node-datacenter
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_datacenter->key ) INTO TABLE lt_modification.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ELSE.
LOOP AT lt_datacenter REFERENCE INTO lr_datacenter
WHERE hec_datacenter_guid IS INITIAL. "only inherit the delivery regions if no datacenter is set yet
lr_datacenter->hec_dlvy_region_l1_guid = lr_landscape->hec_dlvy_region_l1_guid.
lr_datacenter->hec_dlvy_region_l1_descr = lr_landscape->hec_dlvy_region_l1_descr.
lr_datacenter->hec_dlvy_region_l2_guid = lr_landscape->hec_dlvy_region_l2_guid.
lr_datacenter->hec_dlvy_region_l2_descr = lr_landscape->hec_dlvy_region_l2_descr.
lr_datacenter->hec_datacenter_country = lr_landscape->hec_country_key.
lr_datacenter->hec_datacenter_country_descr = lr_landscape->hec_country_descr.
INSERT VALUE #( data = lr_datacenter
node = /hec1/if_configuration_c=>sc_node-datacenter
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_datacenter->key ) INTO TABLE lt_modification.
ENDLOOP.
ENDIF. " lines( lt_datacenter ) = 1.
ELSEIF is_ctx-node_key = /hec1/if_configuration_c=>sc_node-delivery_unit.
" ***************************************************************************
" Update is triggered from Delivery Unit
" ***************************************************************************
ASSIGN ir_parameter->* TO <fs_act_param>.
IF <fs_act_param> IS ASSIGNED.
DATA(ls_act_param) = VALUE #( <fs_act_param>[ 1 ] ).
LOOP AT lt_datacenter REFERENCE INTO lr_datacenter.
IF ls_act_param-do_update_search_fields = abap_true.
lr_datacenter->hec_delivery_unit_guid = lr_dlvy_unit->hec_delivery_unit_guid.
lr_datacenter->hec_delivery_unit_descr = lr_dlvy_unit->hec_delivery_unit_descr.
lr_datacenter->hec_infra_provider_guid = lr_dlvy_unit->hec_inf_provider_guid.
lr_datacenter->hec_inf_provider_descr = lr_dlvy_unit->hec_inf_provider_descr.
ELSEIF ls_act_param-do_reset = abap_true.
CLEAR: lr_datacenter->hec_delivery_unit_guid,
lr_datacenter->hec_delivery_unit_descr,
lr_datacenter->hec_infra_provider_guid,
lr_datacenter->hec_inf_provider_descr,
lr_datacenter->hec_datacenter_country,
lr_datacenter->hec_datacenter_country_descr,
lr_datacenter->hec_datacenter_guid,
lr_datacenter->hec_datacenter_descr.
ENDIF.
INSERT VALUE #( data = lr_datacenter
node = /hec1/if_configuration_c=>sc_node-datacenter
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_datacenter->key ) INTO TABLE lt_modification.
ENDLOOP.
ENDIF. "if <fs_act_param> is assigned.
ELSE.
" ***************************************************************************
" Update is triggered from App Server or DB Server
" ***************************************************************************
ASSIGN ir_parameter->* TO <fs_act_param>.
IF <fs_act_param> IS ASSIGNED.
LOOP AT <fs_act_param> ASSIGNING FIELD-SYMBOL(<fs_param>).
TRY.
DATA(ls_data_center) = lt_data_center[ hec_datacenter_guid = <fs_param>-hec_datacenter_fdt_guid ].
"-----------------------------------
" Update Datacenter
"-----------------------------------
LOOP AT lt_datacenter REFERENCE INTO lr_datacenter
WHERE key = <fs_param>-key.
lr_datacenter->hec_datacenter_guid = ls_data_center-hec_datacenter_guid.
lr_datacenter->hec_sec_datacenter_guid = ls_data_center-hec_sec_datacenter_guid.
lr_datacenter->hec_datacenter_descr = ls_data_center-hec_datacenter_descr.
lr_datacenter->hec_datacenter_country = ls_data_center-hec_datacenter_country.
lr_datacenter->hec_tree_descr = ls_data_center-hec_datacenter_descr. "#EC CI_FLDEXT_OK[2215424]
INSERT VALUE #( data = lr_datacenter
node = /hec1/if_configuration_c=>sc_node-datacenter
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_datacenter->key ) INTO TABLE lt_modification.
ENDLOOP.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
CLEAR: ls_data_center,
lr_datacenter.
ENDLOOP.
ENDIF. " IF <fs_act_param> IS ASSIGNED.
ENDIF. " IF is_ctx-node_key = /hec1/if_configuration_c=>sc_node-landscape.
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_db_node.
DATA: lt_db_node TYPE /hec1/t_data_db_node_ct,
lt_non_def_master_node TYPE /hec1/t_data_db_node_ct,
lt_db_serv_pc TYPE /hec1/t_data_db_serv_pc_ct,
lt_node_key TYPE /bobf/t_frw_key,
lt_non_def_master_key TYPE /bobf/t_frw_key,
lt_act_param_succ TYPE /hec1/t_act_set_success_predec,
lt_act_param_del_node TYPE /bobf/t_frw_node,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_update_db_node.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
IF <fs_act_param> IS ASSIGNED.
DATA(lt_act_parameter) = <fs_act_param>.
LOOP AT lt_act_parameter ASSIGNING FIELD-SYMBOL(<fs_act_paramter>)
WHERE do_release_node = abap_true OR
do_delete_subnode = abap_true.
IF NOT line_exists( lt_non_def_master_key[ key = <fs_act_paramter>-key ] ).
/hec1/cl_bopf_config_validat_h=>check_standby_node_is_released( EXPORTING iv_check_rule = /hec1/if_bopf_constants=>gc_check_rule-node
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( ( key = <fs_act_paramter>-key ) )
io_read = io_read
IMPORTING et_node_key = lt_node_key ).
APPEND LINES OF lt_node_key TO lt_non_def_master_key.
CLEAR lt_node_key.
ENDIF.
ENDLOOP.
" Get standby/worker node
IF lt_non_def_master_key IS NOT INITIAL.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = lt_non_def_master_key
IMPORTING et_data = lt_non_def_master_node ).
" Get standby/worker node: server performance category
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = lt_non_def_master_key
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-db_node-db_server_perform_cat
IMPORTING et_key_link = DATA(lt_spc_key_link) ).
ENDIF.
ENDIF. " IF <fs_act_param> IS ASSIGNED.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_db_node ).
" DB 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-db_node-db_server_perform_cat
IMPORTING et_data = lt_db_serv_pc ).
LOOP AT lt_db_node REFERENCE INTO DATA(lr_db_node).
"-----------------------------------
" Release standby/worker node for
" selection or delete subnodes of
" standby/worker node
"-----------------------------------
IF line_exists( lt_act_parameter[ key = lr_db_node->key
do_release_node = abap_true ] ) OR
line_exists( lt_act_parameter[ key = lr_db_node->key
do_delete_subnode = abap_true ] ).
" 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_check_rule = /hec1/if_bopf_constants=>gc_check_rule-node
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( ( key = lr_db_node->key ) )
io_read = io_read ).
LOOP AT lt_non_def_master_node
REFERENCE INTO DATA(lr_node)
WHERE parent_key = lr_db_node->parent_key.
IF lr_node->hec_row_selectable <> lv_complete.
lr_node->hec_row_selectable = lv_complete.
DATA(lv_data_changed) = abap_true.
ENDIF.
IF line_exists( lt_act_parameter[ key = lr_db_node->key
do_delete_subnode = abap_true ] ).
CLEAR: lr_node->hec_phase_guid,
lr_node->hec_db_srv_perf_cat_qty.
lv_data_changed = abap_true.
ENDIF.
IF lv_data_changed = abap_true.
INSERT VALUE #( data = lr_node
node = is_ctx-node_key
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_node->key ) INTO TABLE lt_modification.
ENDIF.
CLEAR lv_data_changed.
ENDLOOP.
"-----------------------------------
" Fill action table for delete
" standby/worker node subnodes
"-----------------------------------
IF line_exists( lt_act_parameter[ key = lr_db_node->key
do_delete_subnode = abap_true ] ) AND
lt_spc_key_link IS NOT INITIAL.
lt_act_param_del_node = VALUE #( FOR wa IN lt_spc_key_link
( node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
key = wa-target_key ) ).
ENDIF. " IF line_exists( lt_act_parameter[ key = lr_db_node->key...
EXIT. ">>>>>>
ENDIF.
"-----------------------------------
" UPDATE pricing for NODES
"-----------------------------------
IF lr_db_node->hec_effort_required = abap_true.
DATA(ls_node_pricing) = /hec1/cl_config_helper=>do_price_validation( iv_node_key = is_ctx-node_key
it_key = VALUE #( ( key = lr_db_node->key ) )
io_read = io_read
iv_effort_bb_guid = lr_db_node->hec_timebased_effort_bb_guid
iv_tier_is_dr_node = lr_db_node->hec_tier_is_dr_node
iv_dr_operating_mode = lr_db_node->hec_dr_oper_mode_value ).
lr_db_node->price = CORRESPONDING #( ls_node_pricing ).
lv_data_changed = abap_true.
ENDIF.
"-----------------------------------
" Update Serv PC Quantities
"-----------------------------------
DATA(lv_lines) = lines( VALUE /hec1/t_data_db_serv_pc_ct( FOR serv_pc IN lt_db_serv_pc
WHERE ( parent_key = lr_db_node->key )
( serv_pc ) ) ).
IF lr_db_node->hec_db_srv_perf_cat_qty > lv_lines.
lr_db_node->hec_db_srv_perf_cat_qty = lv_lines.
" Add line to adjust successor/predecessor
INSERT VALUE #( key = lr_db_node->key
parent_key = lr_db_node->parent_key
hec_no_children_node = lv_lines ) INTO TABLE lt_act_param_succ.
ENDIF.
IF lv_data_changed = abap_true.
INSERT VALUE #( data = lr_db_node
node = /hec1/if_configuration_c=>sc_node-db_node
source_node = /hec1/if_configuration_c=>sc_node-instance_db
association = /hec1/if_configuration_c=>sc_association-instance_db-db_node
source_key = lr_db_node->parent_key
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_node->key ) INTO TABLE lt_modification.
ENDIF.
CLEAR ls_node_pricing.
ENDLOOP.
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message) ).
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-db_node
assoc_key = /hec1/if_configuration_c=>sc_association-db_node-db_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 delete node action
" to GENERAL
"-----------------------------------
IF lt_act_param_del_node IS NOT INITIAL.
CLEAR me->mr_act_param_delete.
me->mr_act_param_delete = NEW /bobf/t_frw_node( lt_act_param_del_node ).
/hec1/cl_config_det_general=>/hec1/if_config_det_general~set_act_node_keys(
is_ctx = CORRESPONDING #( is_ctx )
it_key = VALUE #( FOR wa_key IN lt_act_param_del_node
( key = wa_key-key ) )
iv_action = /hec1/cl_config_det_general=>/hec1/if_config_det_general~get_act_key( /hec1/if_config_constant=>gc_act_method-delete_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_delete ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_db_server.
DATA: lt_db_serv_perf_cat TYPE /hec1/t_data_db_serv_pc_ct,
lt_db_server TYPE /hec1/t_data_db_serv_ct,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_update_db_server.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_db_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-db_server_perform_cat-db_server
IMPORTING et_data = lt_db_server ).
IF lt_db_server IS INITIAL.
RETURN. ">>>>>>
ENDIF.
IF <fs_act_param> IS ASSIGNED.
"-----------------------------------
" Fill DB server update structure
"-----------------------------------
LOOP AT lt_db_serv_perf_cat ASSIGNING FIELD-SYMBOL(<fs_serv_perf_cat>).
TRY.
DATA(ls_act_param) = <fs_act_param>[ parent_key = <fs_serv_perf_cat>-key ].
IF ls_act_param-do_update_db_server = abap_true.
DATA(lr_db_server) = NEW /hec1/s_data_db_serv_cs( lt_db_server[ key = ls_act_param-key ] ).
" Update IP Server GUID
lr_db_server->hec_ip_server_guid = ls_act_param-hec_ip_server_guid.
DATA(lv_data_changed) = abap_true.
ENDIF..
"-----------------------------------
" Fill DB server update structure
"-----------------------------------
IF lv_data_changed = abap_true.
INSERT VALUE #( data = lr_db_server
node = /hec1/if_configuration_c=>sc_node-db_server
source_node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
association = /hec1/if_configuration_c=>sc_association-db_server_perform_cat-db_server
source_key = lr_db_server->parent_key
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_server->key ) INTO TABLE lt_modification.
ENDIF.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
CLEAR: lv_data_changed,
ls_act_param,
lr_db_server.
ENDLOOP.
ENDIF. " IF <fs_act_param> IS ASSIGNED.
"-----------------------------------
" Update instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_db_server_perf_cat.
DATA: lt_db_serv_pc TYPE /hec1/t_data_db_serv_pc_ct,
lt_db_serv_pc_all TYPE /hec1/t_data_db_serv_pc_ct,
lt_db_storage_qty TYPE /hec1/t_data_db_storage_qty_ct,
lt_db_node TYPE /hec1/t_data_db_node_ct,
lt_act_param_succ TYPE /hec1/t_act_set_success_predec,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_param> TYPE /hec1/t_act_update_db_serv_pc.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_param>.
CHECK <fs_param> IS ASSIGNED.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_db_serv_pc ).
" DB 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-db_server_perform_cat-to_parent
IMPORTING et_data = lt_db_node
et_target_key = DATA(lt_db_node_key) ).
" Get all DB Server Performance Categories
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_node
it_key = lt_db_node_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_node-db_server_perform_cat
IMPORTING et_data = lt_db_serv_pc_all ).
" DB 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-db_server_perform_cat-db_storage_amount
IMPORTING et_data = lt_db_storage_qty ).
LOOP AT lt_db_serv_pc REFERENCE INTO DATA(lr_db_serv_pc).
"-----------------------------------
" Update Storage Quantities
"-----------------------------------
IF line_exists( <fs_param>[ do_update_storage_qty = abap_true
key = lr_db_serv_pc->key ] ).
DATA(lv_lines) = lines( VALUE /hec1/t_data_db_storage_qty_ct( FOR storage_qty IN lt_db_storage_qty
WHERE ( parent_key = lr_db_serv_pc->key )
( storage_qty ) ) ).
IF lr_db_serv_pc->hec_storage_qty > lv_lines.
lr_db_serv_pc->hec_storage_qty = lv_lines.
" Add line to adjust successor/predecessor
INSERT VALUE #( key = lr_db_serv_pc->key
parent_key = lr_db_serv_pc->parent_key
hec_no_children_node = lv_lines
) INTO TABLE lt_act_param_succ.
ENDIF.
ENDIF. "do_update_storage_qty
"-----------------------------------
" Clear Phasing
"-----------------------------------
IF line_exists( <fs_param>[ do_clear_phasing = abap_true ] ).
IF lines( lt_db_serv_pc_all ) = 1.
" Get Parent Phase
DATA(ls_db_node) = lt_db_node[ key = lr_db_serv_pc->parent_key ].
lr_db_serv_pc->hec_phase_guid = ls_db_node-hec_phase_guid.
lr_db_serv_pc->hec_phase_assign_allowed = abap_false.
lr_db_serv_pc->hec_phase_changed = abap_true.
lr_db_serv_pc->hec_phase_fixed = abap_true.
ELSE.
CLEAR: lr_db_serv_pc->hec_phase_guid,
lr_db_serv_pc->hec_phase_fixed.
lr_db_serv_pc->hec_phase_changed = abap_true.
ENDIF. "lines(lt_db_serv_pc_all) = 1
ENDIF. "do_clear_phasing
INSERT VALUE #( data = lr_db_serv_pc
node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_serv_pc->key
) INTO TABLE lt_modification.
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-db_server_perform_cat
assoc_key = /hec1/if_configuration_c=>sc_association-db_server_perform_cat-db_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.
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_db_storage.
DATA: lt_db_server TYPE /hec1/t_data_db_serv_ct,
lt_db_serv_pc TYPE /hec1/t_data_db_serv_pc_ct,
lt_db_storage_qty TYPE /hec1/t_data_db_storage_qty_ct,
lt_db_storage TYPE /hec1/t_data_db_storage_ct,
lt_db_backup TYPE /hec1/t_data_db_backup_ct,
lt_modification TYPE /bobf/t_frw_modification.
CLEAR: eo_message,
et_failed_key.
"-----------------------------------
" this action can be triggered
" from db server or db storage amount
" or from db storage
"-----------------------------------
CHECK is_ctx-node_key = /hec1/if_configuration_c=>sc_node-db_storage.
" 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 ).
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
IMPORTING et_data = lt_db_storage ).
" get backup (children)
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-db_storage-db_storage_backup
IMPORTING et_data = lt_db_backup ).
" get 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-db_storage-to_parent
IMPORTING et_data = lt_db_server
et_target_key = DATA(lt_db_server_key) ).
" get storage qty (parent) - 2 steps
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server
it_key = lt_db_server_key
iv_association = /hec1/if_configuration_c=>sc_association-db_server-to_parent
IMPORTING et_target_key = DATA(lt_db_serv_pc_key)
et_key_link = DATA(lt_server_to_spc_link) ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
it_key = lt_db_serv_pc_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_server_perform_cat-db_storage_amount
IMPORTING et_key_link = DATA(lt_spc_to_storage_qty_link)
et_data = lt_db_storage_qty ).
"-----------------------------------
" Update DB Storage
"-----------------------------------
LOOP AT lt_db_server ASSIGNING FIELD-SYMBOL(<fs_db_server>).
LOOP AT lt_db_storage REFERENCE INTO DATA(lr_db_storage) WHERE parent_key = <fs_db_server>-key.
TRY.
DATA(ls_db_storage_qty) = lt_db_storage_qty[ hec_node_db_storage_qty = lr_db_storage->hec_storage_qty_ref_guid ]. "#EC CI_SORTSEQ
lr_db_storage->hec_has_successor = ls_db_storage_qty-hec_has_successor.
lr_db_storage->hec_successor_guid = ls_db_storage_qty-hec_successor_guid.
lr_db_storage->hec_predecessor_guid = ls_db_storage_qty-hec_predecessor_guid.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
"-----------------------------------
" Update DB storage
"-----------------------------------
lr_db_storage->hec_storage_quantity = COND #( WHEN <fs_db_server>-hec_srv_main_stor_qty IS NOT INITIAL
THEN <fs_db_server>-hec_srv_main_stor_qty + ls_db_storage_qty-hec_dsq_additional_stor_qty
ELSE COND #( WHEN <fs_db_server>-hec_host_type_value = /hec1/if_config_constants=>gc_server_host_type-physical
THEN ls_db_storage_qty-hec_dsq_main_stor_qty_physical + ls_db_storage_qty-hec_dsq_additional_stor_qty
ELSE ls_db_storage_qty-hec_dsq_main_stor_qty_virtual + ls_db_storage_qty-hec_dsq_additional_stor_qty ) ).
IF <fs_db_server>-hec_ip_server_guid IS NOT INITIAL AND
lr_db_storage->hec_ip_storage_guid IS INITIAL.
SELECT *
FROM /hec1/i_storagelbbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_sec_datacenter_guid = @<fs_db_server>-hec_sec_datacenter_guid AND
hec_infra_provider_guid = @lr_dlvy_unit->hec_inf_provider_guid
INTO TABLE @DATA(lt_storage).
IF lines( lt_storage ) = 1.
TRY.
lr_db_storage->hec_ip_storage_guid = lt_storage[ 1 ]-hec_ip_storage_guid.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
ENDIF. " IF <fs_db_server>-hec_ip_server_guid IS NOT INITIAL AND
"-----------------------------------
" Update Backup Qty
"-----------------------------------
lr_db_storage->hec_backup_qty = lines( VALUE /hec1/t_data_db_backup_ct( FOR backup IN lt_db_backup
WHERE ( parent_key = lr_db_storage->key )
( backup ) ) ).
INSERT VALUE #( data = lr_db_storage
node = /hec1/if_configuration_c=>sc_node-db_storage
source_node = /hec1/if_configuration_c=>sc_node-db_server
association = /hec1/if_configuration_c=>sc_association-db_server-db_storage
source_key = lr_db_storage->parent_key
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_storage->key ) INTO TABLE lt_modification.
ENDLOOP. " LOOP AT lt_db_storage REFERENCE INTO DATA(lr_db_storage)...
ENDLOOP. " LOOP AT lt_db_server ASSIGNING FIELD-SYMBOL(<fs_db_server>).
"-----------------------------------
" Update instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_db_storage_amount.
DATA: lt_db_serv_pc TYPE /hec1/t_data_db_serv_pc_ct,
lt_db_storage_qty TYPE /hec1/t_data_db_storage_qty_ct,
lt_modification TYPE /bobf/t_frw_modification,
lv_ram_class TYPE int4.
FIELD-SYMBOLS: <fs_param> TYPE /hec1/t_act_update_db_strg_qty.
CONSTANTS: lc_factor TYPE p DECIMALS 1 VALUE '1.2'.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_param>.
CHECK <fs_param> IS ASSIGNED.
/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 ).
io_read->retrieve( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
it_key = VALUE #( FOR param IN <fs_param>
( key = param-parent_key ) )
IMPORTING et_data = lt_db_serv_pc ).
" DB Storage Amount (child)
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
it_key = VALUE #( FOR param IN <fs_param>
( key = param-parent_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_server_perform_cat-db_storage_amount
IMPORTING et_data = lt_db_storage_qty ).
"-----------------------------------
" Get DB server performance category
"-----------------------------------
DATA(lt_range_table) = VALUE /hec1/t_selection_range( FOR wa IN lt_db_serv_pc
( 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_dbservperfcatbasic
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).
" Here we loop across the server performance category, which is the parent
" The update can be executed from the server performance category and then needs to run for all child nodes
LOOP AT lt_db_serv_pc ASSIGNING FIELD-SYMBOL(<fs_db_serv_pc>).
LOOP AT lt_db_storage_qty
REFERENCE INTO DATA(lr_db_storage_qty)
WHERE parent_key = <fs_db_serv_pc>-key.
"-----------------------------------
" Update Storage
"-----------------------------------
IF line_exists( <fs_param>[ do_update_storage = abap_true
parent_key = <fs_db_serv_pc>-key ] ).
TRY.
DATA(ls_serv_perf_cat) = lt_serv_perf_cat[ hec_srv_perf_cat_guid = <fs_db_serv_pc>-hec_srv_perf_cat_guid ].
CATCH cx_sy_itab_line_not_found.
ENDTRY.
lv_ram_class = ls_serv_perf_cat-hec_srv_ram_class.
lr_db_storage_qty->hec_dsq_main_stor_qty_physical = COND #( WHEN <fs_db_serv_pc>-hec_db_srv_type_value = /hec1/if_config_constants=>gc_db_server_type-hana
THEN 10
ELSE space ).
lr_db_storage_qty->hec_dsq_main_stor_qty_virtual = COND #( WHEN <fs_db_serv_pc>-hec_db_srv_type_value = /hec1/if_config_constants=>gc_db_server_type-hana
THEN |{ lc_factor * lv_ram_class }|
ELSE space ).
INSERT VALUE #( data = lr_db_storage_qty
node = /hec1/if_configuration_c=>sc_node-db_storage_amount
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_storage_qty->key ) INTO TABLE lt_modification.
CLEAR: lv_ram_class,
ls_serv_perf_cat.
ENDIF. " do_update_storage
"-----------------------------------
" Clear Phasing
"-----------------------------------
IF line_exists( <fs_param>[ do_clear_phasing = abap_true
key = lr_db_storage_qty->key ] ).
IF lines( lt_db_storage_qty ) = 1.
" Get Parent Phase
TRY.
DATA(ls_db_serv_pc) = lt_db_serv_pc[ key = lr_db_storage_qty->parent_key ].
lr_db_storage_qty->hec_phase_guid = ls_db_serv_pc-hec_phase_guid.
lr_db_storage_qty->hec_phase_assign_allowed = abap_false.
lr_db_storage_qty->hec_phase_changed = abap_true.
lr_db_storage_qty->hec_phase_fixed = abap_true.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ELSE.
CLEAR: lr_db_storage_qty->hec_phase_guid,
lr_db_storage_qty->hec_phase_fixed.
lr_db_storage_qty->hec_phase_changed = abap_true.
ENDIF. "lines(lt_db_storage_qty) = 1
ENDIF. "do_clear_phasing
INSERT VALUE #( data = lr_db_storage_qty
node = /hec1/if_configuration_c=>sc_node-db_storage_amount
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_storage_qty->key ) INTO TABLE lt_modification.
ENDLOOP. "lt_db_storage_qty
ENDLOOP. "lt_db_serv_pc
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_delivery_unit.
DATA: lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_update_dlvy_unit.
CLEAR: eo_message,
et_failed_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 ).
"-----------------------------------
" Get delivery unit and
" infrastructure provider
"-----------------------------------
SELECT * "#EC CI_NOWHERE
FROM /hec1/i_deliveryunitbasic
INTO TABLE @DATA(lt_dlvy_unit).
SELECT * "#EC CI_NOWHERE
FROM /hec1/i_infraproviderbasic
INTO TABLE @DATA(lt_inf_provider).
ASSIGN ir_parameter->* TO <fs_act_param>.
IF <fs_act_param> IS ASSIGNED.
"-----------------------------------
" Fill delivery unit structure
"-----------------------------------
LOOP AT <fs_act_param> ASSIGNING FIELD-SYMBOL(<fs_param>).
TRY.
DATA(ls_inf_provider) = lt_inf_provider[ hec_infra_provider_guid = <fs_param>-hec_inf_provider_guid ].
DATA(ls_dlvy_unit) = lt_dlvy_unit[ hec_delivery_unit_guid = ls_inf_provider-hec_delivery_unit_guid ].
IF lr_dlvy_unit->hec_inf_provider_guid <> ls_inf_provider-hec_infra_provider_guid OR
lr_dlvy_unit->hec_inf_provider_category <> ls_inf_provider-hec_inf_provider_cat_value OR
lr_dlvy_unit->hec_delivery_unit_guid <> ls_dlvy_unit-hec_delivery_unit_guid OR
lr_dlvy_unit->hec_delivery_unit_category <> ls_dlvy_unit-hec_delivery_unit_cat_value.
lr_dlvy_unit->hec_inf_provider_guid = ls_inf_provider-hec_infra_provider_guid.
lr_dlvy_unit->hec_inf_provider_descr = ls_inf_provider-hec_inf_provider_descr.
lr_dlvy_unit->hec_inf_provider_category = ls_inf_provider-hec_inf_provider_cat_value.
lr_dlvy_unit->hec_delivery_unit_guid = ls_dlvy_unit-hec_delivery_unit_guid.
lr_dlvy_unit->hec_delivery_unit_descr = ls_dlvy_unit-hec_delivery_unit_descr.
lr_dlvy_unit->hec_delivery_unit_category = ls_dlvy_unit-hec_delivery_unit_cat_value.
INSERT VALUE #( data = lr_dlvy_unit
node = /hec1/if_configuration_c=>sc_node-delivery_unit
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_dlvy_unit->key ) INTO TABLE lt_modification.
ENDIF.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
CLEAR: ls_inf_provider,
ls_dlvy_unit.
ENDLOOP.
ENDIF. " IF <fs_act_param> IS ASSIGNED.
"-----------------------------------
" Update instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_if_baseline.
DATA: lt_if_baseline TYPE /hec1/t_data_if_baseline_ct,
lt_modification TYPE /bobf/t_frw_modification.
CLEAR: eo_message,
et_failed_key.
CHECK is_ctx-node_key = /hec1/if_configuration_c=>sc_node-infrastructure_baseline.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
IMPORTING et_data = lt_if_baseline ).
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
LOOP AT lt_if_baseline REFERENCE INTO DATA(lr_if_baseline).
TRY.
DATA(ls_datacenter) = lt_datacenter[ key = lr_if_baseline->parent_key ].
CATCH cx_sy_itab_line_not_found.
ENDTRY.
"-----------------------------------
" Get Price
"-----------------------------------
TRY.
DATA(lv_datacenter_guid) = lt_datacenter[ key = lr_if_baseline->parent_key ]-hec_datacenter_guid.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
SELECT SINGLE hec_cb_pricing_lb_guid
FROM /hec1/i_infrabaselinelbbasic
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 = @lv_datacenter_guid
INTO @DATA(lv_lb_guid).
SELECT SINGLE * FROM /hec1/c_cbp_lb "#EC CI_ALL_FIELDS_NEEDED
INTO @DATA(ls_pricing)
WHERE hec_price_lb = @lv_lb_guid.
lr_if_baseline->price = CORRESPONDING #( ls_pricing ).
lr_if_baseline->hec_phase_guid = ls_datacenter-hec_phase_guid.
INSERT VALUE #( data = lr_if_baseline
node = /hec1/if_configuration_c=>sc_node-infrastructure_baseline
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_if_baseline->key ) INTO TABLE lt_modification.
CLEAR: lv_lb_guid,
ls_pricing.
ENDLOOP.
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_man_serv_baseline.
DATA: lt_modification TYPE /bobf/t_frw_modification.
CLEAR: eo_message,
et_failed_key.
"-----------------------------------
" Get APM model GUID and description
" delivery unit and managed service
" baseline
"-----------------------------------
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_man_serv_baseline = DATA(lt_man_serv_baseline)
et_failed_key = et_failed_key ).
IF lr_dlvy_unit->hec_delivery_unit_guid IS NOT INITIAL AND
lr_dlvy_unit->hec_delivery_unit_category IS NOT INITIAL AND
lr_dlvy_unit->hec_inf_provider_guid IS NOT INITIAL AND
lr_dlvy_unit->hec_inf_provider_category IS NOT INITIAL.
" Get effort building block GUID
SELECT SINGLE hec_timebased_effort_bb_guid
FROM /hec1/i_managservbasetbbbbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_delivery_unit_cat_value = @lr_dlvy_unit->hec_delivery_unit_category AND
hec_inf_provider_cat_value = @lr_dlvy_unit->hec_inf_provider_category AND
hec_mat_oper_mode_value = @lr_landscape->hec_material_opmode_value
INTO @DATA(lv_effort_bb_guid).
LOOP AT lt_man_serv_baseline REFERENCE INTO DATA(lr_man_serv_baseline).
IF lv_effort_bb_guid IS NOT INITIAL.
lr_man_serv_baseline->price = /hec1/cl_config_helper=>do_price_validation( iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
iv_effort_bb_guid = lv_effort_bb_guid
iv_tier_is_dr_node = abap_false
iv_dr_operating_mode = '' ).
INSERT VALUE #( data = lr_man_serv_baseline
node = /hec1/if_configuration_c=>sc_node-managed_service_baseline
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_man_serv_baseline->key ) INTO TABLE lt_modification.
ENDIF. " IF lv_effort_bb_guid IS NOT INITIAL.
ENDLOOP.
ENDIF. " IF lr_dlvy_unit->hec_delivery_unit IS NOT INITIAL AND...
"-----------------------------------
" Update instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_phase.
DATA: lt_phase TYPE /hec1/t_data_phase_ct,
lt_phase_all TYPE /hec1/t_data_phase_ct,
lt_root TYPE /hec1/t_config_root_ct,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_param> TYPE /hec1/t_act_update_phase.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_param>.
CHECK <fs_param> IS ASSIGNED.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_phase ).
io_read->get_root_key( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_target_key = DATA(lt_root_key) ).
io_read->retrieve( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = lt_root_key
IMPORTING et_data = lt_root ).
TRY.
DATA(ls_root) = lt_root[ 1 ]. "There is only ever one root
CATCH cx_sy_itab_line_not_found.
ENDTRY.
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = VALUE #( FOR wa IN lt_phase
( key = wa-parent_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-phase
IMPORTING et_data = lt_phase_all ).
LOOP AT lt_phase REFERENCE INTO DATA(lr_phase).
"-----------------------------------
" Clear Successor Phasing
" This is done when the successor
" is deleted. Then the "successor"-
" field needs to be cleared on the
" predecessor.
"-----------------------------------
IF line_exists( <fs_param>[ do_clear_phasing = abap_true
key = lr_phase->key ] ).
TRY.
DATA(ls_phase_all) = lt_phase_all[ hec_node_phase = lr_phase->hec_phase_successor_guid ].
CATCH cx_sy_itab_line_not_found.
CLEAR: lr_phase->hec_phase_successor_guid,
lr_phase->hec_phase_successor_descr.
ENDTRY.
INSERT VALUE #( data = lr_phase
node = /hec1/if_configuration_c=>sc_node-phase
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_phase->key ) INTO TABLE lt_modification.
ENDIF. "do_clear_phasing
"-----------------------------------
" Update Predecessor
" This is done when a successor
" is created.
"-----------------------------------
IF line_exists( <fs_param>[ do_update_predecessor = abap_true
key = lr_phase->key ] ).
TRY.
DATA(lr_phase_pred) = NEW /hec1/s_data_phase_cs( lt_phase_all[ key = lr_phase->hec_phase_predecessor_guid ] ).
lr_phase_pred->hec_phase_successor_guid = lr_phase->key.
lr_phase_pred->hec_update_from_general = abap_true.
INSERT VALUE #( data = lr_phase_pred
node = /hec1/if_configuration_c=>sc_node-phase
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_phase_pred->key ) INTO TABLE lt_modification.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. "do_update_predecessor
"-----------------------------------
" Update Phasing Duration Unit
"-----------------------------------
IF line_exists( <fs_param>[ do_update_duration_unit = abap_true
key = lr_phase->key ] ).
INSERT VALUE #( data = NEW #( BASE lr_phase->*
hec_update_from_general = abap_true
hec_duration_unit = ls_root-hec_ls_contract_dur_unit_value )
node = /hec1/if_configuration_c=>sc_node-phase
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_phase->key ) INTO TABLE lt_modification.
ENDIF.
"-----------------------------------
" Update Default Start and End date
"-----------------------------------
IF line_exists( <fs_param>[ do_update_def_start_end = abap_true
key = lr_phase->key ] ).
"if phase dates are not filled yet
IF lr_phase->hec_phase_start_date IS INITIAL AND lr_phase->hec_phase_end_date IS INITIAL.
INSERT VALUE #( data = NEW #( BASE lr_phase->*
hec_update_from_general = abap_true
hec_phase_start_date = ls_root-hec_contract_start_date
hec_phase_end_date = ls_root-hec_contract_end_date )
node = /hec1/if_configuration_c=>sc_node-phase
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_phase->key ) INTO TABLE lt_modification.
ENDIF.
ENDIF.
ENDLOOP.
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_solution.
DATA: lt_solution TYPE /hec1/t_data_solution_ct,
lt_tier TYPE /hec1/t_data_tier_ct,
lt_modification TYPE /bobf/t_frw_modification.
CLEAR: eo_message,
et_failed_key.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_solution ).
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-solution-tier
IMPORTING et_data = lt_tier ).
LOOP AT lt_solution REFERENCE INTO DATA(lr_solution).
" Update Number of Tiers
lr_solution->hec_tier_qty_nprod_level = 0.
lr_solution->hec_tier_qty_prod_level = 0.
LOOP AT lt_tier ASSIGNING FIELD-SYMBOL(<fs_tier>)
WHERE parent_key = lr_solution->key.
IF <fs_tier>-hec_tier_cat_value = /hec1/if_config_constants=>gc_tier_category-nonprod.
ADD 1 TO lr_solution->hec_tier_qty_nprod_level .
ELSE.
ADD 1 TO lr_solution->hec_tier_qty_prod_level .
ENDIF.
ENDLOOP.
INSERT VALUE #( data = lr_solution
node = /hec1/if_configuration_c=>sc_node-solution
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_solution->key ) INTO TABLE lt_modification.
ENDLOOP.
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_storage_backup_price.
DATA: lt_landscape TYPE /hec1/t_config_root_ct,
lt_dlvy_unit TYPE /hec1/t_data_dlvy_unit_ct,
lt_datacenter TYPE /hec1/t_data_datacenter_ct,
lt_solution TYPE /hec1/t_data_solution_ct,
lt_tier TYPE /hec1/t_data_tier_ct,
lt_db_si TYPE /hec1/t_data_db_server_inst_ct,
lt_db_inst TYPE /hec1/t_data_db_inst_ct,
lt_db_node TYPE /hec1/t_data_db_node_ct,
lt_db_serv_pc TYPE /hec1/t_data_db_serv_pc_ct,
lt_app_si TYPE /hec1/t_data_app_serv_inst_ct,
lt_app_node TYPE /hec1/t_data_app_node_ct,
lt_app_serv_pc TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_backup TYPE /hec1/t_data_app_backup_ct,
lt_app_server TYPE /hec1/t_data_app_serv_ct,
lt_app_storage TYPE /hec1/t_data_app_storage_ct,
lt_db_backup TYPE /hec1/t_data_db_backup_ct,
lt_db_server TYPE /hec1/t_data_db_serv_ct,
lt_db_storage TYPE /hec1/t_data_db_storage_ct,
lt_modification TYPE /bobf/t_frw_modification,
ls_pricing TYPE /hec1/s_costbased_pricing_lb.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_create_db_backup.
CLEAR: eo_message,
et_failed_key.
IF eo_message IS NOT BOUND.
eo_message = /bobf/cl_frw_factory=>get_message( ).
ENDIF.
io_read->get_root_key( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_target_key = DATA(lt_root_key) ).
"landscape
io_read->retrieve( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = lt_root_key
IMPORTING et_data = lt_landscape ).
"delivery unit
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = lt_root_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-delivery_unit
IMPORTING et_target_key = DATA(lt_dlvy_unit_key)
et_data = lt_dlvy_unit ).
"datacenter
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-delivery_unit
it_key = lt_dlvy_unit_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-delivery_unit-datacenter
IMPORTING et_target_key = DATA(lt_datacenter_key)
et_data = lt_datacenter ).
"solution
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = lt_root_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-solution
IMPORTING et_target_key = DATA(lt_solution_key)
et_data = lt_solution ).
"tier
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-solution
it_key = lt_solution_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-solution-tier
IMPORTING et_target_key = DATA(lt_tier_key)
et_data = lt_tier ).
"db server instance
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-db_server_instance
IMPORTING et_target_key = DATA(lt_db_si_key)
et_data = lt_db_si ).
"db inst
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server_instance
it_key = lt_db_si_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_server_instance-instance_db
IMPORTING et_target_key = DATA(lt_db_inst_key)
et_data = lt_db_inst ).
"db node
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-instance_db
it_key = lt_db_inst_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-instance_db-db_node
IMPORTING et_target_key = DATA(lt_db_node_key)
et_data = lt_db_node ).
"db serv pc
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_node
it_key = lt_db_node_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_node-db_server_perform_cat
IMPORTING et_target_key = DATA(lt_db_serv_pc_key)
et_data = lt_db_serv_pc ).
"db server
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
it_key = lt_db_serv_pc_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_server_perform_cat-db_server
IMPORTING et_target_key = DATA(lt_db_server_key)
et_data = lt_db_server ).
"db storage
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server
it_key = lt_db_server_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_server-db_storage
IMPORTING et_target_key = DATA(lt_db_storage_key)
et_data = lt_db_storage ).
"db backup
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_storage
it_key = lt_db_storage_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_storage-db_storage_backup
IMPORTING et_target_key = DATA(lt_db_backup_key)
et_data = lt_db_backup ).
"app server instance
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_target_key = DATA(lt_app_si_key)
et_data = lt_app_si ).
"app node
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server_instance
it_key = lt_app_si_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_instance-app_node
IMPORTING et_target_key = DATA(lt_app_node_key)
et_data = lt_app_node ).
"app serv pc
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-app_server_perform_cat
IMPORTING et_target_key = DATA(lt_app_serv_pc_key)
et_data = lt_app_serv_pc ).
"app server
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_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-app_server
IMPORTING et_target_key = DATA(lt_app_server_key)
et_data = lt_app_server ).
"app storage
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server
it_key = lt_app_server_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_server-app_storage
IMPORTING et_target_key = DATA(lt_app_storage_key)
et_data = lt_app_storage ).
"app backup
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_storage
it_key = lt_app_storage_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-app_storage-app_storage_backup
IMPORTING et_target_key = DATA(lt_app_backup_key)
et_data = lt_app_backup ).
" Update all app storage backup over all solutions
LOOP AT lt_app_backup REFERENCE INTO DATA(lr_app_backup)
WHERE hec_backup_class_guid IS NOT INITIAL AND
price IS INITIAL. "#EC CI_SORTSEQ
"-----------------------------------
" Get Storage Backup Price
"-----------------------------------
"""""""""""""""""" TODO: MOve to different method
TRY.
DATA(ls_tier) = lt_tier[ hec_node_tier = lr_app_backup->hec_node_tier ]. " Here I use the alternate key because it's faster
DATA(ls_landscape) = lt_landscape[ root_key = lr_app_backup->root_key ]. "should we process multiple configurations at this point, the root key is the only way to keep different landscapes apart
DATA(ls_dlvy_unit) = lt_dlvy_unit[ root_key = lr_app_backup->root_key ].
DATA(ls_app_server) = lt_app_server[ hec_node_app_server = lr_app_backup->hec_node_app_server ]. " Here I use the alternate key because it's faster
CATCH cx_sy_itab_line_not_found.
ENDTRY.
* " Try first to get data center from server
* DATA(lv_datacenter) = ls_app_server-hec_sec_datacenter_guid. " Here I use the alternate key because it's faster
*
* " If there is no data center, try to get data center from tier
* IF lv_datacenter IS INITIAL.
* TRY.
* lv_datacenter = lt_datacenter[ hec_node_datacenter = ls_tier-hec_tier_datacenter_guid ]-hec_datacenter_guid.
* CATCH cx_sy_itab_line_not_found.
* ENDTRY.
* ENDIF.
" Get storage backup 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
io_read = io_read
IMPORTING es_backup_class = DATA(ls_backup_class)
es_backup_pricing = DATA(ls_backup_pricing) ).
lr_app_backup->price = ls_backup_pricing.
* " Get DT backup class data
* DATA(lt_fdt_backup_class) = /hec1/cl_config_fdt_provider=>get_instance( )->/hec1/if_config_fdt_provider~get_storage_backup_class( iv_apm_guid = ls_landscape-hec_apm_guid
* iv_db_serv_type_guid = space
* iv_server_inst_type = |02|
* iv_tier_category = ls_tier-hec_tier_cat_value ).
*
* " Get default backup class data
* TRY.
* DATA(ls_backup_class) = lt_fdt_backup_class[ hec_backup_class_default = abap_true ].
* CATCH cx_sy_itab_line_not_found.
* ENDTRY.
*
* " Get backup pricing
* IF ls_backup_class-hec_backup_class_guid IS NOT INITIAL.
*
*
*
* DATA(lv_lb_guid) = /hec1/cl_config_fdt_provider=>get_instance( )->/hec1/if_config_fdt_provider~get_storage_backup_pricing_lb( iv_apm_guid = ls_landscape-hec_apm_guid
* iv_backup_class_guid = ls_backup_class-hec_backup_class_guid
* iv_datacenter_guid = lv_datacenter
* iv_inf_provider_guid = ls_dlvy_unit-hec_inf_provider_guid ).
*
* IF lv_lb_guid IS NOT INITIAL.
* SELECT SINGLE * FROM /hec1/c_cbp_lb "#EC CI_ALL_FIELDS_NEEDED
* WHERE hec_price_lb = @lv_lb_guid
* INTO CORRESPONDING FIELDS OF @lr_app_backup->price.
*
* ENDIF.
* ENDIF. " IF ls_fdt_backup_class-hec_backup_class_guid IS NOT INITIAL.
* """" End of "Move to different method"
" Add Backup to Update table
INSERT VALUE #( data = lr_app_backup
node = /hec1/if_configuration_c=>sc_node-app_storage_backup
source_node = /hec1/if_configuration_c=>sc_node-app_storage_backup
source_key = lr_app_backup->key
change_mode = /bobf/if_frw_c=>sc_modify
key = lr_app_backup->key
) INTO TABLE lt_modification.
ENDLOOP.
" Update all DB storage backup over all solutions
LOOP AT lt_db_backup REFERENCE INTO DATA(lr_db_backup)
WHERE hec_backup_class_guid IS NOT INITIAL AND
price IS INITIAL. "#EC CI_SORTSEQ
"-----------------------------------
" Get Storage Backup Price
"-----------------------------------
"""""""""""""""""" TODO: MOve to different method
TRY.
ls_tier = lt_tier[ hec_node_tier = lr_db_backup->hec_node_tier ]. " Here I use the alternate key because it's faster
ls_landscape = lt_landscape[ root_key = lr_db_backup->root_key ]. "should we process multiple configurations at this point, the root key is the only way to keep different landscapes apart
ls_dlvy_unit = lt_dlvy_unit[ root_key = lr_db_backup->root_key ].
DATA(ls_solution) = lt_solution[ hec_node_solution = lr_db_backup->hec_node_solution ].
DATA(ls_db_server) = lt_db_server[ hec_node_db_server = lr_db_backup->hec_node_db_server ]. " Here I use the alternate key because it's faster
CATCH cx_sy_itab_line_not_found.
ENDTRY.
* " Get storage backup 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_db_backup->key ) )
* iv_tier_category_guid = lr_db_backup->hec_tier_cat_value
* iv_tier_datacenter_guid = lr_db_backup->hec_tier_datacenter_guid
* io_read = io_read
* IMPORTING es_backup_class = ls_backup_class
* es_backup_pricing = ls_backup_pricing ).
lr_db_backup->price = ls_backup_pricing.
* " Get DT backup class data
* lt_fdt_backup_class = /hec1/cl_config_fdt_provider=>get_instance( )->/hec1/if_config_fdt_provider~get_storage_backup_class( iv_apm_guid = ls_landscape-hec_apm_guid
* iv_db_serv_type_guid = ''"ls_solution-hec_db_srv_type_guid
* iv_server_inst_type = |01|
* iv_tier_category = ls_tier-hec_tier_cat_value ).
*
* " Get default backup class data
* TRY.
* ls_backup_class = lt_fdt_backup_class[ hec_backup_class_default = abap_true ].
* CATCH cx_sy_itab_line_not_found.
* ENDTRY.
*
* " Get backup pricing
* IF ls_backup_class-hec_backup_class_guid IS NOT INITIAL.
*
* " Try first to get data center from server
* lv_datacenter = ls_db_server-hec_datacenter_guid. " Here I use the alternate key because it's faster
*
* " If there is no data center, try to get data center from tier
* IF lv_datacenter IS INITIAL.
* TRY.
* lv_datacenter = lt_datacenter[ hec_node_datacenter = ls_tier-hec_tier_datacenter_guid ]-hec_datacenter_guid.
* CATCH cx_sy_itab_line_not_found.
* ENDTRY.
* ENDIF.
*
* lv_lb_guid = /hec1/cl_config_fdt_provider=>get_instance( )->/hec1/if_config_fdt_provider~get_storage_backup_pricing_lb( iv_apm_guid = ls_landscape-hec_apm_guid
* iv_backup_class_guid = ls_backup_class-hec_backup_class_guid
* iv_datacenter_guid = lv_datacenter
* iv_inf_provider_guid = ls_dlvy_unit-hec_inf_provider_guid ).
*
* IF lv_lb_guid IS NOT INITIAL.
* SELECT SINGLE * FROM /hec1/c_cbp_lb "#EC CI_ALL_FIELDS_NEEDED
* WHERE hec_price_lb = @lv_lb_guid
* INTO CORRESPONDING FIELDS OF @lr_db_backup->price.
*
* ENDIF.
* ENDIF. " IF ls_fdt_backup_class-hec_backup_class_guid IS NOT INITIAL.
* """" End of "Move to different method"
" Add Backup to Update table
INSERT VALUE #( data = lr_db_backup
node = /hec1/if_configuration_c=>sc_node-db_storage_backup
source_node = /hec1/if_configuration_c=>sc_node-db_storage_backup
source_key = lr_db_backup->key
change_mode = /bobf/if_frw_c=>sc_modify
key = lr_db_backup->key ) INTO TABLE lt_modification.
ENDLOOP.
"-----------------------------------
" Modify instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_tier.
DATA: lt_solution TYPE /hec1/t_data_solution_ct,
lt_tier TYPE /hec1/t_data_tier_ct,
lt_db_serv_inst TYPE /hec1/t_data_db_server_inst_ct,
lt_app_serv_inst TYPE /hec1/t_data_app_serv_inst_ct,
lt_material TYPE /hec1/t_data_material_ct,
lt_software_item TYPE /hec1/t_data_sw_item_ct,
lt_parameter TYPE /hec1/t_act_update_tier,
lt_modification TYPE /bobf/t_frw_modification,
lt_act_param_delete TYPE /bobf/t_frw_node.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO FIELD-SYMBOL(<fs_parameter>).
IF <fs_parameter> IS ASSIGNED.
lt_parameter = <fs_parameter>.
ENDIF.
/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) ).
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_tier ).
" Solution
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-tier-to_parent
IMPORTING et_data = lt_solution ).
" DB 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-tier-db_server_instance
IMPORTING et_data = lt_db_serv_inst ).
" 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-tier-app_server_instance
IMPORTING et_data = lt_app_serv_inst ).
" Get Materials
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-tier-material
IMPORTING et_data = lt_material
et_target_key = DATA(lt_material_key) ).
" Get Software Items
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-material
it_key = lt_material_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-material-software_item
IMPORTING et_data = lt_software_item ).
" Get Material List
DATA(lt_material_list) = /hec1/cl_config_sw_helper=>get_instance( )->/hec1/if_config_sw_helper~get_material_list( ).
" Get Software Item List
DATA(lt_software_item_list) = /hec1/cl_config_sw_helper=>get_instance( )->/hec1/if_config_sw_helper~get_software_item_list( ).
" own tier
LOOP AT lt_tier REFERENCE INTO DATA(lr_tier).
TRY.
DATA(ls_parameter) = lt_parameter[ key = lr_tier->key ].
"-----------------------------------
" Update Server Instance Quantities
"-----------------------------------
IF ls_parameter-do_update_qty = abap_true.
lr_tier->hec_app_srv_qty = lines( VALUE /hec1/t_data_app_serv_inst_ct( FOR app_si IN lt_app_serv_inst
WHERE ( parent_key = lr_tier->key AND
hec_srv_inst_rel_value = '01' )
( app_si ) ) ).
lr_tier->hec_app_srv_qty_opt = lines( VALUE /hec1/t_data_app_serv_inst_ct( FOR app_si IN lt_app_serv_inst
WHERE ( parent_key = lr_tier->key AND
hec_srv_inst_rel_value = '02' )
( app_si ) ) ).
lr_tier->hec_db_srv_qty = lines( VALUE /hec1/t_data_db_server_inst_ct( FOR db_si IN lt_db_serv_inst
WHERE ( parent_key = lr_tier->key AND
hec_db_srv_type_value = '01' )
( db_si ) ) ).
lr_tier->hec_db_srv_qty_opt = lines( VALUE /hec1/t_data_db_server_inst_ct( FOR db_si IN lt_db_serv_inst
WHERE ( parent_key = lr_tier->key AND
hec_db_srv_type_value = '02' )
( db_si ) ) ).
ENDIF. "do_update_qty
"-----------------------------------
" Update language
"-----------------------------------
IF ls_parameter-do_update_language = abap_true.
TRY.
DATA(ls_solution) = lt_solution[ key = lr_tier->parent_key ].
lr_tier->hec_tier_language_sys_alt = ls_solution-hec_sol_language_sys_alt.
lr_tier->hec_tier_language_sys_def = ls_solution-hec_sol_language_sys_def.
lr_tier->hec_tier_language_list = ls_solution-hec_sol_language_list.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF ls_parameter-do_update_language = abap_true.
"-----------------------------------
" Update Business Function
"-----------------------------------
IF ls_parameter-do_update_bf_activation = abap_true.
TRY.
ls_solution = lt_solution[ key = lr_tier->parent_key ].
lr_tier->hec_bf_activation = ls_solution-hec_bf_activation.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF ls_parameter-do_update_bf_activation = abap_true.
IF ls_parameter-do_update_bf_tmpl_sent_to_cust = abap_true.
TRY.
ls_solution = lt_solution[ key = lr_tier->parent_key ].
lr_tier->hec_bpacti_tmpl_sent_to_cust = ls_solution-hec_bpacti_tmpl_sent_to_cust.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF ls_parameter-do_update_bf_tmpl_sent_to_cust = abap_true.
IF ls_parameter-do_update_bf_tmpl_upl_by_cust = abap_true.
TRY.
ls_solution = lt_solution[ key = lr_tier->parent_key ].
lr_tier->hec_bpacti_tmpl_upl_by_cust = ls_solution-hec_bpacti_tmpl_upl_by_cust.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF ls_parameter-do_update_bf_tmpl_upl_by_cust = abap_true.
IF ls_parameter-do_update_db_version = abap_true.
TRY.
ls_solution = lt_solution[ key = lr_tier->parent_key ].
lr_tier->hec_db_version_guid = ls_solution-hec_sol_db_version_guid.
lr_tier->hec_db_version_descr = ls_solution-hec_sol_db_version_descr.
lr_tier->hec_db_version_value = ls_solution-hec_sol_db_version_value.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF ls_parameter-do_update_bf_tmpl_upl_by_cust = abap_true.
IF ls_parameter-do_update_impl_type = abap_true.
TRY.
ls_solution = lt_solution[ key = lr_tier->parent_key ].
lr_tier->hec_tier_impl_type_value = ls_solution-hec_sol_impl_type_value.
lr_tier->hec_tier_impl_type_descr = ls_solution-hec_sol_impl_type_descr.
lr_tier->hec_tier_impl_type_vlqt = ls_solution-hec_sol_impl_type_vlqt.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF ls_parameter-do_update_language = abap_true.
"-----------------------------------
" Insert Tier data to modification table
"-----------------------------------
INSERT VALUE #( data = lr_tier
node = /hec1/if_configuration_c=>sc_node-tier
source_node = /hec1/if_configuration_c=>sc_node-solution
association = /hec1/if_configuration_c=>sc_association-solution-tier
source_key = lr_tier->parent_key
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_tier->key
) INTO TABLE lt_modification.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDLOOP.
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD constructor.
me->mo_instance = me.
ENDMETHOD.
METHOD get_instance.
ro_instance = COND #( WHEN mo_instance IS BOUND
THEN mo_instance
ELSE NEW /hec1/cl_config_action_intern( ) ).
ENDMETHOD.
METHOD /hec1/if_config_action_intern~copy_node.
* "disable determinations on create
* /hec1/cl_lib_d_superclass=>set_switch( abap_false ).
*
* TRY.
*
* NEW /hec1/cl_copy_controller_(
* iv_bo_key = is_ctx-bo_key
* io_read = io_read
* io_modify = io_modify
* iv_node_key = is_ctx-node_key
* it_key = it_key
* iv_adopt_alt_keys = abap_true
* )->copy( ).
*
* CATCH /hec1/cx_copy_control.
* ENDTRY.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_app_node.
DATA: lt_app_server_inst TYPE /hec1/t_data_app_serv_inst_ct,
lt_solution TYPE /hec1/t_data_solution_ct,
lt_tier TYPE /hec1/t_data_tier_ct,
lt_modification TYPE /bobf/t_frw_modification,
ls_landscape TYPE /hec1/s_config_root_cs.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_create_app_node.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_server_inst ).
"-----------------------------------
" Get APM model GUID and description
"-----------------------------------
/hec1/cl_config_helper=>get_apm_model( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING et_failed_key = et_failed_key
es_apm_model = ls_landscape ).
"-----------------------------------
" Get App server cluster node type
"-----------------------------------
DATA(lt_range_table) = VALUE /hec1/t_selection_range( FOR wa IN lt_app_server_inst
( option = /hec1/if_config_constants=>gc_range_option-eq
sign = /hec1/if_config_constants=>gc_range_sign-i
low = wa-hec_app_serv_type_clust_guid ) ).
SELECT *
FROM /hec1/i_appclustnodetypebasic
WHERE hec_apm_guid = @ls_landscape-hec_apm_guid AND
hec_app_serv_type_clust_guid IN @lt_range_table
INTO TABLE @DATA(lt_cluster_node_type).
"-----------------------------------
" Fill App server node data
"-----------------------------------
LOOP AT lt_app_server_inst ASSIGNING FIELD-SYMBOL(<fs_app_serv_inst>).
ASSIGN <fs_act_param>[ key = <fs_app_serv_inst>-key ] TO FIELD-SYMBOL(<fs_param>).
IF <fs_act_param> IS ASSIGNED.
" Get correct cluster node type
TRY.
DATA(ls_cluster_node_type) = lt_cluster_node_type[ hec_app_serv_type_clust_guid = <fs_app_serv_inst>-hec_app_serv_type_clust_guid
hec_app_clust_node_type_value = SWITCH #( <fs_param>-hec_app_cluster_type_value
WHEN /hec1/if_config_constants=>gc_app_clust_node-none
THEN /hec1/if_config_constants=>gc_app_clust_node_type-master
ELSE /hec1/if_config_constants=>gc_app_clust_node_type-standby ) ].
CATCH cx_sy_itab_line_not_found.
ls_cluster_node_type-hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master.
ls_cluster_node_type-hec_app_clust_node_type_descr = 'Master'.
ENDTRY.
DATA(lr_app_node) = NEW /hec1/s_data_app_node_cs( parent_key = <fs_app_serv_inst>-key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_app_serv_inst>-hec_node_solution
hec_node_tier = <fs_app_serv_inst>-hec_node_tier
hec_node_app_serv_inst = <fs_app_serv_inst>-hec_node_app_serv_inst
hec_node_app_node = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = ls_landscape-hec_confid
hec_comp_config_version = ls_landscape-hec_conf_version
inh = <fs_app_serv_inst>-inh
hec_server_required = <fs_app_serv_inst>-hec_server_required
hec_effort_required = <fs_app_serv_inst>-hec_effort_required
hec_backup_relev_value = <fs_app_serv_inst>-hec_backup_relev_value
hec_backup_relev_descr = <fs_app_serv_inst>-hec_backup_relev_descr
hec_master_default = SWITCH #( <fs_param>-hec_app_cluster_type_value
WHEN /hec1/if_config_constants=>gc_app_clust_node-none
THEN abap_true
ELSE abap_false )
hec_apm_guid = ls_landscape-hec_apm_guid
hec_apm_descr = ls_landscape-hec_apm_descr
hec_apst_clustty_clustnty_guid = ls_cluster_node_type-hec_apst_clustty_clustnty_guid
hec_default_app_server_inst = <fs_app_serv_inst>-hec_default_app_server_inst
hec_sol_apsi_clusttyp_guid = <fs_app_serv_inst>-hec_sol_apsi_clusttyp_guid
hec_app_cluster_type_value = <fs_param>-hec_app_cluster_type_value
hec_app_clust_node_type_guid = ls_cluster_node_type-hec_app_clust_node_type_guid
hec_app_clust_node_type_value = ls_cluster_node_type-hec_app_clust_node_type_value
hec_app_clust_node_type_descr = ls_cluster_node_type-hec_app_clust_node_type_descr
* hec_app_clust_relation_guid = iv_clust_relation_guid
hec_app_srv_perf_cat_qty = COND #( WHEN ls_cluster_node_type-hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master
THEN 1
ELSE 0 )
hec_phase_guid = COND #( WHEN ls_cluster_node_type-hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master
THEN <fs_app_serv_inst>-hec_phase_guid )
hec_phase_assign_allowed = COND #( WHEN ls_cluster_node_type-hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master
THEN abap_false
ELSE abap_true )
hec_tree_descr = ls_cluster_node_type-hec_app_clust_node_type_descr
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_app_node->crea_date_time.
INSERT VALUE #( data = lr_app_node
node = /hec1/if_configuration_c=>sc_node-app_node
source_node = /hec1/if_configuration_c=>sc_node-app_server_instance
association = /hec1/if_configuration_c=>sc_association-app_server_instance-app_node
source_key = <fs_app_serv_inst>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_app_node->key ) INTO TABLE lt_modification.
ENDIF. " IF <fs_act_param> IS ASSIGNED.
CLEAR: ls_cluster_node_type,
lr_app_node.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_app_server.
DATA: lt_app_serv_perf_cat TYPE /hec1/t_data_app_serv_pc_ct,
lt_solution TYPE /hec1/t_data_solution_ct,
lt_tier TYPE /hec1/t_data_tier_ct,
lt_modification TYPE /bobf/t_frw_modification.
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_perf_cat ).
"-----------------------------------
" Get APM model GUID and description
" delivery unit and data centers
"-----------------------------------
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
"-----------------------------------
" Fill App server data
"-----------------------------------
LOOP AT lt_app_serv_perf_cat ASSIGNING FIELD-SYMBOL(<fs_app_serv_perf_cat>).
DATA(lr_app_server) = NEW /hec1/s_data_app_serv_cs( parent_key = <fs_app_serv_perf_cat>-parent_key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_app_serv_perf_cat>-hec_node_solution
hec_node_tier = <fs_app_serv_perf_cat>-hec_node_tier
hec_node_app_serv_inst = <fs_app_serv_perf_cat>-hec_node_app_serv_inst
hec_node_app_node = <fs_app_serv_perf_cat>-hec_node_app_node
hec_node_app_serv_pc = <fs_app_serv_perf_cat>-hec_node_app_serv_pc
hec_node_app_server = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = lr_landscape->hec_confid
hec_comp_config_version = lr_landscape->hec_conf_version
inh = <fs_app_serv_perf_cat>-inh
hec_apm_guid = lr_landscape->hec_apm_guid
hec_apm_descr = lr_landscape->hec_apm_descr
hec_phase_fixed = abap_true
hec_phase_assign_allowed = abap_false
hec_phase_guid = <fs_app_serv_perf_cat>-hec_phase_guid
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_app_server->crea_date_time.
INSERT VALUE #( data = lr_app_server
node = /hec1/if_configuration_c=>sc_node-app_server
source_node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-app_server
source_key = <fs_app_serv_perf_cat>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_app_server->key ) INTO TABLE lt_modification.
CLEAR lr_app_server.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_app_server_pc.
DATA: lt_app_node TYPE /hec1/t_data_app_node_ct,
lt_solution TYPE /hec1/t_data_solution_ct,
lt_app_serv_pc TYPE /hec1/t_data_app_serv_pc_ct,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_create_app_spc.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_node ).
" all server performance categories need to clear the phasing for previous nodes
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 ).
"-----------------------------------
" Get APM model GUID and description
" delivery unit and data centers
"-----------------------------------
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lr_datacenter)
et_failed_key = et_failed_key ).
"-----------------------------------
" Fill App server performance
" category data
"-----------------------------------
LOOP AT lt_app_node ASSIGNING FIELD-SYMBOL(<fs_app_node>).
ASSIGN <fs_act_param>[ key = <fs_app_node>-key ] TO FIELD-SYMBOL(<fs_param>).
IF <fs_param> IS ASSIGNED.
DO <fs_param>-hec_app_srv_perf_cat_qty TIMES.
DATA(lr_app_serv_perf_cat) = NEW /hec1/s_data_app_serv_pc_cs( parent_key = <fs_app_node>-key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_app_node>-hec_node_solution
hec_node_tier = <fs_app_node>-hec_node_tier
hec_node_app_serv_inst = <fs_app_node>-hec_node_app_serv_inst
hec_node_app_node = <fs_app_node>-hec_node_app_node
hec_node_app_serv_pc = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = lr_landscape->hec_confid
hec_comp_config_version = lr_landscape->hec_conf_version
hec_apm_guid = lr_landscape->hec_apm_guid
hec_apm_descr = lr_landscape->hec_apm_descr
inh = <fs_app_node>-inh
* hec_app_cluster_type_value = <fs_app_node>-hec_app_cluster_type_value
hec_apst_clustty_clustnty_guid = <fs_app_node>-hec_apst_clustty_clustnty_guid
hec_app_clust_node_type_value = <fs_app_node>-hec_app_clust_node_type_value
hec_app_node_default = <fs_app_node>-hec_master_default
hec_server_qty = 1
hec_storage_qty = 1
hec_phase_guid = COND #( WHEN 1 = <fs_app_node>-hec_app_srv_perf_cat_qty
THEN <fs_app_node>-hec_phase_guid
ELSE space )
hec_phase_fixed = COND #( WHEN 1 = <fs_app_node>-hec_app_srv_perf_cat_qty
THEN abap_true
ELSE abap_false )
hec_phase_assign_allowed = abap_false
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_app_serv_perf_cat->crea_date_time.
INSERT VALUE #( data = lr_app_serv_perf_cat
node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
source_node = /hec1/if_configuration_c=>sc_node-app_node
association = /hec1/if_configuration_c=>sc_association-app_node-app_server_perform_cat
source_key = <fs_app_node>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_app_serv_perf_cat->key ) INTO TABLE lt_modification.
CLEAR lr_app_serv_perf_cat.
ENDDO.
"-----------------------------------
" Clear phasing for previously last
" object in successor/predecessor chain
"-----------------------------------
TRY.
lr_app_serv_perf_cat = NEW /hec1/s_data_app_serv_pc_cs( lt_app_serv_pc[ parent_key = <fs_app_node>-key
hec_has_successor = abap_false ] ).
lr_app_serv_perf_cat->hec_phase_assign_allowed = COND #( WHEN lr_app_serv_perf_cat->hec_phase_guid IS NOT INITIAL
AND lr_app_serv_perf_cat->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master
THEN abap_true
ELSE abap_false ).
CLEAR: lr_app_serv_perf_cat->hec_phase_guid,
lr_app_serv_perf_cat->hec_phase_changed.
lr_app_serv_perf_cat->hec_phase_assign_allowed = abap_true.
INSERT VALUE #( data = lr_app_serv_perf_cat
node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_serv_perf_cat->key ) INTO TABLE lt_modification.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF <fs_act_param> IS ASSIGNED.
UNASSIGN <fs_param>.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_app_storage.
DATA: lt_app_server TYPE /hec1/t_data_app_serv_ct,
lt_app_storage_qty TYPE /hec1/t_data_app_storageqty_ct,
lt_app_storage TYPE /hec1/t_data_app_storage_ct,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_create_app_storage.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_server ).
"-----------------------------------
" Get APM model GUID and description
" delivery unit and data centers
"-----------------------------------
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lr_datacenter)
et_failed_key = et_failed_key ).
"-----------------------------------
" Get App storage amount data
"-----------------------------------
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_server-to_app_storage_amount
IMPORTING et_target_key = DATA(lt_storage_qty_key)
et_failed_key = et_failed_key ).
IF lt_storage_qty_key IS NOT INITIAL.
io_read->retrieve( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_storage_amount
it_key = lt_storage_qty_key
IMPORTING et_data = lt_app_storage_qty ).
ENDIF.
"-----------------------------------
" Get all existing App storages
" for the given 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-app_storage
IMPORTING et_data = lt_app_storage
et_failed_key = et_failed_key ).
"-----------------------------------
" Fill App server storage data
"-----------------------------------
LOOP AT lt_app_server ASSIGNING FIELD-SYMBOL(<fs_app_server>).
LOOP AT lt_app_storage_qty ASSIGNING FIELD-SYMBOL(<fs_storage_qty>)
WHERE hec_node_solution = <fs_app_server>-hec_node_solution AND
hec_node_tier = <fs_app_server>-hec_node_tier AND
hec_node_app_serv_inst = <fs_app_server>-hec_node_app_serv_inst AND
hec_node_app_node = <fs_app_server>-hec_node_app_node AND
hec_node_app_serv_pc = <fs_app_server>-hec_node_app_serv_pc.
IF line_exists( lt_app_storage[ hec_node_solution = <fs_storage_qty>-hec_node_solution
hec_node_tier = <fs_storage_qty>-hec_node_tier
hec_node_app_serv_inst = <fs_storage_qty>-hec_node_app_serv_inst
hec_node_app_node = <fs_storage_qty>-hec_node_app_node
hec_node_app_serv_pc = <fs_storage_qty>-hec_node_app_serv_pc
hec_storage_qty_ref_guid = <fs_storage_qty>-hec_node_app_storage_qty ] ).
CONTINUE. " >>>>>>>
ENDIF.
IF <fs_act_param> IS ASSIGNED.
ASSIGN <fs_act_param>[ key = <fs_app_server>-key ]-hec_pricing_included TO FIELD-SYMBOL(<fs_pricing_included>).
IF <fs_pricing_included> IS ASSIGNED.
" Get pricing for app server storage
IF <fs_pricing_included> = abap_true.
TRY.
DATA(lv_datacenter_guid) = lr_datacenter[ hec_node_datacenter = <fs_app_server>-hec_tier_datacenter_guid ]-hec_datacenter_guid.
" Get storage data
SELECT *
FROM /hec1/i_storagelbbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_sec_datacenter_guid = @lv_datacenter_guid AND
hec_infra_provider_guid = @lr_dlvy_unit->hec_inf_provider_guid
INTO TABLE @DATA(lt_storage).
IF lines( lt_storage ) = 1.
DATA(ls_storage) = lt_storage[ 1 ].
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.
ENDIF.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF <fs_pricing_included> = abap_true.
ENDIF. " IF <fs_pricing_included> IS ASSIGNED.
ENDIF. " IF <fs_act_param> is assigned.
DATA(lr_app_storage) = NEW /hec1/s_data_app_storage_cs( parent_key = <fs_app_server>-parent_key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_app_server>-hec_node_solution
hec_node_tier = <fs_app_server>-hec_node_tier
hec_node_app_serv_inst = <fs_app_server>-hec_node_app_serv_inst
hec_node_app_node = <fs_app_server>-hec_node_app_node
hec_node_app_serv_pc = <fs_app_server>-hec_node_app_serv_pc
hec_node_app_server = <fs_app_server>-hec_node_app_server
hec_node_app_storage = /rbp/cl_general_utilities=>get_new_guid22( )
hec_storage_qty_ref_guid = <fs_storage_qty>-hec_node_app_storage_qty
hec_comp_config_id = lr_landscape->hec_confid
hec_comp_config_version = lr_landscape->hec_conf_version
inh = <fs_app_server>-inh
hec_apm_guid = lr_landscape->hec_apm_guid
hec_apm_descr = lr_landscape->hec_apm_descr
hec_storage_quantity = COND #( WHEN <fs_app_server>-hec_srv_main_storage_qty IS NOT INITIAL
THEN <fs_app_server>-hec_srv_main_storage_qty +
<fs_storage_qty>-hec_asq_additional_stor_qty
ELSE COND #( WHEN <fs_app_server>-hec_host_type_value = /hec1/if_config_constants=>gc_server_host_type-virtual
THEN <fs_storage_qty>-hec_asq_main_stor_qty_virtual +
<fs_storage_qty>-hec_asq_additional_stor_qty
ELSE <fs_storage_qty>-hec_asq_main_stor_qty_virtual +
<fs_storage_qty>-hec_asq_additional_stor_qty ) )
hec_ip_storage_guid = COND #( WHEN ls_storage-hec_ip_storage_guid IS NOT INITIAL
THEN ls_storage-hec_ip_storage_guid
ELSE space )
hec_storage_descr = COND #( WHEN ls_storage-hec_storage_descr IS NOT INITIAL
THEN ls_storage-hec_storage_descr
ELSE space )
hec_backup_qty = SWITCH #( <fs_app_server>-hec_backup_relev_value
WHEN '01'
THEN 1
ELSE 0 )
hec_phase_guid = COND #( WHEN <fs_storage_qty>-hec_phase_guid IS NOT INITIAL
THEN <fs_storage_qty>-hec_phase_guid
ELSE space )
hec_phase_fixed = abap_true
hec_phase_assign_allowed = abap_false
hec_tree_descr = COND #( WHEN ls_storage-hec_storage_descr IS INITIAL
THEN space
ELSE ls_storage-hec_storage_descr )
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_app_storage->crea_date_time.
INSERT VALUE #( data = lr_app_storage
node = /hec1/if_configuration_c=>sc_node-app_storage
source_node = /hec1/if_configuration_c=>sc_node-app_server
association = /hec1/if_configuration_c=>sc_association-app_server-app_storage
source_key = <fs_app_server>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_app_storage->key ) INTO TABLE lt_modification.
CLEAR: lv_datacenter_guid,
ls_pricing,
lt_storage,
lr_app_storage.
UNASSIGN <fs_pricing_included>.
ENDLOOP.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_app_storage_amount.
DATA: lt_app_serv_perf_cat TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_storage_qty_all TYPE /hec1/t_data_app_storageqty_ct,
lt_modification TYPE /bobf/t_frw_modification,
ls_landscape TYPE /hec1/s_config_root_cs.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_create_app_qty.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_serv_perf_cat ).
"-----------------------------------
" Get APM model GUID and description
"-----------------------------------
/hec1/cl_config_helper=>get_apm_model( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING et_failed_key = et_failed_key
es_apm_model = ls_landscape ).
"-----------------------------------
" Get App Storage Amounts
"-----------------------------------
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
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_all ).
"-----------------------------------
" Fill App storage amount data
"-----------------------------------
LOOP AT lt_app_serv_perf_cat ASSIGNING FIELD-SYMBOL(<fs_app_serv_perf_cat>).
ASSIGN <fs_act_param>[ key = <fs_app_serv_perf_cat>-key ] TO FIELD-SYMBOL(<fs_param>).
IF <fs_param> IS ASSIGNED.
DO <fs_param>-hec_storage_amount_qty TIMES.
DATA(lr_app_storage_qty) = NEW /hec1/s_data_app_storageqty_cs( parent_key = <fs_app_serv_perf_cat>-key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_app_serv_perf_cat>-hec_node_solution
hec_node_tier = <fs_app_serv_perf_cat>-hec_node_tier
hec_node_app_serv_inst = <fs_app_serv_perf_cat>-hec_node_app_serv_inst
hec_node_app_node = <fs_app_serv_perf_cat>-hec_node_app_node
hec_node_app_serv_pc = <fs_app_serv_perf_cat>-hec_node_app_serv_pc
hec_node_app_storage_qty = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = ls_landscape-hec_confid
hec_comp_config_version = ls_landscape-hec_conf_version
inh = <fs_app_serv_perf_cat>-inh
hec_apm_guid = ls_landscape-hec_apm_guid
hec_apm_descr = ls_landscape-hec_apm_descr
hec_tree_descr = |0 + 0[GiB]|
hec_phase_guid = COND #( WHEN <fs_app_serv_perf_cat>-hec_storage_qty = 1
THEN <fs_app_serv_perf_cat>-hec_phase_guid )
hec_phase_fixed = COND #( WHEN <fs_app_serv_perf_cat>-hec_storage_qty = 1
THEN abap_true
ELSE abap_false )
hec_phase_assign_allowed = abap_false
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_app_storage_qty->crea_date_time.
INSERT VALUE #( data = lr_app_storage_qty
node = /hec1/if_configuration_c=>sc_node-app_storage_amount
source_node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-app_storage_amount
source_key = <fs_app_serv_perf_cat>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_app_storage_qty->key ) INTO TABLE lt_modification.
CLEAR lr_app_storage_qty.
ENDDO.
"-----------------------------------
" Clear phasing for previously last
" object in successor/predecessor chain
"-----------------------------------
TRY.
DATA(lr_app_storage_qty_pred) = NEW /hec1/s_data_app_storageqty_cs( lt_app_storage_qty_all[ parent_key = <fs_app_serv_perf_cat>-key
hec_has_successor = abap_false ] ).
lr_app_storage_qty_pred->hec_phase_assign_allowed = COND #( WHEN lr_app_storage_qty_pred->hec_phase_guid IS NOT INITIAL
AND lr_app_storage_qty->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master
THEN abap_true
ELSE abap_false ).
CLEAR: lr_app_storage_qty_pred->hec_phase_guid,
lr_app_storage_qty_pred->hec_phase_changed.
lr_app_storage_qty_pred->hec_phase_fixed = abap_false.
INSERT VALUE #( data = lr_app_storage_qty_pred
node = /hec1/if_configuration_c=>sc_node-app_storage_amount
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_storage_qty_pred->key ) INTO TABLE lt_modification.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF <fs_param> IS ASSIGNED.
UNASSIGN <fs_param>.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_app_storage_backup.
DATA: lt_app_storage TYPE /hec1/t_data_app_storage_ct,
ls_landscape TYPE /hec1/s_config_root_cs,
lt_app_backup TYPE /hec1/t_data_app_backup_ct,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_create_app_backup.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_app_storage ).
" all server performance categories need to clear the phasing for previous nodes
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 ).
"-----------------------------------
" Get APM model GUID and description
"-----------------------------------
/hec1/cl_config_helper=>get_apm_model( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING et_failed_key = et_failed_key
es_apm_model = ls_landscape ).
"-----------------------------------
" Fill App storage backup data
"-----------------------------------
LOOP AT lt_app_storage ASSIGNING FIELD-SYMBOL(<fs_app_storage>).
ASSIGN <fs_act_param>[ key = <fs_app_storage>-key ] TO FIELD-SYMBOL(<fs_param>).
IF <fs_param> IS ASSIGNED.
DO <fs_param>-hec_backup_qty TIMES.
" Get storage backup 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 = <fs_app_storage>-key ) )
iv_app_server = abap_true
iv_tier_category_value = <fs_app_storage>-hec_tier_cat_value
iv_tier_datacenter_guid = <fs_app_storage>-hec_tier_datacenter_guid
io_read = io_read
IMPORTING es_backup_class = DATA(ls_backup_class)
es_backup_pricing = DATA(ls_backup_pricing) ).
DATA(lr_app_backup) = NEW /hec1/s_data_app_backup_cs( parent_key = <fs_app_storage>-parent_key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_app_storage>-hec_node_solution
hec_node_tier = <fs_app_storage>-hec_node_tier
hec_node_app_serv_inst = <fs_app_storage>-hec_node_app_serv_inst
hec_node_app_node = <fs_app_storage>-hec_node_app_node
hec_node_app_serv_pc = <fs_app_storage>-hec_node_app_serv_pc
hec_node_app_server = <fs_app_storage>-hec_node_app_server
hec_node_app_storage = <fs_app_storage>-hec_node_app_storage
hec_node_app_backup = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = ls_landscape-hec_confid
hec_comp_config_version = ls_landscape-hec_conf_version
inh = <fs_app_storage>-inh
hec_apm_guid = ls_landscape-hec_apm_guid
hec_apm_descr = ls_landscape-hec_apm_descr
hec_backup_class_guid = ls_backup_class-hec_backup_class_guid
hec_backup_class_descr = ls_backup_class-hec_backup_class_descr
hec_tree_descr = ls_backup_class-hec_backup_class_descr
price = ls_backup_pricing
hec_phase_guid = COND #( WHEN <fs_app_storage>-hec_backup_qty = 1
THEN <fs_app_storage>-hec_phase_guid
ELSE space )
hec_phase_fixed = COND #( WHEN <fs_app_storage>-hec_backup_qty = 1
THEN abap_true
ELSE abap_false )
hec_phase_assign_allowed = abap_false
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_app_backup->crea_date_time.
INSERT VALUE #( data = lr_app_backup
node = /hec1/if_configuration_c=>sc_node-app_storage_backup
source_node = /hec1/if_configuration_c=>sc_node-app_storage
association = /hec1/if_configuration_c=>sc_association-app_storage-app_storage_backup
source_key = <fs_app_storage>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_app_backup->key ) INTO TABLE lt_modification.
CLEAR: ls_backup_class,
ls_backup_pricing,
lr_app_backup.
ENDDO.
"-----------------------------------
" Clear phasing for previously last
" object in successor/predecessor chain
"-----------------------------------
TRY.
lr_app_backup = NEW /hec1/s_data_app_backup_cs( lt_app_backup[ parent_key = <fs_app_storage>-key
hec_has_successor = abap_false ] ).
lr_app_backup->hec_phase_assign_allowed = COND #( WHEN lr_app_backup->hec_phase_guid IS NOT INITIAL
AND lr_app_backup->hec_app_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master
THEN abap_true
ELSE abap_false ).
CLEAR: lr_app_backup->hec_phase_guid,
lr_app_backup->hec_phase_changed.
lr_app_backup->hec_phase_fixed = abap_false.
INSERT VALUE #( data = lr_app_backup
node = /hec1/if_configuration_c=>sc_node-app_storage_backup
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_backup->key ) INTO TABLE lt_modification.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. "IF <fs_param> IS ASSIGNED.
UNASSIGN <fs_param>.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_db_node.
DATA: lt_instance_db TYPE /hec1/t_data_db_inst_ct,
lt_db_serv_inst TYPE /hec1/t_data_db_server_inst_ct,
lt_tier TYPE /hec1/t_data_tier_ct,
lt_db_node TYPE /hec1/t_data_db_node_ct,
lt_modification TYPE /bobf/t_frw_modification,
ls_landscape TYPE /hec1/s_config_root_cs.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_create_db_node.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_instance_db ).
"-----------------------------------
" Get APM model GUID and description
"-----------------------------------
/hec1/cl_config_helper=>get_apm_model( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING et_failed_key = et_failed_key
es_apm_model = ls_landscape ).
"-----------------------------------
" Get DB node for cluster relation
" guid
"-----------------------------------
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-instance_db-db_node
IMPORTING et_data = lt_db_node
et_failed_key = et_failed_key ).
"-----------------------------------
" Get DB server cluster node type
"-----------------------------------
SELECT *
FROM /hec1/i_dbclustnodetypebasic
WHERE hec_apm_guid = @ls_landscape-hec_apm_guid
INTO TABLE @DATA(lt_cluster_node_type).
"-----------------------------------
" Fill DB server node data
"-----------------------------------
LOOP AT lt_instance_db ASSIGNING FIELD-SYMBOL(<fs_instance_db>).
ASSIGN <fs_act_param>[ key = <fs_instance_db>-key ] TO FIELD-SYMBOL(<fs_param>).
IF <fs_param> IS ASSIGNED.
IF <fs_param>-hec_def_master_node = abap_true.
" Create cluster relation guid
DATA(lv_clust_relation_guid) = /rbp/cl_general_utilities=>get_new_guid22( ).
ELSE.
" Get cluster relation guid from default master node
lv_clust_relation_guid = lt_db_node[ parent_key = <fs_instance_db>-key "#EC CI_SORTSEQ
hec_db_clust_node_type_value = /hec1/if_config_constants=>gc_db_clust_node_type-master
hec_master_default = abap_true ]-hec_db_clust_relation_guid.
ENDIF.
DO <fs_param>-hec_db_node_qty TIMES.
" Get DB server cluster node type
TRY.
DATA(ls_cluster_node_type) = lt_cluster_node_type[ hec_dbst_nodety_clust_ty_guid = <fs_instance_db>-hec_dbst_nodety_clust_ty_guid
hec_db_clust_node_type_value = <fs_param>-hec_cluster_node_type_value ].
CATCH cx_sy_itab_line_not_found.
ENDTRY.
IF <fs_instance_db>-hec_tier_cat_value IS NOT INITIAL AND
<fs_instance_db>-hec_effort_required = abap_true.
" Get effort building block GUID
SELECT SINGLE hec_timebased_effort_bb_guid
FROM /hec1/i_dbservnodetbbbbasic
WHERE hec_apm_guid = @ls_landscape-hec_apm_guid AND
hec_dbst_clustty_clustntyguid = @ls_cluster_node_type-hec_dbst_clustty_clustntyguid AND
hec_tier_cat_value = @<fs_instance_db>-hec_tier_cat_value
INTO @DATA(lv_effort_bb_guid).
ENDIF.
" Fill DB server node data
DATA(lr_db_node) = NEW /hec1/s_data_db_node_cs( parent_key = <fs_instance_db>-key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_instance_db>-hec_node_solution
hec_node_tier = <fs_instance_db>-hec_node_tier
hec_node_db_serv_inst = <fs_instance_db>-hec_node_db_serv_inst
hec_node_db_inst = <fs_instance_db>-hec_node_db_inst
hec_node_db_node = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = ls_landscape-hec_confid
hec_comp_config_version = ls_landscape-hec_conf_version
inh = <fs_instance_db>-inh
hec_dbst_nodety_clust_ty_guid = <fs_instance_db>-hec_dbst_nodety_clust_ty_guid
hec_apm_guid = ls_landscape-hec_apm_guid
hec_apm_descr = ls_landscape-hec_apm_descr
hec_db_node_type_value = <fs_instance_db>-hec_db_node_type_value
hec_db_cluster_type_value = <fs_instance_db>-hec_db_cluster_type_value
hec_master_default = <fs_param>-hec_def_master_node
hec_db_clust_relation_guid = lv_clust_relation_guid
hec_dbst_clustty_clustntyguid = ls_cluster_node_type-hec_dbst_clustty_clustntyguid
hec_db_clust_node_type_value = ls_cluster_node_type-hec_db_clust_node_type_value
hec_db_clust_node_type_descr = ls_cluster_node_type-hec_db_clust_node_type_descr
hec_gen_parallel_file_sys = ls_cluster_node_type-hec_gen_parallel_file_sys
hec_calc_setup_dr = ls_cluster_node_type-hec_calc_setup_dr
hec_db_srv_perf_cat_qty = SWITCH #( ls_cluster_node_type-hec_db_clust_node_type_value
WHEN /hec1/if_config_constants=>gc_db_clust_node_type-master
THEN 1
ELSE 0 )
price = /hec1/cl_config_helper=>do_price_validation( iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
iv_effort_bb_guid = lv_effort_bb_guid
iv_tier_is_dr_node = <fs_instance_db>-hec_tier_is_dr_node
iv_dr_operating_mode = <fs_instance_db>-hec_dr_oper_mode_value )
hec_phase_fixed = COND #( WHEN ls_cluster_node_type-hec_db_clust_node_type_value = /hec1/if_config_constants=>gc_db_clust_node_type-master
THEN abap_true
ELSE abap_false )
hec_phase_guid = COND #( WHEN ls_cluster_node_type-hec_db_clust_node_type_value = /hec1/if_config_constants=>gc_db_clust_node_type-master
THEN <fs_instance_db>-hec_phase_guid
ELSE space )
hec_phase_assign_allowed = COND #( WHEN ls_cluster_node_type-hec_db_clust_node_type_value = /hec1/if_config_constants=>gc_db_clust_node_type-master
THEN abap_false
ELSE abap_true )
hec_tree_descr = ls_cluster_node_type-hec_db_clust_node_type_descr
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_db_node->crea_date_time.
INSERT VALUE #( data = lr_db_node
node = /hec1/if_configuration_c=>sc_node-db_node
source_node = /hec1/if_configuration_c=>sc_node-instance_db
association = /hec1/if_configuration_c=>sc_association-instance_db-db_node
source_key = <fs_instance_db>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_db_node->key ) INTO TABLE lt_modification.
CLEAR: lv_effort_bb_guid,
ls_cluster_node_type,
lr_db_node.
ENDDO.
ENDIF. " IF <fs_param> IS ASSIGNED.
CLEAR lv_clust_relation_guid.
UNASSIGN <fs_param>.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_db_server.
DATA: lt_db_serv_perf_cat TYPE /hec1/t_data_db_serv_pc_ct,
lt_solution TYPE /hec1/t_data_solution_ct,
lt_tier TYPE /hec1/t_data_tier_ct,
lt_modification TYPE /bobf/t_frw_modification.
CLEAR: eo_message,
et_failed_key.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_db_serv_perf_cat ).
"-----------------------------------
" Get APM model GUID and description
" delivery unit and data centers
"-----------------------------------
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
"-----------------------------------
" Get tier for assigned data center
"-----------------------------------
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-instance_db
it_key = it_key
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-instance_db-to_parent
IMPORTING et_target_key = DATA(lt_key)
et_key_link = DATA(lt_key_link)
et_failed_key = et_failed_key ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server_instance
it_key = lt_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_server_instance-to_parent
IMPORTING et_data = lt_tier
et_key_link = DATA(lt_tier_key_link)
et_failed_key = et_failed_key ).
"-----------------------------------
" Get DB server data
"-----------------------------------
DATA(lt_range_table) = VALUE /hec1/t_selection_range( FOR wa_spc IN lt_db_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_serverbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_infra_provider_guid = @lr_dlvy_unit->hec_inf_provider_guid AND
hec_srv_perf_cat_guid IN @lt_range_table
INTO TABLE @DATA(lt_server_data).
"-----------------------------------
" Fill DB server data
"-----------------------------------
LOOP AT lt_db_serv_perf_cat ASSIGNING FIELD-SYMBOL(<fs_db_serv_perf_cat>).
" Get assigned data center from tier
TRY.
DATA(lv_db_serv_inst_key) = lt_key_link[ source_key = <fs_db_serv_perf_cat>-parent_key ]-target_key.
DATA(lv_assigned_datacenter) = lt_tier[ key = lt_tier_key_link[ source_key = lv_db_serv_inst_key ]-target_key ]-hec_tier_datacenter_guid.
DATA(lv_datacenter_guid) = lt_datacenter[ hec_node_datacenter = lv_assigned_datacenter ]-hec_datacenter_guid.
DATA(lt_server) = VALUE /hec1/t_apm_server( FOR wa IN lt_server_data
WHERE ( hec_sec_datacenter_guid = lv_datacenter_guid AND
hec_srv_perf_cat_guid = <fs_db_serv_perf_cat>-hec_srv_perf_cat_guid )
( CORRESPONDING #( wa ) ) ).
" Get DB server and pricing
IF lines( lt_server ) = 1.
TRY.
DATA(ls_server) = lt_server[ 1 ].
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 = @ls_server-hec_sec_datacenter_guid AND
hec_infra_provider_guid = @ls_server-hec_infra_provider_guid AND
hec_ip_server_guid = @ls_server-hec_ip_server_guid
INTO @DATA(lv_lb_guid).
SELECT SINGLE * FROM /hec1/c_cbp_lb "#EC CI_ALL_FIELDS_NEEDED
INTO @DATA(ls_pricing)
WHERE hec_price_lb = @lv_lb_guid.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
DATA(lr_db_server) = NEW /hec1/s_data_db_serv_cs( parent_key = <fs_db_serv_perf_cat>-parent_key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_db_serv_perf_cat>-hec_node_solution
hec_node_tier = <fs_db_serv_perf_cat>-hec_node_tier
hec_node_db_serv_inst = <fs_db_serv_perf_cat>-hec_node_db_serv_inst
hec_node_db_inst = <fs_db_serv_perf_cat>-hec_node_db_inst
hec_node_db_node = <fs_db_serv_perf_cat>-hec_node_db_node
hec_node_db_serv_pc = <fs_db_serv_perf_cat>-hec_node_db_serv_pc
hec_node_db_server = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = lr_landscape->hec_confid
hec_comp_config_version = lr_landscape->hec_conf_version
inh = <fs_db_serv_perf_cat>-inh
hec_apm_guid = lr_landscape->hec_apm_guid
hec_apm_descr = lr_landscape->hec_apm_descr
hec_ip_server_guid = ls_server-hec_ip_server_guid
hec_ip_server_descr = ls_server-hec_ip_server_descr
hec_host_type_value = ls_server-hec_srv_host_type_value
hec_host_type_descr = ls_server-hec_srv_host_type_descr
hec_ram_size = ls_server-hec_srv_ram_size
hec_cpu_size = ls_server-hec_srv_cpu_size
hec_srv_main_stor_qty = ls_server-hec_srv_main_storage_qty
hec_saps = ls_server-hec_saps
hec_srv_flavour = ls_server-hec_srv_flavour
hec_approval_needed = ls_server-hec_approval_needed
price = CORRESPONDING #( ls_pricing )
hec_phase_guid = <fs_db_serv_perf_cat>-hec_phase_guid
hec_phase_fixed = abap_true
hec_phase_assign_allowed = abap_false
hec_tree_descr = COND #( WHEN ls_server-hec_ip_server_descr IS INITIAL
THEN space
ELSE ls_server-hec_ip_server_descr )
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_db_server->crea_date_time.
INSERT VALUE #( data = lr_db_server
node = /hec1/if_configuration_c=>sc_node-db_server
source_node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
association = /hec1/if_configuration_c=>sc_association-db_server_perform_cat-db_server
source_key = <fs_db_serv_perf_cat>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_db_server->key ) INTO TABLE lt_modification.
CLEAR: lv_datacenter_guid,
lv_assigned_datacenter,
lv_db_serv_inst_key,
lv_lb_guid,
ls_pricing,
ls_server,
lt_server,
lr_db_server.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_db_server_pc.
DATA: lt_db_node TYPE /hec1/t_data_db_node_ct,
lt_solution TYPE /hec1/t_data_solution_ct,
lt_db_serv_pc TYPE /hec1/t_data_db_serv_pc_ct,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_create_db_spc.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_db_node ).
"-----------------------------------
" All server performance categories
" need to clear the phasing for
" previous nodes
"-----------------------------------
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-db_node-db_server_perform_cat
IMPORTING et_data = lt_db_serv_pc ).
"-----------------------------------
" Get APM model GUID and description
" delivery unit and data centers
"-----------------------------------
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lr_datacenter)
et_failed_key = et_failed_key ).
"-----------------------------------
" Fill DB server performance
" category data
"-----------------------------------
LOOP AT lt_db_node ASSIGNING FIELD-SYMBOL(<fs_db_node>).
ASSIGN <fs_act_param>[ key = <fs_db_node>-key ] TO FIELD-SYMBOL(<fs_param>).
IF <fs_param> IS ASSIGNED.
DO <fs_param>-hec_db_srv_perf_cat_qty TIMES.
DATA(lr_db_serv_perf_cat) = NEW /hec1/s_data_db_serv_pc_cs( parent_key = <fs_db_node>-key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_db_node>-hec_node_solution
hec_node_tier = <fs_db_node>-hec_node_tier
hec_node_db_serv_inst = <fs_db_node>-hec_node_db_serv_inst
hec_node_db_inst = <fs_db_node>-hec_node_db_inst
hec_node_db_node = <fs_db_node>-hec_node_db_node
hec_node_db_serv_pc = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = lr_landscape->hec_confid
hec_comp_config_version = lr_landscape->hec_conf_version
inh = <fs_db_node>-inh
hec_dbst_clustty_clustntyguid = <fs_db_node>-hec_dbst_clustty_clustntyguid
hec_db_clust_node_type_value = <fs_db_node>-hec_db_clust_node_type_value
hec_db_node_default = <fs_db_node>-hec_master_default
hec_apm_guid = lr_landscape->hec_apm_guid
hec_apm_descr = lr_landscape->hec_apm_descr
hec_server_qty = SWITCH #( <fs_db_node>-hec_db_node_type_value
WHEN /hec1/if_config_constants=>gc_db_node_type-tenant
THEN 0
ELSE 1 )
hec_storage_qty = SWITCH #( <fs_db_node>-hec_db_node_type_value
WHEN /hec1/if_config_constants=>gc_db_node_type-tenant
THEN 0
ELSE 1 )
hec_phase_guid = SWITCH #( <fs_db_node>-hec_db_srv_perf_cat_qty
WHEN 1
THEN <fs_db_node>-hec_phase_guid
ELSE space )
hec_phase_fixed = SWITCH #( <fs_db_node>-hec_db_srv_perf_cat_qty
WHEN 1
THEN abap_true
ELSE abap_false )
hec_phase_assign_allowed = abap_false
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_db_serv_perf_cat->crea_date_time.
INSERT VALUE #( data = lr_db_serv_perf_cat
node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
source_node = /hec1/if_configuration_c=>sc_node-db_node
association = /hec1/if_configuration_c=>sc_association-db_node-db_server_perform_cat
source_key = <fs_db_node>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_db_serv_perf_cat->key ) INTO TABLE lt_modification.
CLEAR lr_db_serv_perf_cat.
ENDDO.
"-----------------------------------
" Clear phasing for previously last
" object in successor/predecessor chain
"-----------------------------------
TRY.
lr_db_serv_perf_cat = NEW /hec1/s_data_db_serv_pc_cs( lt_db_serv_pc[ parent_key = <fs_db_node>-key
hec_has_successor = abap_false ] ).
lr_db_serv_perf_cat->hec_phase_assign_allowed = COND #( WHEN lr_db_serv_perf_cat->hec_phase_guid IS NOT INITIAL
AND lr_db_serv_perf_cat->hec_db_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master
THEN abap_true
ELSE abap_false ).
CLEAR: lr_db_serv_perf_cat->hec_phase_guid,
lr_db_serv_perf_cat->hec_phase_changed.
lr_db_serv_perf_cat->hec_phase_fixed = abap_false.
INSERT VALUE #( data = lr_db_serv_perf_cat
node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
source_node = /hec1/if_configuration_c=>sc_node-db_node
association = /hec1/if_configuration_c=>sc_association-db_node-db_server_perform_cat
source_key = <fs_db_node>-key
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_serv_perf_cat->key ) INTO TABLE lt_modification.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF <fs_act_param> IS ASSIGNED.
UNASSIGN <fs_param>.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_db_storage.
DATA: lt_db_server TYPE /hec1/t_data_db_serv_ct,
lt_db_storage_qty TYPE /hec1/t_data_db_storage_qty_ct,
lt_db_storage TYPE /hec1/t_data_db_storage_ct,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_create_db_storage.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_db_server ).
"-----------------------------------
" Get APM model GUID and description
" delivery unit and data centers
"-----------------------------------
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
"-----------------------------------
" Get DB storage amount data
"-----------------------------------
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-db_server-to_parent
IMPORTING et_target_key = DATA(lt_key)
et_failed_key = et_failed_key ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
it_key = lt_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_server_perform_cat-db_storage_amount
IMPORTING et_data = lt_db_storage_qty
et_failed_key = et_failed_key ).
"-----------------------------------
" Get all existing DB storages
" for the given DB 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-db_server-db_storage
IMPORTING et_data = lt_db_storage
et_failed_key = et_failed_key ).
"-----------------------------------
" Fill DB server storage data
"-----------------------------------
LOOP AT lt_db_server ASSIGNING FIELD-SYMBOL(<fs_db_server>).
LOOP AT lt_db_storage_qty ASSIGNING FIELD-SYMBOL(<fs_storage_qty>)
WHERE hec_node_solution = <fs_db_server>-hec_node_solution AND
hec_node_tier = <fs_db_server>-hec_node_tier AND
hec_node_db_serv_inst = <fs_db_server>-hec_node_db_serv_inst AND
hec_node_db_inst = <fs_db_server>-hec_node_db_inst AND
hec_node_db_node = <fs_db_server>-hec_node_db_node AND
hec_node_db_serv_pc = <fs_db_server>-hec_node_db_serv_pc.
IF line_exists( lt_db_storage[ hec_node_solution = <fs_storage_qty>-hec_node_solution
hec_node_tier = <fs_storage_qty>-hec_node_tier
hec_node_db_serv_inst = <fs_storage_qty>-hec_node_db_serv_inst
hec_node_db_inst = <fs_storage_qty>-hec_node_db_inst
hec_node_db_node = <fs_storage_qty>-hec_node_db_node
hec_node_db_serv_pc = <fs_storage_qty>-hec_node_db_serv_pc
hec_storage_qty_ref_guid = <fs_storage_qty>-hec_node_db_storage_qty ] ).
CONTINUE. " >>>>>>>
ENDIF.
IF <fs_act_param> IS ASSIGNED.
ASSIGN <fs_act_param>[ key = <fs_db_server>-key ]-hec_pricing_included TO FIELD-SYMBOL(<fs_pricing_included>).
IF <fs_pricing_included> IS ASSIGNED.
" Get pricing for DB server storage
IF <fs_pricing_included> = abap_true.
TRY.
DATA(lv_datacenter_guid) = lt_datacenter[ hec_node_datacenter = <fs_db_server>-hec_tier_datacenter_guid ]-hec_datacenter_guid.
" Get storage data
SELECT *
FROM /hec1/i_storagelbbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_sec_datacenter_guid = @lv_datacenter_guid AND
hec_infra_provider_guid = @lr_dlvy_unit->hec_inf_provider_guid
INTO TABLE @DATA(lt_storage).
IF lines( lt_storage ) = 1.
DATA(ls_storage) = lt_storage[ 1 ].
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.
ENDIF.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF <fs_pricing_included> = abap_true.
ENDIF. " IF <fs_pricing_included> IS ASSIGNED.
ENDIF. "IF <fs_act_param> is assigned.
DATA(lr_db_storage) = NEW /hec1/s_data_db_storage_cs( parent_key = <fs_db_server>-parent_key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_db_server>-hec_node_solution
hec_node_tier = <fs_db_server>-hec_node_tier
hec_node_db_serv_inst = <fs_db_server>-hec_node_db_serv_inst
hec_node_db_inst = <fs_db_server>-hec_node_db_inst
hec_node_db_node = <fs_db_server>-hec_node_db_node
hec_node_db_serv_pc = <fs_db_server>-hec_node_db_serv_pc
hec_node_db_server = <fs_db_server>-hec_node_db_server
hec_node_db_storage = /rbp/cl_general_utilities=>get_new_guid22( )
hec_storage_qty_ref_guid = <fs_storage_qty>-hec_node_db_storage_qty
hec_comp_config_id = lr_landscape->hec_confid
hec_comp_config_version = lr_landscape->hec_conf_version
inh = <fs_db_server>-inh
hec_apm_guid = lr_landscape->hec_apm_guid
hec_apm_descr = lr_landscape->hec_apm_descr
hec_storage_quantity = COND #( WHEN <fs_db_server>-hec_srv_main_stor_qty IS NOT INITIAL
THEN <fs_db_server>-hec_srv_main_stor_qty +
<fs_storage_qty>-hec_dsq_additional_stor_qty
ELSE COND #( WHEN <fs_db_server>-hec_host_type_value = /hec1/if_config_constants=>gc_server_host_type-virtual
THEN <fs_storage_qty>-hec_dsq_main_stor_qty_virtual +
<fs_storage_qty>-hec_dsq_additional_stor_qty
ELSE <fs_storage_qty>-hec_dsq_main_stor_qty_virtual +
<fs_storage_qty>-hec_dsq_additional_stor_qty ) )
hec_backup_qty = SWITCH #( <fs_db_server>-hec_backup_relev_value
WHEN '01'
THEN 1
ELSE 0 )
hec_phase_guid = COND #( WHEN <fs_storage_qty>-hec_phase_guid IS NOT INITIAL
THEN <fs_storage_qty>-hec_phase_guid
ELSE space )
hec_phase_fixed = abap_true
hec_phase_assign_allowed = abap_false
hec_tree_descr = COND #( WHEN ls_storage-hec_storage_descr IS INITIAL
THEN space
ELSE ls_storage-hec_storage_descr )
hec_db_srv_type_guid = <fs_db_server>-hec_db_srv_type_guid
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_db_storage->crea_date_time.
INSERT VALUE #( data = lr_db_storage
node = /hec1/if_configuration_c=>sc_node-db_storage
source_node = /hec1/if_configuration_c=>sc_node-db_server
association = /hec1/if_configuration_c=>sc_association-db_server-db_storage
source_key = <fs_db_server>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_db_storage->key ) INTO TABLE lt_modification.
CLEAR: lv_datacenter_guid,
ls_pricing,
lt_storage,
lr_db_storage.
UNASSIGN <fs_pricing_included>.
ENDLOOP.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_db_storage_amount.
DATA: lt_db_serv_perf_cat TYPE /hec1/t_data_db_serv_pc_ct,
lt_db_storage_qty_all TYPE /hec1/t_data_db_storage_qty_ct,
lt_db_serv_inst TYPE /hec1/t_data_db_server_inst_ct,
lt_tier TYPE /hec1/t_data_tier_ct,
lt_modification TYPE /bobf/t_frw_modification.
CONSTANTS: lc_factor TYPE p DECIMALS 1 VALUE '1.2'.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_create_db_qty.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_db_serv_perf_cat ).
"-----------------------------------
" Get APM model GUID and description
" delivery unit and data centers
"-----------------------------------
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING er_landscape = DATA(lr_landscape)
er_delivery_unit = DATA(lr_dlvy_unit)
et_datacenter = DATA(lt_datacenter)
et_failed_key = et_failed_key ).
"-----------------------------------
" Get tier for DB server type
"-----------------------------------
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_node
it_key = VALUE #( FOR wa IN <fs_act_param>
( key = wa-parent_key ) )
iv_fill_data = abap_false
iv_association = /hec1/if_configuration_c=>sc_association-db_node-to_parent
IMPORTING et_target_key = DATA(lt_key)
et_key_link = DATA(lt_key_link)
et_failed_key = et_failed_key ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-instance_db
it_key = lt_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-instance_db-to_parent
IMPORTING et_data = lt_db_serv_inst
et_target_key = DATA(lt_db_serv_inst_key)
et_key_link = DATA(lt_db_serv_inst_key_link)
et_failed_key = et_failed_key ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server_instance
it_key = lt_db_serv_inst_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_server_instance-to_parent
IMPORTING et_data = lt_tier
et_key_link = DATA(lt_tier_key_link)
et_failed_key = et_failed_key ).
"-----------------------------------
" Get DB Storage Amounts
"-----------------------------------
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
it_key = it_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_server_perform_cat-db_storage_amount
IMPORTING et_data = lt_db_storage_qty_all ).
"-----------------------------------
" Get server performance category
"-----------------------------------
DATA(lt_range_table) = VALUE /hec1/t_selection_range( FOR wa_spc IN lt_db_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_dbservperfcatbasic
WHERE hec_apm_guid = @lr_landscape->hec_apm_guid AND
hec_inf_provider_guid = @lr_dlvy_unit->hec_inf_provider_guid AND
hec_srv_perf_cat_guid IN @lt_range_table
INTO TABLE @DATA(lt_serv_perf_cat).
"-----------------------------------
" Fill DB storage amount data
"-----------------------------------
LOOP AT lt_db_serv_perf_cat ASSIGNING FIELD-SYMBOL(<fs_db_serv_perf_cat>).
ASSIGN <fs_act_param>[ key = <fs_db_serv_perf_cat>-key ] TO FIELD-SYMBOL(<fs_param>).
IF <fs_param> IS ASSIGNED.
DO <fs_param>-hec_storage_amount_qty TIMES.
" Get DB server type from tier
TRY.
DATA(lv_inst_db_key) = lt_key_link[ source_key = <fs_db_serv_perf_cat>-parent_key ]-target_key.
DATA(lv_db_serv_inst_key) = lt_db_serv_inst_key_link[ source_key = lv_inst_db_key ]-target_key.
DATA(lv_db_server_type) = lt_db_serv_inst[ key = lv_db_serv_inst_key ]-hec_db_srv_type_value.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
"***********
" Datacenter mit in selektion?????????
TRY.
DATA(ls_serv_perf_cat) = lt_serv_perf_cat[ hec_srv_perf_cat_guid = <fs_db_serv_perf_cat>-hec_srv_perf_cat_guid ].
CATCH cx_sy_itab_line_not_found.
ENDTRY.
DATA(lr_db_storage_qty) = NEW /hec1/s_data_db_storage_qty_cs( parent_key = <fs_db_serv_perf_cat>-key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_db_serv_perf_cat>-hec_node_solution
hec_node_tier = <fs_db_serv_perf_cat>-hec_node_tier
hec_node_db_serv_inst = <fs_db_serv_perf_cat>-hec_node_db_serv_inst
hec_node_db_inst = <fs_db_serv_perf_cat>-hec_node_db_inst
hec_node_db_node = <fs_db_serv_perf_cat>-hec_node_db_node
hec_node_db_serv_pc = <fs_db_serv_perf_cat>-hec_node_db_serv_pc
hec_node_db_storage_qty = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = lr_landscape->hec_confid
hec_comp_config_version = lr_landscape->hec_conf_version
inh = <fs_db_serv_perf_cat>-inh
hec_apm_guid = lr_landscape->hec_apm_guid
hec_apm_descr = lr_landscape->hec_apm_descr
hec_dsq_main_stor_qty_virtual = SWITCH #( lv_db_server_type
WHEN /hec1/if_config_constants=>gc_db_server_type-hana
THEN lc_factor * ls_serv_perf_cat-hec_srv_ram_class
ELSE space )
hec_dsq_main_stor_qty_physical = 10
hec_tree_descr = SWITCH #( lv_db_server_type
WHEN /hec1/if_config_constants=>gc_db_server_type-hana
THEN |{ lc_factor * ls_serv_perf_cat-hec_srv_ram_class } + 0[GiB]|
ELSE space )
hec_phase_guid = COND #( WHEN <fs_db_serv_perf_cat>-hec_storage_qty = 1
THEN <fs_db_serv_perf_cat>-hec_phase_guid )
hec_phase_fixed = COND #( WHEN <fs_db_serv_perf_cat>-hec_storage_qty = 1
THEN abap_true )
hec_phase_assign_allowed = abap_false
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_db_storage_qty->crea_date_time.
INSERT VALUE #( data = lr_db_storage_qty
node = /hec1/if_configuration_c=>sc_node-db_storage_amount
source_node = /hec1/if_configuration_c=>sc_node-db_server_perform_cat
association = /hec1/if_configuration_c=>sc_association-db_server_perform_cat-db_storage_amount
source_key = <fs_db_serv_perf_cat>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_db_storage_qty->key ) INTO TABLE lt_modification.
CLEAR: lv_inst_db_key,
lv_db_serv_inst_key,
lv_db_server_type,
ls_serv_perf_cat,
lr_db_storage_qty.
ENDDO.
"-----------------------------------
" Clear phasing for previously last
" object in successor/predecessor chain
"-----------------------------------
TRY.
DATA(lr_db_storage_qty_pred) = NEW /hec1/s_data_db_storage_qty_cs( lt_db_storage_qty_all[ parent_key = <fs_db_serv_perf_cat>-key
hec_has_successor = abap_false ] ).
lr_db_storage_qty_pred->hec_phase_assign_allowed = COND #( WHEN lr_db_storage_qty_pred->hec_phase_guid IS NOT INITIAL
AND lr_db_storage_qty_pred->hec_db_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master
THEN abap_true
ELSE abap_false ).
CLEAR: lr_db_storage_qty_pred->hec_phase_guid,
lr_db_storage_qty_pred->hec_phase_changed.
lr_db_storage_qty_pred->hec_phase_fixed = abap_false.
INSERT VALUE #( data = lr_db_storage_qty_pred
node = /hec1/if_configuration_c=>sc_node-db_storage_amount
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_storage_qty_pred->key ) INTO TABLE lt_modification.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF <fs_param> IS ASSIGNED.
UNASSIGN <fs_param>.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_db_storage_backup.
DATA: lt_db_storage TYPE /hec1/t_data_db_storage_ct,
ls_landscape TYPE /hec1/s_config_root_cs,
lt_db_backup TYPE /hec1/t_data_db_backup_ct,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_create_db_backup.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_db_storage ).
" all backups need to clear the phasing for previous nodes
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-db_storage-db_storage_backup
IMPORTING et_data = lt_db_backup ).
"-----------------------------------
" Get APM model GUID and description
"-----------------------------------
/hec1/cl_config_helper=>get_apm_model( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING et_failed_key = et_failed_key
es_apm_model = ls_landscape ).
"-----------------------------------
" Fill DB storage backup data
"-----------------------------------
LOOP AT lt_db_storage ASSIGNING FIELD-SYMBOL(<fs_db_storage>).
ASSIGN <fs_act_param>[ key = <fs_db_storage>-key ] TO FIELD-SYMBOL(<fs_param>).
IF <fs_param> IS ASSIGNED.
DO <fs_param>-hec_backup_qty TIMES.
" Get storage backup 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 = <fs_db_storage>-key ) )
iv_tier_category_value = <fs_db_storage>-hec_tier_cat_value
iv_tier_datacenter_guid = <fs_db_storage>-hec_tier_datacenter_guid
io_read = io_read
IMPORTING es_backup_class = DATA(ls_fdt_backup_class)
es_backup_pricing = DATA(ls_fdt_backup_pricing) ).
DATA(lr_db_backup) = NEW /hec1/s_data_db_backup_cs( parent_key = <fs_db_storage>-parent_key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_db_storage>-hec_node_solution
hec_node_tier = <fs_db_storage>-hec_node_tier
hec_node_db_serv_inst = <fs_db_storage>-hec_node_db_serv_inst
hec_node_db_inst = <fs_db_storage>-hec_node_db_inst
hec_node_db_node = <fs_db_storage>-hec_node_db_node
hec_node_db_serv_pc = <fs_db_storage>-hec_node_db_serv_pc
hec_node_db_server = <fs_db_storage>-hec_node_db_server
hec_node_db_storage = <fs_db_storage>-hec_node_db_storage
hec_node_db_backup = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = ls_landscape-hec_confid
hec_comp_config_version = ls_landscape-hec_conf_version
inh = <fs_db_storage>-inh
hec_apm_guid = ls_landscape-hec_apm_guid
hec_apm_descr = ls_landscape-hec_apm_descr
hec_backup_class_guid = ls_fdt_backup_class-hec_backup_class_guid
hec_backup_class_descr = ls_fdt_backup_class-hec_backup_class_descr
hec_tree_descr = ls_fdt_backup_class-hec_backup_class_descr
price = ls_fdt_backup_pricing
* hec_db_srv_type_guid = <fs_db_storage>-hec_db_srv_type_guid
hec_phase_guid = COND #( WHEN <fs_db_storage>-hec_backup_qty = 1
THEN <fs_db_storage>-hec_phase_guid
ELSE space )
hec_phase_fixed = COND #( WHEN <fs_db_storage>-hec_backup_qty = 1
THEN abap_true
ELSE abap_false )
hec_phase_assign_allowed = abap_false
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_db_backup->crea_date_time.
INSERT VALUE #( data = lr_db_backup
node = /hec1/if_configuration_c=>sc_node-db_storage_backup
source_node = /hec1/if_configuration_c=>sc_node-db_storage
association = /hec1/if_configuration_c=>sc_association-db_storage-db_storage_backup
source_key = <fs_db_storage>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_db_backup->key ) INTO TABLE lt_modification.
CLEAR: ls_fdt_backup_class,
ls_fdt_backup_pricing,
lr_db_backup.
ENDDO.
"-----------------------------------
" Clear phasing for previously last
" object in successor/predecessor chain
"-----------------------------------
TRY.
lr_db_backup = NEW /hec1/s_data_db_backup_cs( lt_db_backup[ parent_key = <fs_db_storage>-key
hec_has_successor = abap_false ] ).
lr_db_backup->hec_phase_assign_allowed = COND #( WHEN lr_db_backup->hec_phase_guid IS NOT INITIAL
AND lr_db_backup->hec_db_clust_node_type_value = /hec1/if_config_constants=>gc_app_clust_node_type-master
THEN abap_true
ELSE abap_false ).
CLEAR: lr_db_backup->hec_phase_guid,
lr_db_backup->hec_phase_changed.
lr_db_backup->hec_phase_fixed = abap_false.
INSERT VALUE #( data = lr_db_backup
node = /hec1/if_configuration_c=>sc_node-db_storage_backup
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_backup->key ) INTO TABLE lt_modification.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. "IF <fs_param> IS ASSIGNED.
UNASSIGN <fs_param>.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_delivery_unit.
DATA: lt_modification TYPE /bobf/t_frw_modification,
lt_landscape TYPE /hec1/t_data_landscape_ct,
lt_root TYPE /hec1/t_config_root_ct.
"-----------------------------------
" Get APM model GUID and description
" delivery unit and data centers
"-----------------------------------
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING er_landscape = DATA(lr_landscape)
et_failed_key = et_failed_key ).
"this is triggered from delivery-node
io_read->get_root_key( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_target_key = DATA(lt_root_key) ).
LOOP AT lt_root_key ASSIGNING FIELD-SYMBOL(<fs_root>).
"-----------------------------------
" Set delivery unit data
"-----------------------------------
DATA(lv_delivery_unit_key) = /bopf/cl_frw_factory=>get_new_key( ).
DATA(lr_delivery_unit) = NEW /hec1/s_data_dlvy_unit_cs( parent_key = <fs_root>-key
key = lv_delivery_unit_key
hec_node_delivery_unit = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = lr_landscape->hec_confid
hec_comp_config_version = lr_landscape->hec_conf_version
hec_row_selectable = abap_true
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_delivery_unit->crea_date_time.
INSERT VALUE #( data = lr_delivery_unit
node = /hec1/if_configuration_c=>sc_node-delivery_unit
source_node = /hec1/if_configuration_c=>sc_node-root
association = /hec1/if_configuration_c=>sc_association-root-delivery_unit
source_key = <fs_root>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lv_delivery_unit_key ) INTO TABLE lt_modification.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_instance_db.
DATA: lt_db_server_inst TYPE /hec1/t_data_db_server_inst_ct,
lt_modification TYPE /bobf/t_frw_modification,
ls_landscape TYPE /hec1/s_config_root_cs,
lv_counter TYPE int4.
CLEAR: eo_message,
et_failed_key.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_db_server_inst ).
"-----------------------------------
" Get APM model GUID and description
"-----------------------------------
/hec1/cl_config_helper=>get_apm_model( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING et_failed_key = et_failed_key
es_apm_model = ls_landscape ).
"-----------------------------------
" Get DB node type, cluster type
" and cluster node type
"-----------------------------------
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_dbnodetypebasic
WHERE hec_apm_guid = @ls_landscape-hec_apm_guid
INTO TABLE @DATA(lt_db_node_type).
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_dbclustertypebasic
WHERE hec_apm_guid = @ls_landscape-hec_apm_guid
INTO TABLE @DATA(lt_db_cluster_type).
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_dbclustnodetypebasic
WHERE hec_apm_guid = @ls_landscape-hec_apm_guid
INTO TABLE @DATA(lt_db_cluster_node_type).
"-----------------------------------
" Get DB node type
"-----------------------------------
LOOP AT lt_db_server_inst ASSIGNING FIELD-SYMBOL(<fs_db_serv_inst>).
DATA(lt_node_type) = VALUE /hec1/t_apm_db_node_type( FOR wa_nt IN lt_db_node_type
WHERE ( hec_sol_tier_dsi_dbstype_guid = <fs_db_serv_inst>-hec_sol_tier_dsi_dbstype_guid AND
hec_sol_dbst_imty_inty_al_guid = <fs_db_serv_inst>-hec_sol_dbst_imty_inty_al_guid )
( CORRESPONDING #( wa_nt ) ) ).
" DB server instance: DB instance type = Container
" then 2 instance DB are needed: - DB Tenant
" - Container DB
"
" !!! Both instance DB have then the same Multitenancy Relation ID !!!
IF line_exists( lt_node_type[ hec_db_node_type_value = /hec1/if_config_constants=>gc_db_node_type-container ] ).
DATA(lv_multi_ten_id) = /rbp/cl_general_utilities=>get_new_guid22( ).
ENDIF.
WHILE lv_counter < <fs_db_serv_inst>-hec_db_quantity.
ADD 1 TO lv_counter.
TRY.
DATA(ls_node_type) = lt_node_type[ lv_counter ].
" Get DB server cluster type
DATA(ls_cluster_type) = lt_db_cluster_type[ hec_sol_tier_dsi_dbstype_guid = <fs_db_serv_inst>-hec_sol_tier_dsi_dbstype_guid
hec_sol_dbst_alloc_nodety_guid = ls_node_type-hec_sol_dbst_alloc_nodety_guid
hec_db_node_type_guid = ls_node_type-hec_db_node_type_guid
hec_db_cluster_type_value = /hec1/if_config_constants=>gc_db_clust_node-none
hec_clu_support_stat_value = '02' ].
" Get DB server cluster node type
DATA(ls_cluster_node_type) = lt_db_cluster_node_type[ hec_dbst_nodety_clust_ty_guid = ls_cluster_type-hec_dbst_nodety_clust_ty_guid
hec_db_clust_node_type_value = /hec1/if_config_constants=>gc_db_clust_node_type-master ].
CATCH cx_sy_itab_line_not_found.
ENDTRY.
DATA(lr_instance_db) = NEW /hec1/s_data_db_inst_cs( parent_key = <fs_db_serv_inst>-key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_db_serv_inst>-hec_node_solution
hec_node_tier = <fs_db_serv_inst>-hec_node_tier
hec_node_db_serv_inst = <fs_db_serv_inst>-hec_node_db_serv_inst
hec_node_db_inst = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = ls_landscape-hec_confid
hec_comp_config_version = ls_landscape-hec_conf_version
inh = <fs_db_serv_inst>-inh
hec_sol_tier_dsi_dbstype_guid = <fs_db_serv_inst>-hec_sol_tier_dsi_dbstype_guid
hec_db_srv_type_guid = <fs_db_serv_inst>-hec_db_srv_type_guid
hec_db_srv_type_value = <fs_db_serv_inst>-hec_db_srv_type_value
hec_server_required = <fs_db_serv_inst>-hec_server_required
hec_effort_required = <fs_db_serv_inst>-hec_effort_required
hec_backup_relev_value = <fs_db_serv_inst>-hec_backup_relev_value
hec_backup_relev_descr = <fs_db_serv_inst>-hec_backup_relev_descr
hec_db_impl_type_value = <fs_db_serv_inst>-hec_db_impl_type_value
hec_db_inst_type_value = <fs_db_serv_inst>-hec_db_inst_type_value
hec_apm_guid = ls_landscape-hec_apm_guid
hec_apm_descr = ls_landscape-hec_apm_descr
hec_sol_dbst_alloc_nodety_guid = ls_node_type-hec_sol_dbst_alloc_nodety_guid
hec_db_node_type_guid = ls_node_type-hec_db_node_type_guid
hec_db_node_type_value = ls_node_type-hec_db_node_type_value
hec_db_node_type_descr = ls_node_type-hec_db_node_type_descr
hec_multi_tenant_rel_guid = lv_multi_ten_id
hec_dbst_nodety_clust_ty_guid = ls_cluster_type-hec_dbst_nodety_clust_ty_guid
hec_db_cluster_type_guid = ls_cluster_type-hec_db_cluster_type_guid
hec_db_cluster_type_value = ls_cluster_type-hec_db_cluster_type_value
hec_db_cluster_type_descr = ls_cluster_type-hec_db_cluster_type_descr
hec_init_clu_supp_stat_value = ls_cluster_type-hec_clu_support_stat_value
hec_init_clu_supp_stat_descr = ls_cluster_type-hec_clu_support_stat_descr
hec_clu_support_stat_value = ls_cluster_type-hec_clu_support_stat_value
hec_clu_support_stat_descr = ls_cluster_type-hec_clu_support_stat_descr
hec_db_master_node_qty = 1
hec_db_master_node_lower_qty = ls_cluster_node_type-hec_db_node_limit_low
hec_db_master_node_limit_qty = ls_cluster_node_type-hec_db_node_limit_high
hec_row_selectable = abap_true
hec_phase_fixed = COND #( WHEN ls_node_type-hec_db_node_type_value = /hec1/if_config_constants=>gc_db_node_type-container
OR ls_node_type-hec_db_node_type_value = /hec1/if_config_constants=>gc_db_node_type-single
THEN abap_true
ELSE abap_false )
hec_phase_guid = COND #( WHEN ls_node_type-hec_db_node_type_value <> /hec1/if_config_constants=>gc_db_node_type-container
OR <fs_db_serv_inst>-hec_db_allocation_value <> /hec1/if_config_constants=>gc_db_allocation-separate_db
THEN <fs_db_serv_inst>-hec_phase_guid )
hec_phase_assign_allowed = COND #( WHEN ls_node_type-hec_db_node_type_value = /hec1/if_config_constants=>gc_db_node_type-container
OR ls_node_type-hec_db_node_type_value = /hec1/if_config_constants=>gc_db_node_type-single
THEN abap_false
ELSE abap_true )
hec_tree_descr = |: { ls_node_type-hec_db_node_type_descr }|
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_instance_db->crea_date_time.
INSERT VALUE #( data = lr_instance_db
node = /hec1/if_configuration_c=>sc_node-instance_db
source_node = /hec1/if_configuration_c=>sc_node-db_server_instance
association = /hec1/if_configuration_c=>sc_association-db_server_instance-instance_db
source_key = <fs_db_serv_inst>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_instance_db->key ) INTO TABLE lt_modification.
CLEAR: ls_node_type,
ls_cluster_type,
ls_cluster_node_type.
ENDWHILE.
CLEAR: lv_multi_ten_id,
lv_counter,
lt_node_type.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_man_serv_baseline.
DATA: lt_modification TYPE /bobf/t_frw_modification,
lt_landscape TYPE /hec1/t_config_root_ct,
lt_phase TYPE /hec1/t_data_phase_ct,
lt_root TYPE /hec1/t_config_root_ct.
" This is triggered from landscape node(root)
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_landscape ).
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-root-phase
IMPORTING et_data = lt_phase ).
LOOP AT lt_landscape ASSIGNING FIELD-SYMBOL(<fs_landscape>).
TRY.
DATA(ls_phase) = lt_phase[ parent_key = <fs_landscape>-root_key ].
CATCH cx_sy_itab_line_not_found.
ENDTRY.
DATA(lv_key) = /bopf/cl_frw_factory=>get_new_key( ).
"-----------------------------------
" Set managed service baseline data
"-----------------------------------
DATA(lr_man_serv_base) = NEW /hec1/s_data_man_serv_basel_cs( BASE CORRESPONDING #( <fs_landscape> )
parent_key = <fs_landscape>-key
key = lv_key
hec_node_man_service_bl = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = <fs_landscape>-hec_confid
hec_comp_config_version = <fs_landscape>-hec_conf_version
hec_phase_guid = ls_phase-hec_node_phase
hec_phase_assign_allowed = abap_false
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_man_serv_base->crea_date_time.
INSERT VALUE #( data = lr_man_serv_base
node = /hec1/if_configuration_c=>sc_node-managed_service_baseline
source_node = /hec1/if_configuration_c=>sc_node-root
association = /hec1/if_configuration_c=>sc_association-root-managed_service_baseline
source_key = <fs_landscape>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lv_key ) INTO TABLE lt_modification.
CLEAR lv_key.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_material.
" input node is the tier
" this method checks the selected materials against the existing materials and creates the delta
DATA: lt_tier TYPE /hec1/t_data_tier_ct,
lt_solution TYPE /hec1/t_data_solution_ct,
lt_material TYPE /hec1/t_data_material_ct,
lt_parameter TYPE /hec1/t_act_create_material,
lt_act_param_delete TYPE /bobf/t_frw_node,
lt_modification TYPE /bobf/t_frw_modification.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO FIELD-SYMBOL(<fs_parameter>).
IF <fs_parameter> IS INITIAL.
RETURN. ">>>>
ENDIF.
lt_parameter = <fs_parameter>.
"-----------------------------------
" Get APM model GUID and description
" delivery unit and data centers
"-----------------------------------
/hec1/cl_config_helper=>get_general_data( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING er_landscape = DATA(lr_landscape)
et_failed_key = et_failed_key ).
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = VALUE #( FOR param IN lt_parameter
( key = param-parent_key ) )
IMPORTING et_data = lt_tier ).
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = VALUE #( FOR param IN lt_parameter
( key = param-parent_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-tier-material
IMPORTING et_data = lt_material ).
" Get Material List
DATA(lt_material_list) = /hec1/cl_config_sw_helper=>get_instance( )->/hec1/if_config_sw_helper~get_material_list( ).
LOOP AT lt_parameter ASSIGNING FIELD-SYMBOL(<fs_parameter_line>).
TRY.
DATA(ls_tier) = lt_tier[ key = <fs_parameter_line>-parent_key ].
CATCH cx_sy_itab_line_not_found.
ENDTRY.
" Create materials in material list
LOOP AT lt_material_list ASSIGNING FIELD-SYMBOL(<fs_material_list>)
WHERE hec_node_solution = ls_tier-hec_node_solution
AND hec_mat_selection = abap_true.
" **************
" add material
" **************
" check if material exists
IF NOT line_exists( lt_material[ hec_node_solution = <fs_material_list>-hec_node_solution
hec_material_guid = <fs_material_list>-hec_material_guid ] ).
DATA(lr_material_new) = NEW /hec1/s_data_material_cs( BASE CORRESPONDING #( <fs_material_list> )
parent_key = ls_tier-key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = ls_tier-hec_node_solution
hec_node_tier = ls_tier-hec_node_tier
hec_node_material = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = lr_landscape->hec_confid
hec_comp_config_version = lr_landscape->hec_conf_version
hec_row_selectable = abap_true
hec_apm_guid = ls_tier-hec_apm_guid
hec_apm_descr = ls_tier-hec_apm_descr
hec_phase_guid = ls_tier-hec_phase_guid
hec_phase_fixed = COND #( WHEN <fs_material_list>-hec_material_rel_value = /hec1/if_config_constants=>gc_material_rel-mandatory "'01'
THEN abap_true
ELSE abap_false )
hec_phase_assign_allowed = COND #( WHEN <fs_material_list>-hec_material_rel_value = /hec1/if_config_constants=>gc_material_rel-mandatory "'01'
THEN abap_false
ELSE abap_true )
hec_phase_changed = abap_true
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_material_new->crea_date_time.
INSERT VALUE #( data = lr_material_new
node = /hec1/if_configuration_c=>sc_node-material
source_node = /hec1/if_configuration_c=>sc_node-tier
association = /hec1/if_configuration_c=>sc_association-tier-material
source_key = ls_tier-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_material_new->key )
INTO TABLE lt_modification.
ENDIF.
ENDLOOP. "lt_material_list
ENDLOOP. "lt_parameter
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
"-----------------------------------
" Set Delete action to GENERAL
"-----------------------------------
IF lt_act_param_delete IS NOT INITIAL.
me->mr_act_param_delete = NEW /bobf/t_frw_node( lt_act_param_delete ).
/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-delete_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_delete ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_phase.
DATA: lt_modification TYPE /bobf/t_frw_modification,
lt_root TYPE /hec1/t_config_root_ct.
"this is triggered from root
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_root ).
LOOP AT lt_root ASSIGNING FIELD-SYMBOL(<fs_root>).
"-----------------------------------
" Set default phase data
"-----------------------------------
INSERT VALUE #( data = NEW /hec1/s_data_phase_cs( hec_node_parent_phase = /hec1/cl_config_helper=>convert_key_2_uuid_c22( <fs_root>-key )
hec_node_phase = /rbp/cl_general_utilities=>get_new_guid22( )
hec_default_phase = abap_true
hec_phase_descr = |Default|
hec_phase_tree_descr = |Default|
hec_duration_unit = COND #( WHEN <fs_root>-hec_ls_contract_dur_unit_value IS INITIAL
THEN '02'
ELSE <fs_root>-hec_ls_contract_dur_unit_value ) ) "Months
* "ITSHECS4HANA-1799
* hec_phase_start_date = iv_contract_start_date
* hec_phase_end_date = iv_contract_end_date
node = /hec1/if_configuration_c=>sc_node-phase
source_node = /hec1/if_configuration_c=>sc_node-root
association = /hec1/if_configuration_c=>sc_association-root-phase
source_key = <fs_root>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = /bopf/cl_frw_factory=>get_new_key( ) )
INTO TABLE lt_modification.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
CLEAR: lt_modification.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_server_instance.
DATA: lt_tier TYPE /hec1/t_data_tier_ct,
lt_tier_all TYPE /hec1/t_data_tier_ct,
lt_root_key TYPE /bobf/t_frw_key,
lt_landscape TYPE /hec1/t_data_landscape_ct,
lt_solution TYPE /hec1/t_data_solution_ct,
lt_db_server_inst TYPE /hec1/t_data_db_server_inst_ct,
lt_app_server_inst TYPE /hec1/t_data_app_serv_inst_ct,
lt_db_serv_inst_mod TYPE /bobf/t_frw_modification,
lt_app_serv_inst_mod TYPE /bobf/t_frw_modification,
lt_dd07v TYPE dd07v_tab,
ls_landscape TYPE /hec1/s_config_root_cs.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_create_serv_inst.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_tier ).
" get related tier
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-tier-to_parent
IMPORTING et_target_key = DATA(lt_solution_key) ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-solution
it_key = lt_solution_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-solution-tier
IMPORTING et_data = lt_tier_all ).
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-tier-db_server_instance
IMPORTING et_data = lt_db_server_inst ).
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-tier-app_server_instance
IMPORTING et_data = lt_app_server_inst ).
"-----------------------------------
" Get APM model GUID and description
"-----------------------------------
/hec1/cl_config_helper=>get_apm_model( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING et_failed_key = et_failed_key
es_apm_model = ls_landscape ).
"-----------------------------------
" Get DB server instance data
"-----------------------------------
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_dbservinstancenobasic
WHERE hec_apm_guid = @ls_landscape-hec_apm_guid
INTO TABLE @DATA(lt_db_serv_inst_no).
"-----------------------------------
" Get DB server type
"-----------------------------------
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_dbservertypebasic
WHERE hec_apm_guid = @ls_landscape-hec_apm_guid
INTO TABLE @DATA(lt_db_server_type).
"-----------------------------------
" Get DB server operating system
"-----------------------------------
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_dboperssystembasic
WHERE hec_apm_guid = @ls_landscape-hec_apm_guid
INTO TABLE @DATA(lt_db_operating_sys).
"-----------------------------------
" Get DB server implementation type
"-----------------------------------
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_dbimplementtypebasic
WHERE hec_apm_guid = @ls_landscape-hec_apm_guid
INTO TABLE @DATA(lt_db_impl_type).
"-----------------------------------
" Get DB server instance type
"-----------------------------------
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_dbinstancetypebasic
WHERE hec_apm_guid = @ls_landscape-hec_apm_guid
INTO TABLE @DATA(lt_db_inst_type).
"-----------------------------------
" Get DB server allocation
"-----------------------------------
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_dballocationbasic
WHERE hec_apm_guid = @ls_landscape-hec_apm_guid
INTO TABLE @DATA(lt_db_allocation).
"-----------------------------------
" Get App server instance data
"-----------------------------------
SELECT * "#EC CI_ALL_FIELDS_NEEDED
FROM /hec1/i_appservinstancenobasic
WHERE hec_apm_guid = @ls_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 = @ls_landscape-hec_apm_guid
INTO TABLE @DATA(lt_app_operating_sys).
"-----------------------------------
" " Get Server instance type domain
"-----------------------------------
CALL FUNCTION 'DDIF_DOMA_GET'
EXPORTING
name = '/HEC1/DOM_SRV_INST_TYPE'
langu = sy-langu
TABLES
dd07v_tab = lt_dd07v
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc <> 0.
RETURN. " >>>>>>>>>
ENDIF.
LOOP AT lt_tier ASSIGNING FIELD-SYMBOL(<fs_tier>).
ASSIGN <fs_act_param>[ key = <fs_tier>-key ] TO FIELD-SYMBOL(<fs_param>).
IF <fs_param> IS ASSIGNED.
"-----------------------------------
" Get default DB server instances
"-----------------------------------
DATA(lv_tabix) = 1.
DATA(lv_default_si) = abap_true.
IF <fs_param>-hec_default_server_inst = abap_true.
DATA(lt_db_server_inst_no) = VALUE /hec1/t_apm_db_serv_inst_no( FOR wa_dbpsi IN lt_db_serv_inst_no
WHERE ( hec_solution_guid = <fs_tier>-hec_solution_guid AND
hec_sol_tier_stack_guid = <fs_tier>-hec_sol_tier_stack_guid AND
hec_srv_inst_rel_value = /hec1/if_config_constants=>gc_relevance-mandatory )
( wa_dbpsi ) ).
ELSE.
CLEAR lv_default_si.
ENDIF. " IF <fs_param>-hec_default_server_inst = abap_true.
"-----------------------------------
" " Get Server instance type domain
"-----------------------------------
TRY.
DATA(lv_serv_inst_type_descr) = lt_dd07v[ domvalue_l = /hec1/if_config_constants=>gc_srv_instance_type-db_server ]-ddtext.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
" ***************************************************************************
" DB server instance logic
" ***************************************************************************
DO <fs_param>-hec_db_srv_qty TIMES.
CASE lv_default_si.
"-----------------------------------
" Default DB server instance
"-----------------------------------
WHEN abap_true.
TRY.
DATA(ls_db_serv_inst_no) = lt_db_server_inst_no[ lv_tabix ].
DATA(lt_server_type) = VALUE /hec1/t_apm_db_server_type( FOR wa_type IN lt_db_server_type
WHERE ( hec_sol_tier_stack_si_guid = ls_db_serv_inst_no-hec_sol_tier_stack_si_guid )
( wa_type ) ).
IF <fs_tier>-hec_related_stack = abap_true.
LOOP AT lt_tier_all INTO DATA(ls_related_tier)
WHERE hec_related_stack_guid = <fs_tier>-hec_related_stack_guid
AND key <> <fs_tier>-key.
" there should only be one entry which is now written into <fs_related_tier>
ENDLOOP.
ENDIF.
IF lines( lt_server_type ) = 1.
DATA(ls_db_server_type) = lt_server_type[ 1 ].
"-----------------------------------
" If there is only one operating
" system, then it should be
" preselected
"-----------------------------------
DATA(lt_operating_sys) = VALUE /hec1/t_apm_db_operating_sys( FOR wa_dbos IN lt_db_operating_sys
WHERE ( hec_sol_tier_dsi_dbstype_guid = ls_db_server_type-hec_sol_tier_dsi_dbstype_guid )
( CORRESPONDING #( wa_dbos ) ) ).
IF lines( lt_operating_sys ) = 1.
TRY.
DATA(ls_db_operating_sys) = lt_operating_sys[ 1 ].
CATCH cx_sy_itab_line_not_found.
ENDTRY.
"-----------------------------------
" If there are multiple operating
" systems possible and Linux is
" between them - set it preselected
"-----------------------------------
ELSEIF lines( lt_operating_sys ) > 1 AND line_exists( lt_operating_sys[ hec_operating_sys_value = /hec1/cl_rep_config_data=>c_os_linux ] ).
TRY.
ls_db_operating_sys = lt_operating_sys[ hec_operating_sys_value = /hec1/cl_rep_config_data=>c_os_linux ].
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF lines( lt_db_operating_sys ) = 1.
IF ls_db_operating_sys IS NOT INITIAL.
DATA(lt_impl_type) = VALUE /hec1/t_apm_db_implement_type( FOR wa_imp IN lt_db_impl_type
WHERE ( hec_sol_tier_dsi_dbstype_guid = ls_db_server_type-hec_sol_tier_dsi_dbstype_guid )
( CORRESPONDING #( wa_imp ) ) ).
IF lines( lt_impl_type ) = 1.
TRY.
DATA(ls_impl_type) = lt_impl_type[ 1 ].
DATA(lt_inst_type) = VALUE /hec1/t_apm_db_instance_type( FOR wa_ins IN lt_db_inst_type
WHERE ( hec_sol_tier_dsi_dbstype_guid = ls_impl_type-hec_sol_tier_dsi_dbstype_guid AND
hec_sol_dbst_impltype_guid = ls_impl_type-hec_sol_dbst_impltype_guid )
( CORRESPONDING #( wa_ins ) ) ).
IF lines( lt_inst_type ) = 1.
TRY.
DATA(ls_inst_type) = lt_inst_type[ 1 ].
DATA(lt_alloc) = VALUE /hec1/t_apm_db_allocation( FOR wa_alloc IN lt_db_allocation
WHERE ( hec_sol_tier_dsi_dbstype_guid = ls_inst_type-hec_sol_tier_dsi_dbstype_guid AND
hec_sol_dbst_impty_instty_guid = ls_inst_type-hec_sol_dbst_impty_instty_guid )
( CORRESPONDING #( wa_alloc ) ) ).
IF lines( lt_alloc ) = 1.
DATA(ls_allocation) = lt_alloc[ 1 ].
ENDIF.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF lines( lt_impl_type ) = 1.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. " IF lines( lt_impl_type ) = 1.
ENDIF. " IF ls_db_operating_sys IS NOT INITIAL.
ENDIF. " IF lines(lt_server_type) = 1.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
DATA(lr_db_server_inst) = NEW /hec1/s_data_db_server_inst_cs( parent_key = <fs_tier>-key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_tier>-hec_node_solution
hec_node_tier = <fs_tier>-hec_node_tier
hec_node_db_serv_inst = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = ls_landscape-hec_confid
hec_comp_config_version = ls_landscape-hec_conf_version
hec_solution_guid = <fs_tier>-hec_solution_guid
hec_tier_cat_value = <fs_tier>-hec_tier_cat_value
hec_tier_stack_guid = <fs_tier>-hec_sol_tier_stack_guid
hec_tier_stack_value = <fs_tier>-hec_sol_tier_stack_value
hec_tier_datacenter_guid = <fs_tier>-hec_tier_datacenter_guid
hec_tier_is_dr_node = <fs_tier>-hec_tier_is_dr_node
hec_disaster_rec_option = <fs_tier>-hec_disaster_rec_option
hec_dr_oper_mode_value = <fs_tier>-hec_dr_oper_mode_value
hec_dr_oper_mode_descr = <fs_tier>-hec_dr_oper_mode_descr
hec_apm_guid = ls_landscape-hec_apm_guid
hec_apm_descr = ls_landscape-hec_apm_descr
hec_default_db_server_inst = abap_true
hec_sol_tier_dsi_dbstype_guid = ls_db_server_type-hec_sol_tier_dsi_dbstype_guid
hec_db_srv_type_guid = ls_db_server_type-hec_db_srv_type_guid
hec_db_srv_type_value = ls_db_server_type-hec_db_srv_type_value
hec_db_srv_type_descr = ls_db_server_type-hec_db_srv_type_descr
hec_calc_setup_dr = ls_db_server_type-hec_calc_setup_dr
hec_init_ty_support_stat_value = ls_db_server_type-hec_ty_support_stat_value
hec_init_ty_support_stat_descr = ls_db_server_type-hec_ty_support_stat_descr
hec_ty_support_stat_value = ls_db_server_type-hec_ty_support_stat_value
hec_ty_support_stat_descr = ls_db_server_type-hec_ty_support_stat_descr
hec_srv_inst_type_descr = lv_serv_inst_type_descr
hec_sol_tier_stack_si_guid = ls_db_serv_inst_no-hec_sol_tier_stack_si_guid
hec_sol_tier_dsi_descr = ls_db_serv_inst_no-hec_sol_tier_dsi_descr
hec_srv_inst_rel_value = ls_db_serv_inst_no-hec_srv_inst_rel_value
hec_srv_inst_rel_descr = ls_db_serv_inst_no-hec_srv_inst_rel_descr
hec_main_instance = ls_db_serv_inst_no-hec_main_instance
hec_server_required = ls_db_serv_inst_no-hec_server_required
hec_effort_required = ls_db_serv_inst_no-hec_effort_required
hec_backup_relev_value = SWITCH #( <fs_tier>-hec_tier_is_dr_node
WHEN abap_false
THEN ls_db_serv_inst_no-hec_backup_relevance
ELSE '03' )
hec_backup_relev_descr = SWITCH #( <fs_tier>-hec_tier_is_dr_node
WHEN abap_false
THEN ls_db_serv_inst_no-hec_backup_relev_descr
ELSE 'None' )
hec_data_op_req_value = ls_db_serv_inst_no-hec_data_op_req_value
hec_data_op_req_descr = ls_db_serv_inst_no-hec_data_op_req_descr
hec_sol_dbst_oper_sys_guid = ls_db_operating_sys-hec_sol_dbst_oper_sys_guid
hec_operating_sys_guid = ls_db_operating_sys-hec_operating_sys_guid
hec_operating_sys_value = ls_db_operating_sys-hec_operating_sys_value
hec_operating_sys_descr = ls_db_operating_sys-hec_operating_sys_descr
hec_init_os_support_stat_value = ls_db_operating_sys-hec_os_support_stat_value
hec_init_os_support_stat_descr = ls_db_operating_sys-hec_os_support_stat_descr
hec_os_support_stat_value = ls_db_operating_sys-hec_os_support_stat_value
hec_os_support_stat_descr = ls_db_operating_sys-hec_os_support_stat_descr
hec_sol_dbst_impltype_guid = ls_impl_type-hec_sol_dbst_impltype_guid
hec_db_impl_type_guid = ls_impl_type-hec_db_impl_type_guid
hec_db_impl_type_value = ls_impl_type-hec_db_impl_type_value
hec_db_impl_type_descr = ls_impl_type-hec_db_impl_type_descr
hec_init_imp_supp_stat_value = ls_impl_type-hec_imp_support_stat_value
hec_init_imp_supp_stat_descr = ls_impl_type-hec_imp_support_stat_descr
hec_imp_support_stat_value = ls_impl_type-hec_imp_support_stat_value
hec_imp_support_stat_descr = ls_impl_type-hec_imp_support_stat_descr
hec_sol_dbst_impty_instty_guid = ls_inst_type-hec_sol_dbst_impty_instty_guid
hec_db_inst_type_guid = ls_inst_type-hec_db_inst_type_guid
hec_db_inst_type_value = ls_inst_type-hec_db_inst_type_value
hec_db_inst_type_descr = ls_inst_type-hec_db_inst_type_descr
hec_init_inst_supp_stat_value = ls_inst_type-hec_inst_support_stat_value
hec_init_inst_supp_stat_descr = ls_inst_type-hec_inst_support_stat_descr
hec_inst_support_stat_value = ls_inst_type-hec_inst_support_stat_value
hec_inst_support_stat_descr = ls_inst_type-hec_inst_support_stat_descr
hec_sol_dbst_imty_inty_al_guid = ls_allocation-hec_sol_dbst_imty_inty_al_guid
hec_db_allocation_guid = ls_allocation-hec_db_allocation_guid
hec_db_allocation_value = ls_allocation-hec_db_allocation_value
hec_db_allocation_descr = ls_allocation-hec_db_allocation_descr
hec_db_quantity = ls_allocation-hec_db_quantity
hec_init_alloc_supp_stat_value = ls_allocation-hec_alloc_support_stat_value
hec_init_alloc_supp_stat_descr = ls_allocation-hec_alloc_support_stat_descr
hec_alloc_support_stat_value = ls_allocation-hec_alloc_support_stat_value
hec_alloc_support_stat_descr = ls_allocation-hec_alloc_support_stat_descr
hec_db_tier_guid = SWITCH #( ls_allocation-hec_db_allocation_value
WHEN /hec1/if_config_constants=>gc_db_allocation-internal
THEN <fs_tier>-hec_node_tier
WHEN /hec1/if_config_constants=>gc_db_allocation-related_stack
THEN ls_related_tier-hec_node_tier )
hec_phase_guid = <fs_tier>-hec_phase_guid
hec_phase_fixed = abap_true
hec_phase_assign_allowed = abap_false "the default db server instance always gets the tier's phase
hec_tree_descr = ls_db_server_type-hec_db_srv_type_descr
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_db_server_inst->crea_date_time.
"-----------------------------------
" Non default DB server instance
"-----------------------------------
WHEN abap_false.
lr_db_server_inst = NEW /hec1/s_data_db_server_inst_cs( parent_key = <fs_tier>-key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_tier>-hec_node_solution
hec_node_tier = <fs_tier>-hec_node_tier
hec_node_db_serv_inst = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = ls_landscape-hec_confid
hec_comp_config_version = ls_landscape-hec_conf_version
hec_solution_guid = <fs_tier>-hec_solution_guid
hec_tier_cat_value = <fs_tier>-hec_tier_cat_value
hec_tier_stack_guid = <fs_tier>-hec_sol_tier_stack_guid
hec_tier_stack_value = <fs_tier>-hec_sol_tier_stack_value
hec_tier_datacenter_guid = <fs_tier>-hec_tier_datacenter_guid
hec_tier_is_dr_node = <fs_tier>-hec_tier_is_dr_node
hec_disaster_rec_option = <fs_tier>-hec_disaster_rec_option
hec_dr_oper_mode_value = <fs_tier>-hec_dr_oper_mode_value
hec_dr_oper_mode_descr = <fs_tier>-hec_dr_oper_mode_descr
hec_apm_guid = ls_landscape-hec_apm_guid
hec_apm_descr = ls_landscape-hec_apm_descr
hec_srv_inst_type_descr = lv_serv_inst_type_descr
hec_srv_inst_rel_value = SWITCH #( <fs_tier>-hec_tier_is_dr_node
WHEN abap_false
THEN '02'
ELSE '03' )
hec_srv_inst_rel_descr = SWITCH #( <fs_tier>-hec_tier_is_dr_node
WHEN abap_false
THEN 'Optional'
ELSE 'None' )
hec_db_srv_type_guid = ls_db_server_type-hec_db_srv_type_guid
hec_db_srv_type_value = ls_db_server_type-hec_db_srv_type_value
hec_db_srv_type_descr = ls_db_server_type-hec_db_srv_type_descr
hec_phase_guid = <fs_tier>-hec_phase_guid
hec_phase_fixed = abap_true
hec_phase_assign_allowed = COND #( WHEN <fs_tier>-hec_phase_guid IS NOT INITIAL
THEN abap_true
ELSE abap_false ) "if the parent is not yet assigned, the phase cannot be assigned yet
hec_tree_descr = ls_db_server_type-hec_db_srv_type_descr
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_db_server_inst->crea_date_time.
ENDCASE.
INSERT VALUE #( data = lr_db_server_inst
node = /hec1/if_configuration_c=>sc_node-db_server_instance
source_node = /hec1/if_configuration_c=>sc_node-tier
association = /hec1/if_configuration_c=>sc_association-tier-db_server_instance
source_key = <fs_tier>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_db_server_inst->key ) INTO TABLE lt_db_serv_inst_mod.
CLEAR: ls_related_tier,
ls_db_serv_inst_no,
ls_db_server_type,
ls_db_operating_sys,
ls_impl_type,
ls_inst_type,
ls_allocation,
lt_server_type,
lt_operating_sys,
lt_impl_type,
lt_inst_type,
lt_alloc,
lr_db_server_inst.
ENDDO. " DO <fs_param>-hec_db_srv_qty TIMES.
" ***************************************************************************
" App server instance logic
" ***************************************************************************
lv_default_si = abap_true.
lv_tabix = 1.
"-----------------------------------
" Get default App server instances
"-----------------------------------
IF <fs_param>-hec_default_server_inst = abap_true.
DATA(lt_app_server_inst_no) = VALUE /hec1/t_apm_app_server_inst_no( FOR wa_appsi IN lt_app_serv_inst_no
WHERE ( hec_solution_guid = <fs_tier>-hec_solution_guid AND
hec_sol_tier_stack_guid = <fs_tier>-hec_sol_tier_stack_guid AND
hec_srv_inst_rel_value = /hec1/if_config_constants=>gc_relevance-mandatory )
( wa_appsi ) ).
ELSE.
CLEAR lv_default_si.
ENDIF. " IF <fs_param>-hec_default_server_inst = abap_true.
"-----------------------------------
" " Get Server instance type domain
"-----------------------------------
CLEAR lv_serv_inst_type_descr.
TRY.
lv_serv_inst_type_descr = lt_dd07v[ domvalue_l = /hec1/if_config_constants=>gc_srv_instance_type-app_server ]-ddtext.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
"-----------------------------------
" Fill App server instance data
"-----------------------------------
" Get App server cluster type
SELECT SINGLE *
FROM /hec1/i_appclustertypebasic
WHERE hec_apm_guid = @ls_landscape-hec_apm_guid AND
hec_solution_guid = @<fs_tier>-hec_solution_guid AND
hec_sol_tier_stack_value = @<fs_tier>-hec_sol_tier_stack_value AND
hec_app_cluster_type_value = @/hec1/if_config_constants=>gc_app_clust_node-none AND
hec_clu_support_stat_value = '02'
INTO @DATA(ls_app_clust_type).
DO <fs_param>-hec_app_srv_qty TIMES.
CASE lv_default_si.
"-----------------------------------
" Default app server instance
"-----------------------------------
WHEN abap_true.
TRY.
DATA(ls_app_serv_inst_no) = lt_app_server_inst_no[ lv_tabix ].
CATCH cx_sy_itab_line_not_found.
ENDTRY.
DATA(lt_app_oper_system) = VALUE /hec1/t_apm_app_operating_sys( FOR wa_appos IN lt_app_operating_sys
WHERE ( hec_sol_tier_stack_si_guid = ls_app_serv_inst_no-hec_sol_tier_stack_si_guid )
( CORRESPONDING #( wa_appos ) ) ).
IF lines( lt_app_oper_system ) = 1.
TRY.
DATA(ls_app_operating_sys) = lt_app_oper_system[ 1 ].
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ELSEIF lines( lt_app_oper_system ) > 1.
READ TABLE lt_app_oper_system WITH KEY hec_operating_sys_value = /hec1/cl_rep_config_data=>c_os_linux INTO ls_app_operating_sys.
ENDIF.
DATA(lr_app_server_inst) = NEW /hec1/s_data_app_serv_inst_cs( parent_key = <fs_tier>-key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_tier>-hec_node_solution
hec_node_tier = <fs_tier>-hec_node_tier
hec_node_app_serv_inst = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = ls_landscape-hec_confid
hec_comp_config_version = ls_landscape-hec_conf_version
hec_solution_guid = <fs_tier>-hec_solution_guid
hec_tier_cat_value = <fs_tier>-hec_tier_cat_value
hec_sol_tier_stack_guid = <fs_tier>-hec_sol_tier_stack_guid
hec_tier_stack_guid = <fs_tier>-hec_sol_tier_stack_guid
hec_tier_stack_value = <fs_tier>-hec_sol_tier_stack_value
hec_tier_datacenter_guid = <fs_tier>-hec_tier_datacenter_guid
hec_tier_is_dr_node = <fs_tier>-hec_tier_is_dr_node
hec_disaster_rec_option = <fs_tier>-hec_disaster_rec_option
hec_dr_oper_mode_value = <fs_tier>-hec_dr_oper_mode_value
hec_dr_oper_mode_descr = <fs_tier>-hec_dr_oper_mode_descr
hec_apm_guid = ls_landscape-hec_apm_guid
hec_apm_descr = ls_landscape-hec_apm_descr
hec_srv_inst_type_descr = lv_serv_inst_type_descr
hec_default_app_server_inst = lv_default_si
hec_app_master_node_qty = 1
hec_sol_tier_stack_si_guid = ls_app_serv_inst_no-hec_sol_tier_stack_si_guid
hec_sol_tier_asi_descr = ls_app_serv_inst_no-hec_sol_tier_asi_descr
hec_srv_inst_rel_value = ls_app_serv_inst_no-hec_srv_inst_rel_value
hec_srv_inst_rel_descr = ls_app_serv_inst_no-hec_srv_inst_rel_descr
hec_main_instance = ls_app_serv_inst_no-hec_main_instance
hec_server_required = ls_app_serv_inst_no-hec_server_required
hec_effort_required = ls_app_serv_inst_no-hec_effort_required
hec_backup_relev_value = SWITCH #( <fs_tier>-hec_tier_is_dr_node
WHEN abap_false
THEN ls_app_serv_inst_no-hec_backup_relevance
ELSE '03' )
hec_backup_relev_descr = SWITCH #( <fs_tier>-hec_tier_is_dr_node
WHEN abap_false
THEN ls_app_serv_inst_no-hec_backup_relev_descr
ELSE 'None' )
hec_sol_apsi_oper_sys_guid = ls_app_operating_sys-hec_sol_apsi_oper_sys_guid
hec_operating_sys_guid = ls_app_operating_sys-hec_operating_sys_guid
hec_operating_sys_value = ls_app_operating_sys-hec_operating_sys_value
hec_operating_sys_descr = ls_app_operating_sys-hec_operating_sys_descr
hec_os_support_stat_value = ls_app_operating_sys-hec_os_support_stat_value
hec_os_support_stat_descr = ls_app_operating_sys-hec_os_support_stat_descr
hec_app_serv_type_clust_guid = ls_app_clust_type-hec_app_serv_type_clust_guid
hec_sol_apsi_clusttyp_guid = ls_app_clust_type-hec_sol_apsi_clusttyp_guid
hec_app_cluster_type_guid = ls_app_clust_type-hec_app_serv_type_clust_guid
hec_app_cluster_type_value = ls_app_clust_type-hec_app_cluster_type_value
hec_app_cluster_type_descr = ls_app_clust_type-hec_app_cluster_type_descr
hec_clu_support_stat_value = ls_app_clust_type-hec_clu_support_stat_value
hec_clu_support_stat_descr = ls_app_clust_type-hec_clu_support_stat_descr
hec_instance_status = 'I'
hec_phase_guid = <fs_tier>-hec_phase_guid
hec_phase_fixed = abap_true
hec_phase_assign_allowed = abap_false "for the default server instance the phase is always inherited from the tier
hec_tree_descr = ls_app_serv_inst_no-hec_sol_tier_asi_descr
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_app_server_inst->crea_date_time.
"-----------------------------------
" Non default app server instance
"-----------------------------------
WHEN abap_false.
lr_app_server_inst = NEW /hec1/s_data_app_serv_inst_cs( parent_key = <fs_tier>-key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_tier>-hec_node_solution
hec_node_tier = <fs_tier>-hec_node_tier
hec_node_app_serv_inst = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = ls_landscape-hec_confid
hec_comp_config_version = ls_landscape-hec_conf_version
hec_solution_guid = <fs_tier>-hec_solution_guid
hec_tier_cat_value = <fs_tier>-hec_tier_cat_value
hec_sol_tier_stack_guid = <fs_tier>-hec_sol_tier_stack_guid
hec_tier_stack_guid = <fs_tier>-hec_sol_tier_stack_guid
hec_tier_stack_value = <fs_tier>-hec_sol_tier_stack_value
hec_tier_datacenter_guid = <fs_tier>-hec_tier_datacenter_guid
hec_tier_is_dr_node = <fs_tier>-hec_tier_is_dr_node
hec_disaster_rec_option = <fs_tier>-hec_disaster_rec_option
hec_dr_oper_mode_value = <fs_tier>-hec_dr_oper_mode_value
hec_dr_oper_mode_descr = <fs_tier>-hec_dr_oper_mode_descr
hec_apm_guid = ls_landscape-hec_apm_guid
hec_apm_descr = ls_landscape-hec_apm_descr
hec_srv_inst_type_descr = lv_serv_inst_type_descr
hec_srv_inst_rel_value = SWITCH #( <fs_tier>-hec_tier_is_dr_node
WHEN abap_false
THEN '02'
ELSE '03' )
hec_srv_inst_rel_descr = SWITCH #( <fs_tier>-hec_tier_is_dr_node
WHEN abap_false
THEN 'Optional'
ELSE 'None' )
hec_app_cluster_type_value = ls_app_clust_type-hec_app_cluster_type_value
hec_app_cluster_type_descr = ls_app_clust_type-hec_app_cluster_type_descr
hec_app_master_node_qty = 1
hec_instance_status = 'I'
hec_phase_guid = <fs_tier>-hec_phase_guid
hec_phase_fixed = abap_false
hec_phase_assign_allowed = COND #( WHEN <fs_tier>-hec_phase_guid IS NOT INITIAL
THEN abap_true
ELSE abap_false ) "for non-default app server instance, the phase can be changed if the tier has a phase assigned
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_app_server_inst->crea_date_time.
ENDCASE.
INSERT VALUE #( data = lr_app_server_inst
node = /hec1/if_configuration_c=>sc_node-app_server_instance
source_node = /hec1/if_configuration_c=>sc_node-tier
association = /hec1/if_configuration_c=>sc_association-tier-app_server_instance
source_key = <fs_tier>-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_app_server_inst->key ) INTO TABLE lt_app_serv_inst_mod.
CLEAR: ls_app_serv_inst_no,
ls_app_operating_sys,
ls_app_clust_type,
lt_app_oper_system,
lr_app_server_inst.
ADD 1 TO lv_tabix.
ENDDO.
ENDIF. " IF <fs_param> IS ASSIGNED.
CLEAR: lv_serv_inst_type_descr,
lt_db_server_inst,
lt_app_server_inst.
lv_tabix = 1.
ENDLOOP.
"-----------------------------------
" Create DB server instance
"-----------------------------------
IF lt_db_serv_inst_mod IS NOT INITIAL.
io_modify->do_modify( lt_db_serv_inst_mod ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
"-----------------------------------
" Create App server instance
"-----------------------------------
IF lt_app_serv_inst_mod IS NOT INITIAL.
io_modify->do_modify( lt_app_serv_inst_mod ).
CLEAR: lo_message,
lo_change.
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = lo_message
eo_change = lo_change ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_software_item.
" input node is the material
DATA: ls_landscape TYPE /hec1/s_config_root_cs,
lt_tier TYPE /hec1/t_data_tier_ct,
lt_solution TYPE /hec1/t_data_solution_ct,
lt_material TYPE /hec1/t_data_material_ct,
lt_sw_item TYPE /hec1/t_data_sw_item_ct,
lt_parameter TYPE /hec1/t_act_create_sw_item,
lt_act_param_delete TYPE /bobf/t_frw_node,
lt_modification TYPE /bobf/t_frw_modification.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO FIELD-SYMBOL(<fs_parameter>).
IF <fs_parameter> IS INITIAL.
RETURN. ">>>>
ENDIF.
lt_parameter = <fs_parameter>.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = VALUE #( FOR param IN lt_parameter
( key = param-parent_key ) )
IMPORTING et_data = lt_material ).
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = VALUE #( FOR param IN lt_parameter
( key = param-parent_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-material-software_item
IMPORTING et_data = lt_sw_item ).
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = VALUE #( FOR param IN lt_parameter
( key = param-parent_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-material-to_parent
IMPORTING et_data = lt_tier ).
"-----------------------------------
" Get APM model GUID and description
"-----------------------------------
/hec1/cl_config_helper=>get_apm_model( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING et_failed_key = et_failed_key
es_apm_model = ls_landscape ).
" Get Software Item List
DATA(lt_sw_item_list) = /hec1/cl_config_sw_helper=>get_instance( )->/hec1/if_config_sw_helper~get_software_item_list( ).
LOOP AT lt_parameter ASSIGNING FIELD-SYMBOL(<fs_parameter_line>).
TRY.
DATA(ls_material) = lt_material[ key = <fs_parameter_line>-parent_key ].
DATA(ls_tier) = lt_tier[ key = ls_material-parent_key ].
CATCH cx_sy_itab_line_not_found.
ENDTRY.
" add all materials
LOOP AT lt_sw_item_list ASSIGNING FIELD-SYMBOL(<fs_sw_item_list>) "#EC CI_SORTSEQ
WHERE hec_node_solution = ls_material-hec_node_solution AND "#EC CI_SORTSEQ
hec_material_guid = ls_material-hec_material_guid AND
hec_sw_selection = abap_true.
IF "( <fs_sw_item_list>-hec_hsp_swi_stack_value = /hec1/if_config_constants=>gc_sw_stack_value-none AND
" ls_tier-hec_sol_tier_stack_value = /hec1/if_config_constants=>gc_sw_stack_value-all )
" OR
( <fs_sw_item_list>-hec_hsp_swi_stack_value = /hec1/if_config_constants=>gc_sw_stack_value-java AND
ls_tier-hec_sol_tier_stack_value = /hec1/if_config_constants=>gc_sw_stack_value-abap )
OR
( <fs_sw_item_list>-hec_hsp_swi_stack_value = /hec1/if_config_constants=>gc_sw_stack_value-abap AND
ls_tier-hec_sol_tier_stack_value = /hec1/if_config_constants=>gc_sw_stack_value-java ).
CONTINUE. ">>>> Skip loop
ENDIF.
" **************
" add software item
" **************
" check if software item exists
IF NOT line_exists( lt_sw_item[ hec_node_solution = <fs_sw_item_list>-hec_node_solution
hec_material_guid = <fs_sw_item_list>-hec_material_guid ] ).
" If tier price for solution(S/4 on premise, SAP BW etc.) exist, only optional solution materials
" get a price, else mandatory solution materials gets not a price
DATA(lv_get_pricing) = COND #( WHEN ls_material-hec_material_rel_value = /hec1/if_config_constants=>gc_material_rel-mandatory
THEN abap_false
ELSE COND #( WHEN ls_material-hec_material_rel_value = /hec1/if_config_constants=>gc_material_rel-optional
THEN abap_true
ELSE abap_true ) ).
IF lv_get_pricing = abap_true.
" Get effort building block GUID
SELECT SINGLE hec_timebased_effort_bb_guid
FROM /hec1/i_softwareitemtbbbbasic
INTO @DATA(lv_effort_bb_guid)
WHERE hec_apm_guid = @ls_landscape-hec_apm_guid
AND hec_hsp_swi_stack_guid = @<fs_sw_item_list>-hec_hsp_swi_stack_guid
AND hec_tier_cat_value = @ls_tier-hec_tier_cat_value.
ENDIF.
DATA(lr_sw_item_new) = NEW /hec1/s_data_sw_item_cs( BASE CORRESPONDING #( <fs_sw_item_list> )
parent_key = ls_material-key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = ls_material-hec_node_solution
hec_node_tier = ls_material-hec_node_tier
hec_node_material = ls_material-hec_node_material
hec_node_sw_item = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = ls_landscape-hec_confid
hec_comp_config_version = ls_landscape-hec_conf_version
hec_row_selectable = abap_true
hec_apm_guid = ls_material-hec_apm_guid
hec_apm_descr = ls_material-hec_apm_descr
hec_phase_guid = ls_material-hec_phase_guid
hec_phase_fixed = COND #( WHEN <fs_sw_item_list>-hec_sw_item_mat_rel_value = /hec1/if_config_constants=>gc_material_rel-mandatory " '01'
THEN abap_true
ELSE abap_false )
hec_phase_assign_allowed = COND #( WHEN <fs_sw_item_list>-hec_sw_item_mat_rel_value = /hec1/if_config_constants=>gc_material_rel-mandatory " '01'
THEN abap_false
ELSE abap_true )
hec_phase_changed = abap_true
price = COND #( WHEN lv_effort_bb_guid IS NOT INITIAL
THEN /hec1/cl_config_helper=>do_price_validation( iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
iv_effort_bb_guid = lv_effort_bb_guid
iv_tier_is_dr_node = ls_tier-hec_tier_is_dr_node
iv_dr_operating_mode = ls_tier-hec_dr_oper_mode_value )
ELSE space )
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_sw_item_new->crea_date_time.
INSERT VALUE #( data = lr_sw_item_new
node = /hec1/if_configuration_c=>sc_node-software_item
source_node = /hec1/if_configuration_c=>sc_node-material
association = /hec1/if_configuration_c=>sc_association-material-software_item
source_key = ls_material-key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_sw_item_new->key )
INTO TABLE lt_modification.
ENDIF. "IF NOT line_exists( lt_sw_item[ hec_node_solution = <fs_sw_item_list>-hec_node_solution
CLEAR: lv_get_pricing,
lv_effort_bb_guid.
ENDLOOP. "LOOP AT lt_sw_item_list ASSIGNING FIELD-SYMBOL(<fs_sw_item_list>)
ENDLOOP. "LOOP AT lt_parameter ASSIGNING FIELD-SYMBOL(<fs_parameter_line>).
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
"-----------------------------------
" Set Delete action to GENERAL
"-----------------------------------
IF lt_act_param_delete IS NOT INITIAL.
me->mr_act_param_delete = NEW /bobf/t_frw_node( lt_act_param_delete ).
/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-delete_node )
iv_act_exectime = /bobf/if_conf_c=>sc_time_after_validation
ir_act_param = me->mr_act_param_delete ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_tier.
DATA: lt_solution TYPE /hec1/t_data_solution_ct,
lt_root_key TYPE /bobf/t_frw_key,
ls_landscape TYPE /hec1/s_config_root_cs,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_create_tier> TYPE /hec1/t_act_create_tier.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_create_tier>.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_solution ).
"-----------------------------------
" Get APM model GUID and description
"-----------------------------------
/hec1/cl_config_helper=>get_apm_model( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING et_failed_key = et_failed_key
es_apm_model = ls_landscape ).
LOOP AT lt_solution ASSIGNING FIELD-SYMBOL(<fs_solution>).
ASSIGN <fs_create_tier>[ key = <fs_solution>-key ] TO FIELD-SYMBOL(<fs_new_tier_no>).
IF <fs_new_tier_no> IS ASSIGNED.
"-----------------------------------
" Get number of stack tiers
" per tier level
"-----------------------------------
SELECT SINGLE hec_sol_tier_stack_no
FROM /hec1/i_solutionbasic
WHERE hec_apm_guid = @ls_landscape-hec_apm_guid AND
hec_solution_guid = @<fs_solution>-hec_solution_guid
INTO @DATA(lv_stack_tier_no).
IF lv_stack_tier_no IS INITIAL.
lv_stack_tier_no = 1.
ENDIF.
"-----------------------------------
" Fill data for new non productiv
" tiers
"-----------------------------------
IF <fs_new_tier_no>-hec_tier_qty_nprod_level > 0.
APPEND LINES OF
/hec1/cl_config_action_helper=>/hec1/if_bopf_action_helper~create_tier( iv_create_no_tier = CONV #( <fs_new_tier_no>-hec_tier_qty_nprod_level ) " No. of tiers to be created
iv_stack_tier_no = lv_stack_tier_no " Number of Stack Tiers
iv_tier_category_value = /hec1/if_config_constants=>gc_tier_category-nonprod " Tier Category Value
is_landscape = REF #( ls_landscape ) " Landscape
is_solution = REF #( <fs_solution> ) " Solution
io_read = io_read )
TO lt_modification.
ENDIF.
"-----------------------------------
" Fill data for new productiv tier
"-----------------------------------
IF <fs_new_tier_no>-hec_tier_qty_prod_level > 0.
APPEND LINES OF
/hec1/cl_config_action_helper=>/hec1/if_bopf_action_helper~create_tier( iv_create_no_tier = CONV #( <fs_new_tier_no>-hec_tier_qty_prod_level ) " No. of tiers to be created
iv_stack_tier_no = lv_stack_tier_no " Number of Stack Tiers
iv_tier_category_value = /hec1/if_config_constants=>gc_tier_category-prod " Tier Category Value
is_landscape = REF #( ls_landscape ) " Landscape
is_solution = REF #( <fs_solution> ) " Solution
io_read = io_read )
TO lt_modification.
ENDIF.
ENDIF. " IF <fs_new_tier_no> IS ASSIGNED.
CLEAR lv_stack_tier_no.
UNASSIGN <fs_new_tier_no>.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_tier_software.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_db_server_instance.
DATA: lt_modification TYPE /bobf/t_frw_modification,
lt_db_server_instance TYPE /hec1/t_data_db_server_inst_ct,
lt_solution TYPE /hec1/t_data_solution_ct.
CLEAR: eo_message,
et_failed_key.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
IMPORTING et_data = lt_db_server_instance ).
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-tier
it_key = VALUE #( FOR db_si IN lt_db_server_instance
( key = db_si-parent_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-tier-to_parent
IMPORTING et_data = lt_solution
et_key_link = DATA(lt_tier_sol_link) ).
* LOOP AT lt_db_server_instance REFERENCE INTO DATA(lr_db_server_instance).
* "-----------------------------------
* " Fill DB server update structure
* "-----------------------------------
* TRY.
* DATA(ls_solution) = lt_solution[ key = lt_tier_sol_link[ source_key = lr_db_server_instance->parent_key ]-target_key ].
* lr_db_server_instance->hec_db_encrypted = ls_solution-hec_sol_db_encrypted.
* CATCH cx_sy_itab_line_not_found.
* ENDTRY.
*
* INSERT VALUE #( data = lr_db_server_instance
* node = /hec1/if_configuration_c=>sc_node-db_server_instance
* source_key = lr_db_server_instance->key
* change_mode = /bobf/if_frw_c=>sc_modify_update
* key = lr_db_server_instance->key ) INTO TABLE lt_modification.
*
* ENDLOOP. " IF <fs_act_param> IS ASSIGNED.
"-----------------------------------
" Update instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_tier_from_landscape.
" This method is triggered from the landscape level. All tiers are updated.
DATA: lt_root TYPE /hec1/t_config_root_ct,
lt_tier TYPE /hec1/t_data_tier_ct,
lt_modification TYPE /bobf/t_frw_modification,
ls_act_param TYPE /hec1/s_act_update_tier_inhrit.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO FIELD-SYMBOL(<fs_param>).
IF <fs_param> IS ASSIGNED.
ls_act_param = <fs_param>.
ENDIF.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_root ).
" Solution
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_association = /hec1/if_configuration_c=>sc_association-root-solution
IMPORTING et_target_key = DATA(lt_solution_key) ).
" Tier
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-solution
it_key = lt_solution_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-solution-tier
IMPORTING et_data = lt_tier ).
DATA(ls_root) = VALUE #( lt_root[ 1 ] OPTIONAL ).
LOOP AT lt_tier REFERENCE INTO DATA(lr_tier).
" Update Timezone
IF ls_act_param-do_update_timezone = abap_true.
lr_tier->hec_system_timezone = ls_root-hec_system_timezone.
ENDIF.
" Update Non-Production Recurrence
IF ls_act_param-do_update_nonprod = abap_true
AND lr_tier->hec_tier_cat_value = /hec1/if_config_constants=>gc_tier_category-nonprod.
lr_tier->hec_tier_recurrence_type = ls_root-hec_nprod_recurrence_type.
lr_tier->hec_tier_recurrence_interval = ls_root-hec_nprod_recurrence_interval.
lr_tier->hec_tier_weekday = ls_root-hec_nprod_weekday.
lr_tier->hec_tier_starttime = ls_root-hec_nprod_starttime.
lr_tier->hec_tier_duration = ls_root-hec_nprod_duration.
lr_tier->hec_tier_duration_unit = ls_root-hec_nprod_duration_unit.
lr_tier->hec_tier_cmp_timezone = ls_root-hec_nprod_cmp_timezone.
ENDIF.
" Update Production Recurrence
IF ls_act_param-do_update_prod = abap_true
AND lr_tier->hec_tier_cat_value = /hec1/if_config_constants=>gc_tier_category-prod.
lr_tier->hec_tier_recurrence_type = ls_root-hec_prod_recurrence_type.
lr_tier->hec_tier_recurrence_interval = ls_root-hec_prod_recurrence_interval.
lr_tier->hec_tier_weekday = ls_root-hec_prod_weekday.
lr_tier->hec_tier_starttime = ls_root-hec_prod_starttime.
lr_tier->hec_tier_duration = ls_root-hec_prod_duration.
lr_tier->hec_tier_duration_unit = ls_root-hec_prod_duration_unit.
lr_tier->hec_tier_cmp_timezone = ls_root-hec_prod_cmp_timezone.
ENDIF.
"-----------------------------------
" Insert Tier data to modification table
"-----------------------------------
INSERT VALUE #( data = lr_tier
node = /hec1/if_configuration_c=>sc_node-tier
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_tier->key
) INTO TABLE lt_modification.
ENDLOOP.
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_app_server.
DATA: lt_modification TYPE /bobf/t_frw_modification,
lt_app_serv_perf_cat TYPE /hec1/t_data_app_serv_pc_ct,
lt_app_server TYPE /hec1/t_data_app_serv_ct.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_update_app_server.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
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_perform_cat-app_server
IMPORTING et_data = lt_app_server ).
IF lt_app_server IS INITIAL.
RETURN. ">>>>>>
ENDIF.
IF <fs_act_param> IS ASSIGNED.
"-----------------------------------
" Fill APP server update structure
"-----------------------------------
LOOP AT lt_app_serv_perf_cat ASSIGNING FIELD-SYMBOL(<fs_serv_perf_cat>).
TRY.
DATA(ls_act_param) = <fs_act_param>[ parent_key = <fs_serv_perf_cat>-key ].
IF ls_act_param-do_update_app_server = abap_true.
DATA(lr_app_server) = NEW /hec1/s_data_app_serv_cs( lt_app_server[ key = ls_act_param-key ] ).
" Update IP Server GUID
lr_app_server->hec_ip_server_guid = ls_act_param-hec_ip_server_guid.
DATA(lv_data_changed) = abap_true.
ENDIF.
"-----------------------------------
" Fill App server update structure
"-----------------------------------
IF lv_data_changed = abap_true.
INSERT VALUE #( data = lr_app_server
node = /hec1/if_configuration_c=>sc_node-app_server
source_node = /hec1/if_configuration_c=>sc_node-app_server_perform_cat
association = /hec1/if_configuration_c=>sc_association-app_server_perform_cat-app_server
source_key = lr_app_server->parent_key
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_server->key ) INTO TABLE lt_modification.
ENDIF.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
CLEAR: lv_data_changed,
ls_act_param,
lr_app_server.
ENDLOOP.
ENDIF. " IF <fs_act_param> IS ASSIGNED.
"-----------------------------------
" Update instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_tier_lt_backup.
DATA: lt_modification TYPE /bobf/t_frw_modification,
ls_act_param TYPE /hec1/s_act_update_tier_ltb,
lt_tier_lt_backup TYPE /hec1/t_data_tier_lt_backup_ct.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO FIELD-SYMBOL(<fs_param>).
IF <fs_param> IS ASSIGNED.
ls_act_param = <fs_param>.
ENDIF.
io_read->get_root_key(
EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_target_key = DATA(lt_root_key) ).
" Solution
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = lt_root_key
iv_association = /hec1/if_configuration_c=>sc_association-root-solution
IMPORTING et_target_key = DATA(lt_solution_key) ).
" Tier
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-solution
it_key = lt_solution_key
iv_association = /hec1/if_configuration_c=>sc_association-solution-tier
IMPORTING et_target_key = DATA(lt_tier_key) ).
" TIER_LT_BACKUP
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-tier_longterm_backup
IMPORTING et_data = lt_tier_lt_backup ).
LOOP AT lt_tier_lt_backup REFERENCE INTO DATA(lr_tier_lt_backup)
WHERE hec_tlt_backup_cl_node_ref = ls_act_param-hec_node_lt_backup_class.
lr_tier_lt_backup->hec_tlt_backup_ref_descr = ls_act_param-hec_ltb_class_descr.
lr_tier_lt_backup->hec_tlt_backup_ref_descr_ext = ls_act_param-hec_ltb_class_descr_ext.
"-----------------------------------
" Insert Tier data to modification table
"-----------------------------------
INSERT VALUE #( data = lr_tier_lt_backup
node = /hec1/if_configuration_c=>sc_node-tier_longterm_backup
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_tier_lt_backup->key
) INTO TABLE lt_modification.
ENDLOOP.
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_connectivity.
"triggered from datacenter
DATA: lt_datacenter TYPE /hec1/t_data_datacenter_ct,
lt_connectivity TYPE /hec1/t_data_connectivity_ct,
lt_modification TYPE /bobf/t_frw_modification,
ls_landscape TYPE /hec1/s_config_root_cs.
CLEAR: eo_message,
et_failed_key.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
IMPORTING et_data = lt_datacenter ).
io_read->retrieve_by_association( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
iv_association = /hec1/if_configuration_c=>sc_association-datacenter-connectivity
iv_fill_data = abap_true
IMPORTING et_data = lt_connectivity ).
/hec1/cl_config_helper=>get_apm_model( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING es_apm_model = ls_landscape ).
LOOP AT lt_datacenter ASSIGNING FIELD-SYMBOL(<fs_datacenter>).
LOOP AT lt_connectivity REFERENCE INTO DATA(lr_connectivity)
WHERE parent_key = <fs_datacenter>-key.
IF <fs_datacenter>-hec_sec_datacenter_guid IS INITIAL.
CLEAR: lr_connectivity->hec_sec_datacenter_guid,
lr_connectivity->hec_connectivity_descr,
lr_connectivity->hec_connectivity_guid,
lr_connectivity->price.
ELSE.
lr_connectivity->hec_sec_datacenter_guid = <fs_datacenter>-hec_sec_datacenter_guid.
ENDIF.
IF lr_connectivity->hec_apm_guid IS INITIAL.
lr_connectivity->hec_apm_guid = ls_landscape-hec_apm_guid.
lr_connectivity->hec_apm_descr = ls_landscape-hec_apm_descr.
ENDIF.
INSERT VALUE #( data = lr_connectivity
node = /hec1/if_configuration_c=>sc_node-connectivity
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_connectivity->key ) INTO TABLE lt_modification.
ENDLOOP. " LOOP AT lt_connectivity REFERENCE INTO DATA(lr_connectivity)
ENDLOOP. " LOOP AT lt_datacenter ASSIGNING FIELD-SYMBOL(<fs_datacenter>).
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_landscape.
DATA: lt_modification TYPE /bobf/t_frw_modification,
lt_root TYPE /hec1/t_config_root_ct.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/s_act_update_landscape.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
" 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 ).
IF lr_landscape IS INITIAL.
RETURN. ">>>>>>
ENDIF.
IF <fs_act_param> IS ASSIGNED.
IF <fs_act_param>-do_update_region = abap_true.
/hec1/cl_apm_data_access_class=>/hec1/if_apm_data_access_class~get_region_dlvyunit_datacenter( EXPORTING it_country_key = VALUE #( FOR datacenter IN lt_datacenter
( datacenter-hec_datacenter_country ) )
IMPORTING et_region_l1 = DATA(lt_region_l1)
et_region_l2 = DATA(lt_region_l2)
et_region_l3 = DATA(lt_region_l3) ).
SORT lt_region_l1 ASCENDING.
DELETE ADJACENT DUPLICATES FROM lt_region_l1.
SORT lt_region_l2 ASCENDING.
DELETE ADJACENT DUPLICATES FROM lt_region_l2.
SORT lt_region_l3 ASCENDING.
DELETE ADJACENT DUPLICATES FROM lt_region_l3.
IF lines( lt_region_l1 ) = 1.
DATA(ls_region_l1) = VALUE #( lt_region_l1[ 1 ] OPTIONAL ).
lr_landscape->hec_dlvy_region_l1_guid = ls_region_l1-value.
lr_landscape->hec_dlvy_region_l1_descr = ls_region_l1-text.
ELSE.
lr_landscape->hec_dlvy_region_l1_guid = '00'.
ENDIF.
IF lines( lt_region_l2 ) = 1.
DATA(ls_region_l2) = VALUE #( lt_region_l2[ 1 ] OPTIONAL ).
lr_landscape->hec_dlvy_region_l2_guid = ls_region_l2-value.
lr_landscape->hec_dlvy_region_l2_descr = ls_region_l2-text.
ELSE.
lr_landscape->hec_dlvy_region_l2_guid = '00'.
ENDIF.
IF lines( lt_region_l3 ) = 1.
DATA(ls_region_l3) = VALUE #( lt_region_l3[ 1 ] OPTIONAL ).
lr_landscape->hec_country_key = ls_region_l3-value.
lr_landscape->hec_country_descr = ls_region_l3-text.
ELSE.
lr_landscape->hec_country_key = '00'.
ENDIF.
INSERT VALUE #( data = lr_landscape
node = /hec1/if_configuration_c=>sc_node-root
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_landscape->key
) INTO TABLE lt_modification.
ENDIF. "do_update_region
ENDIF. "<fs_act_param> is assigned.
"-----------------------------------
" Update
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_instance_db.
DATA: lt_modification TYPE /bobf/t_frw_modification,
lt_instance_db TYPE /hec1/t_data_db_inst_ct.
FIELD-SYMBOLS: <fs_act_param> TYPE /hec1/t_act_update_instance_db.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_act_param>.
CHECK <fs_act_param> IS ASSIGNED.
io_read->retrieve( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-instance_db
it_key = VALUE #( FOR wa IN <fs_act_param>
( key = wa-key ) )
iv_fill_data = abap_true
IMPORTING et_data = lt_instance_db ).
LOOP AT <fs_act_param> ASSIGNING FIELD-SYMBOL(<fs_act_param_line>).
IF <fs_act_param_line>-do_update_multi_tenancy_guid = abap_true.
DATA(lr_instance_db) = NEW /hec1/s_data_db_inst_cs( lt_instance_db[ key = <fs_act_param_line>-key ] ).
IF <fs_act_param_line>-do_update_multi_tenancy_guid = abap_true.
lr_instance_db->hec_multi_tenant_rel_guid = <fs_act_param_line>-hec_multi_tenant_rel_guid.
INSERT VALUE #( data = lr_instance_db
node = /hec1/if_configuration_c=>sc_node-instance_db
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_instance_db->key
) INTO TABLE lt_modification.
ENDIF. "<fs_act_param_line>-do_update_multi_tenancy_guid = abap_true.
ENDIF.
ENDLOOP.
"-----------------------------------
" Update instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~create_tier_sla.
DATA: lt_tier TYPE /hec1/t_data_tier_ct,
lt_root_key TYPE /bobf/t_frw_key,
ls_landscape TYPE /hec1/s_config_root_cs,
lt_modification TYPE /bobf/t_frw_modification.
CLEAR: eo_message,
et_failed_key.
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_tier ).
"-----------------------------------
" Get APM model GUID and description
"-----------------------------------
/hec1/cl_config_helper=>get_apm_model( EXPORTING iv_node_key = is_ctx-node_key
it_key = it_key
io_read = io_read
IMPORTING et_failed_key = et_failed_key
es_apm_model = ls_landscape ).
LOOP AT lt_tier ASSIGNING FIELD-SYMBOL(<fs_tier>).
DATA(lr_tier_sla_new) = NEW /hec1/s_data_tier_sla_cs( BASE CORRESPONDING #( <fs_tier> )
parent_key = <fs_tier>-key
key = /bopf/cl_frw_factory=>get_new_key( )
hec_node_solution = <fs_tier>-hec_node_solution
hec_node_tier = <fs_tier>-hec_node_tier
hec_node_tier_sla = /rbp/cl_general_utilities=>get_new_guid22( )
hec_comp_config_id = ls_landscape-hec_confid
hec_comp_config_version = ls_landscape-hec_conf_version
hec_row_selectable = abap_true
hec_apm_guid = <fs_tier>-hec_apm_guid
hec_apm_descr = <fs_tier>-hec_apm_descr
hec_phase_guid = <fs_tier>-hec_phase_guid
hec_phase_fixed = abap_true
hec_phase_assign_allowed = abap_false
hec_phase_changed = abap_true
crea_uname = sy-uname ).
GET TIME STAMP FIELD lr_tier_sla_new->crea_date_time.
INSERT VALUE #( data = lr_tier_sla_new
node = /hec1/if_configuration_c=>sc_node-tier_sla
source_node = /hec1/if_configuration_c=>sc_node-tier
association = /hec1/if_configuration_c=>sc_association-tier-tier_sla
source_key = lr_tier_sla_new->parent_key
change_mode = /bobf/if_frw_c=>sc_modify_create
key = lr_tier_sla_new->key )
INTO TABLE lt_modification.
ENDLOOP.
"-----------------------------------
" Create instances
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_db_storage_backup.
DATA: lt_db_storage TYPE /hec1/t_data_db_storage_ct,
lt_db_backup TYPE /hec1/t_data_db_backup_ct,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_param> TYPE /hec1/t_act_update_db_backup.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_param>.
CHECK <fs_param> IS ASSIGNED.
/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 ).
io_read->retrieve( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_storage
it_key = VALUE #( FOR param IN <fs_param>
( key = param-parent_key ) )
IMPORTING et_data = lt_db_storage ).
" DB Storage Amount (child)
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-db_storage
it_key = VALUE #( FOR param IN <fs_param>
( key = param-parent_key ) )
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-db_storage-db_storage_backup
IMPORTING et_data = lt_db_backup ).
" Here we loop across the storage backup, which is the parent
" The update can be executed from the storage and then needs to run for all child nodes
LOOP AT lt_db_storage ASSIGNING FIELD-SYMBOL(<fs_db_storage>).
LOOP AT lt_db_backup
REFERENCE INTO DATA(lr_db_backup)
WHERE parent_key = <fs_db_storage>-key.
"-----------------------------------
" Clear Phasing
"-----------------------------------
IF line_exists( <fs_param>[ do_clear_phasing = abap_true
key = lr_db_backup->key ] ).
IF lines( lt_db_backup ) = 1.
" Get Parent Phase
TRY.
DATA(ls_db_storage) = lt_db_storage[ key = lr_db_backup->parent_key ].
lr_db_backup->hec_phase_guid = ls_db_storage-hec_phase_guid.
lr_db_backup->hec_phase_assign_allowed = abap_false.
lr_db_backup->hec_phase_changed = abap_true.
lr_db_backup->hec_phase_fixed = abap_true.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ELSE.
CLEAR: lr_db_backup->hec_phase_guid,
lr_db_backup->hec_phase_fixed.
lr_db_backup->hec_phase_changed = abap_true.
ENDIF. "lines(lt_db_storage_qty) = 1
ENDIF. "do_clear_phasing
INSERT VALUE #( data = lr_db_backup
node = /hec1/if_configuration_c=>sc_node-db_storage_backup
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_db_backup->key
) INTO TABLE lt_modification.
ENDLOOP. "lt_db_storage_qty
ENDLOOP. "lt_db_serv_pc
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_app_storage_backup.
DATA: lt_app_storage TYPE /hec1/t_data_app_storage_ct,
lt_app_backup TYPE /hec1/t_data_app_backup_ct,
lt_modification TYPE /bobf/t_frw_modification.
FIELD-SYMBOLS: <fs_param> TYPE /hec1/t_act_update_app_backup.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_param>.
CHECK <fs_param> IS ASSIGNED.
/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 ).
io_read->retrieve( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_storage
it_key = VALUE #( FOR param IN <fs_param>
( key = param-parent_key ) )
IMPORTING et_data = lt_app_storage ).
" DB Storage Amount (child)
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-app_storage
it_key = VALUE #( FOR param IN <fs_param>
( key = param-parent_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 ).
" Here we loop across the storage backup, which is the parent
" The update can be executed from the storage and then needs to run for all child nodes
LOOP AT lt_app_storage ASSIGNING FIELD-SYMBOL(<fs_app_storage>).
LOOP AT lt_app_backup
REFERENCE INTO DATA(lr_app_backup)
WHERE parent_key = <fs_app_storage>-key.
"-----------------------------------
" Clear Phasing
"-----------------------------------
IF line_exists( <fs_param>[ do_clear_phasing = abap_true
key = lr_app_backup->key ] ).
IF lines( lt_app_backup ) = 1.
" Get Parent Phase
TRY.
DATA(ls_app_storage) = lt_app_storage[ key = lr_app_backup->parent_key ].
lr_app_backup->hec_phase_guid = ls_app_storage-hec_phase_guid.
lr_app_backup->hec_phase_assign_allowed = abap_false.
lr_app_backup->hec_phase_changed = abap_true.
lr_app_backup->hec_phase_fixed = abap_true.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ELSE.
CLEAR: lr_app_backup->hec_phase_guid,
lr_app_backup->hec_phase_fixed.
lr_app_backup->hec_phase_changed = abap_true.
ENDIF. "lines(lt_app_storage_qty) = 1
ENDIF. "do_clear_phasing
INSERT VALUE #( data = lr_app_backup
node = /hec1/if_configuration_c=>sc_node-app_storage_backup
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_app_backup->key
) INTO TABLE lt_modification.
ENDLOOP. "lt_app_storage_qty
ENDLOOP. "lt_app_serv_pc
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message) ).
ENDIF.
ENDMETHOD.
METHOD /hec1/if_config_action_intern~update_tier_add_service.
DATA: lt_modification TYPE /bobf/t_frw_modification,
lt_act_param TYPE /hec1/t_act_update_t_add_serv,
lt_tier_add_service TYPE /hec1/t_data_tier_add_serv_ct,
lt_add_service TYPE /hec1/t_data_add_services_ct.
FIELD-SYMBOLS: <fs_param> TYPE /hec1/t_act_update_t_add_serv.
CLEAR: eo_message,
et_failed_key.
ASSIGN ir_parameter->* TO <fs_param>.
CHECK <fs_param> IS ASSIGNED.
io_read->get_root_key( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_target_key = DATA(lt_root_key) ).
" Additional Service
io_read->retrieve_by_association( EXPORTING iv_node = /hec1/if_configuration_c=>sc_node-root
it_key = lt_root_key
iv_fill_data = abap_true
iv_association = /hec1/if_configuration_c=>sc_association-root-add_service
IMPORTING et_data = lt_add_service ).
" Tier Add Service
io_read->retrieve( EXPORTING iv_node = is_ctx-node_key
it_key = it_key
IMPORTING et_data = lt_tier_add_service ).
LOOP AT lt_tier_add_service REFERENCE INTO DATA(lr_tier_add_service).
IF line_exists( <fs_param>[ key = lr_tier_add_service->key
do_update_service = abap_true ] ).
TRY.
DATA(ls_add_service) = lt_add_service[ hec_node_service = lr_tier_add_service->hec_tas_service_ref_guid ].
IF lr_tier_add_service->hec_tas_service_ref_descr_ext IS INITIAL.
lr_tier_add_service->hec_tas_service_ref_descr_ext = ls_add_service-hec_as_class_descr_ext.
ENDIF.
lr_tier_add_service->* = VALUE #( BASE lr_tier_add_service->*
hec_tas_service_ref_descr = ls_add_service-hec_ip_as_class_descr
hec_tas_tier_uplift_perc = ls_add_service-hec_as_tier_uplift_perc
hec_tree_descr = COND #( WHEN lr_tier_add_service->hec_tas_service_ref_descr_ext IS INITIAL
THEN ls_add_service-hec_ip_as_class_descr
ELSE |{ ls_add_service-hec_ip_as_class_descr } : { lr_tier_add_service->hec_tas_service_ref_descr_ext }| ) ).
"-----------------------------------
" Insert Tier data to modification table
"-----------------------------------
INSERT VALUE #( data = lr_tier_add_service
node = /hec1/if_configuration_c=>sc_node-tier_add_service
change_mode = /bobf/if_frw_c=>sc_modify_update
key = lr_tier_add_service->key
) INTO TABLE lt_modification.
CATCH cx_sy_itab_line_not_found.
ENDTRY.
ENDIF. "line_exists do_update_service
ENDLOOP.
"-----------------------------------
" Do Modify
"-----------------------------------
IF lt_modification IS NOT INITIAL.
io_modify->do_modify( lt_modification ).
io_modify->end_modify( EXPORTING iv_process_immediately = abap_true
IMPORTING eo_message = DATA(lo_message)
eo_change = DATA(lo_change) ).
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
4871,
1220,
39,
2943,
16,
14,
5097,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
2839,
628,
220,
3298,
2460,
1220,
39,
2943,
16,
14,
5097,
62,
10943,
16254,
62,
35,
2767,
62,
35353,
27130,
764,
198,
198,
11377,
2665,
13,
628,
220,
20314,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
19734,
2665,
13,
628,
220,
47217,
27975,
56,
62,
45,
16820,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
34,
3185,
56,
62,
45,
16820,
764,
198,
220,
47217,
29244,
6158,
62,
24805,
62,
45,
16820,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
24805,
62,
45,
16820,
764,
198,
220,
47217,
29244,
6158,
62,
24805,
62,
35009,
5959,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
24805,
62,
35009,
5959,
764,
198,
220,
47217,
29244,
6158,
62,
24805,
62,
35009,
5959,
62,
5662,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
24805,
62,
35009,
5959,
62,
5662,
764,
198,
220,
47217,
29244,
6158,
62,
24805,
62,
2257,
1581,
11879,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
24805,
62,
2257,
1581,
11879,
764,
198,
220,
47217,
29244,
6158,
62,
24805,
62,
2257,
1581,
11879,
62,
2390,
28270,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
24805,
62,
2257,
1581,
11879,
62,
2390,
28270,
764,
198,
220,
47217,
29244,
6158,
62,
24805,
62,
2257,
1581,
11879,
62,
31098,
8577,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
24805,
62,
2257,
1581,
11879,
62,
31098,
8577,
764,
198,
220,
47217,
29244,
6158,
62,
11012,
62,
45,
16820,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
11012,
62,
45,
16820,
764,
198,
220,
47217,
29244,
6158,
62,
11012,
62,
35009,
5959,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
11012,
62,
35009,
5959,
764,
198,
220,
47217,
29244,
6158,
62,
11012,
62,
35009,
5959,
62,
5662,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
11012,
62,
35009,
5959,
62,
5662,
764,
198,
220,
47217,
29244,
6158,
62,
11012,
62,
2257,
1581,
11879,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
11012,
62,
2257,
1581,
11879,
764,
198,
220,
47217,
29244,
6158,
62,
11012,
62,
2257,
1581,
11879,
62,
2390,
28270,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
11012,
62,
2257,
1581,
11879,
62,
2390,
28270,
764,
198,
220,
47217,
29244,
6158,
62,
11012,
62,
2257,
1581,
11879,
62,
31098,
8577,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
11012,
62,
2257,
1581,
11879,
62,
31098,
8577,
764,
198,
220,
47217,
29244,
6158,
62,
35,
3698,
3824,
19664,
62,
4944,
2043,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
35,
3698,
3824,
19664,
62,
4944,
2043,
764,
198,
220,
47217,
29244,
6158,
62,
38604,
19240,
62,
11012,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
38604,
19240,
62,
11012,
764,
198,
220,
47217,
29244,
6158,
62,
10725,
62,
35009,
53,
62,
33,
1921,
3698,
8881,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
10725,
62,
35009,
53,
62,
33,
1921,
3698,
8881,
764,
198,
220,
47217,
29244,
6158,
62,
44,
23261,
12576,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
44,
23261,
12576,
764,
198,
220,
47217,
29244,
6158,
62,
11909,
11159,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
11909,
11159,
764,
198,
220,
47217,
29244,
6158,
62,
35009,
5959,
62,
38604,
19240,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
35009,
5959,
62,
38604,
19240,
764,
198,
220,
47217,
29244,
6158,
62,
15821,
37485,
62,
2043,
3620,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
15821,
37485,
62,
2043,
3620,
764,
198,
220,
47217,
29244,
6158,
62,
25621,
1137,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
25621,
1137,
764,
198,
220,
47217,
29244,
6158,
62,
25621,
1137,
62,
8634,
32,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
43387,
6158,
62,
25621,
1137,
62,
8634,
32,
764,
198,
220,
47217,
5550,
2538,
9328,
62,
45,
16820,
198,
220,
220,
220,
329,
1220,
39,
2943,
16,
14,
5064,
62,
10943,
16254,
62,
44710,
62,
1268,
31800,
93,
7206,
2538,
9328,
62,
45,
16820,
764,
198,
220,
47217,
3268,
16879,
2043,
62,
11909,
11159,
62,
10705,
16284,
10979,
198,
220,
220,
220,
329,
1220
] | [
1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
*----------------------------------------------------------------------*
***INCLUDE MZBOOK_DEMO_DYN_GRID2_GET_DI01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module GET_DATA INPUT
*&---------------------------------------------------------------------*
MODULE get_data INPUT.
CLEAR gs_zbook_ticket.
SELECT SINGLE * FROM zbook_ticket INTO gs_zbook_ticket
WHERE tiknr = zbook_ticket-tiknr.
CHECK sy-subrc = 0.
if gr_dd_grid is INITIAL.
CREATE OBJECT gr_dd_grid
EXPORTING
container_name = 'CC_DYN'
cont_log_name = 'CC_LOG'.
ENDIF.
CHECK gr_dd_grid IS BOUND.
gr_dd_grid->prepare_data( tiknr = gs_zbook_ticket-tiknr
area = gs_zbook_ticket-area
clas = gs_zbook_ticket-clas ).
ENDMODULE. " GET_DATA INPUT
| [
9,
10097,
23031,
9,
198,
8162,
1268,
5097,
52,
7206,
337,
57,
39453,
62,
39429,
46,
62,
35,
40760,
62,
10761,
2389,
17,
62,
18851,
62,
17931,
486,
764,
198,
9,
10097,
23031,
9,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
220,
220,
220,
220,
19937,
220,
17151,
62,
26947,
220,
3268,
30076,
198,
9,
5,
10097,
30934,
9,
198,
33365,
24212,
651,
62,
7890,
3268,
30076,
13,
628,
220,
30301,
1503,
308,
82,
62,
89,
2070,
62,
43350,
13,
198,
220,
33493,
311,
2751,
2538,
1635,
16034,
1976,
2070,
62,
43350,
39319,
308,
82,
62,
89,
2070,
62,
43350,
198,
220,
220,
33411,
256,
1134,
48624,
796,
1976,
2070,
62,
43350,
12,
83,
1134,
48624,
13,
198,
220,
5870,
25171,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
611,
1036,
62,
1860,
62,
25928,
318,
3268,
2043,
12576,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
1036,
62,
1860,
62,
25928,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
9290,
62,
3672,
796,
705,
4093,
62,
35,
40760,
6,
198,
220,
220,
220,
220,
220,
220,
220,
542,
62,
6404,
62,
3672,
220,
796,
705,
4093,
62,
25294,
4458,
198,
220,
23578,
5064,
13,
628,
220,
5870,
25171,
1036,
62,
1860,
62,
25928,
3180,
220,
347,
15919,
13,
198,
220,
1036,
62,
1860,
62,
25928,
3784,
46012,
533,
62,
7890,
7,
256,
1134,
48624,
796,
308,
82,
62,
89,
2070,
62,
43350,
12,
83,
1134,
48624,
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,
1989,
220,
796,
308,
82,
62,
89,
2070,
62,
43350,
12,
20337,
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,
537,
292,
220,
796,
308,
82,
62,
89,
2070,
62,
43350,
12,
565,
292,
6739,
628,
198,
198,
10619,
33365,
24212,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
17151,
62,
26947,
220,
3268,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
**********************************************************************
* UTIL
**********************************************************************
CLASS lcl_nodes_helper DEFINITION FINAL.
PUBLIC SECTION.
DATA mt_nodes TYPE zif_abapgit_ajson=>ty_nodes_tt.
METHODS add
IMPORTING
iv_str TYPE string.
METHODS clear.
METHODS sorted
RETURNING
VALUE(rt_nodes) TYPE zif_abapgit_ajson=>ty_nodes_ts.
ENDCLASS.
CLASS lcl_nodes_helper IMPLEMENTATION.
METHOD add.
FIELD-SYMBOLS <n> LIKE LINE OF mt_nodes.
DATA lv_children TYPE string.
DATA lv_index TYPE string.
DATA lv_order TYPE string.
APPEND INITIAL LINE TO mt_nodes ASSIGNING <n>.
SPLIT iv_str AT '|' INTO
<n>-path
<n>-name
<n>-type
<n>-value
lv_index
lv_children
lv_order.
CONDENSE <n>-path.
CONDENSE <n>-name.
CONDENSE <n>-type.
CONDENSE <n>-value.
<n>-index = lv_index.
<n>-children = lv_children.
<n>-order = lv_order.
ENDMETHOD.
METHOD sorted.
rt_nodes = mt_nodes.
ENDMETHOD.
METHOD clear.
CLEAR mt_nodes.
ENDMETHOD.
ENDCLASS.
**********************************************************************
* PARSER
**********************************************************************
CLASS ltcl_parser_test DEFINITION FINAL
FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT.
PUBLIC SECTION.
CLASS-METHODS sample_json
IMPORTING
iv_separator TYPE string OPTIONAL
RETURNING
VALUE(rv_json) TYPE string.
PRIVATE SECTION.
DATA mo_cut TYPE REF TO lcl_json_parser.
DATA mo_nodes TYPE REF TO lcl_nodes_helper.
METHODS setup.
METHODS parse FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS parse_string FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS parse_number FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS parse_float FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS parse_boolean FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS parse_false FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS parse_null FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS parse_date FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS parse_bare_values FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS parse_error FOR TESTING RAISING zcx_abapgit_ajson_error.
ENDCLASS.
CLASS ltcl_parser_test IMPLEMENTATION.
METHOD setup.
CREATE OBJECT mo_cut.
CREATE OBJECT mo_nodes.
ENDMETHOD.
METHOD parse_bare_values.
DATA lt_act TYPE zif_abapgit_ajson=>ty_nodes_tt.
mo_nodes->add( ' | |str |abc | |0' ).
lt_act = mo_cut->parse( '"abc"' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
mo_nodes->clear( ).
mo_nodes->add( ' | |num |-123 | |0' ).
lt_act = mo_cut->parse( '-123' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
mo_nodes->clear( ).
mo_nodes->add( ' | |bool |true | |0' ).
lt_act = mo_cut->parse( 'true' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
mo_nodes->clear( ).
mo_nodes->add( ' | |bool |false | |0' ).
lt_act = mo_cut->parse( 'false' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
mo_nodes->clear( ).
mo_nodes->add( ' | |null | | |0' ).
lt_act = mo_cut->parse( 'null' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
ENDMETHOD.
METHOD parse_error.
DATA lt_act TYPE zif_abapgit_ajson=>ty_nodes_tt.
DATA lx_err TYPE REF TO zcx_abapgit_ajson_error.
TRY.
lt_act = mo_cut->parse( 'abc' ).
cl_abap_unit_assert=>fail( 'Parsing of string w/o quotes must fail (spec)' ).
CATCH zcx_abapgit_ajson_error INTO lx_err.
cl_abap_unit_assert=>assert_char_cp(
act = lx_err->get_text( )
exp = '*parsing error*' ).
cl_abap_unit_assert=>assert_char_cp(
act = lx_err->location
exp = '@PARSER' ).
ENDTRY.
ENDMETHOD.
METHOD parse_string.
mo_nodes->add( ' | |object | | |1' ).
mo_nodes->add( '/ |string |str |abc | |0' ).
DATA lt_act TYPE zif_abapgit_ajson=>ty_nodes_tt.
lt_act = mo_cut->parse( '{"string": "abc"}' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
ENDMETHOD.
METHOD parse_number.
mo_nodes->add( ' | |object | | |1' ).
mo_nodes->add( '/ |number |num |123 | |0' ).
DATA lt_act TYPE zif_abapgit_ajson=>ty_nodes_tt.
lt_act = mo_cut->parse( '{"number": 123}' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
ENDMETHOD.
METHOD parse_float.
mo_nodes->add( ' | |object | | |1' ).
mo_nodes->add( '/ |float |num |123.45 | |0' ).
DATA lt_act TYPE zif_abapgit_ajson=>ty_nodes_tt.
CREATE OBJECT mo_cut.
lt_act = mo_cut->parse( '{"float": 123.45}' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
ENDMETHOD.
METHOD parse_boolean.
mo_nodes->add( ' | |object | | |1' ).
mo_nodes->add( '/ |boolean |bool |true | |0' ).
DATA lt_act TYPE zif_abapgit_ajson=>ty_nodes_tt.
lt_act = mo_cut->parse( '{"boolean": true}' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
ENDMETHOD.
METHOD parse_false.
mo_nodes->add( ' | |object | | |1' ).
mo_nodes->add( '/ |false |bool |false | |0' ).
DATA lt_act TYPE zif_abapgit_ajson=>ty_nodes_tt.
lt_act = mo_cut->parse( '{"false": false}' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
ENDMETHOD.
METHOD parse_null.
mo_nodes->add( ' | |object | | |1' ).
mo_nodes->add( '/ |null |null | | |0' ).
DATA lt_act TYPE zif_abapgit_ajson=>ty_nodes_tt.
lt_act = mo_cut->parse( '{"null": null}' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
ENDMETHOD.
METHOD parse_date.
mo_nodes->add( ' | |object | | |1' ).
mo_nodes->add( '/ |date |str |2020-03-15 | |0' ).
DATA lt_act TYPE zif_abapgit_ajson=>ty_nodes_tt.
lt_act = mo_cut->parse( '{"date": "2020-03-15"}' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
ENDMETHOD.
METHOD sample_json.
rv_json =
'{\n' &&
' "string": "abc",\n' &&
' "number": 123,\n' &&
' "float": 123.45,\n' &&
' "boolean": true,\n' &&
' "false": false,\n' &&
' "null": null,\n' &&
' "date": "2020-03-15",\n' &&
' "issues": [\n' &&
' {\n' &&
' "message": "Indentation problem ...",\n' &&
' "key": "indentation",\n' &&
' "start": {\n' &&
' "row": 4,\n' &&
' "col": 3\n' &&
' },\n' &&
' "end": {\n' &&
' "row": 4,\n' &&
' "col": 26\n' &&
' },\n' &&
' "filename": "./zxxx.prog.abap"\n' &&
' },\n' &&
' {\n' &&
' "message": "Remove space before XXX",\n' &&
' "key": "space_before_dot",\n' &&
' "start": {\n' &&
' "row": 3,\n' &&
' "col": 21\n' &&
' },\n' &&
' "end": {\n' &&
' "row": 3,\n' &&
' "col": 22\n' &&
' },\n' &&
' "filename": "./zxxx.prog.abap"\n' &&
' }\n' &&
' ]\n' &&
'}'.
REPLACE ALL OCCURRENCES OF '\n' IN rv_json WITH iv_separator.
ENDMETHOD.
METHOD parse.
DATA lo_cut TYPE REF TO lcl_json_parser.
DATA lt_act TYPE zif_abapgit_ajson=>ty_nodes_tt.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | | |8' ).
lo_nodes->add( '/ |string |str |abc | |0' ).
lo_nodes->add( '/ |number |num |123 | |0' ).
lo_nodes->add( '/ |float |num |123.45 | |0' ).
lo_nodes->add( '/ |boolean |bool |true | |0' ).
lo_nodes->add( '/ |false |bool |false | |0' ).
lo_nodes->add( '/ |null |null | | |0' ).
lo_nodes->add( '/ |date |str |2020-03-15 | |0' ).
lo_nodes->add( '/ |issues |array | | |2' ).
lo_nodes->add( '/issues/ |1 |object | |1 |5' ).
lo_nodes->add( '/issues/1/ |message |str |Indentation problem ... | |0' ).
lo_nodes->add( '/issues/1/ |key |str |indentation | |0' ).
lo_nodes->add( '/issues/1/ |start |object | | |2' ).
lo_nodes->add( '/issues/1/start/ |row |num |4 | |0' ).
lo_nodes->add( '/issues/1/start/ |col |num |3 | |0' ).
lo_nodes->add( '/issues/1/ |end |object | | |2' ).
lo_nodes->add( '/issues/1/end/ |row |num |4 | |0' ).
lo_nodes->add( '/issues/1/end/ |col |num |26 | |0' ).
lo_nodes->add( '/issues/1/ |filename |str |./zxxx.prog.abap | |0' ).
lo_nodes->add( '/issues/ |2 |object | |2 |5' ).
lo_nodes->add( '/issues/2/ |message |str |Remove space before XXX | |0' ).
lo_nodes->add( '/issues/2/ |key |str |space_before_dot | |0' ).
lo_nodes->add( '/issues/2/ |start |object | | |2' ).
lo_nodes->add( '/issues/2/start/ |row |num |3 | |0' ).
lo_nodes->add( '/issues/2/start/ |col |num |21 | |0' ).
lo_nodes->add( '/issues/2/ |end |object | | |2' ).
lo_nodes->add( '/issues/2/end/ |row |num |3 | |0' ).
lo_nodes->add( '/issues/2/end/ |col |num |22 | |0' ).
lo_nodes->add( '/issues/2/ |filename |str |./zxxx.prog.abap | |0' ).
CREATE OBJECT lo_cut.
lt_act = lo_cut->parse( sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = lo_nodes->mt_nodes ).
lt_act = lo_cut->parse( sample_json( |{ cl_abap_char_utilities=>newline }| ) ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = lo_nodes->mt_nodes ).
lt_act = lo_cut->parse( sample_json( |{ cl_abap_char_utilities=>cr_lf }| ) ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = lo_nodes->mt_nodes ).
ENDMETHOD.
ENDCLASS.
**********************************************************************
* SERIALIZER
**********************************************************************
CLASS ltcl_serializer_test DEFINITION FINAL
FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT.
PUBLIC SECTION.
CLASS-METHODS sample_json
RETURNING
VALUE(rv_json) TYPE string.
CLASS-METHODS sample_nodes
RETURNING
VALUE(rt_nodes) TYPE zif_abapgit_ajson=>ty_nodes_ts.
PRIVATE SECTION.
METHODS stringify_condensed FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS stringify_indented FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS array_index FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS item_order FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS simple_indented FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS empty_set FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS escape FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS empty FOR TESTING RAISING zcx_abapgit_ajson_error.
ENDCLASS.
CLASS ltcl_serializer_test IMPLEMENTATION.
METHOD sample_json.
rv_json =
'{\n' &&
' "boolean": true,\n' &&
' "date": "2020-03-15",\n' &&
' "false": false,\n' &&
' "float": 123.45,\n' &&
' "issues": [\n' &&
' {\n' &&
' "end": {\n' &&
' "col": 26,\n' &&
' "row": 4\n' &&
' },\n' &&
' "filename": "./zxxx.prog.abap",\n' &&
' "key": "indentation",\n' &&
' "message": "Indentation problem ...",\n' &&
' "start": {\n' &&
' "col": 3,\n' &&
' "row": 4\n' &&
' }\n' &&
' },\n' &&
' {\n' &&
' "end": {\n' &&
' "col": 22,\n' &&
' "row": 3\n' &&
' },\n' &&
' "filename": "./zxxx.prog.abap",\n' &&
' "key": "space_before_dot",\n' &&
' "message": "Remove space before XXX",\n' &&
' "start": {\n' &&
' "col": 21,\n' &&
' "row": 3\n' &&
' }\n' &&
' }\n' &&
' ],\n' &&
' "null": null,\n' &&
' "number": 123,\n' &&
' "string": "abc"\n' &&
'}'.
rv_json = replace(
val = rv_json
sub = '\n'
with = cl_abap_char_utilities=>newline
occ = 0 ).
ENDMETHOD.
METHOD sample_nodes.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | | |8' ).
lo_nodes->add( '/ |string |str |abc | |0' ).
lo_nodes->add( '/ |number |num |123 | |0' ).
lo_nodes->add( '/ |float |num |123.45 | |0' ).
lo_nodes->add( '/ |boolean |bool |true | |0' ).
lo_nodes->add( '/ |false |bool |false | |0' ).
lo_nodes->add( '/ |null |null | | |0' ).
lo_nodes->add( '/ |date |str |2020-03-15 | |0' ).
lo_nodes->add( '/ |issues |array | | |2' ).
lo_nodes->add( '/issues/ |1 |object | |1 |5' ).
lo_nodes->add( '/issues/1/ |message |str |Indentation problem ... | |0' ).
lo_nodes->add( '/issues/1/ |key |str |indentation | |0' ).
lo_nodes->add( '/issues/1/ |start |object | | |2' ).
lo_nodes->add( '/issues/1/start/ |row |num |4 | |0' ).
lo_nodes->add( '/issues/1/start/ |col |num |3 | |0' ).
lo_nodes->add( '/issues/1/ |end |object | | |2' ).
lo_nodes->add( '/issues/1/end/ |row |num |4 | |0' ).
lo_nodes->add( '/issues/1/end/ |col |num |26 | |0' ).
lo_nodes->add( '/issues/1/ |filename |str |./zxxx.prog.abap | |0' ).
lo_nodes->add( '/issues/ |2 |object | |2 |5' ).
lo_nodes->add( '/issues/2/ |message |str |Remove space before XXX | |0' ).
lo_nodes->add( '/issues/2/ |key |str |space_before_dot | |0' ).
lo_nodes->add( '/issues/2/ |start |object | | |2' ).
lo_nodes->add( '/issues/2/start/ |row |num |3 | |0' ).
lo_nodes->add( '/issues/2/start/ |col |num |21 | |0' ).
lo_nodes->add( '/issues/2/ |end |object | | |2' ).
lo_nodes->add( '/issues/2/end/ |row |num |3 | |0' ).
lo_nodes->add( '/issues/2/end/ |col |num |22 | |0' ).
lo_nodes->add( '/issues/2/ |filename |str |./zxxx.prog.abap | |0' ).
rt_nodes = lo_nodes->sorted( ).
ENDMETHOD.
METHOD stringify_condensed.
DATA lv_act TYPE string.
DATA lv_exp TYPE string.
lv_act = lcl_json_serializer=>stringify( sample_nodes( ) ).
lv_exp = sample_json( ).
lv_exp = replace(
val = lv_exp
sub = cl_abap_char_utilities=>newline
with = ''
occ = 0 ).
CONDENSE lv_exp.
lv_exp = replace(
val = lv_exp
sub = `: `
with = ':'
occ = 0 ).
lv_exp = replace(
val = lv_exp
sub = `{ `
with = '{'
occ = 0 ).
lv_exp = replace(
val = lv_exp
sub = `[ `
with = '['
occ = 0 ).
lv_exp = replace(
val = lv_exp
sub = ` }`
with = '}'
occ = 0 ).
lv_exp = replace(
val = lv_exp
sub = ` ]`
with = ']'
occ = 0 ).
lv_exp = replace(
val = lv_exp
sub = `, `
with = ','
occ = 0 ).
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
ENDMETHOD.
METHOD stringify_indented.
DATA lv_act TYPE string.
DATA lv_exp TYPE string.
lv_act = lcl_json_serializer=>stringify(
it_json_tree = sample_nodes( )
iv_indent = 2 ).
lv_exp = sample_json( ).
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
ENDMETHOD.
METHOD array_index.
DATA lv_act TYPE string.
DATA lv_exp TYPE string.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |array | | |3' ).
lo_nodes->add( '/ |1 |str |abc |2 |0' ).
lo_nodes->add( '/ |2 |num |123 |1 |0' ).
lo_nodes->add( '/ |3 |num |123.45 |3 |0' ).
lv_act = lcl_json_serializer=>stringify( lo_nodes->sorted( ) ).
lv_exp = '[123,"abc",123.45]'.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
ENDMETHOD.
METHOD item_order.
DATA lv_act TYPE string.
DATA lv_exp TYPE string.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | | |3 |0' ).
lo_nodes->add( '/ |beta |str |b | |0 |3' ).
lo_nodes->add( '/ |zulu |str |z | |0 |1' ).
lo_nodes->add( '/ |alpha |str |a | |0 |2' ).
lv_act = lcl_json_serializer=>stringify( lo_nodes->sorted( ) ).
lv_exp = '{"alpha":"a","beta":"b","zulu":"z"}'. " NAME order ! (it is also a UT)
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
lv_act = lcl_json_serializer=>stringify(
it_json_tree = lo_nodes->sorted( )
iv_keep_item_order = abap_true ).
lv_exp = '{"zulu":"z","alpha":"a","beta":"b"}'.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
ENDMETHOD.
METHOD simple_indented.
DATA lv_act TYPE string.
DATA lv_exp TYPE string.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |array | | |3' ).
lo_nodes->add( '/ |1 |object | |2 |2' ).
lo_nodes->add( '/1/ |a |num |1 | |0' ).
lo_nodes->add( '/1/ |b |num |2 | |0' ).
lo_nodes->add( '/ |2 |num |123 |1 |0' ).
lo_nodes->add( '/ |3 |num |123.45 |3 |0' ).
lv_act = lcl_json_serializer=>stringify(
it_json_tree = lo_nodes->sorted( )
iv_indent = 2 ).
lv_exp = '[\n' &&
' 123,\n' &&
' {\n' &&
' "a": 1,\n' &&
' "b": 2\n' &&
' },\n' &&
' 123.45\n' &&
']'.
lv_exp = replace(
val = lv_exp
sub = '\n'
with = cl_abap_char_utilities=>newline
occ = 0 ).
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
ENDMETHOD.
METHOD empty_set.
DATA lv_act TYPE string.
DATA lv_exp TYPE string.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |array | | |0' ).
lv_act = lcl_json_serializer=>stringify(
it_json_tree = lo_nodes->sorted( )
iv_indent = 0 ).
lv_exp = '[]'.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
lv_act = lcl_json_serializer=>stringify(
it_json_tree = lo_nodes->sorted( )
iv_indent = 2 ).
lv_exp = '[]'.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
ENDMETHOD.
METHOD escape.
DATA lv_act TYPE string.
DATA lv_exp TYPE string.
DATA lv_val TYPE string.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
CREATE OBJECT lo_nodes.
lv_val = 'a' && '"' && '\' && cl_abap_char_utilities=>horizontal_tab && cl_abap_char_utilities=>cr_lf.
lo_nodes->add( | \| \|str \|{ lv_val }\| \|0| ).
lv_act = lcl_json_serializer=>stringify( lo_nodes->sorted( ) ).
lv_exp = '"a\"\\\t\r\n"'.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
ENDMETHOD.
METHOD empty.
DATA lv_act TYPE string.
DATA lv_exp TYPE string.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
CREATE OBJECT lo_nodes.
lv_act = lcl_json_serializer=>stringify( lo_nodes->sorted( ) ).
lv_exp = ''.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
ENDMETHOD.
ENDCLASS.
**********************************************************************
* UTILS
**********************************************************************
CLASS ltcl_utils_test DEFINITION FINAL
FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT.
PRIVATE SECTION.
METHODS normalize_path FOR TESTING.
METHODS split_path FOR TESTING.
METHODS validate_array_index FOR TESTING RAISING zcx_abapgit_ajson_error.
ENDCLASS.
CLASS zcl_abapgit_ajson DEFINITION LOCAL FRIENDS ltcl_utils_test.
CLASS ltcl_utils_test IMPLEMENTATION.
METHOD validate_array_index.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>validate_array_index( iv_path = 'x' iv_index = '123' )
exp = 123 ).
TRY.
lcl_utils=>validate_array_index( iv_path = 'x'
iv_index = 'a' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error.
ENDTRY.
TRY.
lcl_utils=>validate_array_index( iv_path = 'x'
iv_index = '0' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error.
ENDTRY.
ENDMETHOD.
METHOD normalize_path.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>normalize_path( '' )
exp = '/' ).
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>normalize_path( '/' )
exp = '/' ).
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>normalize_path( 'abc' )
exp = '/abc/' ).
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>normalize_path( '/abc' )
exp = '/abc/' ).
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>normalize_path( 'abc/' )
exp = '/abc/' ).
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>normalize_path( '/abc/' )
exp = '/abc/' ).
ENDMETHOD.
METHOD split_path.
DATA ls_exp TYPE zif_abapgit_ajson=>ty_path_name.
DATA lv_path TYPE string.
lv_path = ''. " alias to root
ls_exp-path = ''.
ls_exp-name = ''.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
lv_path = '/'.
ls_exp-path = ''.
ls_exp-name = ''.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
lv_path = '/abc/'.
ls_exp-path = '/'.
ls_exp-name = 'abc'.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
lv_path = 'abc'.
ls_exp-path = '/'.
ls_exp-name = 'abc'.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
lv_path = '/abc'.
ls_exp-path = '/'.
ls_exp-name = 'abc'.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
lv_path = 'abc/'.
ls_exp-path = '/'.
ls_exp-name = 'abc'.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
lv_path = '/abc/xyz'.
ls_exp-path = '/abc/'.
ls_exp-name = 'xyz'.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
lv_path = '/abc/xyz/'.
ls_exp-path = '/abc/'.
ls_exp-name = 'xyz'.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
ENDMETHOD.
ENDCLASS.
**********************************************************************
* READER
**********************************************************************
CLASS ltcl_reader_test DEFINITION FINAL
FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT.
PRIVATE SECTION.
METHODS get_value FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS get_node_type FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS exists FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS value_integer FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS value_number FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS value_boolean FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS value_string FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS members FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS slice FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS array_to_string_table FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS get_date FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS get_timestamp FOR TESTING RAISING zcx_abapgit_ajson_error.
ENDCLASS.
CLASS zcl_abapgit_ajson DEFINITION LOCAL FRIENDS ltcl_reader_test.
CLASS ltcl_reader_test IMPLEMENTATION.
METHOD slice.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |array | | |2' ).
lo_nodes->add( '/ |1 |object | |1 |5' ).
lo_nodes->add( '/1/ |message |str |Indentation problem ... | |0' ).
lo_nodes->add( '/1/ |key |str |indentation | |0' ).
lo_nodes->add( '/1/ |start |object | | |2' ).
lo_nodes->add( '/1/start/ |row |num |4 | |0' ).
lo_nodes->add( '/1/start/ |col |num |3 | |0' ).
lo_nodes->add( '/1/ |end |object | | |2' ).
lo_nodes->add( '/1/end/ |row |num |4 | |0' ).
lo_nodes->add( '/1/end/ |col |num |26 | |0' ).
lo_nodes->add( '/1/ |filename |str |./zxxx.prog.abap | |0' ).
lo_nodes->add( '/ |2 |object | |2 |5' ).
lo_nodes->add( '/2/ |message |str |Remove space before XXX | |0' ).
lo_nodes->add( '/2/ |key |str |space_before_dot | |0' ).
lo_nodes->add( '/2/ |start |object | | |2' ).
lo_nodes->add( '/2/start/ |row |num |3 | |0' ).
lo_nodes->add( '/2/start/ |col |num |21 | |0' ).
lo_nodes->add( '/2/ |end |object | | |2' ).
lo_nodes->add( '/2/end/ |row |num |3 | |0' ).
lo_nodes->add( '/2/end/ |col |num |22 | |0' ).
lo_nodes->add( '/2/ |filename |str |./zxxx.prog.abap | |0' ).
lo_cut = zcl_abapgit_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
lo_cut ?= lo_cut->zif_abapgit_ajson~slice( '/issues' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
" **********************************************************************
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | | |8' ).
lo_nodes->add( '/ |string |str |abc | |0' ).
lo_nodes->add( '/ |number |num |123 | |0' ).
lo_nodes->add( '/ |float |num |123.45 | |0' ).
lo_nodes->add( '/ |boolean |bool |true | |0' ).
lo_nodes->add( '/ |false |bool |false | |0' ).
lo_nodes->add( '/ |null |null | | |0' ).
lo_nodes->add( '/ |date |str |2020-03-15 | |0' ).
lo_nodes->add( '/ |issues |array | | |2' ).
lo_nodes->add( '/issues/ |1 |object | |1 |5' ).
lo_nodes->add( '/issues/1/ |message |str |Indentation problem ... | |0' ).
lo_nodes->add( '/issues/1/ |key |str |indentation | |0' ).
lo_nodes->add( '/issues/1/ |start |object | | |2' ).
lo_nodes->add( '/issues/1/start/ |row |num |4 | |0' ).
lo_nodes->add( '/issues/1/start/ |col |num |3 | |0' ).
lo_nodes->add( '/issues/1/ |end |object | | |2' ).
lo_nodes->add( '/issues/1/end/ |row |num |4 | |0' ).
lo_nodes->add( '/issues/1/end/ |col |num |26 | |0' ).
lo_nodes->add( '/issues/1/ |filename |str |./zxxx.prog.abap | |0' ).
lo_nodes->add( '/issues/ |2 |object | |2 |5' ).
lo_nodes->add( '/issues/2/ |message |str |Remove space before XXX | |0' ).
lo_nodes->add( '/issues/2/ |key |str |space_before_dot | |0' ).
lo_nodes->add( '/issues/2/ |start |object | | |2' ).
lo_nodes->add( '/issues/2/start/ |row |num |3 | |0' ).
lo_nodes->add( '/issues/2/start/ |col |num |21 | |0' ).
lo_nodes->add( '/issues/2/ |end |object | | |2' ).
lo_nodes->add( '/issues/2/end/ |row |num |3 | |0' ).
lo_nodes->add( '/issues/2/end/ |col |num |22 | |0' ).
lo_nodes->add( '/issues/2/ |filename |str |./zxxx.prog.abap | |0' ).
lo_cut = zcl_abapgit_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
lo_cut ?= lo_cut->zif_abapgit_ajson~slice( '/' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
" **********************************************************************
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | | |2' ).
lo_nodes->add( '/ |row |num |3 | |0' ).
lo_nodes->add( '/ |col |num |21 | |0' ).
lo_cut = zcl_abapgit_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
lo_cut ?= lo_cut->zif_abapgit_ajson~slice( '/issues/2/start/' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
ENDMETHOD.
METHOD get_value.
DATA lo_cut TYPE REF TO zif_abapgit_ajson.
lo_cut ?= zcl_abapgit_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get( '/string' )
exp = 'abc' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get( '/string/' )
exp = 'abc' ). " Hmmm ?
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get( '/boolean' )
exp = 'true' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get( '/issues/2/start/row' )
exp = '3' ).
ENDMETHOD.
METHOD get_node_type.
DATA li_cut TYPE REF TO zif_abapgit_ajson.
li_cut = zcl_abapgit_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/' )
exp = 'object' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/string' )
exp = 'str' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/number' )
exp = 'num' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/float' )
exp = 'num' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/boolean' )
exp = 'bool' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/false' )
exp = 'bool' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/null' )
exp = 'null' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/date' )
exp = 'str' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/issues' )
exp = 'array' ).
ENDMETHOD.
METHOD get_date.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
DATA lv_exp TYPE d.
CREATE OBJECT lo_cut.
lv_exp = '20200728'.
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | | |1' ).
lo_nodes->add( '/ |date1 |str |2020-07-28 | |0' ).
lo_cut->mt_json_tree = lo_nodes->mt_nodes.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->zif_abapgit_ajson~get_date( '/date1' )
exp = lv_exp ).
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | | |1' ).
lo_nodes->add( '/ |date1 |str |2020-07-28T01:00:00Z | |0' ).
lo_cut->mt_json_tree = lo_nodes->mt_nodes.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->zif_abapgit_ajson~get_date( '/date1' )
exp = lv_exp ).
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | | |1' ).
lo_nodes->add( '/ |date1 |str |20200728 | |0' ).
lo_cut->mt_json_tree = lo_nodes->mt_nodes.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->zif_abapgit_ajson~get_date( '/date1' )
exp = '' ).
ENDMETHOD.
METHOD get_timestamp.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
DATA lv_exp TYPE timestamp VALUE `20200728000000`.
CREATE OBJECT lo_cut.
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | | |1' ).
lo_nodes->add( '/ |timestamp|str |2020-07-28T00:00:00Z | |0' ).
lo_cut->mt_json_tree = lo_nodes->mt_nodes.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->zif_abapgit_ajson~get_timestamp( '/timestamp' )
exp = lv_exp ).
ENDMETHOD.
METHOD exists.
DATA lo_cut TYPE REF TO zif_abapgit_ajson.
lo_cut ?= zcl_abapgit_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->exists( '/string' )
exp = abap_true ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->exists( '/string/' )
exp = abap_true ). " mmmm ?
cl_abap_unit_assert=>assert_equals(
act = lo_cut->exists( '/xxx' )
exp = abap_false ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->exists( '/issues/2/start/row' )
exp = abap_true ).
ENDMETHOD.
METHOD value_integer.
DATA lo_cut TYPE REF TO zif_abapgit_ajson.
lo_cut ?= zcl_abapgit_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_integer( '/string' )
exp = 0 ). " Hmmmm ????
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_integer( '/number' )
exp = 123 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_integer( '/float' )
exp = 123 ).
ENDMETHOD.
METHOD value_number.
DATA lo_cut TYPE REF TO zif_abapgit_ajson.
lo_cut ?= zcl_abapgit_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_number( '/string' )
exp = 0 ). " Hmmmm ????
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_number( '/number' )
exp = +'123.0' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_number( '/float' )
exp = +'123.45' ).
ENDMETHOD.
METHOD value_boolean.
DATA lo_cut TYPE REF TO zif_abapgit_ajson.
lo_cut ?= zcl_abapgit_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_boolean( '/string' )
exp = abap_true ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_boolean( '/number' )
exp = abap_true ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_boolean( '/xxx' )
exp = abap_false ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_boolean( '/boolean' )
exp = abap_true ).
ENDMETHOD.
METHOD value_string.
DATA lo_cut TYPE REF TO zif_abapgit_ajson.
lo_cut ?= zcl_abapgit_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_string( '/string' )
exp = 'abc' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_string( '/number' )
exp = '123' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_string( '/xxx' )
exp = '' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_string( '/boolean' )
exp = 'true' ).
ENDMETHOD.
METHOD members.
DATA lt_exp TYPE string_table.
DATA lo_cut TYPE REF TO zif_abapgit_ajson.
lo_cut ?= zcl_abapgit_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
CLEAR lt_exp.
APPEND '1' TO lt_exp.
APPEND '2' TO lt_exp.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->members( '/issues' )
exp = lt_exp ).
CLEAR lt_exp.
APPEND 'col' TO lt_exp.
APPEND 'row' TO lt_exp.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->members( '/issues/1/start/' )
exp = lt_exp ).
ENDMETHOD.
METHOD array_to_string_table.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
DATA lt_act TYPE string_table.
DATA lt_exp TYPE string_table.
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |array | | |6' ).
lo_nodes->add( '/ |1 |num |123 |1|0' ).
lo_nodes->add( '/ |2 |num |234 |2|0' ).
lo_nodes->add( '/ |3 |str |abc |3|0' ).
lo_nodes->add( '/ |4 |bool |true |4|0' ).
lo_nodes->add( '/ |5 |bool |false |5|0' ).
lo_nodes->add( '/ |6 |null |null |6|0' ).
APPEND '123' TO lt_exp.
APPEND '234' TO lt_exp.
APPEND 'abc' TO lt_exp.
APPEND 'X' TO lt_exp.
APPEND '' TO lt_exp.
APPEND '' TO lt_exp.
CREATE OBJECT lo_cut.
lo_cut->mt_json_tree = lo_nodes->mt_nodes.
lt_act = lo_cut->zif_abapgit_ajson~array_to_string_table( '/' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = lt_exp ).
" negative
DATA lx TYPE REF TO zcx_abapgit_ajson_error.
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | | |1' ).
lo_nodes->add( '/ |a |str |abc | |0' ).
lo_cut->mt_json_tree = lo_nodes->mt_nodes.
TRY.
lo_cut->zif_abapgit_ajson~array_to_string_table( '/x' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Path not found: /x' ).
ENDTRY.
TRY.
lo_cut->zif_abapgit_ajson~array_to_string_table( '/' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Array expected at: /' ).
ENDTRY.
TRY.
lo_cut->zif_abapgit_ajson~array_to_string_table( '/a' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Array expected at: /a' ).
ENDTRY.
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |array | | |1' ).
lo_nodes->add( '/ |1 |object | |1|0' ).
lo_cut->mt_json_tree = lo_nodes->mt_nodes.
TRY.
lo_cut->zif_abapgit_ajson~array_to_string_table( '/' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Cannot convert [object] to string at [/1]' ).
ENDTRY.
ENDMETHOD.
ENDCLASS.
**********************************************************************
* JSON TO ABAP
**********************************************************************
CLASS ltcl_json_to_abap DEFINITION
FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT
FINAL.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_struc,
a TYPE string,
b TYPE i,
END OF ty_struc,
tty_struc TYPE STANDARD TABLE OF ty_struc WITH DEFAULT KEY,
BEGIN OF ty_complex,
str TYPE string,
int TYPE i,
float TYPE f,
bool TYPE abap_bool,
obj TYPE ty_struc,
tab TYPE tty_struc,
oref TYPE REF TO object,
date1 TYPE d,
date2 TYPE d,
timestamp1 TYPE timestamp,
timestamp2 TYPE timestamp,
timestamp3 TYPE timestamp,
END OF ty_complex.
METHODS find_loc FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS find_loc_negative FOR TESTING.
METHODS find_loc_append FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS to_abap FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS to_abap_negative FOR TESTING.
METHODS prepare_cut
EXPORTING
eo_cut TYPE REF TO lcl_json_to_abap
e_elem TYPE ty_struc
e_mock TYPE ty_complex.
ENDCLASS.
CLASS ltcl_json_to_abap IMPLEMENTATION.
METHOD prepare_cut.
e_mock-str = 'Hello'.
e_mock-int = 10.
e_mock-obj-a = 'World'.
e_elem-a = 'One'.
e_elem-b = 1.
APPEND e_elem TO e_mock-tab.
e_elem-a = 'two'.
e_elem-b = 2.
APPEND e_elem TO e_mock-tab.
lcl_json_to_abap=>bind(
CHANGING
c_obj = e_mock
co_instance = eo_cut ).
ENDMETHOD.
METHOD find_loc.
DATA last_elem TYPE ty_struc.
DATA ls_mock TYPE ty_complex.
DATA lo_cut TYPE REF TO lcl_json_to_abap.
prepare_cut(
IMPORTING
eo_cut = lo_cut
e_mock = ls_mock
e_elem = last_elem ).
DATA lr_ref TYPE REF TO data.
FIELD-SYMBOLS <val> TYPE any.
lr_ref = lo_cut->find_loc( 'str' ). " Relative also works but from root
ASSIGN lr_ref->* TO <val>.
cl_abap_unit_assert=>assert_equals(
act = <val>
exp = 'Hello' ).
lr_ref = lo_cut->find_loc( '/str' ).
ASSIGN lr_ref->* TO <val>.
cl_abap_unit_assert=>assert_equals(
act = <val>
exp = 'Hello' ).
lr_ref = lo_cut->find_loc( '/int' ).
ASSIGN lr_ref->* TO <val>.
cl_abap_unit_assert=>assert_equals(
act = <val>
exp = 10 ).
lr_ref = lo_cut->find_loc( '/obj/a' ).
ASSIGN lr_ref->* TO <val>.
cl_abap_unit_assert=>assert_equals(
act = <val>
exp = 'World' ).
lr_ref = lo_cut->find_loc( iv_path = '/obj'
iv_name = 'a' ).
ASSIGN lr_ref->* TO <val>.
cl_abap_unit_assert=>assert_equals(
act = <val>
exp = 'World' ).
lr_ref = lo_cut->find_loc( '/obj' ).
ASSIGN lr_ref->* TO <val>.
cl_abap_unit_assert=>assert_equals(
act = <val>
exp = ls_mock-obj ).
lr_ref = lo_cut->find_loc( '/' ).
ASSIGN lr_ref->* TO <val>.
cl_abap_unit_assert=>assert_equals(
act = <val>
exp = ls_mock ).
lr_ref = lo_cut->find_loc( '/tab/2' ).
ASSIGN lr_ref->* TO <val>.
cl_abap_unit_assert=>assert_equals(
act = <val>
exp = last_elem ).
lr_ref = lo_cut->find_loc( '/tab/1/a' ).
ASSIGN lr_ref->* TO <val>.
cl_abap_unit_assert=>assert_equals(
act = <val>
exp = 'One' ).
ENDMETHOD.
METHOD find_loc_append.
DATA last_elem TYPE ty_struc.
DATA ls_mock TYPE ty_complex.
DATA lo_cut TYPE REF TO lcl_json_to_abap.
DATA lx TYPE REF TO zcx_abapgit_ajson_error.
prepare_cut(
IMPORTING
eo_cut = lo_cut
e_mock = ls_mock
e_elem = last_elem ).
DATA lr_ref TYPE REF TO data.
FIELD-SYMBOLS <val> TYPE any.
lr_ref = lo_cut->find_loc( '/tab/1/a' ).
ASSIGN lr_ref->* TO <val>.
cl_abap_unit_assert=>assert_equals(
act = <val>
exp = 'One' ).
cl_abap_unit_assert=>assert_equals(
act = lines( ls_mock-tab )
exp = 2 ).
TRY.
lo_cut->find_loc( '/tab/3/a' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Index not found in table' ).
ENDTRY.
lr_ref = lo_cut->find_loc( iv_path = '/tab/3/a'
iv_append_tables = abap_true ).
ASSIGN lr_ref->* TO <val>.
cl_abap_unit_assert=>assert_equals(
act = <val>
exp = '' ).
cl_abap_unit_assert=>assert_equals(
act = lines( ls_mock-tab )
exp = 3 ).
TRY.
lo_cut->find_loc( '/tab/5/a' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Index not found in table' ).
ENDTRY.
ENDMETHOD.
METHOD find_loc_negative.
DATA lo_cut TYPE REF TO lcl_json_to_abap.
DATA lx TYPE REF TO zcx_abapgit_ajson_error.
DATA ls_mock TYPE ty_complex.
prepare_cut(
IMPORTING
e_mock = ls_mock " Must be here to keep reference alive
eo_cut = lo_cut ).
TRY.
lo_cut->find_loc( '/xyz' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Path not found' ).
ENDTRY.
TRY.
lo_cut->find_loc( '/oref/xyz' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Cannot assign to ref' ).
ENDTRY.
TRY.
lo_cut->find_loc( '/tab/xyz' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Need index to access tables' ).
ENDTRY.
TRY.
lo_cut->find_loc( '/tab/5' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Index not found in table' ).
ENDTRY.
ENDMETHOD.
METHOD to_abap.
DATA lo_cut TYPE REF TO lcl_json_to_abap.
DATA ls_mock TYPE ty_complex.
DATA lv_exp_date TYPE d VALUE '20200728'.
DATA lv_exp_timestamp TYPE timestamp VALUE '20200728000000'.
lcl_json_to_abap=>bind(
CHANGING
c_obj = ls_mock
co_instance = lo_cut ).
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
CREATE OBJECT lo_nodes.
lo_nodes->add( '/ | |object | | ' ).
lo_nodes->add( '/ |str |str |hello | ' ).
lo_nodes->add( '/ |int |num |5 | ' ).
lo_nodes->add( '/ |float |num |5.5 | ' ).
lo_nodes->add( '/ |bool |bool |true | ' ).
lo_nodes->add( '/ |obj |object | | ' ).
lo_nodes->add( '/obj |a |str |world | ' ).
lo_nodes->add( '/ |tab |array | | ' ).
lo_nodes->add( '/tab |1 |object | |1' ).
lo_nodes->add( '/tab/1 |a |str | One | ' ).
lo_nodes->add( '/tab |2 |object | |2' ).
lo_nodes->add( '/tab/2 |a |str | Two | ' ).
lo_nodes->add( '/ |date1 |str |2020-07-28 | ' ).
lo_nodes->add( '/ |date2 |str |2020-07-28T00:00:00Z | ' ).
lo_nodes->add( '/ |timestamp1 |str |2020-07-28T00:00:00 | ' ).
lo_nodes->add( '/ |timestamp2 |str |2020-07-28T00:00:00Z | ' ).
lo_nodes->add( '/ |timestamp3 |str |2020-07-28T01:00:00+01:00 | ' ).
lo_cut->to_abap( lo_nodes->sorted( ) ).
cl_abap_unit_assert=>assert_equals(
act = ls_mock-str
exp = 'hello' ).
cl_abap_unit_assert=>assert_equals(
act = ls_mock-int
exp = 5 ).
cl_abap_unit_assert=>assert_equals(
act = ls_mock-float
exp = '5.5' ).
cl_abap_unit_assert=>assert_equals(
act = ls_mock-bool
exp = abap_true ).
cl_abap_unit_assert=>assert_equals(
act = ls_mock-obj-a
exp = 'world' ).
cl_abap_unit_assert=>assert_equals(
act = ls_mock-date1
exp = lv_exp_date ).
cl_abap_unit_assert=>assert_equals(
act = ls_mock-date2
exp = lv_exp_date ).
cl_abap_unit_assert=>assert_equals(
act = ls_mock-timestamp1
exp = lv_exp_timestamp ).
cl_abap_unit_assert=>assert_equals(
act = ls_mock-timestamp2
exp = lv_exp_timestamp ).
cl_abap_unit_assert=>assert_equals(
act = ls_mock-timestamp3
exp = lv_exp_timestamp ).
DATA ls_elem LIKE LINE OF ls_mock-tab.
cl_abap_unit_assert=>assert_equals(
act = lines( ls_mock-tab )
exp = 2 ).
READ TABLE ls_mock-tab INTO ls_elem INDEX 1.
cl_abap_unit_assert=>assert_equals(
act = ls_elem-a
exp = 'One' ).
READ TABLE ls_mock-tab INTO ls_elem INDEX 2.
cl_abap_unit_assert=>assert_equals(
act = ls_elem-a
exp = 'Two' ).
ENDMETHOD.
METHOD to_abap_negative.
DATA lo_cut TYPE REF TO lcl_json_to_abap.
DATA lx TYPE REF TO zcx_abapgit_ajson_error.
DATA ls_mock TYPE ty_complex.
lcl_json_to_abap=>bind(
CHANGING
c_obj = ls_mock
co_instance = lo_cut ).
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
TRY.
CREATE OBJECT lo_nodes.
lo_nodes->add( '/ | |object | ' ).
lo_nodes->add( '/ |str |object | ' ).
lo_cut->to_abap( lo_nodes->sorted( ) ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Expected structure' ).
ENDTRY.
TRY.
CREATE OBJECT lo_nodes.
lo_nodes->add( '/ | |object | ' ).
lo_nodes->add( '/ |str |array | ' ).
lo_cut->to_abap( lo_nodes->sorted( ) ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Expected table' ).
ENDTRY.
TRY.
CREATE OBJECT lo_nodes.
lo_nodes->add( '/ | |object | ' ).
lo_nodes->add( '/ |int |str |hello ' ).
lo_cut->to_abap( lo_nodes->sorted( ) ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Source is not a number' ).
ENDTRY.
TRY.
CREATE OBJECT lo_nodes.
lo_nodes->add( '/ | |object | ' ).
lo_nodes->add( '/ |date1 |str |baddate ' ).
lo_cut->to_abap( lo_nodes->sorted( ) ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Unexpected date format' ).
ENDTRY.
ENDMETHOD.
ENDCLASS.
**********************************************************************
* WRITER
**********************************************************************
CLASS ltcl_writer_test DEFINITION FINAL
FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT.
PRIVATE SECTION.
METHODS set_ajson FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_value FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS ignore_empty FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_obj FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_tab FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_tab_hashed FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS prove_path_exists FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS delete_subtree FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS delete FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS arrays FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS arrays_negative FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS root_assignment FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_bool FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_str FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_int FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_date FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_timestamp FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS read_only FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_array_obj FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_with_type FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_with_type_slice
IMPORTING
io_json_in TYPE REF TO zcl_abapgit_ajson
io_json_out TYPE REF TO zif_abapgit_ajson
iv_path TYPE string
RAISING
zcx_abapgit_ajson_error.
ENDCLASS.
CLASS zcl_abapgit_ajson DEFINITION LOCAL FRIENDS ltcl_writer_test.
CLASS ltcl_writer_test IMPLEMENTATION.
METHOD prove_path_exists.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||1' ).
lo_nodes_exp->add( '/a/ |b |object | ||1' ).
lo_nodes_exp->add( '/a/b/ |c |object | ||1' ).
lo_nodes_exp->add( '/a/b/c/ |d |object | ||0' ).
lo_cut->prove_path_exists( '/a/b/c/d/' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||1' ).
lo_nodes_exp->add( '/a/ |b |object | ||1' ).
lo_nodes_exp->add( '/a/b/ |c |object | ||1' ).
lo_nodes_exp->add( '/a/b/c/ |d |object | ||1' ).
lo_nodes_exp->add( '/a/b/c/d |e |object | ||0' ).
lo_cut->prove_path_exists( '/a/b/c/d/e/' ).
ENDMETHOD.
METHOD delete_subtree.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||1' ).
lo_nodes_exp->add( '/a/ |b |object | ||1' ).
lo_nodes_exp->add( '/a/b/ |c |object | ||1' ).
lo_nodes_exp->add( '/a/b/c/ |d |object | ||0' ).
lo_cut->mt_json_tree = lo_nodes_exp->mt_nodes.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||0' ).
lo_cut->delete_subtree(
iv_path = '/a/'
iv_name = 'b' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
ENDMETHOD.
METHOD delete.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||1' ).
lo_nodes_exp->add( '/a/ |b |object | ||1' ).
lo_nodes_exp->add( '/a/b/ |c |object | ||1' ).
lo_nodes_exp->add( '/a/b/c/ |d |object | ||0' ).
lo_cut->mt_json_tree = lo_nodes_exp->mt_nodes.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||0' ).
lo_cut->zif_abapgit_ajson~delete( iv_path = '/a/b' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||1' ).
lo_nodes_exp->add( '/a/ |b |object | ||1' ).
lo_nodes_exp->add( '/a/b/ |c |object | ||1' ).
lo_nodes_exp->add( '/a/b/c/ |d |object | ||0' ).
lo_cut->mt_json_tree = lo_nodes_exp->mt_nodes.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||0' ).
lo_cut->zif_abapgit_ajson~delete( iv_path = '/a/b/' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
ENDMETHOD.
METHOD set_ajson.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
DATA lo_src TYPE REF TO zcl_abapgit_ajson.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
lo_src = zcl_abapgit_ajson=>create_empty( ).
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
" Prepare source
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | ||1' ).
lo_nodes->add( '/ |x |object | ||2' ).
lo_nodes->add( '/x/ |b |str |abc ||0' ).
lo_nodes->add( '/x/ |c |num |10 ||0' ).
lo_src->mt_json_tree = lo_nodes->mt_nodes.
" Test 1 - assign root
li_writer->set(
iv_path = ''
iv_val = lo_src ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
li_writer->set(
iv_path = '/'
iv_val = lo_src ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
" Test 2 - assign deep
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | ||1' ).
lo_nodes->add( '/ |a |object | ||1' ).
lo_nodes->add( '/a/ |b |object | ||1' ).
lo_nodes->add( '/a/b/ |c |object | ||1' ).
lo_nodes->add( '/a/b/c/ |x |object | ||2' ).
lo_nodes->add( '/a/b/c/x/ |b |str |abc ||0' ).
lo_nodes->add( '/a/b/c/x/ |c |num |10 ||0' ).
li_writer->clear( ).
li_writer->set(
iv_path = '/a/b/c'
iv_val = lo_src ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
" Test 3 - assign rewrite
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | ||1' ).
lo_nodes->add( '/ |a |object | ||1' ).
lo_nodes->add( '/a/ |b |object | ||1' ).
lo_nodes->add( '/a/b/ |x |object | ||2' ).
lo_nodes->add( '/a/b/x/ |b |str |abc ||0' ).
lo_nodes->add( '/a/b/x/ |c |num |10 ||0' ).
li_writer->set(
iv_path = '/a/b'
iv_val = lo_src ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
ENDMETHOD.
METHOD set_value.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
" Prepare source
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | ||1' ).
lo_nodes->add( '/ |x |object | ||2' ).
lo_nodes->add( '/x/ |b |str |abc ||0' ).
lo_nodes->add( '/x/ |c |num |10 ||0' ).
li_writer->set(
iv_path = '/x/b'
iv_val = 'abc' ).
li_writer->set(
iv_path = '/x/c'
iv_val = 10 ).
li_writer->set( " ignore empty
iv_path = '/x/d'
iv_val = 0 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
ENDMETHOD.
METHOD ignore_empty.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | ||1' ).
lo_nodes->add( '/ |a |num |1 ||0' ).
li_writer->set(
iv_path = '/a'
iv_val = 1 ).
li_writer->set( " ignore empty
iv_path = '/b'
iv_val = 0 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | ||2' ).
lo_nodes->add( '/ |a |num |1 ||0' ).
lo_nodes->add( '/ |b |num |0 ||0' ).
li_writer->set(
iv_ignore_empty = abap_false
iv_path = '/b'
iv_val = 0 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
ENDMETHOD.
METHOD set_obj.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
DATA:
BEGIN OF ls_struc,
b TYPE string VALUE 'abc',
c TYPE i VALUE 10,
END OF ls_struc.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
" Prepare source
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | ||1' ).
lo_nodes->add( '/ |x |object | ||2' ).
lo_nodes->add( '/x/ |b |str |abc ||0' ).
lo_nodes->add( '/x/ |c |num |10 ||0' ).
li_writer->set(
iv_path = '/x'
iv_val = ls_struc ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
ENDMETHOD.
METHOD set_tab.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
DATA lt_tab TYPE string_table.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
APPEND 'hello' TO lt_tab.
APPEND 'world' TO lt_tab.
" Prepare source
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | | |1' ).
lo_nodes->add( '/ |x |array | | |2' ).
lo_nodes->add( '/x/ |1 |str |hello|1|0' ).
lo_nodes->add( '/x/ |2 |str |world|2|0' ).
li_writer->set(
iv_path = '/x'
iv_val = lt_tab ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
ENDMETHOD.
METHOD set_tab_hashed.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
DATA lt_tab TYPE HASHED TABLE OF string WITH UNIQUE DEFAULT KEY.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
INSERT `hello` INTO TABLE lt_tab.
INSERT `world` INTO TABLE lt_tab.
" Prepare source
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | | |1' ).
lo_nodes->add( '/ |x |array | | |2' ).
lo_nodes->add( '/x/ |1 |str |hello|1|0' ).
lo_nodes->add( '/x/ |2 |str |world|2|0' ).
li_writer->set(
iv_path = '/x'
iv_val = lt_tab ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
ENDMETHOD.
METHOD arrays.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
" touch
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | | |1' ).
lo_nodes_exp->add( '/ |a |array | | |0' ).
li_writer->touch_array( iv_path = '/a' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" add string
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | | |1' ).
lo_nodes_exp->add( '/ |a |array | | |1' ).
lo_nodes_exp->add( '/a/ |1 |str |hello|1|0' ).
li_writer->push(
iv_path = '/a'
iv_val = 'hello' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" add obj
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | | |1' ).
lo_nodes_exp->add( '/ |a |array | | |2' ).
lo_nodes_exp->add( '/a/ |1 |str |hello|1|0' ).
lo_nodes_exp->add( '/a/ |2 |object | |2|1' ).
lo_nodes_exp->add( '/a/2/ |x |str |world| |0' ).
DATA:
BEGIN OF ls_dummy,
x TYPE string VALUE 'world',
END OF ls_dummy.
li_writer->push(
iv_path = '/a'
iv_val = ls_dummy ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" re-touch
li_writer->touch_array( iv_path = '/a' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" re-touch with clear
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | | |1' ).
lo_nodes_exp->add( '/ |a |array | | |0' ).
li_writer->touch_array(
iv_path = '/a'
iv_clear = abap_true ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" free-add array item (index must be updated)
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | | |1' ).
lo_nodes_exp->add( '/ |a |array | | |2' ).
lo_nodes_exp->add( '/a/ |1 |object | |1|1' ).
lo_nodes_exp->add( '/a/1/ |x |num |123 | |0' ).
lo_nodes_exp->add( '/a/ |2 |num |234 |2|0' ).
li_writer->set(
iv_path = '/a/1/x'
iv_val = 123 ).
li_writer->set(
iv_path = '/a/2'
iv_val = 234 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
ENDMETHOD.
METHOD arrays_negative.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
li_writer->touch_array( iv_path = '/a' ).
li_writer->push(
iv_path = '/a'
iv_val = 123 ).
" touch another node
DATA lx TYPE REF TO zcx_abapgit_ajson_error.
TRY.
li_writer->touch_array( iv_path = '/a/1' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Path [/a/1] already used and is not array' ).
ENDTRY.
" push to not array
TRY.
li_writer->push(
iv_path = '/a/1'
iv_val = 123 ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Path [/a/1] is not array' ).
ENDTRY.
" push to not array
TRY.
li_writer->push(
iv_path = '/x'
iv_val = 123 ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Path [/x] does not exist' ).
ENDTRY.
" set array item with non-numeric key
TRY.
li_writer->set(
iv_path = '/a/abc/x'
iv_val = 123 ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Cannot add non-numeric key [abc] to array [/a/]' ).
ENDTRY.
TRY.
li_writer->set(
iv_path = '/a/abc'
iv_val = 123 ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Cannot add non-numeric key [abc] to array [/a/]' ).
ENDTRY.
" set array item with zero key
TRY.
li_writer->set(
iv_path = '/a/0'
iv_val = 123 ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error INTO lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Cannot add zero key to array [/a/]' ).
ENDTRY.
ENDMETHOD.
METHOD root_assignment.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
DATA:
BEGIN OF ls_dummy,
x TYPE string VALUE 'hello',
END OF ls_dummy.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
" object
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |x |str |hello||0' ).
li_writer->set(
iv_path = '/'
iv_val = ls_dummy ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" object empty path
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |x |str |hello||0' ).
li_writer->clear( ).
li_writer->set(
iv_path = ''
iv_val = ls_dummy ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" array
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |array | | |1' ).
lo_nodes_exp->add( '/ |1 |str |hello|1|0' ).
li_writer->clear( ).
li_writer->touch_array( iv_path = '' ).
li_writer->push(
iv_path = ''
iv_val = 'hello' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" value
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |str |hello||0' ).
li_writer->clear( ).
li_writer->set(
iv_path = ''
iv_val = 'hello' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
ENDMETHOD.
METHOD set_bool.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
DATA lt_tab TYPE string_table.
" abap_bool
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||2' ).
lo_nodes_exp->add( '/ |a |bool |true ||0' ).
lo_nodes_exp->add( '/ |b |bool |false ||0' ).
li_writer->set_boolean(
iv_path = '/a'
iv_val = abap_true ).
li_writer->set_boolean(
iv_path = '/b'
iv_val = abap_false ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" int
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||2' ).
lo_nodes_exp->add( '/ |a |bool |true ||0' ).
lo_nodes_exp->add( '/ |b |bool |false ||0' ).
li_writer->set_boolean(
iv_path = '/a'
iv_val = 1 ).
li_writer->set_boolean(
iv_path = '/b'
iv_val = 0 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" tab
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||2' ).
lo_nodes_exp->add( '/ |a |bool |true ||0' ).
lo_nodes_exp->add( '/ |b |bool |false ||0' ).
APPEND 'hello' TO lt_tab.
li_writer->set_boolean(
iv_path = '/a'
iv_val = lt_tab ).
CLEAR lt_tab.
li_writer->set_boolean(
iv_path = '/b'
iv_val = lt_tab ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
ENDMETHOD.
METHOD set_str.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
DATA lv_date TYPE d.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||3' ).
lo_nodes_exp->add( '/ |a |str |123 ||0' ).
lo_nodes_exp->add( '/ |b |str |X ||0' ).
lo_nodes_exp->add( '/ |c |str |20200705 ||0' ).
li_writer->set_string(
iv_path = '/a'
iv_val = '123' ).
li_writer->set_string(
iv_path = '/b'
iv_val = abap_true ).
lv_date = '20200705'.
li_writer->set_string(
iv_path = '/c'
iv_val = lv_date ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
ENDMETHOD.
METHOD set_int.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |num |123 ||0' ).
li_writer->set_integer(
iv_path = '/a'
iv_val = 123 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
ENDMETHOD.
METHOD set_date.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
DATA lv_date TYPE d.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |str |2020-07-05 ||0' ).
lv_date = '20200705'.
li_writer->set_date(
iv_path = '/a'
iv_val = lv_date ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
ENDMETHOD.
METHOD set_timestamp.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
DATA lv_timestamp TYPE timestamp.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |str |2021-05-05T12-00-00Z ||0' ).
lv_timestamp = '20210505120000'.
li_writer->set_timestamp(
iv_path = '/a'
iv_val = lv_timestamp ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
ENDMETHOD.
METHOD read_only.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
" Prepare source
li_writer->set(
iv_path = '/a'
iv_val = 'abc' ).
li_writer->touch_array( iv_path = '/b' ).
li_writer->push(
iv_path = '/b'
iv_val = 'abc' ).
lo_cut->freeze( ).
TRY.
li_writer->set(
iv_path = '/c'
iv_val = 'abc' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error.
ENDTRY.
TRY.
li_writer->touch_array( iv_path = '/d' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error.
ENDTRY.
TRY.
li_writer->push(
iv_path = '/b'
iv_val = 'xyz' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error.
ENDTRY.
TRY.
li_writer->delete( iv_path = '/a' ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error.
ENDTRY.
TRY.
li_writer->clear( ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abapgit_ajson_error.
ENDTRY.
ENDMETHOD.
METHOD set_array_obj.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | | |1' ).
lo_nodes_exp->add( '/ |issues |array | | |2' ).
lo_nodes_exp->add( '/issues/ |1 |object | |1 |1' ).
lo_nodes_exp->add( '/issues/ |2 |object | |2 |1' ).
lo_nodes_exp->add( '/issues/1/ |end |object | | |2' ).
lo_nodes_exp->add( '/issues/1/end/ |col |num |26 | |0' ).
lo_nodes_exp->add( '/issues/1/end/ |row |num |4 | |0' ).
lo_nodes_exp->add( '/issues/2/ |end |object | | |2' ).
lo_nodes_exp->add( '/issues/2/end/ |col |num |22 | |0' ).
lo_nodes_exp->add( '/issues/2/end/ |row |num |3 | |0' ).
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
li_writer->touch_array( iv_path = '/issues' ).
li_writer->set(
iv_path = '/issues/1/end/col'
iv_val = 26 ).
li_writer->set(
iv_path = '/issues/1/end/row'
iv_val = 4 ).
li_writer->set(
iv_path = '/issues/2/end/col'
iv_val = 22 ).
li_writer->set(
iv_path = '/issues/2/end/row'
iv_val = 3 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
ENDMETHOD.
METHOD set_with_type.
DATA lo_sample TYPE REF TO zcl_abapgit_ajson.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
lo_sample = zcl_abapgit_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
set_with_type_slice( io_json_in = lo_sample
io_json_out = li_writer
iv_path = '/' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_sample->mt_json_tree ).
ENDMETHOD.
METHOD set_with_type_slice.
DATA lv_path TYPE string.
FIELD-SYMBOLS <node> TYPE zif_abapgit_ajson=>ty_node.
LOOP AT io_json_in->mt_json_tree ASSIGNING <node> WHERE path = iv_path.
lv_path = <node>-path && <node>-name && '/'.
CASE <node>-type.
WHEN 'array'.
io_json_out->touch_array( lv_path ).
set_with_type_slice( io_json_in = io_json_in
io_json_out = io_json_out
iv_path = lv_path ).
WHEN 'object'.
set_with_type_slice( io_json_in = io_json_in
io_json_out = io_json_out
iv_path = lv_path ).
WHEN OTHERS.
io_json_out->set(
iv_path = lv_path
iv_val = <node>-value
iv_node_type = <node>-type ).
ENDCASE.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
**********************************************************************
* INTEGRATED
**********************************************************************
CLASS ltcl_integrated DEFINITION
FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT
FINAL.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_loc,
row TYPE i,
col TYPE i,
END OF ty_loc,
BEGIN OF ty_issue,
message TYPE string,
key TYPE string,
filename TYPE string,
start TYPE ty_loc,
end TYPE ty_loc,
END OF ty_issue,
tt_issues TYPE STANDARD TABLE OF ty_issue WITH DEFAULT KEY,
BEGIN OF ty_target,
string TYPE string,
number TYPE i,
float TYPE f,
boolean TYPE abap_bool,
false TYPE abap_bool,
null TYPE string,
date TYPE string, " ??? TODO
issues TYPE tt_issues,
END OF ty_target.
METHODS reader FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS array_index FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS array_simple FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS stringify FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS item_order_integrated FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS chaining FOR TESTING RAISING zcx_abapgit_ajson_error.
ENDCLASS.
CLASS ltcl_integrated IMPLEMENTATION.
METHOD array_simple.
DATA lt_act TYPE string_table.
DATA lt_exp TYPE string_table.
DATA lv_exp TYPE string.
DATA lv_src TYPE string.
lv_src = '['.
DO 10 TIMES.
IF sy-index <> 1.
lv_src = lv_src && `, `.
ENDIF.
lv_src = lv_src && |"{ sy-index }"|.
lv_exp = |{ sy-index }|.
APPEND lv_exp TO lt_exp.
ENDDO.
lv_src = lv_src && ']'.
DATA li_reader TYPE REF TO zif_abapgit_ajson.
li_reader = zcl_abapgit_ajson=>parse( lv_src ).
li_reader->to_abap( IMPORTING ev_container = lt_act ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = lt_exp ).
ENDMETHOD.
METHOD array_index.
DATA lt_act TYPE TABLE OF ty_loc.
DATA lt_exp TYPE TABLE OF ty_loc.
DATA ls_exp TYPE ty_loc.
DATA lv_src TYPE string.
lv_src = '['.
DO 10 TIMES.
IF sy-index <> 1.
lv_src = lv_src && `, `.
ENDIF.
lv_src = lv_src && |\{ "row": { sy-index } \}|.
ls_exp-row = sy-index.
APPEND ls_exp TO lt_exp.
ENDDO.
lv_src = lv_src && ']'.
DATA li_reader TYPE REF TO zif_abapgit_ajson.
li_reader = zcl_abapgit_ajson=>parse( lv_src ).
li_reader->to_abap( IMPORTING ev_container = lt_act ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = lt_exp ).
ENDMETHOD.
METHOD reader.
DATA lv_source TYPE string.
DATA li_reader TYPE REF TO zif_abapgit_ajson.
lv_source = ltcl_parser_test=>sample_json( ).
li_reader = zcl_abapgit_ajson=>parse( lv_source ).
cl_abap_unit_assert=>assert_equals(
act = li_reader->get( '/string' )
exp = 'abc' ).
DATA ls_act TYPE ty_target.
DATA ls_exp TYPE ty_target.
FIELD-SYMBOLS <i> LIKE LINE OF ls_exp-issues.
ls_exp-string = 'abc'.
ls_exp-number = 123.
ls_exp-float = '123.45'.
ls_exp-boolean = abap_true.
ls_exp-false = abap_false.
ls_exp-date = '2020-03-15'.
APPEND INITIAL LINE TO ls_exp-issues ASSIGNING <i>.
<i>-message = 'Indentation problem ...'.
<i>-key = 'indentation'.
<i>-filename = './zxxx.prog.abap'.
<i>-start-row = 4.
<i>-start-col = 3.
<i>-end-row = 4.
<i>-end-col = 26.
APPEND INITIAL LINE TO ls_exp-issues ASSIGNING <i>.
<i>-message = 'Remove space before XXX'.
<i>-key = 'space_before_dot'.
<i>-filename = './zxxx.prog.abap'.
<i>-start-row = 3.
<i>-start-col = 21.
<i>-end-row = 3.
<i>-end-col = 22.
li_reader->to_abap( IMPORTING ev_container = ls_act ).
cl_abap_unit_assert=>assert_equals(
act = ls_act
exp = ls_exp ).
ENDMETHOD.
METHOD stringify.
DATA lo_cut TYPE REF TO zcl_abapgit_ajson.
DATA li_writer TYPE REF TO zif_abapgit_ajson.
DATA lv_exp TYPE string.
DATA: BEGIN OF ls_dummy, x TYPE i, END OF ls_dummy.
ls_dummy-x = 1.
lo_cut = zcl_abapgit_ajson=>create_empty( ).
li_writer = lo_cut.
li_writer->set(
iv_path = '/a'
iv_val = 1 ).
li_writer->set(
iv_path = '/b'
iv_val = 'B' ).
li_writer->set(
iv_path = '/c'
iv_val = abap_true ).
li_writer->set_null( iv_path = '/d' ).
" simple test
lv_exp = '{"a":1,"b":"B","c":true,"d":null}'.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->stringify( )
exp = lv_exp ).
li_writer->touch_array( iv_path = '/e' ).
li_writer->touch_array( iv_path = '/f' ).
li_writer->push(
iv_path = '/f'
iv_val = 5 ).
li_writer->push(
iv_path = '/f'
iv_val = ls_dummy ).
li_writer->set(
iv_path = '/g'
iv_val = ls_dummy ).
" complex test
lv_exp = '{"a":1,"b":"B","c":true,"d":null,"e":[],"f":[5,{"x":1}],"g":{"x":1}}'.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->stringify( )
exp = lv_exp ).
" complex test indented
lv_exp =
'{\n' &&
' "a": 1,\n' &&
' "b": "B",\n' &&
' "c": true,\n' &&
' "d": null,\n' &&
' "e": [],\n' &&
' "f": [\n' &&
' 5,\n' &&
' {\n' &&
' "x": 1\n' &&
' }\n' &&
' ],\n' &&
' "g": {\n' &&
' "x": 1\n' &&
' }\n' &&
'}'.
lv_exp = replace(
val = lv_exp
sub = '\n'
with = cl_abap_char_utilities=>newline
occ = 0 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->stringify( iv_indent = 2 )
exp = lv_exp ).
ENDMETHOD.
METHOD item_order_integrated.
DATA:
BEGIN OF ls_dummy,
zulu TYPE string,
alpha TYPE string,
beta TYPE string,
END OF ls_dummy.
DATA lv_act TYPE string.
DATA lv_exp TYPE string.
DATA li_cut TYPE REF TO zif_abapgit_ajson.
ls_dummy-alpha = 'a'.
ls_dummy-beta = 'b'.
ls_dummy-zulu = 'z'.
" NAME order
li_cut = zcl_abapgit_ajson=>create_empty( ).
li_cut->set(
iv_path = '/'
iv_val = ls_dummy ).
lv_act = li_cut->stringify( ).
lv_exp = '{"alpha":"a","beta":"b","zulu":"z"}'.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
" STRUC order (keep)
li_cut = zcl_abapgit_ajson=>create_empty( ).
li_cut->keep_item_order( ).
li_cut->set(
iv_path = '/'
iv_val = ls_dummy ).
lv_act = li_cut->stringify( ).
lv_exp = '{"zulu":"z","alpha":"a","beta":"b"}'.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
ENDMETHOD.
METHOD chaining.
DATA li_cut TYPE REF TO zif_abapgit_ajson.
li_cut = zcl_abapgit_ajson=>create_empty( ).
cl_abap_unit_assert=>assert_bound(
li_cut->set(
iv_path = '/a'
iv_val = 1 ) ).
cl_abap_unit_assert=>assert_bound( li_cut->delete( iv_path = '/a' ) ).
cl_abap_unit_assert=>assert_bound( li_cut->touch_array( iv_path = '/array' ) ).
cl_abap_unit_assert=>assert_bound(
li_cut->push(
iv_path = '/array'
iv_val = '1' ) ).
cl_abap_unit_assert=>assert_bound( li_cut->keep_item_order( ) ).
ENDMETHOD.
ENDCLASS.
**********************************************************************
* ABAP TO JSON
**********************************************************************
CLASS ltcl_abap_to_json DEFINITION
FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT
FINAL.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_struc,
a TYPE string,
b TYPE i,
c TYPE abap_bool,
d TYPE xfeld,
END OF ty_struc,
tt_struc TYPE STANDARD TABLE OF ty_struc WITH DEFAULT KEY,
BEGIN OF ty_struc_complex.
INCLUDE TYPE ty_struc.
TYPES:
el TYPE string,
struc TYPE ty_struc,
tab TYPE tt_struc,
stab TYPE string_table,
END OF ty_struc_complex.
METHODS set_ajson FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_value FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_null FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_obj FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_array FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS set_complex_obj FOR TESTING RAISING zcx_abapgit_ajson_error.
METHODS prefix FOR TESTING RAISING zcx_abapgit_ajson_error.
ENDCLASS.
CLASS zcl_abapgit_ajson DEFINITION LOCAL FRIENDS ltcl_abap_to_json.
CLASS ltcl_abap_to_json IMPLEMENTATION.
METHOD set_ajson.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
DATA lo_src TYPE REF TO zcl_abapgit_ajson.
lo_src = zcl_abapgit_ajson=>create_empty( ).
CREATE OBJECT lo_nodes.
lo_nodes->add( ' | |object | ||1' ).
lo_nodes->add( '/ |a |object | ||1' ).
lo_nodes->add( '/a/ |b |object | ||1' ).
lo_nodes->add( '/a/b/ |c |object | ||0' ).
lo_src->mt_json_tree = lo_nodes->mt_nodes.
DATA lt_nodes TYPE zif_abapgit_ajson=>ty_nodes_tt.
lt_nodes = lcl_abap_to_json=>convert( iv_data = lo_src ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes->mt_nodes ).
ENDMETHOD.
METHOD set_value.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
DATA lt_nodes TYPE zif_abapgit_ajson=>ty_nodes_tt.
" number
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |num |1 ||' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = 1 ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
" string
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |str |abc ||' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = 'abc' ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
" true
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |bool |true ||' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = abap_true ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
" false
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |bool |false ||' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = abap_false ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
" xfeld
DATA lv_xfeld TYPE xfeld.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |bool |true ||' ).
lv_xfeld = 'X'.
lt_nodes = lcl_abap_to_json=>convert( iv_data = lv_xfeld ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
ENDMETHOD.
METHOD set_null.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
DATA lt_nodes TYPE zif_abapgit_ajson=>ty_nodes_tt.
DATA lv_null_ref TYPE REF TO data.
" null
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |null |null ||' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = lv_null_ref ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
ENDMETHOD.
METHOD prefix.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
DATA lt_nodes TYPE zif_abapgit_ajson=>ty_nodes_tt.
DATA ls_prefix TYPE zif_abapgit_ajson=>ty_path_name.
ls_prefix-path = '/a/'.
ls_prefix-name = 'b'.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( '/a/ |b |num |1 ||' ).
lt_nodes = lcl_abap_to_json=>convert(
iv_data = 1
is_prefix = ls_prefix ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
ENDMETHOD.
METHOD set_obj.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
DATA ls_struc TYPE ty_struc.
DATA lt_nodes TYPE zif_abapgit_ajson=>ty_nodes_tt.
ls_struc-a = 'abc'.
ls_struc-b = 10.
ls_struc-c = abap_true.
ls_struc-d = 'X'.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||4' ).
lo_nodes_exp->add( '/ |a |str |abc ||0' ).
lo_nodes_exp->add( '/ |b |num |10 ||0' ).
lo_nodes_exp->add( '/ |c |bool |true ||0' ).
lo_nodes_exp->add( '/ |d |bool |true ||0' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = ls_struc ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
ENDMETHOD.
METHOD set_complex_obj.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
DATA ls_struc TYPE ty_struc_complex.
DATA lt_nodes TYPE zif_abapgit_ajson=>ty_nodes_tt.
FIELD-SYMBOLS <i> LIKE LINE OF ls_struc-tab.
ls_struc-a = 'abc'.
ls_struc-b = 10.
ls_struc-c = abap_true.
ls_struc-d = 'X'.
ls_struc-el = 'elem'.
ls_struc-struc-a = 'deep'.
ls_struc-struc-b = 123.
APPEND 'hello' TO ls_struc-stab.
APPEND 'world' TO ls_struc-stab.
APPEND INITIAL LINE TO ls_struc-tab ASSIGNING <i>.
<i>-a = 'abc'.
APPEND INITIAL LINE TO ls_struc-tab ASSIGNING <i>.
<i>-a = 'bcd'.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||8' ).
lo_nodes_exp->add( '/ |a |str |abc ||0' ).
lo_nodes_exp->add( '/ |b |num |10 ||0' ).
lo_nodes_exp->add( '/ |c |bool |true ||0' ).
lo_nodes_exp->add( '/ |d |bool |true ||0' ).
lo_nodes_exp->add( '/ |el |str |elem ||0' ).
lo_nodes_exp->add( '/ |struc |object | ||4' ).
lo_nodes_exp->add( '/struc/|a |str |deep ||0' ).
lo_nodes_exp->add( '/struc/|b |num |123 ||0' ).
lo_nodes_exp->add( '/struc/|c |bool |false||0' ).
lo_nodes_exp->add( '/struc/|d |bool |false||0' ).
lo_nodes_exp->add( '/ |tab |array | | |2' ).
lo_nodes_exp->add( '/tab/ |1 |object | |1|4' ).
lo_nodes_exp->add( '/tab/1/|a |str |abc | |0' ).
lo_nodes_exp->add( '/tab/1/|b |num |0 | |0' ).
lo_nodes_exp->add( '/tab/1/|c |bool |false| |0' ).
lo_nodes_exp->add( '/tab/1/|d |bool |false| |0' ).
lo_nodes_exp->add( '/tab/ |2 |object | |2|4' ).
lo_nodes_exp->add( '/tab/2/|a |str |bcd | |0' ).
lo_nodes_exp->add( '/tab/2/|b |num |0 | |0' ).
lo_nodes_exp->add( '/tab/2/|c |bool |false| |0' ).
lo_nodes_exp->add( '/tab/2/|d |bool |false| |0' ).
lo_nodes_exp->add( '/ |stab |array | | |2' ).
lo_nodes_exp->add( '/stab/ |1 |str |hello|1|0' ).
lo_nodes_exp->add( '/stab/ |2 |str |world|2|0' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = ls_struc ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
ENDMETHOD.
METHOD set_array.
DATA lo_nodes_exp TYPE REF TO lcl_nodes_helper.
DATA lt_nodes TYPE zif_abapgit_ajson=>ty_nodes_tt.
DATA lt_tab TYPE TABLE OF ty_struc.
FIELD-SYMBOLS <s> LIKE LINE OF lt_tab.
APPEND INITIAL LINE TO lt_tab ASSIGNING <s>.
<s>-a = 'abc'.
<s>-b = 10.
APPEND INITIAL LINE TO lt_tab ASSIGNING <s>.
<s>-a = 'bcd'.
<s>-b = 20.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |array | | |2' ).
lo_nodes_exp->add( '/ |1 |object | |1|4' ).
lo_nodes_exp->add( '/1/ |a |str |abc | |0' ).
lo_nodes_exp->add( '/1/ |b |num |10 | |0' ).
lo_nodes_exp->add( '/1/ |c |bool |false| |0' ).
lo_nodes_exp->add( '/1/ |d |bool |false| |0' ).
lo_nodes_exp->add( '/ |2 |object | |2|4' ).
lo_nodes_exp->add( '/2/ |a |str |bcd | |0' ).
lo_nodes_exp->add( '/2/ |b |num |20 | |0' ).
lo_nodes_exp->add( '/2/ |c |bool |false| |0' ).
lo_nodes_exp->add( '/2/ |d |bool |false| |0' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = lt_tab ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
DATA lt_strtab TYPE string_table.
APPEND 'abc' TO lt_strtab.
APPEND 'bcd' TO lt_strtab.
CREATE OBJECT lo_nodes_exp.
lo_nodes_exp->add( ' | |array | | |2' ).
lo_nodes_exp->add( '/ |1 |str |abc |1|0' ).
lo_nodes_exp->add( '/ |2 |str |bcd |2|0' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = lt_strtab ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
ENDMETHOD.
ENDCLASS.
| [
17174,
17174,
2466,
1174,
198,
9,
19255,
4146,
198,
17174,
17174,
2466,
1174,
198,
31631,
300,
565,
62,
77,
4147,
62,
2978,
525,
5550,
20032,
17941,
25261,
13,
198,
220,
44731,
44513,
13,
628,
220,
220,
220,
42865,
45079,
62,
77,
4147,
41876,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
14804,
774,
62,
77,
4147,
62,
926,
13,
198,
220,
220,
220,
337,
36252,
50,
751,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
2536,
41876,
4731,
13,
198,
220,
220,
220,
337,
36252,
50,
1598,
13,
198,
220,
220,
220,
337,
36252,
50,
23243,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
77,
4147,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
14804,
774,
62,
77,
4147,
62,
912,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
300,
565,
62,
77,
4147,
62,
2978,
525,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
751,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
1279,
77,
29,
34178,
48920,
3963,
45079,
62,
77,
4147,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
17197,
41876,
4731,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
9630,
41876,
4731,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
2875,
41876,
4731,
13,
628,
220,
220,
220,
43504,
10619,
3268,
2043,
12576,
48920,
5390,
45079,
62,
77,
4147,
24994,
3528,
15871,
1279,
77,
28401,
628,
220,
220,
220,
46341,
2043,
21628,
62,
2536,
5161,
705,
91,
6,
39319,
198,
220,
220,
220,
220,
220,
1279,
77,
29,
12,
6978,
198,
220,
220,
220,
220,
220,
1279,
77,
29,
12,
3672,
198,
220,
220,
220,
220,
220,
1279,
77,
29,
12,
4906,
198,
220,
220,
220,
220,
220,
1279,
77,
29,
12,
8367,
198,
220,
220,
220,
220,
220,
300,
85,
62,
9630,
198,
220,
220,
220,
220,
220,
300,
85,
62,
17197,
198,
220,
220,
220,
220,
220,
300,
85,
62,
2875,
13,
198,
220,
220,
220,
7102,
35,
24290,
1279,
77,
29,
12,
6978,
13,
198,
220,
220,
220,
7102,
35,
24290,
1279,
77,
29,
12,
3672,
13,
198,
220,
220,
220,
7102,
35,
24290,
1279,
77,
29,
12,
4906,
13,
198,
220,
220,
220,
7102,
35,
24290,
1279,
77,
29,
12,
8367,
13,
198,
220,
220,
220,
1279,
77,
29,
12,
9630,
796,
300,
85,
62,
9630,
13,
198,
220,
220,
220,
1279,
77,
29,
12,
17197,
796,
300,
85,
62,
17197,
13,
198,
220,
220,
220,
1279,
77,
29,
12,
2875,
796,
300,
85,
62,
2875,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
23243,
13,
198,
220,
220,
220,
374,
83,
62,
77,
4147,
796,
45079,
62,
77,
4147,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1598,
13,
198,
220,
220,
220,
30301,
1503,
45079,
62,
77,
4147,
13,
198,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198,
198,
17174,
17174,
2466,
1174,
198,
9,
350,
27415,
1137,
198,
17174,
17174,
2466,
1174,
198,
198,
31631,
300,
83,
565,
62,
48610,
62,
9288,
5550,
20032,
17941,
25261,
198,
220,
7473,
43001,
2751,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
198,
220,
360,
4261,
6234,
6006,
9863,
13,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
6291,
62,
17752,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
25512,
1352,
41876,
4731,
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,
17752,
8,
41876,
4731,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
6941,
62,
8968,
41876,
4526,
37,
5390,
300,
565,
62,
17752,
62,
48610,
13,
198,
220,
220,
220,
42865,
6941,
62,
77,
4147,
41876,
4526,
37,
5390,
300,
565,
62,
77,
4147,
62,
2978,
525,
13,
628,
220,
220,
220,
337,
36252,
50,
9058,
13,
198,
220,
220,
220,
337,
36252,
50,
21136,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
337,
36252,
50,
21136,
62,
8841,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
337,
36252,
50,
21136,
62,
17618,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
337,
36252,
50,
21136,
62,
22468,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
337,
36252,
50,
21136,
62,
2127,
21052,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
337,
36252,
50,
21136,
62,
9562,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
337,
36252,
50,
21136,
62,
8423,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
337,
36252,
50,
21136,
62,
4475,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
337,
36252,
50,
21136,
62,
49382,
62,
27160,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
337,
36252,
50,
21136,
62,
18224,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1228,
1559,
62,
18224,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
48610,
62,
9288,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
6941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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
] |
CLASS zcx_abap_gen_report_create DEFINITION
PUBLIC
INHERITING FROM zcx_abap_gen
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor
IMPORTING
textid LIKE if_t100_message=>t100key OPTIONAL
previous LIKE previous OPTIONAL.
CONSTANTS msgno TYPE symsgno VALUE '006'.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcx_abap_gen_report_create IMPLEMENTATION.
METHOD constructor ##ADT_SUPPRESS_GENERATION.
super->constructor( previous = previous ).
CLEAR me->textid.
IF textid IS INITIAL.
if_t100_message~t100key-msgno = me->msgno.
ELSE.
if_t100_message~t100key = textid.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
66,
87,
62,
397,
499,
62,
5235,
62,
13116,
62,
17953,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
66,
87,
62,
397,
499,
62,
5235,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
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,
2420,
312,
220,
220,
34178,
611,
62,
83,
3064,
62,
20500,
14804,
83,
3064,
2539,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
2180,
34178,
2180,
39852,
2849,
1847,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
31456,
3919,
41876,
827,
19662,
3919,
26173,
8924,
705,
28041,
4458,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
66,
87,
62,
397,
499,
62,
5235,
62,
13116,
62,
17953,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
23772,
22492,
2885,
51,
62,
40331,
32761,
62,
35353,
1137,
6234,
13,
628,
220,
220,
220,
2208,
3784,
41571,
273,
7,
2180,
796,
2180,
6739,
628,
220,
220,
220,
30301,
1503,
502,
3784,
5239,
312,
13,
198,
220,
220,
220,
16876,
2420,
312,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
611,
62,
83,
3064,
62,
20500,
93,
83,
3064,
2539,
12,
19662,
3919,
796,
502,
3784,
19662,
3919,
13,
198,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
611,
62,
83,
3064,
62,
20500,
93,
83,
3064,
2539,
796,
2420,
312,
13,
198,
220,
220,
220,
23578,
5064,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_services_abapgit DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
CONSTANTS c_abapgit_repo TYPE string VALUE 'https://github.com/abapGit/abapGit' ##NO_TEXT.
CONSTANTS c_abapgit_homepage TYPE string VALUE 'https://www.abapgit.org' ##NO_TEXT.
CONSTANTS c_abapgit_wikipage TYPE string VALUE 'https://docs.abapgit.org' ##NO_TEXT.
CONSTANTS c_dotabap_homepage TYPE string VALUE 'https://dotabap.org' ##NO_TEXT.
CONSTANTS c_abapgit_class TYPE seoclsname VALUE `ZCX_ABAPGIT_EXCEPTION` ##NO_TEXT.
CLASS-METHODS open_abapgit_homepage
RAISING
zcx_abapgit_exception .
CLASS-METHODS open_abapgit_wikipage
RAISING
zcx_abapgit_exception .
CLASS-METHODS open_dotabap_homepage
RAISING
zcx_abapgit_exception .
CLASS-METHODS open_abapgit_changelog
RAISING
zcx_abapgit_exception .
CLASS-METHODS is_installed
RETURNING
VALUE(rv_devclass) TYPE tadir-devclass .
CLASS-METHODS prepare_gui_startup
RAISING
zcx_abapgit_exception .
PROTECTED SECTION.
PRIVATE SECTION.
CLASS-METHODS set_start_repo_from_package
IMPORTING
!iv_package TYPE devclass
RAISING
zcx_abapgit_exception .
CLASS-METHODS get_package_from_adt
RETURNING
VALUE(rv_package) TYPE devclass .
CLASS-METHODS check_sapgui
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS ZCL_ABAPGIT_SERVICES_ABAPGIT IMPLEMENTATION.
METHOD check_sapgui.
CONSTANTS:
lc_hide_sapgui_hint TYPE string VALUE '2'.
DATA:
lv_answer TYPE char1,
ls_settings TYPE zif_abapgit_definitions=>ty_s_user_settings,
li_user_persistence TYPE REF TO zif_abapgit_persist_user.
li_user_persistence = zcl_abapgit_persistence_user=>get_instance( ).
ls_settings = li_user_persistence->get_settings( ).
IF ls_settings-hide_sapgui_hint = abap_true.
RETURN.
ENDIF.
IF zcl_abapgit_ui_factory=>get_gui_functions( )->is_sapgui_for_java( ) = abap_false.
RETURN.
ENDIF.
lv_answer = zcl_abapgit_ui_factory=>get_popups( )->popup_to_confirm(
iv_titlebar = 'Not supported SAPGUI'
iv_text_question = 'SAPGUI for Java is not supported! There might be some issues.'
iv_text_button_1 = 'Got it'
iv_icon_button_1 = |{ icon_okay }|
iv_text_button_2 = 'Hide'
iv_icon_button_2 = |{ icon_set_state }|
iv_display_cancel_button = abap_false ).
IF lv_answer = lc_hide_sapgui_hint.
ls_settings-hide_sapgui_hint = abap_true.
li_user_persistence->set_settings( ls_settings ).
ENDIF.
ENDMETHOD.
METHOD get_package_from_adt.
DATA: ls_item TYPE zif_abapgit_definitions=>ty_item,
lr_context TYPE REF TO data,
lt_fields TYPE tihttpnvp.
FIELD-SYMBOLS: <lg_context> TYPE any,
<lv_parameters> TYPE string,
<ls_field> LIKE LINE OF lt_fields.
ls_item-obj_type = 'CLAS'.
ls_item-obj_name = 'CL_ADT_GUI_INTEGRATION_CONTEXT'.
IF zcl_abapgit_objects=>exists( ls_item ) = abap_false.
" ADT is not supported in this NW release
RETURN.
ENDIF.
TRY.
CREATE DATA lr_context TYPE ('CL_ADT_GUI_INTEGRATION_CONTEXT=>TY_CONTEXT_INFO').
ASSIGN lr_context->* TO <lg_context>.
ASSERT sy-subrc = 0.
CALL METHOD ('CL_ADT_GUI_INTEGRATION_CONTEXT')=>read_context
RECEIVING
result = <lg_context>.
ASSIGN COMPONENT 'PARAMETERS'
OF STRUCTURE <lg_context>
TO <lv_parameters>.
ASSERT sy-subrc = 0.
lt_fields = cl_http_utility=>string_to_fields( cl_http_utility=>unescape_url( <lv_parameters> ) ).
READ TABLE lt_fields ASSIGNING <ls_field>
WITH KEY name = 'p_package_name'.
IF sy-subrc = 0.
rv_package = <ls_field>-value.
" We want to open the repo just once. Therefore we delete the parameters
" and initialize the ADT context.
CLEAR <lv_parameters>.
CALL METHOD ('CL_ADT_GUI_INTEGRATION_CONTEXT')=>initialize_instance
EXPORTING
context_info = <lg_context>.
ENDIF.
CATCH cx_root.
" Some problems with dynamic ADT access.
" Let's ignore it for now and fail silently
ENDTRY.
ENDMETHOD.
METHOD is_installed.
SELECT SINGLE devclass FROM tadir INTO rv_devclass
WHERE pgmid = 'R3TR'
AND object = 'CLAS'
AND obj_name = c_abapgit_class.
ENDMETHOD.
METHOD open_abapgit_changelog.
cl_gui_frontend_services=>execute(
EXPORTING document = c_abapgit_repo && '/blob/main/changelog.txt'
EXCEPTIONS OTHERS = 1 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Opening page in external browser failed.' ).
ENDIF.
ENDMETHOD.
METHOD open_abapgit_homepage.
cl_gui_frontend_services=>execute(
EXPORTING document = c_abapgit_homepage
EXCEPTIONS OTHERS = 1 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Opening page in external browser failed.' ).
ENDIF.
ENDMETHOD.
METHOD open_abapgit_wikipage.
cl_gui_frontend_services=>execute(
EXPORTING document = c_abapgit_wikipage
EXCEPTIONS OTHERS = 1 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Opening page in external browser failed.' ).
ENDIF.
ENDMETHOD.
METHOD open_dotabap_homepage.
cl_gui_frontend_services=>execute(
EXPORTING document = c_dotabap_homepage
EXCEPTIONS OTHERS = 1 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Opening page in external browser failed.' ).
ENDIF.
ENDMETHOD.
METHOD prepare_gui_startup.
DATA: lv_repo_key TYPE zif_abapgit_persistence=>ty_value,
lv_package TYPE devclass,
lv_package_adt TYPE devclass.
check_sapgui( ).
IF zcl_abapgit_persist_factory=>get_settings( )->read( )->get_show_default_repo( ) = abap_false.
" Don't show the last seen repo at startup
zcl_abapgit_persistence_user=>get_instance( )->set_repo_show( || ).
ENDIF.
" We have three special cases for gui startup
" - open a specific repo by repo key
" - open a specific repo by package name
" - open a specific repo by package name provided by ADT
" These overrule the last shown repo
GET PARAMETER ID zif_abapgit_definitions=>c_spagpa_param_repo_key FIELD lv_repo_key.
GET PARAMETER ID zif_abapgit_definitions=>c_spagpa_param_package FIELD lv_package.
lv_package_adt = get_package_from_adt( ).
IF lv_repo_key IS NOT INITIAL.
SET PARAMETER ID zif_abapgit_definitions=>c_spagpa_param_repo_key FIELD ''.
zcl_abapgit_persistence_user=>get_instance( )->set_repo_show( lv_repo_key ).
ELSEIF lv_package IS NOT INITIAL.
SET PARAMETER ID zif_abapgit_definitions=>c_spagpa_param_package FIELD ''.
set_start_repo_from_package( lv_package ).
ELSEIF lv_package_adt IS NOT INITIAL.
set_start_repo_from_package( lv_package_adt ).
ENDIF.
ENDMETHOD.
METHOD set_start_repo_from_package.
DATA: lo_repo TYPE REF TO zcl_abapgit_repo,
lt_r_package TYPE RANGE OF devclass,
ls_r_package LIKE LINE OF lt_r_package,
lt_superpackages TYPE zif_abapgit_sap_package=>ty_devclass_tt,
li_package TYPE REF TO zif_abapgit_sap_package,
lt_repo_list TYPE zif_abapgit_repo_srv=>ty_repo_list.
FIELD-SYMBOLS: <lo_repo> TYPE LINE OF zif_abapgit_repo_srv=>ty_repo_list,
<lv_superpackage> LIKE LINE OF lt_superpackages.
li_package = zcl_abapgit_factory=>get_sap_package( iv_package ).
IF li_package->exists( ) = abap_false.
RETURN.
ENDIF.
ls_r_package-sign = 'I'.
ls_r_package-option = 'EQ'.
ls_r_package-low = iv_package.
INSERT ls_r_package INTO TABLE lt_r_package.
" Also consider superpackages. E.g. when some open $abapgit_ui, abapGit repo
" should be found via package $abapgit
lt_superpackages = li_package->list_superpackages( ).
LOOP AT lt_superpackages ASSIGNING <lv_superpackage>.
ls_r_package-low = <lv_superpackage>.
INSERT ls_r_package INTO TABLE lt_r_package.
ENDLOOP.
lt_repo_list = zcl_abapgit_repo_srv=>get_instance( )->list( ).
LOOP AT lt_repo_list ASSIGNING <lo_repo>.
IF <lo_repo>->get_package( ) IN lt_r_package.
lo_repo = <lo_repo>.
EXIT.
ENDIF.
ENDLOOP.
IF lo_repo IS BOUND.
zcl_abapgit_persistence_user=>get_instance( )->set_repo_show( lo_repo->get_key( ) ).
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
30416,
62,
397,
499,
18300,
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,
397,
499,
18300,
62,
260,
7501,
41876,
4731,
26173,
8924,
705,
5450,
1378,
12567,
13,
785,
14,
397,
499,
38,
270,
14,
397,
499,
38,
270,
6,
22492,
15285,
62,
32541,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
397,
499,
18300,
62,
11195,
7700,
41876,
4731,
26173,
8924,
705,
5450,
1378,
2503,
13,
397,
499,
18300,
13,
2398,
6,
22492,
15285,
62,
32541,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
397,
499,
18300,
62,
20763,
541,
496,
41876,
4731,
26173,
8924,
705,
5450,
1378,
31628,
13,
397,
499,
18300,
13,
2398,
6,
22492,
15285,
62,
32541,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
26518,
397,
499,
62,
11195,
7700,
41876,
4731,
26173,
8924,
705,
5450,
1378,
26518,
397,
499,
13,
2398,
6,
22492,
15285,
62,
32541,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
397,
499,
18300,
62,
4871,
41876,
384,
420,
7278,
3672,
26173,
8924,
4600,
57,
34,
55,
62,
6242,
2969,
38,
2043,
62,
6369,
42006,
2849,
63,
22492,
15285,
62,
32541,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
1280,
62,
397,
499,
18300,
62,
11195,
7700,
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,
1280,
62,
397,
499,
18300,
62,
20763,
541,
496,
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,
1280,
62,
26518,
397,
499,
62,
11195,
7700,
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,
1280,
62,
397,
499,
18300,
62,
354,
8368,
519,
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,
318,
62,
37050,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
7959,
4871,
8,
41876,
36264,
343,
12,
7959,
4871,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
8335,
62,
48317,
62,
9688,
929,
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,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
900,
62,
9688,
62,
260,
7501,
62,
6738,
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,
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,
651,
62,
26495,
62,
6738,
62,
324,
83,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
26495,
8,
41876,
1614,
4871,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
2198,
62,
82,
499,
48317,
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,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
35009,
53,
34444,
62,
6242,
2969,
38,
2043,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
2198,
62,
82,
499,
48317,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
300,
66,
62,
24717,
62,
82,
499,
48317,
62,
71,
600,
41876,
4731,
26173,
8924,
705,
17,
4458,
628,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
300,
85,
62,
41484,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
43979,
62,
33692,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
82,
62,
7220,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
7649,
62,
7220,
62,
19276,
13274,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19276,
396,
62,
7220,
13,
628,
220,
220,
220,
7649,
62,
7220,
62,
19276,
13274,
796,
1976,
565,
62,
397,
499,
18300,
62,
19276,
13274,
62,
7220,
14804,
1136,
62,
39098,
7,
6739,
628,
220,
220,
220,
43979,
62,
33692,
796,
7649,
62,
7220,
62,
19276,
13274,
3784,
1136,
62,
33692,
7,
6739,
628,
220,
220,
220,
16876,
43979,
62,
33692,
12,
24717,
62,
82,
499,
48317,
62,
71,
600,
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,
1976,
565,
62,
397,
499,
18300,
62,
9019,
62,
69,
9548,
14804,
1136,
62,
48317,
62,
12543,
2733,
7,
1267,
3784,
271,
62,
82,
499,
48317,
62,
1640,
62,
12355,
7,
1267,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
300,
85,
62,
41484,
796,
1976,
565,
62,
397,
499,
18300,
62,
9019,
62,
69,
9548,
14804,
1136,
62,
12924,
4739,
7,
1267,
3784,
12924,
929,
62,
1462,
62,
10414,
2533,
7,
198,
220,
220,
220,
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,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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 ZCX_VISE_FORCED_ROLLBACK definition
public
inheriting from ZCX_VISE
create public .
public section.
methods CONSTRUCTOR
importing
!TEXTID like TEXTID optional
!PREVIOUS like PREVIOUS optional .
protected section.
private section.
ENDCLASS.
CLASS ZCX_VISE_FORCED_ROLLBACK IMPLEMENTATION.
method CONSTRUCTOR.
CALL METHOD SUPER->CONSTRUCTOR
EXPORTING
TEXTID = TEXTID
PREVIOUS = PREVIOUS
.
endmethod.
ENDCLASS.
| [
4871,
1168,
34,
55,
62,
53,
24352,
62,
13775,
34,
1961,
62,
13252,
3069,
31098,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
1168,
34,
55,
62,
53,
24352,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
5050,
7102,
46126,
1581,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
32541,
2389,
588,
40383,
2389,
11902,
198,
220,
220,
220,
220,
220,
5145,
46437,
12861,
20958,
588,
22814,
12861,
20958,
11902,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
34,
55,
62,
53,
24352,
62,
13775,
34,
1961,
62,
13252,
3069,
31098,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
2446,
7102,
46126,
1581,
13,
198,
34,
7036,
337,
36252,
33088,
3784,
10943,
46126,
1581,
198,
6369,
15490,
2751,
198,
32541,
2389,
796,
40383,
2389,
198,
46437,
12861,
20958,
796,
22814,
12861,
20958,
198,
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,
1,
1
] |
*******************************************************************
* System-defined Include-files. *
*******************************************************************
INCLUDE lzdbbr_user_settingstop. " Global Data
INCLUDE lzdbbr_user_settingsuxx. " Function Modules
*******************************************************************
* User-defined Include-files (if necessary). *
*******************************************************************
INCLUDE zuitb_data_cache.
INCLUDE zuitb_screen_util.
INCLUDE lzdbbr_user_settingss01.
| [
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,
300,
89,
9945,
1671,
62,
7220,
62,
33990,
11338,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8060,
6060,
198,
220,
3268,
5097,
52,
7206,
300,
89,
9945,
1671,
62,
7220,
62,
33692,
2821,
87,
13,
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,
220,
3268,
5097,
52,
7206,
1976,
5013,
65,
62,
7890,
62,
23870,
13,
198,
220,
3268,
5097,
52,
7206,
1976,
5013,
65,
62,
9612,
62,
22602,
13,
628,
220,
3268,
5097,
52,
7206,
300,
89,
9945,
1671,
62,
7220,
62,
33692,
82,
486,
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
] |
"! <p class="shorttext synchronized" lang="en">XML To JSON via CALL Transformation</p>
CLASS zcl_xml_to_json_call DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_XML_TO_JSON_CALL IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
DATA(xml) = `<object><str name="TEXT">JSON</str></object>`.
DATA(json_writer) = cl_sxml_string_writer=>create( type = if_sxml=>co_xt_json ).
CALL TRANSFORMATION id SOURCE XML xml
RESULT XML json_writer.
TRY.
DATA(reader) = cl_sxml_string_reader=>create( json_writer->get_output( ) ).
DATA(writer) = CAST if_sxml_writer(
cl_sxml_string_writer=>create( type = if_sxml=>co_xt_json ) ).
writer->set_option( option = if_sxml_writer=>co_opt_linebreaks ).
writer->set_option( option = if_sxml_writer=>co_opt_indent ).
reader->next_node( ).
reader->skip_node( writer ).
data(json_output) = CL_ABAP_CONV_CODEPAGE=>CREATE_IN( )->CONVERT( CAST cl_sxml_string_writer( writer )->get_output( ) ).
CATCH cx_sxml_parse_error.
RETURN.
ENDTRY.
out->write( json_output ).
ENDMETHOD.
ENDCLASS.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
55,
5805,
1675,
19449,
2884,
42815,
49127,
3556,
79,
29,
198,
31631,
1976,
565,
62,
19875,
62,
1462,
62,
17752,
62,
13345,
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,
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,
5097,
62,
55,
5805,
62,
10468,
62,
40386,
62,
34,
7036,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
611,
62,
2238,
62,
324,
83,
62,
4871,
5143,
93,
12417,
13,
198,
220,
220,
220,
42865,
7,
19875,
8,
796,
4600,
27,
15252,
6927,
2536,
1438,
2625,
32541,
5320,
40386,
3556,
2536,
12240,
15252,
29,
44646,
198,
220,
220,
220,
42865,
7,
17752,
62,
16002,
8,
796,
537,
62,
82,
19875,
62,
8841,
62,
16002,
14804,
17953,
7,
2099,
796,
611,
62,
82,
19875,
14804,
1073,
62,
742,
62,
17752,
6739,
198,
220,
220,
220,
42815,
44069,
35036,
4686,
311,
31033,
23735,
35555,
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,
15731,
16724,
23735,
33918,
62,
16002,
13,
628,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
46862,
8,
796,
537,
62,
82,
19875,
62,
8841,
62,
46862,
14804,
17953,
7,
33918,
62,
16002,
3784,
1136,
62,
22915,
7,
220,
1267,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
16002,
8,
796,
327,
11262,
611,
62,
82,
19875,
62,
16002,
7,
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,
537,
62,
82,
19875,
62,
8841,
62,
16002,
14804,
17953,
7,
2099,
796,
611,
62,
82,
19875,
14804,
1073,
62,
742,
62,
17752,
1267,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
6260,
3784,
2617,
62,
18076,
7,
3038,
796,
611,
62,
82,
19875,
62,
16002,
14804,
1073,
62,
8738,
62,
1370,
30058,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
6260,
3784,
2617,
62,
18076,
7,
3038,
796,
611,
62,
82,
19875,
62,
16002,
14804,
1073,
62,
8738,
62,
521,
298,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
9173,
3784,
19545,
62,
17440,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
9173,
3784,
48267,
62,
17440,
7,
6260,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
7,
17752,
62,
22915,
8,
796,
7852,
62,
6242,
2969,
62,
10943,
53,
62,
34,
16820,
4537,
8264,
14804,
43387,
6158,
62,
1268,
7,
220,
1267,
3784,
10943,
15858,
7,
327,
11262,
537,
62,
82,
19875,
62,
8841,
62,
16002,
7,
6260,
1267,
3784,
1136,
62,
22915,
7,
1267,
6739,
628,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
82,
19875,
62,
29572,
62,
18224,
13,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
40405,
13,
198,
220,
220,
220,
503,
3784,
13564,
7,
33918,
62,
22915,
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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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
] |
"! Takes a deep structure with all the information of the requested object,
"! renders the HTML and CSS assets based on the requested theme and displays it.
CLASS zcl_timem_gui_viewer DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
CONSTANTS:
BEGIN OF c_theme,
light TYPE ztimem_theme VALUE 'LIGHT',
dark TYPE ztimem_theme VALUE 'DARK',
END OF c_theme .
"! Constructor which takes a theme as input
"! @parameter i_theme | Theme name
METHODS constructor
IMPORTING
!io_handler TYPE REF TO zcl_timem_gui_handler .
"! Takes a deep structure with all the information of the object, renders
"! the HTML and CSS assets and displays them.
METHODS render
IMPORTING
!data TYPE ztimem_data
RAISING
zcx_timem .
PROTECTED SECTION.
PRIVATE SECTION.
DATA html_viewer TYPE REF TO cl_gui_html_viewer.
DATA userexits TYPE REF TO zcl_timem_userexits.
METHODS add_asset
IMPORTING
!asset TYPE REF TO zif_timem_asset
RETURNING
VALUE(result) TYPE w3url .
METHODS string_2_xstring
IMPORTING
!input TYPE string
RETURNING
VALUE(result) TYPE xstring .
METHODS register_events
IMPORTING
io_handler TYPE REF TO zcl_timem_gui_handler.
CLASS-METHODS xstring_2_bintab
IMPORTING
!xstr TYPE xstring
RETURNING
VALUE(result) TYPE lvc_t_mime .
ENDCLASS.
CLASS ZCL_TIMEM_GUI_VIEWER IMPLEMENTATION.
METHOD add_asset.
DATA content TYPE string.
DATA xstr TYPE xstring.
content = asset->get_content( ).
userexits->modify_asset_content(
EXPORTING
subtype = asset->get_subtype( )
CHANGING
content = content ).
xstr = string_2_xstring( content ).
data(t_bintab) = xstring_2_bintab( xstr ).
html_viewer->load_data(
EXPORTING
url = asset->get_url( )
type = 'text'
subtype = asset->get_subtype( )
CHANGING
data_table = t_bintab
EXCEPTIONS
dp_invalid_parameter = 1
dp_error_general = 2
cntl_error = 3
html_syntax_notcorrect = 4
OTHERS = 5 ).
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
result = asset->get_url( ).
ENDMETHOD.
METHOD constructor.
CREATE OBJECT userexits.
CREATE OBJECT html_viewer TYPE cl_gui_html_viewer EXPORTING parent = cl_gui_container=>screen0
query_table_disabled = abap_true.
register_events( io_handler ).
ENDMETHOD.
METHOD register_events.
DATA t_event TYPE cntl_simple_events.
t_event = VALUE #( ( appl_event = abap_true
eventid = html_viewer->m_id_sapevent ) ).
html_viewer->set_registered_events( t_event ).
SET HANDLER io_handler->on_sapevent FOR html_viewer.
ENDMETHOD.
METHOD render.
DATA temp1 TYPE REF TO zcl_timem_asset_factory.
" Creates the screen0 container
SKIP.
CREATE OBJECT temp1 TYPE zcl_timem_asset_factory.
add_asset( temp1->create_instance(
asset_type = zcl_timem_consts=>asset_type-css
data = data ) ).
DATA(url) = add_asset( NEW zcl_timem_asset_factory( )->create_instance(
asset_type = zcl_timem_consts=>asset_type-html
data = data ) ).
html_viewer->show_url(
EXPORTING
url = url
EXCEPTIONS
cntl_error = 1
cnht_error_not_allowed = 2
cnht_error_parameter = 3
dp_error_general = 4
OTHERS = 5 ).
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDMETHOD.
METHOD string_2_xstring.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = input
IMPORTING
buffer = result
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDMETHOD.
METHOD xstring_2_bintab.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = xstr
TABLES
binary_tab = result.
ENDMETHOD.
ENDCLASS.
| [
40484,
33687,
257,
2769,
4645,
351,
477,
262,
1321,
286,
262,
9167,
2134,
11,
198,
40484,
30111,
262,
11532,
290,
17391,
6798,
1912,
319,
262,
9167,
7505,
290,
11298,
340,
13,
198,
31631,
1976,
565,
62,
16514,
368,
62,
48317,
62,
1177,
263,
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,
269,
62,
43810,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1657,
41876,
1976,
16514,
368,
62,
43810,
26173,
8924,
705,
43,
9947,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
3223,
220,
41876,
1976,
16514,
368,
62,
43810,
26173,
8924,
705,
35,
14175,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
43810,
764,
628,
220,
220,
220,
366,
0,
28407,
273,
543,
2753,
257,
7505,
355,
5128,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
1312,
62,
43810,
930,
26729,
1438,
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,
952,
62,
30281,
41876,
4526,
37,
5390,
1976,
565,
62,
16514,
368,
62,
48317,
62,
30281,
764,
198,
220,
220,
220,
366,
0,
33687,
257,
2769,
4645,
351,
477,
262,
1321,
286,
262,
2134,
11,
30111,
198,
220,
220,
220,
366,
0,
262,
11532,
290,
17391,
6798,
290,
11298,
606,
13,
198,
220,
220,
220,
337,
36252,
50,
8543,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
7890,
41876,
1976,
16514,
368,
62,
7890,
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,
220,
220,
220,
42865,
27711,
62,
1177,
263,
41876,
4526,
37,
5390,
537,
62,
48317,
62,
6494,
62,
1177,
263,
13,
198,
220,
220,
220,
42865,
779,
21510,
896,
41876,
4526,
37,
5390,
1976,
565,
62,
16514,
368,
62,
1904,
21510,
896,
13,
628,
220,
220,
220,
337,
36252,
50,
751,
62,
562,
316,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
562,
316,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
16514,
368,
62,
562,
316,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
266,
18,
6371,
764,
628,
220,
220,
220,
337,
36252,
50,
4731,
62,
17,
62,
87,
8841,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
15414,
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,
20274,
8,
41876,
2124,
8841,
764,
628,
220,
220,
220,
337,
36252,
50,
7881,
62,
31534,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
30281,
41876,
4526,
37,
5390,
1976,
565,
62,
16514,
368,
62,
48317,
62,
30281,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
2124,
8841,
62,
17,
62,
65,
600,
397,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
87,
2536,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
2124,
8841,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
300,
28435,
62,
83,
62,
76,
524,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
51,
3955,
3620,
62,
40156,
62,
28206,
1137,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
751,
62,
562,
316,
13,
198,
220,
220,
220,
42865,
2695,
41876,
4731,
13,
198,
220,
220,
220,
42865,
2124,
2536,
41876,
2124,
8841,
13,
198,
220,
220,
220,
2695,
796,
11171,
3784,
1136,
62,
11299,
7,
6739,
628,
220,
220,
220,
779,
21510,
896,
3784,
4666,
1958,
62,
562,
316,
62,
11299,
7,
198,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
850,
4906,
796,
11171,
3784,
1136,
62,
7266,
4906,
7,
1267,
198,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
2695,
796,
2695,
6739,
628,
198,
220,
220,
220,
2124,
2536,
796,
4731,
62,
17,
62,
87,
8841,
7,
2695,
6739,
628,
220,
220,
220,
1366,
7,
83,
62,
65,
600,
397,
8,
796,
2124,
8841,
62,
17,
62,
65,
600,
397,
7,
2124,
2536,
6739,
628,
220,
220,
220,
27711,
62,
1177,
263,
3784,
2220,
62,
7890,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
19016,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
220,
11171,
3784,
1136,
62,
6371,
7,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
5239,
6,
198,
220,
220,
220,
220,
220,
220,
220,
850,
4906,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
11171,
3784,
1136,
62,
7266,
4906,
7,
1267,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
11487,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
256,
62,
65,
600,
397,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
288,
79,
62,
259,
12102,
62,
17143,
2357,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
288,
79,
62,
18224,
62,
24622,
220,
220,
220,
220,
220,
220,
796,
362,
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,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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
] |
INTERFACE zif_excel_writer
PUBLIC .
METHODS write_file
IMPORTING
!io_excel TYPE REF TO zcl_excel
RETURNING
VALUE(ep_file) TYPE xstring
RAISING
zcx_excel.
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
1069,
5276,
62,
16002,
198,
220,
44731,
764,
628,
198,
220,
337,
36252,
50,
3551,
62,
7753,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
952,
62,
1069,
5276,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
538,
62,
7753,
8,
41876,
2124,
8841,
198,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
1069,
5276,
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
] |
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
CLASS lcl_demo_091 DEFINITION FINAL INHERITING FROM lcl_demo.
PUBLIC SECTION.
METHODS:
get_desc_text REDEFINITION,
get_url_base REDEFINITION,
get_screen_opt REDEFINITION,
set_merge_info REDEFINITION,
get_templates REDEFINITION.
ENDCLASS.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
CLASS lcl_demo_091 IMPLEMENTATION.
METHOD get_desc_text.
rv_desc_text = '3D example (sheets, columns & rows)'(091).
ENDMETHOD.
METHOD get_url_base.
rv_url_base = ''.
ENDMETHOD.
METHOD get_screen_opt.
rs_opt-row_count = rs_opt-block_count = rs_opt-colum_count = abap_true.
ENDMETHOD.
METHOD set_merge_info.
DATA lt_merge TYPE lcl_demo_090=>tt_merge.
DO p_b_cnt TIMES.
DATA lv_index TYPE string.
lv_index = sy-index.
CONDENSE lv_index.
DATA ls_merge LIKE LINE OF lt_merge.
ls_merge = lcl_demo_090=>get_one_merge( io_report ).
CONCATENATE 'Sheet'(sht) lv_index INTO ls_merge-title SEPARATED BY ` `.
APPEND ls_merge TO lt_merge.
ENDDO.
io_report->merge_add_one( lt_merge[] ).
ENDMETHOD.
METHOD get_templates.
APPEND 'ZXXT_DEMO_091-XLSX' TO rt_templates.
ENDMETHOD.
ENDCLASS.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
10097,
30934,
9,
198,
31631,
300,
565,
62,
9536,
78,
62,
2931,
16,
5550,
20032,
17941,
25261,
3268,
16879,
2043,
2751,
16034,
300,
565,
62,
9536,
78,
13,
198,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
651,
62,
20147,
62,
5239,
220,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
651,
62,
6371,
62,
8692,
220,
220,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
651,
62,
9612,
62,
8738,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
900,
62,
647,
469,
62,
10951,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
651,
62,
11498,
17041,
220,
23848,
36,
20032,
17941,
13,
198,
10619,
31631,
13,
198,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
10097,
30934,
9,
198,
31631,
300,
565,
62,
9536,
78,
62,
2931,
16,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
651,
62,
20147,
62,
5239,
13,
198,
220,
220,
220,
374,
85,
62,
20147,
62,
5239,
796,
705,
18,
35,
1672,
357,
42011,
11,
15180,
1222,
15274,
33047,
7,
2931,
16,
737,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
6371,
62,
8692,
13,
198,
220,
220,
220,
374,
85,
62,
6371,
62,
8692,
796,
705,
4458,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
9612,
62,
8738,
13,
198,
220,
220,
220,
44608,
62,
8738,
12,
808,
62,
9127,
796,
44608,
62,
8738,
12,
9967,
62,
9127,
796,
44608,
62,
8738,
12,
4033,
388,
62,
9127,
796,
450,
499,
62,
7942,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
900,
62,
647,
469,
62,
10951,
13,
198,
220,
220,
220,
42865,
300,
83,
62,
647,
469,
41876,
300,
565,
62,
9536,
78,
62,
42534,
14804,
926,
62,
647,
469,
13,
628,
220,
220,
220,
8410,
279,
62,
65,
62,
66,
429,
31742,
1546,
13,
198,
220,
220,
220,
220,
220,
42865,
300,
85,
62,
9630,
41876,
4731,
13,
198,
220,
220,
220,
220,
220,
300,
85,
62,
9630,
796,
827,
12,
9630,
13,
198,
220,
220,
220,
220,
220,
7102,
35,
24290,
300,
85,
62,
9630,
13,
628,
220,
220,
220,
220,
220,
42865,
43979,
62,
647,
469,
34178,
48920,
3963,
300,
83,
62,
647,
469,
13,
198,
220,
220,
220,
220,
220,
43979,
62,
647,
469,
796,
300,
565,
62,
9536,
78,
62,
42534,
14804,
1136,
62,
505,
62,
647,
469,
7,
33245,
62,
13116,
6739,
628,
220,
220,
220,
220,
220,
39962,
1404,
1677,
6158,
705,
3347,
316,
6,
7,
1477,
83,
8,
300,
85,
62,
9630,
39319,
43979,
62,
647,
469,
12,
7839,
7946,
27082,
11617,
11050,
4600,
4600,
13,
628,
220,
220,
220,
220,
220,
43504,
10619,
43979,
62,
647,
469,
5390,
300,
83,
62,
647,
469,
13,
198,
220,
220,
220,
23578,
18227,
13,
628,
220,
220,
220,
33245,
62,
13116,
3784,
647,
469,
62,
2860,
62,
505,
7,
300,
83,
62,
647,
469,
21737,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
11498,
17041,
13,
198,
220,
220,
220,
43504,
10619,
705,
57,
8051,
51,
62,
39429,
46,
62,
2931,
16,
12,
55,
6561,
55,
6,
5390,
374,
83,
62,
11498,
17041,
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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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
] |
CLASS zcl_abapgit_object_wdcc DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_objects_super
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_object .
ALIASES mo_files
FOR zif_abapgit_object~mo_files .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_abapgit_object_wdcc IMPLEMENTATION.
METHOD zif_abapgit_object~changed_by.
DATA: ls_outline TYPE wdy_cfg_outline_data,
ls_config_key TYPE wdy_config_key.
ls_config_key-config_id = ms_item-obj_name+0(32).
ls_config_key-config_type = ms_item-obj_name+32(2).
ls_config_key-config_var = ms_item-obj_name+34(6).
TRY.
cl_wdr_cfg_persistence_utils=>read_comp_config_from_db(
EXPORTING
config_key = ls_config_key
IMPORTING
outline_data = ls_outline ).
CATCH cx_static_check.
zcx_abapgit_exception=>raise( 'Error Reading Component Config from DB: ' && ms_item-obj_name ).
ENDTRY.
rv_user = ls_outline-changedby.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: ls_config_key TYPE wdy_config_key,
lv_subrc TYPE sysubrc.
ls_config_key-config_id = ms_item-obj_name+0(32).
ls_config_key-config_type = ms_item-obj_name+32(2).
ls_config_key-config_var = ms_item-obj_name+34(6).
TRY.
" does not exist in 702
CALL METHOD cl_wdr_cfg_persistence_utils=>('DELETE_CONFIGURATION')
EXPORTING
config_key = ls_config_key
RECEIVING
subrc = lv_subrc.
IF lv_subrc <> 0.
zcx_abapgit_exception=>raise( 'Error deleting WDCC: ' && ms_item-obj_name ).
ENDIF.
CATCH cx_root.
zcx_abapgit_exception=>raise( 'Object type WDCC not supported for this release' ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_config_id TYPE c LENGTH 32,
lv_config_type TYPE n LENGTH 2,
lv_config_var TYPE c LENGTH 6,
lt_otr_texts TYPE TABLE OF wdy_config_compt,
ls_orig_config TYPE wdy_config_data,
lt_config_datt TYPE TABLE OF wdy_config_datt,
lv_xml_string TYPE string,
lv_xml_xstring TYPE xstring.
FIELD-SYMBOLS: <lv_data> TYPE any.
io_xml->read( EXPORTING iv_name = 'CONFIG_ID'
CHANGING cg_data = ls_orig_config-config_id ).
io_xml->read( EXPORTING iv_name = 'CONFIG_TYPE'
CHANGING cg_data = ls_orig_config-config_type ).
io_xml->read( EXPORTING iv_name = 'CONFIG_VAR'
CHANGING cg_data = ls_orig_config-config_var ).
lv_config_id = ls_orig_config-config_id.
lv_config_type = ls_orig_config-config_type.
lv_config_var = ls_orig_config-config_var.
ASSIGN COMPONENT 'CONFIG_IDPAR' OF STRUCTURE ls_orig_config TO <lv_data>.
IF sy-subrc = 0.
io_xml->read( EXPORTING iv_name = 'CONFIG_IDPAR'
CHANGING cg_data = <lv_data> ).
ELSE.
ii_log->add_error( iv_msg = |Object type WDCC not supported for this release|
is_item = ms_item ).
RETURN.
ENDIF.
ASSIGN COMPONENT 'CONFIG_TYPEPAR' OF STRUCTURE ls_orig_config TO <lv_data>.
IF sy-subrc = 0.
io_xml->read( EXPORTING iv_name = 'CONFIG_TYPEPAR'
CHANGING cg_data = <lv_data> ).
ENDIF.
ASSIGN COMPONENT 'CONFIG_VARPAR' OF STRUCTURE ls_orig_config TO <lv_data>.
IF sy-subrc = 0.
io_xml->read( EXPORTING iv_name = 'CONFIG_VARPAR'
CHANGING cg_data = <lv_data> ).
ENDIF.
io_xml->read( EXPORTING iv_name = 'WDA_COMPONENT'
CHANGING cg_data = ls_orig_config-component ).
lv_xml_string = mo_files->read_string( iv_extra = 'comp_config'
iv_ext = 'xml' ).
TRY.
lv_xml_string = zcl_abapgit_xml_pretty=>print( iv_xml = lv_xml_string
iv_ignore_errors = abap_false
iv_unpretty = abap_true ).
CATCH zcx_abapgit_exception.
zcx_abapgit_exception=>raise( 'Error Un-Pretty Printing WDCC XML Content: ' && ms_item-obj_name ).
ENDTRY.
REPLACE FIRST OCCURRENCE
OF REGEX '<\?xml version="1\.0" encoding="[\w-]+"\?>'
IN lv_xml_string
WITH '<?xml version="1.0"?>'.
ASSERT sy-subrc = 0.
lv_xml_xstring = zcl_abapgit_convert=>string_to_xstring( iv_str = lv_xml_string ).
ls_orig_config-xcontent = lv_xml_xstring.
ASSIGN COMPONENT 'PARENT' OF STRUCTURE ls_orig_config TO <lv_data>.
IF sy-subrc = 0.
io_xml->read( EXPORTING iv_name = 'PARENT'
CHANGING cg_data = <lv_data> ).
ENDIF.
io_xml->read( EXPORTING iv_name = 'RELID'
CHANGING cg_data = ls_orig_config-relid ).
SELECT SINGLE author createdon FROM wdy_config_data INTO (ls_orig_config-author, ls_orig_config-createdon)
WHERE config_id = lv_config_id AND
config_type = lv_config_type AND
config_var = lv_config_var.
IF ls_orig_config-author IS INITIAL.
ls_orig_config-author = sy-uname.
ENDIF.
ls_orig_config-changedby = sy-uname.
ls_orig_config-changedon = sy-datum.
IF ls_orig_config-createdon IS INITIAL.
ls_orig_config-createdon = sy-datum.
ENDIF.
CALL FUNCTION 'ENQUEUE_E_WDY_CONFCOMP'
EXPORTING
mode_wdy_config_data = 'E' "if_wdr_cfg_constants=>c_lock_mode_exclusive
config_id = lv_config_id
config_type = lv_config_type
config_var = lv_config_var
x_config_id = 'X'
x_config_type = 'X'
x_config_var = 'X'
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error Enqueueing Component Config: ' && ms_item-obj_name ).
ENDIF.
" CL_WDR_CFG_PERSISTENCE_UTILS=>SAVE_COMP_CONFIG_TO_DB does not exist in 702 so we save directly to DB
DELETE FROM wdy_config_data
WHERE config_id = ls_orig_config-config_id
AND config_type = ls_orig_config-config_type
AND config_var = ls_orig_config-config_var.
MODIFY wdy_config_data FROM ls_orig_config.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error Updating WDY_CONFIG_DATA for Component Config ' && ms_item-obj_name ).
ENDIF.
io_xml->read( EXPORTING iv_name = 'OTR_TEXT'
CHANGING cg_data = lt_otr_texts ).
IF lt_otr_texts IS NOT INITIAL.
DELETE FROM wdy_config_compt
WHERE config_id = ls_orig_config-config_id
AND config_type = ls_orig_config-config_type
AND config_var = ls_orig_config-config_var.
MODIFY wdy_config_compt FROM TABLE lt_otr_texts.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error Updating WDY_CONFIG_COMPT for Component Config ' && ms_item-obj_name ).
ENDIF.
ENDIF.
io_xml->read( EXPORTING iv_name = 'DESCR_LANG'
CHANGING cg_data = lt_config_datt ).
IF lt_config_datt IS NOT INITIAL.
DELETE FROM wdy_config_datt
WHERE config_id = ls_orig_config-config_id
AND config_type = ls_orig_config-config_type
AND config_var = ls_orig_config-config_var.
MODIFY wdy_config_datt FROM TABLE lt_config_datt.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error Updating WDY_CONFIG_DATT for Component Config ' && ms_item-obj_name ).
ENDIF.
ENDIF.
CALL FUNCTION 'DEQUEUE_E_WDY_CONFCOMP'
EXPORTING
mode_wdy_config_data = 'E' "if_wdr_cfg_constants=>c_lock_mode_exclusive
config_id = lv_config_id
config_type = lv_config_type
config_var = lv_config_var
x_config_id = 'X'
x_config_type = 'X'
x_config_var = 'X'.
tadir_insert( iv_package = iv_package ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: ls_outline TYPE wdy_cfg_outline_data,
ls_config_key TYPE wdy_config_key.
ls_config_key-config_id = ms_item-obj_name+0(32).
ls_config_key-config_type = ms_item-obj_name+32(2).
ls_config_key-config_var = ms_item-obj_name+34(6).
TRY.
cl_wdr_cfg_persistence_utils=>read_comp_config_from_db(
EXPORTING
config_key = ls_config_key
IMPORTING
outline_data = ls_outline ).
CATCH cx_static_check.
rv_bool = abap_false.
RETURN.
ENDTRY.
rv_bool = abap_true.
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.
DATA ls_meta_data TYPE zif_abapgit_definitions=>ty_metadata.
ls_meta_data = get_metadata( ).
ls_meta_data-delete_tadir = abap_true.
rs_metadata = ls_meta_data.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
DATA: lt_enq TYPE STANDARD TABLE OF seqg3,
lv_subrc TYPE sysubrc,
lv_garg TYPE eqegraarg.
lv_garg = ms_item-obj_name.
CALL FUNCTION 'ENQUEUE_READ'
EXPORTING
gclient = sy-mandt
gname = 'WDY_CONFIG_DATA'
garg = lv_garg
IMPORTING
subrc = lv_subrc
TABLES
enq = lt_enq
EXCEPTIONS
communication_failure = 2
OTHERS = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error check object lock WDCC: ' && ms_item-obj_name ).
ENDIF.
rv_is_locked = boolc( lines( lt_enq ) > 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~jump.
" Covered by ZCL_ABAPGIT_OBJECTS=>JUMP
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lv_xml_xstring TYPE xstring,
lt_otr_texts TYPE TABLE OF wdy_config_compt,
lt_cc_text TYPE TABLE OF wdy_config_datt,
ls_orig_config TYPE wdy_config_data,
ls_outline TYPE wdy_cfg_outline_data,
ls_config_key TYPE wdy_config_key,
lv_xml_string TYPE string.
FIELD-SYMBOLS: <lv_data> TYPE any.
io_xml->add( iv_name = 'OBJECT_NAME'
ig_data = ms_item-obj_name ).
ls_config_key-config_id = ms_item-obj_name+0(32).
ls_config_key-config_type = ms_item-obj_name+32(2).
ls_config_key-config_var = ms_item-obj_name+34(6).
TRY.
" original_config_data does not exist in 702
CALL METHOD cl_wdr_cfg_persistence_utils=>('READ_COMP_CONFIG_FROM_DB')
EXPORTING
config_key = ls_config_key
IMPORTING
xml_xcontent = lv_xml_xstring
original_config_data = ls_orig_config
outline_data = ls_outline.
CATCH cx_static_check.
zcx_abapgit_exception=>raise( 'Error Reading Component Config from DB: ' && ms_item-obj_name ).
CATCH cx_root.
zcx_abapgit_exception=>raise( 'Object type WDCC not supported for this release' ).
ENDTRY.
io_xml->add( iv_name = 'CONFIG_ID'
ig_data = ls_orig_config-config_id ).
io_xml->add( iv_name = 'CONFIG_TYPE'
ig_data = ls_orig_config-config_type ).
io_xml->add( iv_name = 'CONFIG_VAR'
ig_data = ls_orig_config-config_var ).
io_xml->add( iv_name = 'WDA_COMPONENT'
ig_data = ls_orig_config-component ).
ASSIGN COMPONENT 'CONFIG_IDPAR' OF STRUCTURE ls_orig_config TO <lv_data>.
IF sy-subrc = 0.
io_xml->add( iv_name = 'CONFIG_IDPAR'
ig_data = <lv_data> ).
ENDIF.
ASSIGN COMPONENT 'CONFIG_TYPEPAR' OF STRUCTURE ls_orig_config TO <lv_data>.
IF sy-subrc = 0.
io_xml->add( iv_name = 'CONFIG_TYPEPAR'
ig_data = <lv_data> ).
ENDIF.
ASSIGN COMPONENT 'CONFIG_VARPAR' OF STRUCTURE ls_orig_config TO <lv_data>.
IF sy-subrc = 0.
io_xml->add( iv_name = 'CONFIG_VARPAR'
ig_data = <lv_data> ).
ENDIF.
ASSIGN COMPONENT 'PARENT' OF STRUCTURE ls_orig_config TO <lv_data>.
IF sy-subrc = 0.
io_xml->add( iv_name = 'PARENT'
ig_data = <lv_data> ).
ENDIF.
io_xml->add( iv_name = 'RELID'
ig_data = ls_orig_config-relid ).
lv_xml_string = zcl_abapgit_convert=>xstring_to_string_utf8( iv_data = lv_xml_xstring ).
IF lv_xml_string IS NOT INITIAL.
TRY.
lv_xml_string = zcl_abapgit_xml_pretty=>print(
iv_xml = lv_xml_string
iv_ignore_errors = abap_false ).
CATCH zcx_abapgit_exception.
zcx_abapgit_exception=>raise( 'Error Pretty Printing WDCC XML Content: ' && ms_item-obj_name ).
ENDTRY.
REPLACE FIRST OCCURRENCE
OF REGEX '<\?xml version="1\.0" encoding="[\w-]+"\?>'
IN lv_xml_string
WITH '<?xml version="1.0" encoding="utf-8"?>'.
ASSERT sy-subrc = 0.
ENDIF.
mo_files->add_string( iv_extra = 'comp_config'
iv_ext = 'xml'
iv_string = lv_xml_string ).
SELECT * FROM wdy_config_compt INTO TABLE lt_otr_texts
WHERE config_id = ls_orig_config-config_id
AND config_type = ls_orig_config-config_type
AND config_var = ls_orig_config-config_var
ORDER BY PRIMARY KEY.
IF lt_otr_texts IS NOT INITIAL.
io_xml->add( iv_name = 'OTR_TEXT'
ig_data = lt_otr_texts ).
ENDIF.
SELECT * FROM wdy_config_datt INTO TABLE lt_cc_text
WHERE config_id = ls_orig_config-config_id
AND config_type = ls_orig_config-config_type
AND config_var = ls_orig_config-config_var
ORDER BY PRIMARY KEY.
IF lt_cc_text IS NOT INITIAL.
io_xml->add( iv_name = 'DESCR_LANG'
ig_data = lt_cc_text ).
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
16993,
535,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
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,
397,
499,
18300,
62,
15252,
764,
628,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
764,
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,
397,
499,
18300,
62,
15252,
62,
16993,
535,
30023,
2538,
10979,
6234,
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,
43979,
62,
448,
1370,
220,
220,
220,
41876,
266,
9892,
62,
37581,
62,
448,
1370,
62,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
11250,
62,
2539,
41876,
266,
9892,
62,
11250,
62,
2539,
13,
628,
220,
220,
220,
43979,
62,
11250,
62,
2539,
12,
11250,
62,
312,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
10,
15,
7,
2624,
737,
198,
220,
220,
220,
43979,
62,
11250,
62,
2539,
12,
11250,
62,
4906,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
10,
2624,
7,
17,
737,
198,
220,
220,
220,
43979,
62,
11250,
62,
2539,
12,
11250,
62,
7785,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
10,
2682,
7,
21,
737,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
86,
7109,
62,
37581,
62,
19276,
13274,
62,
26791,
14804,
961,
62,
5589,
62,
11250,
62,
6738,
62,
9945,
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,
4566,
62,
2539,
220,
220,
796,
43979,
62,
11250,
62,
2539,
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,
19001,
62,
7890,
796,
43979,
62,
448,
1370,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
12331,
11725,
35100,
17056,
422,
20137,
25,
705,
11405,
13845,
62,
9186,
12,
26801,
62,
3672,
6739,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
220,
220,
374,
85,
62,
7220,
796,
43979,
62,
448,
1370,
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,
198,
220,
220,
220,
42865,
25,
43979,
62,
11250,
62,
2539,
41876,
266,
9892,
62,
11250,
62,
2539,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
7266,
6015,
220,
220,
220,
220,
220,
41876,
827,
7266,
6015,
13,
628,
220,
220,
220,
43979,
62,
11250,
62,
2539,
12,
11250,
62,
312,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
10,
15,
7,
2624,
737,
198,
220,
220,
220,
43979,
62,
11250,
62,
2539,
12,
11250,
62,
4906,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
10,
2624,
7,
17,
737,
198,
220,
220,
220,
43979,
62,
11250,
62,
2539,
12,
11250,
62,
7785,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
10,
2682,
7,
21,
737,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
366,
857,
407,
2152,
287,
43379,
198,
220,
220,
220,
220,
220,
220,
220,
42815,
337,
36252,
537,
62,
86,
7109,
62,
37581,
62,
19276,
13274,
62,
26791,
14804,
10786,
7206,
2538,
9328,
62,
10943,
16254,
4261,
6234,
11537,
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,
4566,
62,
2539,
796,
43979,
62,
11250,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19644,
36,
3824,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
850,
6015,
220,
220,
220,
220,
220,
796,
300,
85,
62,
7266,
6015,
13,
198,
220,
220,
220,
220,
220,
220,
220,
16876,
300,
85,
62,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
12331,
34817,
48963,
4093,
25,
705,
11405,
13845,
62,
9186,
12,
26801,
62,
3672,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
15763,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
10267,
2099,
48963,
4093,
407,
4855,
329,
428,
2650,
6,
6739,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
8906,
48499,
1096,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
11250,
62,
312,
220,
220,
41876,
269,
406,
49494,
3933,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
11250,
62,
4906,
41876,
299,
406,
49494,
362,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
11250,
62,
7785,
220,
41876,
269,
406,
49494,
718,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
313,
81,
62,
5239,
82,
220,
220,
41876,
43679,
3963,
266,
9892,
62,
11250,
62,
785,
457,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
11612,
62,
11250,
41876,
266,
9892,
62,
11250,
62,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
11250,
62,
67,
1078,
41876,
43679,
3963,
266,
9892,
62,
11250,
62,
67,
1078,
11,
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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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
] |
CLASS zcl_abapgit_object_iasp DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
PRIVATE SECTION.
METHODS:
read
EXPORTING es_attr TYPE w3servattr
et_parameters TYPE w3servpara_tabletype
RAISING zcx_abapgit_exception,
save
IMPORTING is_attr TYPE w3servattr
it_parameters TYPE w3servpara_tabletype
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS zcl_abapgit_object_iasp IMPLEMENTATION.
METHOD zif_abapgit_object~has_changed_since.
rv_changed = abap_true.
ENDMETHOD. "zif_abapgit_object~has_changed_since
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown. " todo
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
ENDMETHOD. "zif_abapgit_object~get_metadata
METHOD read.
DATA: li_service TYPE REF TO if_w3_api_service,
lv_name TYPE itsappl.
lv_name = ms_item-obj_name.
cl_w3_api_service=>if_w3_api_service~load(
EXPORTING
p_service_name = lv_name
IMPORTING
p_service = li_service
EXCEPTIONS
object_not_existing = 1
permission_failure = 2
error_occured = 3
OTHERS = 4 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from w3api_service~load' ).
ENDIF.
li_service->get_attributes( IMPORTING p_attributes = es_attr ).
CLEAR: es_attr-chname,
es_attr-tdate,
es_attr-ttime,
es_attr-devclass.
li_service->get_parameters( IMPORTING p_parameters = et_parameters ).
ENDMETHOD. "read
METHOD zif_abapgit_object~serialize.
DATA: ls_attr TYPE w3servattr,
lt_parameters TYPE w3servpara_tabletype.
IF zif_abapgit_object~exists( ) = abap_false.
RETURN.
ENDIF.
read( IMPORTING es_attr = ls_attr
et_parameters = lt_parameters ).
io_xml->add( iv_name = 'ATTR'
ig_data = ls_attr ).
io_xml->add( iv_name = 'PARAMETERS'
ig_data = lt_parameters ).
ENDMETHOD. "zif_abapgit_object~serialize
METHOD save.
DATA: li_service TYPE REF TO if_w3_api_service.
cl_w3_api_service=>if_w3_api_service~create_new(
EXPORTING p_service_data = is_attr
IMPORTING p_service = li_service ).
li_service->set_attributes( is_attr ).
li_service->set_parameters( it_parameters ).
li_service->if_w3_api_object~save( ).
ENDMETHOD. "save
METHOD zif_abapgit_object~deserialize.
DATA: ls_attr TYPE w3servattr,
lt_parameters TYPE w3servpara_tabletype.
io_xml->read( EXPORTING iv_name = 'ATTR'
CHANGING cg_data = ls_attr ).
io_xml->read( EXPORTING iv_name = 'PARAMETERS'
CHANGING cg_data = lt_parameters ).
ls_attr-devclass = iv_package.
save( is_attr = ls_attr
it_parameters = lt_parameters ).
ENDMETHOD. "zif_abapgit_object~deserialize
METHOD zif_abapgit_object~delete.
DATA: li_service TYPE REF TO if_w3_api_service,
lv_name TYPE itsappl.
lv_name = ms_item-obj_name.
cl_w3_api_service=>if_w3_api_service~load(
EXPORTING
p_service_name = lv_name
IMPORTING
p_service = li_service
EXCEPTIONS
object_not_existing = 1
permission_failure = 2
error_occured = 3
OTHERS = 4 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from if_w3_api_service~load' ).
ENDIF.
li_service->if_w3_api_object~set_changeable( abap_true ).
li_service->if_w3_api_object~delete( ).
li_service->if_w3_api_object~save( ).
ENDMETHOD. "zif_abapgit_object~delete
METHOD zif_abapgit_object~exists.
DATA: lv_name TYPE itsappl.
lv_name = ms_item-obj_name.
cl_w3_api_service=>if_w3_api_service~load(
EXPORTING
p_service_name = lv_name
EXCEPTIONS
object_not_existing = 1
permission_failure = 2
error_occured = 3
OTHERS = 4 ).
IF sy-subrc = 1.
rv_bool = abap_false.
ELSEIF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from w3_api_service~load' ).
ELSE.
rv_bool = abap_true.
ENDIF.
ENDMETHOD. "zif_abapgit_object~exists
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. "zif_abapgit_object~jump
METHOD zif_abapgit_object~compare_to_remote_version.
CREATE OBJECT ro_comparison_result TYPE zcl_abapgit_comparison_null.
ENDMETHOD.
ENDCLASS. "zcl_abapgit_object_iasp IMPLEMENTATION
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
4448,
79,
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,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
1100,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
1658,
62,
35226,
220,
220,
220,
220,
220,
220,
41876,
266,
18,
3168,
35226,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2123,
62,
17143,
7307,
41876,
266,
18,
3168,
1845,
64,
62,
11487,
4906,
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,
3613,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
318,
62,
35226,
220,
220,
220,
220,
220,
220,
41876,
266,
18,
3168,
35226,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
17143,
7307,
41876,
266,
18,
3168,
1845,
64,
62,
11487,
4906,
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,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
4448,
79,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
10134,
62,
40985,
62,
20777,
13,
198,
220,
220,
220,
374,
85,
62,
40985,
796,
450,
499,
62,
7942,
13,
198,
220,
23578,
49273,
13,
220,
366,
89,
361,
62,
397,
499,
18300,
62,
15252,
93,
10134,
62,
40985,
62,
20777,
628,
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,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
1136,
62,
38993,
13,
198,
220,
220,
220,
44608,
62,
38993,
796,
651,
62,
38993,
7,
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,
89,
361,
62,
397,
499,
18300,
62,
15252,
93,
1136,
62,
38993,
628,
220,
337,
36252,
1100,
13,
628,
220,
220,
220,
42865,
25,
7649,
62,
15271,
41876,
4526,
37,
5390,
611,
62,
86,
18,
62,
15042,
62,
15271,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
3672,
220,
220,
220,
41876,
663,
1324,
75,
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,
86,
18,
62,
15042,
62,
15271,
14804,
361,
62,
86,
18,
62,
15042,
62,
15271,
93,
2220,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
15271,
62,
3672,
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,
15271,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
7649,
62,
15271,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
1662,
62,
25687,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
7170,
62,
32165,
495,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
62,
13966,
1522,
220,
220,
220,
220,
220,
220,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
604,
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,
266,
18,
15042,
62,
15271,
93,
2220,
6,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
7649,
62,
15271,
3784,
1136,
62,
1078,
7657,
7,
30023,
9863,
2751,
279,
62,
1078,
7657,
796,
1658,
62,
35226,
6739,
628,
220,
220,
220,
30301,
1503,
25,
1658,
62,
35226,
12,
1349,
480,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1658,
62,
35226,
12,
83,
4475,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1658,
62,
35226,
12,
926,
524,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1658,
62,
35226,
12,
7959,
4871,
13,
628,
220,
220,
220,
7649,
62,
15271,
3784,
1136,
62,
17143,
7307,
7,
30023,
9863,
2751,
279,
62,
17143,
7307,
796,
2123,
62,
17143,
7307,
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,
961,
628,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
46911,
1096,
13,
628,
220,
220,
220,
42865,
25,
43979,
62,
35226,
220,
220,
220,
220,
220,
220,
41876,
266,
18,
3168,
35226,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
17143,
7307,
41876,
266,
18,
3168,
1845,
64,
62,
11487,
4906,
13,
628,
198,
220,
220,
220,
16876,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
1069,
1023,
7,
1267,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
1100,
7,
30023,
9863,
2751,
1658,
62,
35226,
220,
220,
220,
220,
220,
220,
796,
43979,
62,
35226,
198,
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,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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
] |
class ZCL_RESPONSE definition
public
inheriting from ZCL_OBJECT
final
create public .
public section.
data RESPONSE type ref to IF_HTTP_RESPONSE .
methods CONSTRUCTOR
importing
!RESPONSE type ref to IF_HTTP_RESPONSE .
methods ADD_HEADER
importing
!NAME type STRING
!VALUE type STRING .
methods EXPIRES_AFTER
importing
!SECONDS type I .
methods EXPIRES_AT
importing
!DATE type D
!TIME type T .
methods REDIRECT
importing
!URL type STRING
!PERMANENTLY type I default 0
!EXPLANATION type STRING default ''
!PROTOCOL_DEPENDENT type I default 0 .
methods SEND_ACCEPTED
importing
!LOCATION type STRING optional .
methods SEND_BAD_REQUEST
importing
!MESSAGE type STRING optional .
methods SEND_BINARY
importing
!DATA type XSTRING
!MIME_TYPE type STRING default 'application/octet-stream' "#EC NOTEXT
!CODE type I default 200 .
methods SEND_CREATED
importing
!LOCATION type STRING optional .
methods SEND_ERROR
importing
!CODE type I
!MESSAGE type STRING optional .
methods SEND_INTERNAL_SERVER_ERROR
importing
!MESSAGE type STRING optional .
methods SEND_JSON
importing
!JSON_VALUE type ref to ZIF_JSON_VALUE .
methods SEND_NOT_FOUND
importing
!MESSAGE type STRING optional .
methods SEND_OK .
methods SEND_TEXT
importing
!DATA type STRING
!MIME_TYPE type STRING default 'text/plain' "#EC NOTEXT
!CODE type I default 200 .
methods SEND_UNAUTHORIZED
importing
!MESSAGE type STRING optional .
protected section.
*"* protected components of class zCL_RESPONSE
*"* do not include other source files here!!!
private section.
ENDCLASS.
CLASS ZCL_RESPONSE IMPLEMENTATION.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->ADD_HEADER
* +-------------------------------------------------------------------------------------------------+
* | [--->] NAME TYPE STRING
* | [--->] VALUE TYPE STRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method add_header.
*/**
* Add header parameter to the HTTP response
*/
me->response->set_header_field( name = name value = value ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->CONSTRUCTOR
* +-------------------------------------------------------------------------------------------------+
* | [--->] RESPONSE TYPE REF TO IF_HTTP_RESPONSE
* +--------------------------------------------------------------------------------------</SIGNATURE>
method CONSTRUCTOR.
super->constructor( ).
me->response = response.
" Enable full compression by default
me->response->set_compression( me->response->co_compress_in_all_cases ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->EXPIRES_AFTER
* +-------------------------------------------------------------------------------------------------+
* | [--->] SECONDS TYPE I
* +--------------------------------------------------------------------------------------</SIGNATURE>
method expires_after.
me->response->server_cache_expire_rel( seconds ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->EXPIRES_AT
* +-------------------------------------------------------------------------------------------------+
* | [--->] DATE TYPE D
* | [--->] TIME TYPE T
* +--------------------------------------------------------------------------------------</SIGNATURE>
method expires_at.
me->response->server_cache_expire_abs( expires_abs_date = date expires_abs_time = time ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->REDIRECT
* +-------------------------------------------------------------------------------------------------+
* | [--->] URL TYPE STRING
* | [--->] PERMANENTLY TYPE I (default =0)
* | [--->] EXPLANATION TYPE STRING (default ='')
* | [--->] PROTOCOL_DEPENDENT TYPE I (default =0)
* +--------------------------------------------------------------------------------------</SIGNATURE>
method redirect.
me->response->redirect( url = url permanently = permanently explanation = explanation protocol_dependent = protocol_dependent ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->SEND_ACCEPTED
* +-------------------------------------------------------------------------------------------------+
* | [--->] LOCATION TYPE STRING(optional)
* +--------------------------------------------------------------------------------------</SIGNATURE>
method send_accepted.
*/**
* Send a response to the client with the ACCEPTED status code and the Location header
*/
me->add_header( name = zcl_http_header_fields=>location value = location ).
me->response->set_status( code = zcl_http_status_codes=>accepted reason = '' ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->SEND_BAD_REQUEST
* +-------------------------------------------------------------------------------------------------+
* | [--->] MESSAGE TYPE STRING(optional)
* +--------------------------------------------------------------------------------------</SIGNATURE>
method send_bad_request.
*/**
* Send bad request response to the client
*/
me->send_error( code = zcl_http_status_codes=>bad_request message = message ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->SEND_BINARY
* +-------------------------------------------------------------------------------------------------+
* | [--->] DATA TYPE XSTRING
* | [--->] MIME_TYPE TYPE STRING (default ='application/octet-stream')
* | [--->] CODE TYPE I (default =200)
* +--------------------------------------------------------------------------------------</SIGNATURE>
method send_binary.
*/**
* Send a response to the client with binary data in the HTTP body
*/
me->response->set_content_type( mime_type ).
me->response->set_data( data ).
me->response->set_status( code = code reason = '' ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->SEND_CREATED
* +-------------------------------------------------------------------------------------------------+
* | [--->] LOCATION TYPE STRING(optional)
* +--------------------------------------------------------------------------------------</SIGNATURE>
method send_created.
*/**
* Send a response to the client with the CREATED status code and the Location header
*/
me->add_header( name = zcl_http_header_fields=>location value = location ).
me->response->set_status( code = zcl_http_status_codes=>created reason = '' ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->SEND_ERROR
* +-------------------------------------------------------------------------------------------------+
* | [--->] CODE TYPE I
* | [--->] MESSAGE TYPE STRING(optional)
* +--------------------------------------------------------------------------------------</SIGNATURE>
method send_error.
*/**
* Send a response to the client with a specified status code and message
*/
me->response->set_status( code = code reason = message ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->SEND_INTERNAL_SERVER_ERROR
* +-------------------------------------------------------------------------------------------------+
* | [--->] MESSAGE TYPE STRING(optional)
* +--------------------------------------------------------------------------------------</SIGNATURE>
method send_internal_server_error.
*/**
* Send internal server error response to the client
*/
me->send_error( code = zcl_http_status_codes=>internal_server_error message = message ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->SEND_JSON
* +-------------------------------------------------------------------------------------------------+
* | [--->] JSON_VALUE TYPE REF TO ZIF_JSON_VALUE
* +--------------------------------------------------------------------------------------</SIGNATURE>
method send_json.
*/**
* Send a response to the client with a JSON string as the HTTP body
*/
data: json_parser type ref to zcl_json_parser,
json_string type string.
create object json_parser.
json_string = json_parser->serialize( json_value ).
me->send_text( data = json_string mime_type = zcl_http_mime_types=>application_json ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->SEND_NOT_FOUND
* +-------------------------------------------------------------------------------------------------+
* | [--->] MESSAGE TYPE STRING(optional)
* +--------------------------------------------------------------------------------------</SIGNATURE>
method send_not_found.
*/**
* Send not found response to the client
*/
me->send_error( code = zcl_http_status_codes=>not_found message = message ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->SEND_OK
* +-------------------------------------------------------------------------------------------------+
* +--------------------------------------------------------------------------------------</SIGNATURE>
method send_ok.
*/**
* Send HTTP status code OK to the client
*/
me->response->set_status( code = zcl_http_status_codes=>ok reason = '' ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->SEND_TEXT
* +-------------------------------------------------------------------------------------------------+
* | [--->] DATA TYPE STRING
* | [--->] MIME_TYPE TYPE STRING (default ='text/plain')
* | [--->] CODE TYPE I (default =200)
* +--------------------------------------------------------------------------------------</SIGNATURE>
method send_text.
*/**
* Send a response to the client with a string as the HTTP body
* The string is converted to binary UTF-8 encoded data and eventually sent using the SEND_BINARY method
*/
try.
" Convert string to binary UTF8 data
data utf8_converter type ref to cl_abap_conv_out_ce.
data utf8_data type xstring.
utf8_converter = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' ).
utf8_converter->write( data = data ).
utf8_data = utf8_converter->get_buffer( ).
" Add UTF8 charset to MIME type
data utf8_mime_type type string.
concatenate mime_type '; charset=utf-8' into utf8_mime_type. "#EC NOTEXT
" Send
me->send_binary( data = utf8_data mime_type = utf8_mime_type code = code ).
catch cx_sy_codepage_converter_init cx_sy_conversion_codepage cx_parameter_invalid_type cx_parameter_invalid_range.
" Conversion error
raise exception type zcx_text_conversion_error.
endtry.
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_RESPONSE->SEND_UNAUTHORIZED
* +-------------------------------------------------------------------------------------------------+
* | [--->] MESSAGE TYPE STRING(optional)
* +--------------------------------------------------------------------------------------</SIGNATURE>
method send_unauthorized.
*/**
* Send unauthorized response to the client
*/
me->send_error( code = zcl_http_status_codes=>unauthorized message = message ).
endmethod.
ENDCLASS.
| [
4871,
1168,
5097,
62,
19535,
47,
1340,
5188,
6770,
201,
198,
220,
1171,
201,
198,
220,
10639,
1780,
422,
1168,
5097,
62,
9864,
23680,
201,
198,
220,
2457,
201,
198,
220,
2251,
1171,
764,
201,
198,
201,
198,
11377,
2665,
13,
201,
198,
201,
198,
220,
1366,
47203,
1340,
5188,
2099,
1006,
284,
16876,
62,
40717,
62,
19535,
47,
1340,
5188,
764,
201,
198,
201,
198,
220,
5050,
7102,
46126,
1581,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
19535,
47,
1340,
5188,
2099,
1006,
284,
16876,
62,
40717,
62,
19535,
47,
1340,
5188,
764,
201,
198,
220,
5050,
27841,
62,
37682,
1137,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
20608,
2099,
19269,
2751,
201,
198,
220,
220,
220,
220,
220,
5145,
39488,
2099,
19269,
2751,
764,
201,
198,
220,
5050,
25703,
4663,
1546,
62,
8579,
5781,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
23683,
1340,
5258,
2099,
314,
764,
201,
198,
220,
5050,
25703,
4663,
1546,
62,
1404,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
35,
6158,
2099,
360,
201,
198,
220,
220,
220,
220,
220,
5145,
34694,
2099,
309,
764,
201,
198,
220,
5050,
23848,
40,
23988,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
21886,
2099,
19269,
2751,
201,
198,
220,
220,
220,
220,
220,
5145,
18973,
10725,
3525,
11319,
2099,
314,
4277,
657,
201,
198,
220,
220,
220,
220,
220,
5145,
6369,
6489,
1565,
6234,
2099,
19269,
2751,
4277,
10148,
201,
198,
220,
220,
220,
220,
220,
5145,
4805,
2394,
4503,
3535,
62,
46162,
10619,
3525,
2099,
314,
4277,
657,
764,
201,
198,
220,
5050,
311,
10619,
62,
2246,
42006,
1961,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
29701,
6234,
2099,
19269,
2751,
11902,
764,
201,
198,
220,
5050,
311,
10619,
62,
33,
2885,
62,
2200,
35780,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
44,
1546,
4090,
8264,
2099,
19269,
2751,
11902,
764,
201,
198,
220,
5050,
311,
10619,
62,
33,
1268,
13153,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
26947,
2099,
1395,
18601,
2751,
201,
198,
220,
220,
220,
220,
220,
5145,
44,
12789,
62,
25216,
2099,
19269,
2751,
4277,
705,
31438,
14,
38441,
316,
12,
5532,
6,
25113,
2943,
5626,
13918,
201,
198,
220,
220,
220,
220,
220,
5145,
34,
16820,
2099,
314,
4277,
939,
764,
201,
198,
220,
5050,
311,
10619,
62,
43387,
11617,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
29701,
6234,
2099,
19269,
2751,
11902,
764,
201,
198,
220,
5050,
311,
10619,
62,
24908,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
34,
16820,
2099,
314,
201,
198,
220,
220,
220,
220,
220,
5145,
44,
1546,
4090,
8264,
2099,
19269,
2751,
11902,
764,
201,
198,
220,
5050,
311,
10619,
62,
1268,
31800,
1847,
62,
35009,
5959,
62,
24908,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
44,
1546,
4090,
8264,
2099,
19269,
2751,
11902,
764,
201,
198,
220,
5050,
311,
10619,
62,
40386,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
40386,
62,
39488,
2099,
1006,
284,
1168,
5064,
62,
40386,
62,
39488,
764,
201,
198,
220,
5050,
311,
10619,
62,
11929,
62,
37,
15919,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
44,
1546,
4090,
8264,
2099,
19269,
2751,
11902,
764,
201,
198,
220,
5050,
311,
10619,
62,
11380,
764,
201,
198,
220,
5050,
311,
10619,
62,
32541,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
26947,
2099,
19269,
2751,
201,
198,
220,
220,
220,
220,
220,
5145,
44,
12789,
62,
25216,
2099,
19269,
2751,
4277,
705,
5239,
14,
25638,
6,
25113,
2943,
5626,
13918,
201,
198,
220,
220,
220,
220,
220,
5145,
34,
16820,
2099,
314,
4277,
939,
764,
201,
198,
220,
5050,
311,
10619,
62,
52,
4535,
24318,
1581,
14887,
1961,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
44,
1546,
4090,
8264,
2099,
19269,
2751,
11902,
764,
201,
198,
24326,
2665,
13,
201,
198,
9,
1,
9,
6861,
6805,
286,
1398,
1976,
5097,
62,
19535,
47,
1340,
5188,
201,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
201,
198,
19734,
2665,
13,
201,
198,
10619,
31631,
13,
201,
198,
201,
198,
201,
198,
201,
198,
31631,
1168,
5097,
62,
19535,
47,
1340,
5188,
30023,
2538,
10979,
6234,
13,
201,
198,
201,
198,
201,
198,
9,
1279,
46224,
40086,
29,
10097,
19351,
6329,
10,
201,
198,
9,
930,
2262,
590,
5094,
11789,
1168,
5097,
62,
19535,
47,
1340,
5188,
3784,
29266,
62,
37682,
1137,
201,
198,
9,
1343,
10097,
3880,
19529,
201,
198,
9,
930,
685,
438,
3784,
60,
36751,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
220,
220,
220,
220,
220,
220,
220,
19269,
2751,
201,
198,
9,
930,
685,
438,
3784,
60,
26173,
8924,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
220,
220,
220,
220,
220,
220,
220,
19269,
2751,
201,
198,
9,
1343,
10097,
19351,
438,
3556,
46224,
40086,
29,
201,
198,
24396,
751,
62,
25677,
13,
201,
198,
16208,
1174,
201,
198,
9,
3060,
13639,
11507,
284,
262,
14626,
2882,
201,
198,
16208,
201,
198,
220,
502,
3784,
26209,
3784,
2617,
62,
25677,
62,
3245,
7,
1438,
796,
1438,
1988,
796,
1988,
6739,
201,
198,
437,
24396,
13,
201,
198,
201,
198,
201,
198,
9,
1279,
46224,
40086,
29,
10097,
19351,
6329,
10,
201,
198,
9,
930,
2262,
590,
5094,
11789,
1168,
5097,
62,
19535,
47,
1340,
5188,
3784,
10943,
46126,
1581,
201,
198,
9,
1343,
10097,
3880,
19529,
201,
198,
9,
930,
685,
438,
3784,
60,
47203
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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